-
Notifications
You must be signed in to change notification settings - Fork 1
/
InstallDistro.nsh
1411 lines (1232 loc) · 115 KB
/
InstallDistro.nsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* This file is part of YUMI
*
* YUMI is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* any later version.
*
* YUMI is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YUMI. If not, see <http://www.gnu.org/licenses/>.
*/
; ------------ Install Distros Macro --------------
!include ReplaceInFile.nsh
Function FindConfig ; Set config path and file
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\liberte\boot\syslinux\syslinux.cfg" ; Liberte
StrCpy $ConfigPath "liberte/boot/syslinux"
StrCpy $CopyPath "liberte\boot\syslinux"
StrCpy $ConfigFile "syslinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\i386\loader\isolinux.cfg" ; OpenSuse based 32bit
StrCpy $ConfigPath "boot/i386/loader"
StrCpy $CopyPath "boot\i386\loader"
StrCpy $ConfigFile "isolinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\x86_64\loader\isolinux.cfg" ; OpenSuse based 64bit
StrCpy $ConfigPath "boot/x86_64/loader"
StrCpy $CopyPath "boot\x86_64\loader"
StrCpy $ConfigFile "isolinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\syslinux\syslinux.cfg"
StrCpy $ConfigPath "syslinux"
StrCpy $CopyPath "syslinux"
StrCpy $ConfigFile "syslinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\isolinux.cfg"
StrCpy $ConfigPath "isolinux"
StrCpy $CopyPath "isolinux"
StrCpy $ConfigFile "isolinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\syslinux.cfg" ; AVG
StrCpy $ConfigPath "isolinux"
StrCpy $CopyPath "isolinux"
StrCpy $ConfigFile "syslinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\txt.cfg" ; Probably Ubuntu based
StrCpy $ConfigPath "isolinux"
StrCpy $CopyPath "isolinux"
StrCpy $ConfigFile "txt.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\text.cfg" ; Probably Ubuntu based
StrCpy $ConfigPath "isolinux"
StrCpy $CopyPath "isolinux"
StrCpy $ConfigFile "text.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\syslinux\txt.cfg"
StrCpy $ConfigPath "syslinux"
StrCpy $CopyPath "syslinux"
StrCpy $ConfigFile "txt.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\syslinux\text.cfg"
StrCpy $ConfigPath "syslinux"
StrCpy $CopyPath "syslinux"
StrCpy $ConfigFile "text.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\system\isolinux\isolinux.cfg" ; AOSS
StrCpy $ConfigPath "system/isolinux"
StrCpy $CopyPath "system\isolinux"
StrCpy $ConfigFile "isolinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux.cfg" ; Probably Puppy based
StrCpy $ConfigPath ""
StrCpy $CopyPath ""
StrCpy $ConfigFile "isolinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\syslinux.cfg"
StrCpy $ConfigPath ""
StrCpy $CopyPath ""
StrCpy $ConfigFile "syslinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\slax\boot\syslinux.cfg" ; Slax based
StrCpy $ConfigPath "slax/boot"
StrCpy $CopyPath "slax\boot"
StrCpy $ConfigFile "syslinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\syslinux\syslinux.cfg"
StrCpy $ConfigPath "boot/syslinux"
StrCpy $CopyPath "boot\syslinux"
StrCpy $ConfigFile "syslinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\isolinux\isolinux.cfg"
StrCpy $ConfigPath "boot/isolinux"
StrCpy $CopyPath "boot\isolinux"
StrCpy $ConfigFile "isolinux.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\isolinux\syslinux.cfg"
StrCpy $ConfigPath "boot/isolinux"
StrCpy $CopyPath "boot\isolinux"
StrCpy $ConfigFile "syslinux.cfg"
${Else}
StrCpy $ConfigFile "NULL"
${EndIf}
;MessageBox MB_OK "$ConfigPath/$ConfigFile"
FunctionEnd
!insertmacro Locate
Function FindGrubConfig ; Set Grub config path and file
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\liberte\boot\grub\grub.cfg" ; Liberte
StrCpy $GrubConfigPath "liberte/boot/grub"
StrCpy $GrubCopyPath "liberte\boot\grub"
StrCpy $GrubConfigFile "grub.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\efi\boot\grub.cfg" ; Fedora...
StrCpy $GrubConfigPath "efi/boot"
StrCpy $GrubCopyPath "efi\boot"
StrCpy $GrubConfigFile "grub.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\grub\grub.cfg" ; Ubuntu...
StrCpy $GrubConfigPath "boot/grub"
StrCpy $GrubCopyPath "boot\grub"
StrCpy $GrubConfigFile "grub.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\grub\grub*.cfg" ; System Rescue CD...
${Locate} "$BootDir\multiboot\$JustISOName\boot\grub" "/L=F /M=*.cfg" "FoundGrubFile" ; Could eventually replace this whole section using locate.
StrCpy $GrubConfigPath "boot/grub"
StrCpy $GrubCopyPath "boot\grub"
StrCpy $GrubConfigFile "grubsys.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\grub\loopback.cfg" ; Ubuntu...
StrCpy $GrubConfigPath "boot/grub"
StrCpy $GrubCopyPath "boot\grub"
StrCpy $GrubConfigFile "loopback.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\efi\boot\grub\grub.cfg" ; TinyCore, newer Tails
StrCpy $GrubConfigPath "efi/boot/grub"
StrCpy $GrubCopyPath "efi\boot\grub"
StrCpy $GrubConfigFile "grub.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\grub\sparky.cfg" ; Sparky...
StrCpy $GrubConfigPath "boot/grub"
StrCpy $GrubCopyPath "boot\grub"
StrCpy $GrubConfigFile "sparky.cfg"
#${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\grub.cfg" ; Slacko...
# StrCpy $GrubConfigPath ""
# StrCpy $GrubCopyPath ""
# StrCpy $GrubConfigFile "grub.cfg"
${Else}
StrCpy $GrubConfigFile "NULL"
${EndIf}
;MessageBox MB_OK "$GrubConfigPath/$GrubConfigFile"
FunctionEnd
Function FoundGrubFile
CopyFiles "$R9" "$BootDir\multiboot\$JustISOName\boot\grub\grubsys.cfg"
StrCpy $0 StopLocate
Push $0
FunctionEnd
Function WriteStuff
; Now done before this function is called (see line 122) CreateDirectory "$BootDir\multiboot\$JustISOName\YUMI\" ; Create the YUMI Directory.. so we can copy the following config file to it.
CopyFiles "$PLUGINSDIR\$Config2Use" "$BootDir\multiboot\$JustISOName\YUMI\$Config2Use" ; Copy the $Config2Use file to $JustISOName\YUMI folder for the distro (so we know where to remove entry)
DetailPrint "$DistroName ($JustISOName) and its menu entry were added!"
FunctionEnd
!macro Install_Distros
; Initiate Plugins Directory for potential use
SetShellVarContext all
InitPluginsDir
; If distro is already installed, delete the entry, so we don't make a mess.
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\*.*"
${DeleteMenuEntry} "$BootDir\multiboot\menu\$Config2Use" "#start $DistroName" "#end $DistroName" ; Remove entry from config file... I.E. linux.cfg, system.cfg, etc
${EndIf}
; Write $JustISOName to Installed.txt
${InstalledList} "$JustISOName" $R0 ; Write the ISO name to the Installed List "Installed.txt" file (so we can keep track of installs for removal)
${LineFind} "$BootDir\multiboot\Installed.txt" "$BootDir\multiboot\Installed.txt" "1:-1" "DeleteEmptyLine" ; Remove any left over empty lines
CopyFiles "$BootDir\multiboot\Installed.txt" "$BootDir\multiboot\BackupInstalled.txt" ; Make a backup of installed for safety
; Create the Directory for this ISOs files
CreateDirectory "$BootDir\multiboot\$JustISOName\YUMI\" ; Create the YUMI Directory.. so we can eventually copy the config file (see line 90) to it.
; Kaspersky Rescue Disk - Gentoo
${If} $DistroName == "Kaspersky Rescue Disk (Antivirus Scanner)"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -x![BOOT] -o"$BootDir\multiboot\$JustISOName\" -y'
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nif cpuid -l; then set krn=$\"k-x86_64$\"; else set krn=$\"k-x86$\"; fi$\r$\nsearch -s root -f /multiboot/$JustISOName/boot/grub/$${krn}$\r$\nlinux /multiboot/$JustISOName/boot/grub/$${krn} net.ifnames=0 lang=en dostartx subdir=/multiboot/$JustISOName/data$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd /multiboot/$JustISOName/boot/grub/initrd.xz$\r$\n}$\r$\n#end $JustISOName" $R0
; Acronis True Image
${ElseIf} $DistroName == "Acronis True Image"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to ISO Directory
;ExecWait '"$PLUGINSDIR\7zG.exe" e "$ISOFile" -ir!*.dat -o"$BootDir\multiboot\$JustISOName\" -y'
;${If} ${FileExists} "$BootDir\multiboot\$JustISOName\ramdisk_merged64.dat"
;Rename "$BootDir\multiboot\$JustISOName\ramdisk_merged64.dat" "$BootDir\multiboot\$JustISOName\ramdisk64.dat"
;${EndIf}
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset isofile=$\"/multiboot/$JustISOName/$JustISO$\"$\r$\nloopback loop $$isofile$\r$\nlinux (loop)/dat10.dat quiet force_modules=usbhid quiet$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/dat11.dat (loop)/dat12.dat$\r$\n}$\r$\n#end $JustISOName" $R0
;;ALT BIOS? ${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset isofile=$\"/multiboot/$JustISOName/$JustISO$\"$\r$\nloopback loop $$isofile$\r$\nlinux (loop)/dat6.dat quiet force_modules=usbhid quiet$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/dat7.dat (loop)/dat8.dat$\r$\n}$\r$\n#end $JustISOName" $R0
; Calculate Linux Desktop
${ElseIf} $DistroName == "Calculate Linux Desktop"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO"
;ExecWait '"$PLUGINSDIR\7zG.exe" e "$ISOFile" -ir!*nitrd -ir!*mlinuz -o"$BootDir\multiboot\$JustISOName\" -y'
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nset isofile=$\"/multiboot/$JustISOName/$JustISO$\"$\r$\nloopback loop $$isofile$\r$\nlinux (loop)/boot/vmlinuz root=live:LABEL=MULTIBOOT init=/linuxrc rd.live.squashimg=livecd.squashfs looptype=squashfs nodevfs iso-scan/filename=/multiboot/$JustISOName/$JustISO findiso=$$isofile isoboot=$$isofile$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/boot/initrd$\r$\n}$\r$\n#end $JustISOName" $R0
; CentOS
${ElseIf} $DistroName == "CentOS Minimal"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nset isofile='/multiboot/$JustISOName/$JustISO'$\r$\nloopback loop $$isofile$\r$\nlinux (loop)/isolinux/vmlinuz noeject inst.stage2=hd:LABEL=MULTIBOOT:/$$isofile$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/isolinux/initrd.img$\r$\n}$\r$\n#end $JustISOName" $R0
; Linux Kid X
${ElseIf} $DistroName == "Linux Kid X"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nset isofile='/multiboot/$JustISOName/$JustISO'$\r$\nloopback loop $$isofile$\r$\nlinux (loop)/boot/vmlinuz from=$$isofile$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/boot/initrd.gz$\r$\n}$\r$\n#end $JustISOName" $R0
; KNOPPIX - Wont work on Fat32- filesize too big, revisit after fat32/ntfs partition functional
;${ElseIf} $DistroName == "KNOPPIX"
;CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO"
;${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nset isofile='/multiboot/$JustISOName/$JustISO'$\r$\nloopback loop $$isofile$\r$\nlinux (loop)/boot/isolinux/linux ;bootfrom=$$isofile acpi=off keyboard=us language-us$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/boot/isolinux/minirt.gz$\r$\n}$\r$\n#end $JustISOName" $R0
; Bitdefender Rescue CD
${ElseIf} $DistroName == "Bitdefender Rescue CD"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nset isopath=$\"/multiboot/$JustISOName/$JustISO$\"$\r$\nloopback loop $$isopath$\r$\nset root=(loop)$\r$\nlinux (loop)/boot/kernel.x86_64-efi root=/dev/ram0 real_root=/dev/loop0 looptype=squashfs cdroot loop=/rescue/livecd.squashfs cdroot_marker=/rescue/livecd.squashfs initrd udev cdroot scandelay=5 lang=en isoboot=$$isopath$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/boot/initfs.x86_64-efi$\r$\n}$\r$\n#end $JustISOName" $R0
; Dr.Web Live CD
${ElseIf} $DistroName == "Dr.Web LiveDisk"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -x![BOOT] -o"$BootDir\multiboot\$JustISOName\" -y'
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nlinux /multiboot/$JustISOName/casper/vmlinuz boot=casper cdrom-detect/try-usb=true noprompt live-media-path=/multiboot/$JustISOName/casper union=aufs console=tty1 ignore_uuid$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd /multiboot/$JustISOName/casper/initrd.lz$\r$\n}$\r$\n#end $JustISOName" $R0
; Antix (New Method)
${ElseIf} $DistroName == "AntiX"
${OrIf} $DistroName == "MX Linux"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/antiX/vmlinuz load=all bootlabel=MULTIBOOT fromiso=/multiboot/$JustISOName/$JustISO nomodeset nouveau.modeset=0$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/antiX/initrd.gz$\r$\n}$\r$\n#end $JustISOName" $R0
; AOSS (New Method)
${ElseIf} $DistroName == "AOSS (Malware Scanner)"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/system/stage1 root=/dev/ram0 rw rdinit=/linuxrc video=vesa:ywrap,mtrr vga=0x303 loglevel=0 boot=cdrom fromiso=/multiboot/$JustISOName/$JustISO$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/system/stage2$\r$\n}$\r$\n#end $JustISOName" $R0
; DBAN (New Method)
${ElseIf} $DistroName == "DBAN (Hard Drive Nuker)"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/dban.bzi nuke=$\"dwipe$\" fromiso=/multiboot/$JustISOName/$JustISO$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\n}$\r$\n#end $JustISOName" $R0
; Fedora (New Method)
${ElseIf} $DistroName == "Fedora"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -ir!*nitrd* -ir!*mlinu* -o"$BootDir\multiboot\$JustISOName\" -y'
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\isolinux\initrd*"
Call FindInitrd
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\isolinux\vmlinuz*"
Call FindVmlinuz
;${StrRep} '$ISONameDotLess' '$JustISOName' '-x86_64-' '-'
${StrRep} '$ISONameDotLess' '$JustISOName' '.' '-'
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/isolinux/$Vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO rootfstype=auto root=live:CDLABEL=$ISONameDotLess ro rd.live.image$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/isolinux/$Initrd$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "CDLABEL=Fedora-Live-Workstation" "CDLABEL=Fedora-Live-WS" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
!insertmacro ReplaceInFile "CDLABEL=Fedora-Workstation-Live" "CDLABEL=Fedora-WS-Live" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
!insertmacro ReplaceInFile "CDLABEL=Fedora-WS-Live-x86_64" "CDLABEL=Fedora-WS-Live" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
; Linpus Lite (New Method)
${ElseIf} $DistroName == "Linpus Lite"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -ir!*nitrd* -ir!*mlinu* -o"$BootDir\multiboot\$JustISOName\" -y'
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/isolinux/vmlinuz0 iso-scan/filename=/multiboot/$JustISOName/$JustISO rootfstype=auto root=live:LABEL=$JustISOName ro rd.live.image$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/isolinux/initrd0.img$\r$\n}$\r$\n#end $JustISOName" $R0
; GRML
${ElseIf} $DistroName == "GRML (system rescue)"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -x![BOOT] -o"$BootDir\multiboot\$JustISOName\" -y'
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\grml64full\vmlinuz"
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/boot/grml64full/vmlinuz boot=live live-media-path=/multiboot/$JustISOName/live/grml64-full/ verbose noeject noprompt" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\grml64full\initrd.img"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/boot/grml64full/initrd.img" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Liberte
${ElseIf} $DistroName == "Liberte (Anonymous Browsing)"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -x![BOOT] -o"$BootDir\multiboot\$JustISOName\" -y'
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\liberte\boot\kernel-x86.zi"
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/liberte/boot/kernel-x86.zi loop=/multiboot/$JustISOName/liberte/boot/root-x86.sfs" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\liberte\boot\initrd-x86.xz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/liberte/boot/initrd-x86.xz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Linux Mint (New Method)
${ElseIf} $DistroName == "Linux Mint"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -ir!*nitrd.* -ir!*mlinuz -o"$BootDir\multiboot\$JustISOName\" -y'
Rename "$BootDir\multiboot\casper\$JustISOName\initrd.gz" "$BootDir\multiboot\$JustISOName\casper\initrd.lz"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\vmlinuz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/casper/vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO isofrom=/dev/disk/by-label/MULTIBOOT/multiboot/$JustISOName/$JustISO file=/cdrom/preseed/linuxmint.seed boot=casper noprompt floppy.allowed_drive_mask=0 ignore_uuid" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\initrd.lz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/casper/initrd.lz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\live\vmlinuz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/live/vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO isofrom=/dev/disk/by-label/MULTIBOOT/multiboot/$JustISOName/$JustISO file=/cdrom/preseed/linuxmint.seed boot=live noprompt floppy.allowed_drive_mask=0 ignore_uuid" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\live\initrd.lz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/live/initrd.lz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Linux Mint (New Method)
${ElseIf} $DistroName == "Linux Mint Debian"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -ir!*nitrd.* -ir!*mlinuz -o"$BootDir\multiboot\$JustISOName\" -y'
Rename "$BootDir\multiboot\casper\$JustISOName\initrd.gz" "$BootDir\multiboot\$JustISOName\casper\initrd.lz"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\vmlinuz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/casper/vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO isofrom=/dev/disk/by-label/MULTIBOOT/multiboot/$JustISOName/$JustISO file=/cdrom/preseed/linuxmint.seed boot=casper noprompt floppy.allowed_drive_mask=0 ignore_uuid" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\initrd.lz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/casper/initrd.lz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\live\vmlinuz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/live/vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO isofrom=/dev/disk/by-label/MULTIBOOT/multiboot/$JustISOName/$JustISO file=/cdrom/preseed/linuxmint.seed boot=live noprompt floppy.allowed_drive_mask=0 ignore_uuid" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\live\initrd.lz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/live/initrd.lz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Debian Live Based (New Method)
${ElseIf} $DistroName == "Debian Live"
${OrIf} $DistroName == "Raspberry Pi Desktop"
${OrIf} $DistroName == "Deepin"
${OrIf} $DistroName == "Academix"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -ir!*nitrd* -ir!*mlinu* -o"$BootDir\multiboot\$JustISOName\" -y'
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\live\initrd*"
Call FindInitrd
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\live\*mlinu*"
Call FindVmlinuz
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\live\$Initrd" ; likely 86_64
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/live/$Vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO boot=live noprompt components config findiso=/multiboot/$JustISOName/$JustISO" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/live/$Initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Clonezilla (New Method) - Debian Based - TORAM
${ElseIf} $DistroName == "Clonezilla (Backup + Clone Tool)"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -ir!*nitrd* -ir!*mlinu* -o"$BootDir\multiboot\$JustISOName\" -y'
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\live\initrd*"
Call FindInitrd
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\live\*mlinu*"
Call FindVmlinuz
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\live\$Initrd" ; likely 86_64
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/live/$Vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO boot=live noprompt components config toram=live,syslinux,EFI,boot,.disk,utils findiso=/multiboot/$JustISOName/$JustISO" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/live/$Initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Solus
${ElseIf} $DistroName == "Solus"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nset isofile='/multiboot/$JustISOName/$JustISO'$\r$\nloopback loop $$isofile$\r$\nlinux (loop)/boot/kernel iso-scan/filename=/multiboot/$JustISOName/$JustISO root=live:CDLABEL=SolusLiveBudgie ro rd.luks=0 rd.md=0 rd.live.overlay.overlayfs=1 quiet splash$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/boot/initrd.img$\r$\n}$\r$\n#end $JustISOName" $R0
; Demon Linux
${ElseIf} $DistroName == "Demon Linux (Penetration Testing)"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -ir!*nitrd* -ir!*mlinu* -o"$BootDir\multiboot\$JustISOName\" -y'
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\initrd*"
Call FindInitrd
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\vmlinuz*"
Call FindVmlinuz
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\$Initrd" ; likely 86_64
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/$Vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO boot=live noprompt components config findiso=/multiboot/$JustISOName/$JustISO" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/$Initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Open Mandriva
${ElseIf} $DistroName == "OpenMandriva"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
ExecWait '"$PLUGINSDIR\7zG.exe" e "$ISOFile" -ir!*nitrd* -ir!*mlinu* -o"$BootDir\multiboot\$JustISOName\" -y'
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\*initrd*"
Call FindInitrd
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\*mlinu*"
Call FindVmlinuz
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\$Initrd" ; likely 86_64
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/$Vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO findiso=/multiboot/$JustISOName/$JustISO root=live:LABEL=OpenMandrivaLx_4.0 rd.live.image toram" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/$Initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Alpine Linux
${ElseIf} $DistroName == "Alpine Linux"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
ExecWait '"$PLUGINSDIR\7zG.exe" e "$ISOFile" -ir!*nitr* -ir!*mlinu* -o"$BootDir\multiboot\$JustISOName\" -y'
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\*initr*"
Call FindInitrd
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\*mlinu*"
Call FindVmlinuz
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\$Initrd" ; likely 86_64
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/$Vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO findiso=/multiboot/$JustISOName/$JustISO modules=loop,squashfs,sd-mod,usb-storage nomodeset" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/$Initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Clear Linux
${ElseIf} $DistroName == "Clear Linux"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
ExecWait '"$PLUGINSDIR\7zG.exe" e "$ISOFile" -ir!*nitrd* -ir!*mlinu* -o"$BootDir\multiboot\$JustISOName\" -y'
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\*initrd*"
Call FindInitrd
FindFirst $0 $1 "$BootDir\multiboot\$JustISOName\*mlinu*"
Call FindVmlinuz
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\$Initrd" ; likely 86_64
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/$Vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO findiso=/multiboot/$JustISOName/$JustISO" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/$Initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; WIFISLAX (New Method)
${ElseIf} $DistroName == "Wifislax (Wireless Penetration Testing)"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/boot/vmlinuz from=/multiboot/$JustISOName/$JustISO autoexec=telinit~4$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/boot/initrd.xz$\r$\n}$\r$\n#end $JustISOName" $R0
; RIPLinux (New Method)
${ElseIf} $DistroName == "Rip Linux (Recovery Distro) - BIOS ONLY"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
${WriteToFile} "#start $JustISOName$\r$\nif [ $${grub_platform} == $\"pc$\" ]; then$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nset isofile=$\"/multiboot/$JustISOName/$JustISO$\"$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\nlinux16 /multiboot/menu/memdisk iso raw$\r$\ninitrd16 $$isofile$\r$\n}; fi$\r$\n#end $JustISOName" $R0
; Finnix
${ElseIf} $DistroName == "Finnix x86/64- BIOS ONLY"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName - 32bit$\" {$\r$\nset gfxpayload=keep$\r$\nset isofile=$\"/multiboot/$JustISOName/$JustISO$\"$\r$\nloopback loop $$isofile$\r$\nlinux (loop)/boot/x86/linux findiso=$$isofile vga=791 nomodeset quiet$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/boot/x86/initrd.xz$\r$\n}$\r$\nmenuentry $\"$JustISOName - 64bit$\" {$\r$\nset gfxpayload=keep$\r$\nset isofile=$\"/multiboot/$JustISOName/$JustISO$\"$\r$\nloopback loop $$isofile$\r$\nlinux (loop)/boot/x86/linux64 findiso=$$isofile vga=791 nomodeset quiet$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/boot/x86/initrd.xz$\r$\n}$\r$\n#end $JustISOName" $R0
; Trinity Rescue Kit (New Method)
${ElseIf} $DistroName == "Trinity Rescue Kit - BIOS ONLY"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -x![BOOT] -o"$BootDir\multiboot\$JustISOName\" -y'
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\kernel.trk"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd.trk"
${WriteToFile} "#start $JustISOName$\r$\nif [ $${grub_platform} == $\"pc$\" ]; then$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nlinux /multiboot/$JustISOName/kernel.trk from=/multiboot/$JustISOName vollabel=MULTIBOOT ramdisk_size=65536 root=/dev/ram0 splash=verbose pci=conf1 trkmenu$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd /multiboot/$JustISOName/initrd.trk$\r$\n}; fi$\r$\n#end $JustISOName" $R0
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\trk3\trkramfs"
CopyFiles "$BootDir\multiboot\$JustISOName\trk3\*.*" "$BootDir\trk3\" ; Move trk3 to root, so we can boot!
RMDir /R "$BootDir\multiboot\$JustISOName\trk3"
${EndIf}
; Ubuntu Server (New Method)
${ElseIf} $DistroName == "Ubuntu Server"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -ir!install\netboot\ubuntu-installer\*nitrd* -ir!*mlinuz -o"$BootDir\multiboot\$JustISOName\" -y'
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\install\netboot\ubuntu-installer\amd64\*.*"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/install/vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO findiso=/multiboot/$JustISOName/$JustISO file=/cdrom/preseed/ubuntu-server.seed$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/install/netboot/ubuntu-installer/amd64/initrd.gz$\r$\n}$\r$\n#end $JustISOName" $R0
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\install\netboot\ubuntu-installer\i386\*.*"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/install/vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO findiso=/multiboot/$JustISOName/$JustISO file=/cdrom/preseed/ubuntu-server.seed$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/install/netboot/ubuntu-installer/i386/initrd.gz$\r$\n}$\r$\n#end $JustISOName" $R0
${EndIf}
; Ubuntu (New Method)
${ElseIf} $DistroName == "Ubuntu"
${OrIf} $DistroName == "Ubuntu Budgie"
${OrIf} $DistroName == "Ubuntu Gnome"
${OrIf} $DistroName == "Ubuntu Studio"
${OrIf} $DistroName == "Xubuntu"
${OrIf} $DistroName == "Kubuntu"
${OrIf} $DistroName == "Tuxtrans"
${OrIf} $DistroName == "Lubuntu"
${OrIf} $DistroName == "Edubuntu"
${OrIf} $DistroName == "Emmabuntus"
${OrIf} $DistroName == "Feren OS"
${OrIf} $DistroName == "EasyPeasy (NetBook Distro)"
${OrIf} $DistroName == "Kodachi (Anonymous Browsing)"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -ir!*nitrd* -ir!*mlinu* -o"$BootDir\multiboot\$JustISOName\" -y'
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\vmlinuz.efi"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/casper/vmlinuz.efi iso-scan/filename=/multiboot/$JustISOName/$JustISO boot=casper noprompt floppy.allowed_drive_mask=0 ignore_uuid" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\vmlinuz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/casper/vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO boot=casper noprompt floppy.allowed_drive_mask=0 ignore_uuid" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\live\vmlinuz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "linux /SLUG" "loopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux /multiboot/$JustISOName/live/vmlinuz iso-scan/filename=/multiboot/$JustISOName/$JustISO boot=live noprompt components config findiso=/multiboot/$JustISOName/$JustISO" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; add method for initrd
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\live\initrd"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/live/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\initrd"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/casper/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; end method for initrd
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\live\initrd.gz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/live/initrd.gz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\initrd.gz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/casper/initrd.gz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\initrd.lz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/casper/initrd.lz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\live\initrd.lz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/live/initrd.lz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\live\initrd.img" ; For Distros such as Emmabuntus
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/live/initrd.img" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\initrd.img"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\$JustISO"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd (loop)/casper/initrd.img" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} $DistroName == "Ubuntu"
!insertmacro ReplaceInFile "SOMETHING.seed" "ubuntu.seed" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
${ElseIf} $DistroName == "Ubuntu Gnome"
!insertmacro ReplaceInFile "SOMETHING.seed" "ubuntu-gnome.seed" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
${ElseIf} $DistroName == "Ubuntu Studio"
!insertmacro ReplaceInFile "SOMETHING.seed" "ubuntustudio.seed" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
${ElseIf} $DistroName == "Xubuntu"
!insertmacro ReplaceInFile "SOMETHING.seed" "xubuntu.seed" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
${ElseIf} $DistroName == "Kubuntu"
!insertmacro ReplaceInFile "SOMETHING.seed" "kubuntu.seed" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
${ElseIf} $DistroName == "Lubuntu"
!insertmacro ReplaceInFile "SOMETHING.seed" "lubuntu.seed" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
${ElseIf} $DistroName == "Edubuntu"
!insertmacro ReplaceInFile "SOMETHING.seed" "edubuntu.seed" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
${ElseIf} $DistroName == "Ubuntu Budgie"
!insertmacro ReplaceInFile "SOMETHING.seed" "ubuntu-budgie.seed" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
${ElseIf} $DistroName == "Feren OS"
!insertmacro ReplaceInFile "SOMETHING.seed" "lubuntu.seed" "all" "all" "$BootDir\multiboot\menu\linux.cfg"
${EndIf}
; OpenSUSE
${ElseIf} $DistroName == "OpenSUSE"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -x![BOOT] -o"$BootDir\multiboot\$JustISOName\" -y'
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nlinux /multiboot/$JustISOName/boot/x86_64/loader/linux rd.live.image rd.live.overlay.persistent rd.live.overlay.cowfs=ext4 root=live:CDLABEL=MULTIBOOT live_dir=/multiboot/$JustISOName/LiveOS$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd /multiboot/$JustISOName/boot/x86_64/loader/initrd$\r$\n}$\r$\n#end $JustISOName" $R0
;;CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
; OpenSUSE 32bit
;;${If} ${FileExists} "$BootDir\multiboot\$JustISOName\OpenSUSE*86.iso"
;;${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/boot/i386/loader/linux ramdisk_size=512000 ramdisk_blocksize=4096 iso-scan/filename=/multiboot/$JustISOName/$JustISO isofrom=/dev/disk/by-label/MULTIBOOT:/multiboot/$JustISOName/$JustISO isofrom_device=/dev/disk/by-label/MULTIBOOT isofrom_system=/multiboot/$JustISOName/$JustISO$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/boot/i386/loader/initrd$\r$\n}$\r$\n#end $JustISOName" $R0
;;${EndIf}
; OpenSUSE 64bit
;;${If} ${FileExists} "$BootDir\multiboot\$JustISOName\OpenSUSE*64.iso"
;;${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/boot/x86_64/loader/linux ramdisk_size=512000 ramdisk_blocksize=4096 iso-scan/filename=/multiboot/$JustISOName/$JustISO isofrom=/dev/disk/by-label/MULTIBOOT:/multiboot/$JustISOName/$JustISO isofrom_device=/dev/disk/by-label/MULTIBOOT isofrom_system=/multiboot/$JustISOName/$JustISO$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/boot/x86_64/loader/initrd$\r$\n}$\r$\n#end $JustISOName" $R0
;;${EndIf}
;;${If} ${FileExists} "$BootDir\multiboot\$JustISOName\OpenSUSE*Live-x86_64*.iso"
;;${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/boot/x86_64/loader/linux ramdisk_size=512000 ramdisk_blocksize=4096 iso-scan/filename=/multiboot/$JustISOName/$JustISO isofrom=/dev/disk/by-label/MULTIBOOT:/multiboot/$JustISOName/$JustISO isofrom_device=/dev/disk/by-label/MULTIBOOT isofrom_system=/multiboot/$JustISOName/$JustISO$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/boot/x86_64/loader/initrd$\r$\n}$\r$\n#end $JustISOName" $R0
;;${EndIf}
; FreeDOS (Balder img)
${ElseIf} $DistroName == "FreeDOS (Balder img)"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nlinux16 /multiboot/menu/memdisk$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd16 /multiboot/$JustISOName/$JustISO$\r$\n}$\r$\n#end $JustISOName" $R0
; XPUD (New Method)
${ElseIf} $DistroName == "xPUD (Netbook Distro)"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/$JustISO$\r$\nlinux (loop)/boot/bzImage noisapnp lang=en kmap=us fromiso=/multiboot/$JustISOName/$JustISO$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\ninitrd (loop)/opt/core$\r$\n}$\r$\n#end $JustISOName" $R0
; Memtest86+ (Memory Testing Tool)
${ElseIf} $DistroName == "Memtest86+ (Memory Testing Tool) BIOS ONLY"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -x![BOOT] -o"$BootDir\multiboot\$JustISOName\" -y'
${WriteToFile} "#start $JustISOName$\r$\nif [ $${grub_platform} == $\"pc$\" ]; then$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nlinux16 /multiboot/$JustISOName/$JustISOName.bin$\r$\n}$\r$\nfi$\r$\n#end $JustISOName" $R0
; Windows 10
${ElseIf} $DistroName == "Windows 10 Installer"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -xr!bootx64.efi -xr!sources\install.wim -o"$BootDir\" -y'
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -ir!bootx64.efi -aou -o"$BootDir\" -y'
CreateDirectory "$EXEDIR\TEMPYUMI" ; Create the TEMPYUMI directory
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" sources\install.wim -aou -o"$EXEDIR\TEMPYUMI" -y'
ExecWait 'Dism /Split-Image /ImageFile:"$EXEDIR\TEMPYUMI\sources\install.wim" /SWMFile:"$EXEDIR\TEMPYUMI\sources\install.swm" /FileSize:3800'
CopyFiles "$EXEDIR\TEMPYUMI\sources\*.swm" "$BOOTDIR\sources\"
ReadEnvStr $R0 COMSPEC ; grab commandline
nsExec::Exec "$R0 /C Rename $BootDir\EFI\BOOT\bootx64_1.efi win10.efi" ; rename efi file
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\nif [ $${grub_platform} == $\"pc$\" ]; then ntldr /bootmgr; fi$\r$\nif [ $${grub_platform} == $\"efi$\" ]; then chainloader /EFI/BOOT/win10.efi; fi$\r$\n}$\r$\n#end $JustISOName" $R0
; Windows Vista/7/8
${ElseIf} $DistroName == "Windows Vista/7/8 Installer"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -o"$BootDir\" -y -x![BOOT]*'
${WriteToFile} "#start $JustISOName$\r$\ntitle Install $JustISOName$\r$\nchainloader /bootmgr$\r$\n#end $JustISOName" $R0
; Windows XP
/* ${ElseIf} $DistroName == "Windows XP Installer"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO" ; Copy the ISO to Directory
${WriteToFile} "#start $JustISOName$\r$\ntitle Begin Install of Windows XP from $JustISO (Stage 1)$\r$\nfind --set-root /multiboot/$JustISOName/$JustISO$\r$\nmap (hd0) (hd1)$\r$\nmap (hd1) (hd0)$\r$\nmap --mem /multiboot/$JustISOName/firadisk.img (fd0)$\r$\nmap --mem /multiboot/$JustISOName/firadisk.img (fd1)$\r$\nmap --mem /multiboot/$JustISOName/$JustISO (0xff)$\r$\nmap --hook$\r$\nchainloader (0xff)/I386/SETUPLDR.BIN$\r$\n$\r$\ntitle Continue Windows XP Install from $JustISO (Stage 2)$\r$\nfind --set-root /multiboot/$JustISOName/$JustISO$\r$\nmap (hd0) (hd1)$\r$\nmap (hd1) (hd0)$\r$\nmap --mem /multiboot/$JustISOName/$JustISO (0xff)$\r$\nmap --hook$\r$\nchainloader (hd0)+1$\r$\n$\r$\ntitle Boot Windows XP - If fails, reboot with USB removed (Stage 3)$\r$\nmap (hd1) (hd0)$\r$\nmap (hd0) (hd1)$\r$\nroot (hd1,0)$\r$\nfind --set-root /ntldr$\r$\nchainloader /ntldr$\r$\n#end $JustISOName" $R0
File /oname=$PLUGINSDIR\firadisk.img "firadisk.img"
CopyFiles "$PLUGINSDIR\firadisk.img" "$BootDir\multiboot\$JustISOName\firadisk.img" */
; Hiren's BootCD PE
${ElseIf} $DistroName == "Hiren's BootCD PE"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -xr!bootx64.efi -o"$BootDir\" -y'
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -ir!bootx64.efi -aou -o"$BootDir\" -y'
ReadEnvStr $R0 COMSPEC ; grab commandline
nsExec::Exec "$R0 /C Rename $BootDir\EFI\BOOT\bootx64_1.efi HBCDPE.efi" ; rename efi file
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\nif [ $${grub_platform} == $\"pc$\" ]; then ntldr /bootmgr; fi$\r$\nif [ $${grub_platform} == $\"efi$\" ]; then chainloader /EFI/BOOT/HBCDPE.efi; fi$\r$\n}$\r$\n#end $JustISOName" $R0
; RemixOS
${ElseIf} $DistroName == "RemixOS"
CreateDirectory "$EXEDIR\TEMPYUMI" ; Create the TEMPYUMI directory
ExecWait '"$PLUGINSDIR\7zG.exe" e "$ISOFile" -o"$EXEDIR\TEMPYUMI" -y'
ExecWait '"$PLUGINSDIR\7zG.exe" x "$EXEDIR\TEMPYUMI\Remix_OS*.iso" -o"$BootDir\multiboot\$JustISOName\" -y'
RMDir /R "$EXEDIR\TEMPYUMI"
Call FindGrubConfig
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/$GrubConfigPath/$GrubConfigFile$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "linuxefi /kernel" "linux /multiboot/$JustISOName/kernel" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "initrdefi /initrd.img" "initrd /multiboot/$JustISOName/initrd.img" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "--set=root /kernel" "--set=root /multiboot/$JustISOName/kernel" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "quiet DATA= USB_DATA_PARTITION=1" "CREATE_DATA_IMG=1" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
; Memtest86
${ElseIf} $DistroName == "Memtest86 (Memory Testing Tool)"
;CreateDirectory "$EXEDIR\TEMPYUMI" ; Create the TEMPYUMI directory
;ExecWait '"$PLUGINSDIR\7zG.exe" e "$ISOFile" -o"$EXEDIR\TEMPYUMI" -y'
ExecWait '"$PLUGINSDIR\new7z\7zG.exe" e "$ISOFile" -ir!memtest86-usb.img -o"$BootDir\multiboot\$JustISOName\" -y'
;CopyFiles $EXEDIR\TEMPYUMI\memtest86-usb.img "$BootDir\multiboot\$JustISOName\"
ExecWait '"$PLUGINSDIR\new7z\7zG.exe" x "$BootDir\multiboot\$JustISOName\memtest86-usb.img" -o"$BootDir\multiboot\$JustISOName\" -y'
ExecWait '"$PLUGINSDIR\new7z\7zG.exe" x "$BootDir\multiboot\$JustISOName\EFI System Partition.img" -o"$BootDir\multiboot\$JustISOName\" -y'
;RMDir /R "$EXEDIR\TEMPYUMI"
${WriteToFile} "#start $JustISOName$\r$\nif [ $${grub_platform} == $\"efi$\" ]; then$\r$\nmenuentry $\"$JustISOName X64$\" {$\r$\nset gfxpayload=keep$\r$\nloopback loop /multiboot/$JustISOName/memtest86-usb.img$\r$\nchainloader /multiboot/$JustISOName/EFI/BOOT/BOOTX64.efi$\r$\n}$\r$\n$\r$\nmenuentry $\"$JustISOName IA32$\" {$\r$\nloopback loop /multiboot/$JustISOName/memtest86-usb.img$\r$\nchainloader /multiboot/$JustISOName/EFI/BOOT/BOOTIA32.efi$\r$\n}$\r$\nfi$\r$\n#end $JustISOName" $R0
; Slacko Puppy/BionicPup
${ElseIf} $DistroName == "Slacko Puppy"
${OrIf} $DistroName == "BionicPup"
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -x![BOOT] -o"$BootDir\multiboot\$JustISOName\" -y'
# Call FindGrubConfig
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "linux /vmlinuz" "linux /multiboot/$JustISOName/vmlinuz psubdir=/multiboot/$JustISOName psubok=TRUE" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "initrd /initrd" "initrd /multiboot/$JustISOName/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
; Ultimate Boot CD and Hirens Boot CD
${ElseIf} $DistroName == "Ultimate Boot CD (Diagnostics Tools) - BIOS ONLY"
${OrIf} $DistroName == "Hiren's Boot CD - BIOS ONLY"
${OrIf} $DistroName == "Falcon 4 Boot CD - BIOS ONLY"
CopyFiles $ISOFile "$BootDir\multiboot\$JustISOName\$JustISO"
${WriteToFile} "#start $JustISOName$\r$\nif [ $${grub_platform} == $\"pc$\" ]; then$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nset isofile=$\"/multiboot/$JustISOName/$JustISO$\"$\r$\necho $\"Loading - This may take several seconds...$\"$\r$\nlinux16 /multiboot/menu/memdisk iso raw$\r$\ninitrd16 $$isofile$\r$\n}; fi$\r$\n#end $JustISOName" $R0
${Else} ; Start Catch All Install Methods
ExecWait '"$PLUGINSDIR\7zG.exe" x "$ISOFile" -x![BOOT] -o"$BootDir\multiboot\$JustISOName\" -y'
Call FindConfig
Call FindGrubConfig
${If} $GrubConfigFile != "NULL" ; If native Grub config file does exist...
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=auto$\r$\nconfigfile /multiboot/$JustISOName/$GrubConfigPath/$GrubConfigFile$\r$\n}$\r$\n#end $JustISOName" $R0
${ElseIf} $GrubConfigFile == "NULL" ; If Grub config file does not exist...
${AndIfNot} ${FileExists} "$BootDir\multiboot\$JustISOName\grub.cfg"
CopyFiles "$PLUGINSDIR\grubslug.cfg" "$BootDir\multiboot\$JustISOName\grub.cfg"
${WriteToFile} "#start $JustISOName$\r$\nmenuentry $\"$JustISOName$\" {$\r$\nset gfxpayload=keep$\r$\nconfigfile /multiboot/$JustISOName/grub.cfg$\r$\n}$\r$\n#end $JustISOName" $R0
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Ubuntu derived
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\vmlinuz.efi"
${AndIf} $GrubConfigFile == "NULL" ; If Grub config file does not exist...
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/casper/vmlinuz.efi boot=casper noprompt live-media-path=/multiboot/$JustISOName/casper floppy.allowed_drive_mask=0 ignore_uuid" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\vmlinuz"
${AndIf} $GrubConfigFile == "NULL" ; If Grub config file does not exist...
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/casper/vmlinuz boot=casper noprompt live-media-path=/multiboot/$JustISOName/casper floppy.allowed_drive_mask=0 ignore_uuid" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\initrd.lz"
${AndIf} $GrubConfigFile == "NULL" ; If Grub config file does not exist...
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/casper/initrd.lz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\initrd.gz"
${AndIf} $GrubConfigFile == "NULL" ; If Grub config file does not exist...
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/casper/initrd.gz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; For RemixOS - Android derived
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\android-x86.png"
!insertmacro ReplaceInFile "linuxefi /kernel" "linux /multiboot/$JustISOName/kernel" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "initrdefi /initrd.img" "initrd /multiboot/$JustISOName/initrd.img" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "--set=root /kernel" "--set=root /multiboot/$JustISOName/kernel" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${EndIf}
; More Catch All Methods for Vmlinuz, Initrd, Livedir
; Vmlinuz check
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\vmlinu*"
${AndIf} $GrubConfigFile != "NULL" ; If native Grub config file does exist...
!insertmacro ReplaceInFile "linux /boot" "linux /multiboot/$JustISOName/boot" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${EndIf}
; Init check
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\initr*"
${AndIf} $GrubConfigFile != "NULL" ; If native Grub config file does exist...
!insertmacro ReplaceInFile "initrd /boot" "initrd /multiboot/$JustISOName/boot" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${EndIf}
; Live media path check
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\live\*.*"
${AndIf} $GrubConfigFile != "NULL" ; If native Grub config file does exist...
!insertmacro ReplaceInFile "boot=live" "boot=NULL" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "boot=NULL" "boot=live live-media-path=/multiboot/$JustISOName/live" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${EndIf}
; Casper path check
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\casper\*.*"
${AndIf} $GrubConfigFile != "NULL" ; If native Grub config file does exist...
!insertmacro ReplaceInFile "boot=casper" "cdrom-detect/try-usb=true noprompt floppy.allowed_drive_mask=0 ignore_uuid boot=NULL live-media-path=/multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "boot=NULL" "boot=casper" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${EndIf}
; Mageia / Manjaro
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\grub\kernels.cfg"
${AndIf} $GrubConfigFile != "NULL" ; If native Grub config file does exist...
!insertmacro ReplaceInFile " /boot" " /multiboot/$JustISOName/boot" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "$\"/boot/" "$\"/multiboot/$JustISOName/boot" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile " /boot" " /multiboot/$JustISOName/boot" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\kernels.cfg"
!insertmacro ReplaceInFile "misobasedir=manjaro" "misobasedir=/multiboot/$JustISOName/manjaro" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\kernels.cfg"
!insertmacro ReplaceInFile "misolabel=MJ" "misolabel=MULTIBOOT NULL-" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\kernels.cfg"
!insertmacro ReplaceInFile "misolabel=M1" "misolabel=MULTIBOOT NULL-" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\kernels.cfg"
!insertmacro ReplaceInFile "misolabel=MANJ" "misolabel=MULTIBOOT NULL-" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\kernels.cfg"
!insertmacro ReplaceInFile "$\"/boot/" "$\"/multiboot/$JustISOName/boot" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\kernels.cfg"
!insertmacro ReplaceInFile " /boot/" " /multiboot/$JustISOName/boot" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\loopback.cfg"
!insertmacro ReplaceInFile "grub_theme=/boot" "grub_theme=/multiboot/$JustISOName/boot" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\variable.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\cdrom\init*"
${AndIf} $GrubConfigFile != "NULL" ; If native Grub config file does exist...
!insertmacro ReplaceInFile "initrd /boot" "initrd /multiboot/$JustISOName/boot" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${EndIf}
; NetRunner
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\netrunner\boot\x86_64\netrunner"
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/netrunner/boot/x86_64/netrunner misobasedir=/multiboot/$JustISOName/netrunner misolabel=MULTIBOOT nouveau.modeset=1 i915.modeset=1 radeon.modeset=1 logo.nologo overlay=free showopts" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\netrunner\boot\x86_64\netrunner.img"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/netrunner/boot/x86_64/netrunner.img" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; PCLinuxOS
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\vmlinuz"
${AndIf} $GrubConfigFile == "NULL" ; If native Grub config file does not exist...
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/isolinux/vmlinuz fromusb livecd=/multiboot/$JustISOName/livecd root=/dev/rd/3 keyb=us" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\initrd.gz"
${AndIf} $GrubConfigFile == "NULL" ; If native Grub config file does not exist...
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/isolinux/initrd.gz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\vmlinuz"
${AndIf} $GrubConfigFile != "NULL" ; If native Grub config file does exist...
!insertmacro ReplaceInFile "linux /isolinux/vmlinuz" "linux /multiboot/$JustISOName/isolinux/vmlinuz fromusb livecd=/multiboot/$JustISOName/livecd root=/dev/rd/3 keyb=us" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\initrd.gz"
${AndIf} $GrubConfigFile != "NULL" ; If native Grub config file does exist...
!insertmacro ReplaceInFile "initrd /isolinux/initrd.gz" "initrd /multiboot/$JustISOName/isolinux/initrd.gz" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\EFI\BOOT\grub.cfg"
!insertmacro ReplaceInFile "theme=($$root)/EFI/BOOT/" "theme=($$root)/multiboot/$JustISOName/EFI/BOOT/" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${EndIf}
; Partition Wizard
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\BOOT\BZIMAGE3"
${AndIf} $GrubConfigFile != "NULL"
!insertmacro ReplaceInFile "linuxefi /boot/bzImage3" "linux /multiboot/$JustISOName/boot/bzImage3" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "initrdefi /boot/tinycore.gz" "initrd /multiboot/$JustISOName/boot/tinycore.gz" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${EndIf}
; Alt For derivatives like Dr.Web Livedisk
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\syslinux\txt.cfg" ; Rename the following for syslinux txt.cfg
!insertmacro ReplaceInFile "file=/cdrom/preseed/" "file=/cdrom/multiboot/$JustISOName/preseed/" "all" "all" "$BootDir\multiboot\$JustISOName\syslinux\txt.cfg"
!insertmacro ReplaceInFile "initrd=/casper/" "cdrom-detect/try-usb=true noprompt floppy.allowed_drive_mask=0 ignore_uuid live-media-path=/multiboot/$JustISOName/casper/ initrd=/multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\syslinux\txt.cfg"
!insertmacro ReplaceInFile "kernel /casper/" "kernel /multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\syslinux\txt.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\syslinux\text.cfg" ; Rename the following for syslinux text.cfg
!insertmacro ReplaceInFile "file=/cdrom/preseed/" "file=/cdrom/multiboot/$JustISOName/preseed/" "all" "all" "$BootDir\multiboot\$JustISOName\syslinux\text.cfg"
!insertmacro ReplaceInFile "initrd=/casper/" "cdrom-detect/try-usb=true noprompt floppy.allowed_drive_mask=0 ignore_uuid live-media-path=/multiboot/$JustISOName/casper/ initrd=/multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\syslinux\text.cfg"
!insertmacro ReplaceInFile "kernel /casper/" "kernel /multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\syslinux\text.cfg"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\syslinux\syslinux.cfg" ; Rename the following for syslinux.cfg
!insertmacro ReplaceInFile "file=/cdrom/preseed/" "file=/cdrom/multiboot/$JustISOName/preseed/" "all" "all" "$BootDir\multiboot\$JustISOName\syslinux\syslinux.cfg"
!insertmacro ReplaceInFile "initrd=/casper/" "cdrom-detect/try-usb=true noprompt floppy.allowed_drive_mask=0 ignore_uuid live-media-path=/multiboot/$JustISOName/casper/ initrd=/multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\syslinux\syslinux.cfg"
!insertmacro ReplaceInFile "kernel /casper/" "kernel /multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\syslinux\syslinux.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\grub\loopback.cfg" ; Rename the following for grub loopback.cfg
!insertmacro ReplaceInFile "file=/cdrom/preseed/" "file=/cdrom/multiboot/$JustISOName/preseed/" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\loopback.cfg"
!insertmacro ReplaceInFile "/casper/vmlinuz" "/multiboot/$JustISOName/casper/vmlinuz" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\loopback.cfg"
!insertmacro ReplaceInFile "/casper/initrd" "/multiboot/$JustISOName/casper/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\loopback.cfg"
!insertmacro ReplaceInFile "boot=casper" "cdrom-detect/try-usb=true noprompt floppy.allowed_drive_mask=0 ignore_uuid boot=NULL live-media-path=/multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\loopback.cfg"
!insertmacro ReplaceInFile "boot=NULL" "boot=casper" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\loopback.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\grub\grub.cfg" ; Rename the following for grub.cfg
!insertmacro ReplaceInFile "file=/cdrom/preseed/" "file=/cdrom/multiboot/$JustISOName/preseed/" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\grub.cfg"
!insertmacro ReplaceInFile "/casper/vmlinuz" "/multiboot/$JustISOName/casper/vmlinuz" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\grub.cfg"
!insertmacro ReplaceInFile "/casper/initrd" "/multiboot/$JustISOName/casper/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\grub.cfg"
!insertmacro ReplaceInFile "boot=casper" "cdrom-detect/try-usb=true noprompt floppy.allowed_drive_mask=0 ignore_uuid boot=NULL live-media-path=/multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\grub.cfg"
!insertmacro ReplaceInFile "boot=NULL" "boot=casper" "all" "all" "$BootDir\multiboot\$JustISOName\boot\grub\grub.cfg"
${EndIf}
; SolydX
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\solydxk\filesystem.squashfs"
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/solydxk/vmlinuz live-media-path=/multiboot/$JustISOName/solydxk boot=live config ignore_uuid" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/solydxk/initrd.lz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Sparky Linux, Subgraph, Clonezilla, etc
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\live\vmlinuz"
${AndIf} $GrubConfigFile != "NULL"
!insertmacro ReplaceInFile "/live/vmlinuz" "VMLSLUG" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "VMLSLUG" " /multiboot/$JustISOName/live/vmlinuz" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "live-media-path=/live" "live-media-path=/multiboot/$JustISOName/live cdrom-detect/try-usb=true" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "boot=live" "BOOTSLUG" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "BOOTSLUG" "boot=live noprompt live-media-path=/multiboot/$JustISOName/live cdrom-detect/try-usb=true" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\live\initrd.img"
${AndIf} $GrubConfigFile != "NULL"
!insertmacro ReplaceInFile "/live/initrd.img" "INITSLUG" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "INITSLUG" " /multiboot/$JustISOName/live/initrd.img" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${EndIf}
; For Desinfect Distro
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\os.cfg" ; Rename the following for isolinux os.cfg
!insertmacro ReplaceInFile "file=/cdrom/preseed/" "file=/cdrom/multiboot/$JustISOName/preseed/" "all" "all" "$BootDir\multiboot\$JustISOName\isolinux\os.cfg"
!insertmacro ReplaceInFile "initrd=/casper/" "cdrom-detect/try-usb=true noprompt floppy.allowed_drive_mask=0 ignore_uuid live-media-path=/multiboot/$JustISOName/casper/ initrd=/multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\isolinux\os.cfg"
!insertmacro ReplaceInFile "kernel /casper/" "kernel /multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\isolinux\os.cfg"
!insertmacro ReplaceInFile "BOOT_IMAGE=/casper/" "BOOT_IMAGE=/multiboot/$JustISOName/casper/" "all" "all" "$BootDir\multiboot\$JustISOName\isolinux\os.cfg"
${EndIf}
; For Fedora Based and derivatives
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\isolinux.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\LiveOS\livecd-iso-to-disk" ; Probably Fedora based
!insertmacro ReplaceInFile "root=live:CDLABEL=" "root=live:LABEL=MULTIBOOT live_dir=/multiboot/$JustISOName/LiveOS NULL=" "all" "all" "$BootDir\multiboot\$JustISOName\isolinux\isolinux.cfg"
!insertmacro ReplaceInFile "root=live:LABEL=Fedora" "root=live:LABEL=MULTIBOOT live_dir=/multiboot/$JustISOName/LiveOS NULL=" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "isolinux/vmlin" "multiboot/$JustISOName/isolinux/vmlin" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "isolinux/init" "multiboot/$JustISOName/isolinux/init" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "linuxefi" "linux" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
!insertmacro ReplaceInFile "initrdefi" "initrd" "all" "all" "$BootDir\multiboot\$JustISOName\$GrubCopyPath\$GrubConfigFile"
${AndIf} $GrubConfigFile == "NULL" ;It's likely not natively Grub supported... let's do this differently
!insertmacro ReplaceInFile "menuentry $\"BOOT$\"" "menuentry $\"$JustISOName$\"" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/isolinux/vmlinuz0 live_dir=/multiboot/$JustISOName/LiveOS initrd=initrd0.img root=live:LABEL=MULTIBOOT live_dir=/multiboot/$JustISOName/LiveOS rootfstype=auto ro rd.live.image rhgb rd.luks=0 rd.md=0 rd.dm=0" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/isolinux/initrd0.img" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Offline NT and others
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd.cgz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\scsi.cgz"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\vmlinuz"
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/vmlinuz rw loglevel=1" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/initrd.cgz /multiboot/$JustISOName/scsi.cgz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; For Puppy Based and derivatives
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\help2.msg" ; Probably Puppy based
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/vmlinuz psubdir=/multiboot/$JustISOName psubok=TRUE" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd.gz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/initrd.gz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
/* ; For Slacko Puppy Based and derivatives
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\slacko.png" ; Probably Slacko based
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\help\help.msg" ; Probably Puppy based
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/vmlinuz psubdir=/multiboot/$JustISOName psubok=TRUE" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd.gz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/initrd.gz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf} */
; Fatdog64
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\help\help.msg" ; Probably Puppy based
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\fatdog.png" ; Fatdog64
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/vmlinuz rootfstype=ramfs waitdev=5" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd.gz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\help\help.msg" ; Probably Puppy based
${AndIfNot} ${FileExists} "$BootDir\multiboot\$JustISOName\fatdog.png" ; Fatdog64
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/vmlinuz psubdir=/multiboot/$JustISOName psubok=TRUE" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd.gz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/initrd.gz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; Dpup
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\help.msg" ; Probably Puppy based
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\dpup*" ; Dpup
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/vmlinuz psubdir=/multiboot/$JustISOName psubok=TRUE" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd.gz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/initrd.gz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\initrd"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; AntivirusLiveCD, Comodo
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\bzImage"
${AndIf} $GrubConfigFile != "NULL"
!insertmacro ReplaceInFile "kernel /boot/bzImage" "kernel /multiboot/$JustISOName/boot/bzImage" "all" "all" "$BootDir\multiboot\$JustISOName\$CopyPath\$ConfigFile"
${ElseIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\bzImage"
${AndIf} $GrubConfigFile == "NULL"
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/boot/bzImage" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\bzImage"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\initrd*"
${AndIf} $GrubConfigFile != "NULL"
${OrIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\rootfs*"
!insertmacro ReplaceInFile "append initrd=/boot" "append initrd=/multiboot/$JustISOName/boot" "all" "all" "$BootDir\multiboot\$JustISOName\$CopyPath\$ConfigFile"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\*.jpg" ; Fix background Image Paths
${OrIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\*.png"
!insertmacro ReplaceInFile "MENU BACKGROUND /boot" "MENU BACKGROUND /multiboot/$JustISOName/boot" "all" "all" "$BootDir\multiboot\$JustISOName\$CopyPath\$ConfigFile"
${EndIf}
; AOSS
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\system\stage1"
${AndIf} $GrubConfigFile == "NULL"
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/system/stage1 root=/dev/ram0 rw rdinit=/linuxrc video=vesa:ywrap,mtrr vga=0x303 loglevel=0 boot=usb" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/system/stage2" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
;!insertmacro ReplaceInFile "boot=cdrom" "boot=usb" "all" "all" "$BootDir\multiboot\$JustISOName\$CopyPath\$ConfigFile"
${EndIf}
; AVG Rescue CD
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\isolinux\initrd.lzm"
${AndIf} $GrubConfigFile == "NULL"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/isolinux/initrd.lzm" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
; TinyCore, + REVISIT WifiWay, + REVISIT Dr.Web
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\vmlinuz"
${AndIf} $GrubConfigFile == "NULL"
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/boot/vmlinuz loglevel=3 cde waitusb=5" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${AndIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\initrd"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/boot/initrd" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${OrIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\initrd.gz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/boot/initrd.gz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${OrIf} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\initrd.lz"
!insertmacro ReplaceInFile "initrd /SLUG" "initrd /multiboot/$JustISOName/boot/initrd.lz" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"
${EndIf}
${If} ${FileExists} "$BootDir\multiboot\$JustISOName\boot\vmlinuz64"
${AndIf} $GrubConfigFile == "NULL"
!insertmacro ReplaceInFile "linux /SLUG" "linux /multiboot/$JustISOName/boot/vmlinuz64 loglevel=3 cde waitusb=5" "all" "all" "$BootDir\multiboot\$JustISOName\grub.cfg"