-
Notifications
You must be signed in to change notification settings - Fork 21
/
launch_everything.bat
1080 lines (1003 loc) · 37.8 KB
/
launch_everything.bat
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
if "%~1" neq "" (call :%~1 & exit /b !current_version!)
@echo off
setlocal enabledelayedexpansion
setlocal enableextensions
Color 0A
cls
set nag=Finally Getting Updates After 4 Years (Helper Update)
set new_version=OFFLINE_OR_NO_UPDATES
set "name=%~n0"
set "name=!name:launch_=!"
set "license=.\doc\!name!_license.txt"
set "main_launcher=%~n0.bat"
set "poc_launcher=%~n0_poc.bat"
set "quick_launcher=quick%~n0.bat"
if exist replacer.bat del replacer.bat >nul
if exist !poc_launcher! del !poc_launcher! >nul
if exist .\doc\everything_quicklaunch.txt del .\doc\everything_quicklaunch.txt >nul
set "folder=%~dp0"
set "folder=!folder:~0,-1!"
pushd "!folder!"
call :AlphaToNumber
call :SetArch
call :FolderCheck
call :Version
call :Credits
call :HelperCheck
call :DataUpgrade
call :SettingsCheck
:Menu
MODE CON:cols=120 lines=35
cls
title Portable Everything Launcher - Helper Edition - Main Menu
echo !NAG!
set nag="Selection Time!"
echo 1. reinstall everything [will remove everything entirely]
echo 2. launch everything [launches everything]
echo 3. reset everything [will remove everything everything except the binary]
echo 4. uninstall everything [no longer want everything?]
echo 5. update script [check for updates]
echo 6. credits [credits]
echo 7. exit [EXIT]
echo a. download dll's [dll errors anyone?]
echo b. download other projects [check out my other stuff]
echo c. write all quicklauncher [MAKE IT EVEN FASTER] [make sure to run m first]
REM echo d. check for new everything version [automatically check for a new version]
echo e. install text-reader [update if had]
echo.
echo legacy options [ being merged in ]
echo f. download a program
echo g. launch a program
echo h. update a launcher
echo i. delete a program
echo j. DOWNLOAD EVERYTHING
echo k. DELETE EVERYTHING
echo l. FORCE UPDATE EVERYTHING
if exist .\extra\notfirstrun.txt echo m. UPDATE EVERYTHING
echo n. TROUBLESHOOTING
echo.
if "!Debug!" EQU "1" echo w. testing mode [all]
if "!Debug!" EQU "1" echo x. testing mode [single]
echo y. open explorer [open windows explorer to user directory]
echo z. purge current install [ reset, uninstall, and delete launcher]
echo.
set /p choice="enter your choice and press enter to confirm: "
:: sets errorlevel to 0 (?)
ver >nul
:: an incorrect call throws an errorlevel of 1
call :%choice%
REM if "%ERRORLEVEL%" NEQ "2" set nag="PLEASE Select A CHOICE 1-7 or a/b/c/d/e"
goto Menu
:Null
cls
set nag="NOT A FEATURE YET!"
exit /b 2
:1
:ReinstallEverything
cls
call :UninstallEverything
call :UpgradeEverything
exit /b 2
:2
:LaunchEverything
set "nag=you are already using it.."
exit /b 2
:3
if "!NoPrompt!" NEQ "1" (
cls
echo !NAG!
set nag=SELECTION TIME!
echo DO YOU REALLY WANT TO RESET?
echo type yes if you want this
set /p choice="choice: "
if "!CHOICE!" NEQ "yes" exit /b 2
)
:ResetEverything
cls
call :Null
exit /b 2
:4
if "!NoPrompt!" NEQ "1" (
cls
echo !NAG!
set nag=SELECTION TIME!
echo DO YOU REALLY WANT TO UNINSTALL?
echo type yes if you want this
set /p choice="choice: "
if "!CHOICE!" NEQ "yes" exit /b 2
)
:UninstallEverything
call :Null
exit /b 2
:5
:UpdateCheck
REM fix wrong update being reported after updating everything (edge case, shouldnt be triggered)
call :Version
if exist version.txt del version.txt >nul
cls
title Portable Everything Launcher - Helper Edition - Checking For Update
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/version.txt" "version.txt"
set Counter=0 & for /f "DELIMS=" %%i in ('type version.txt') do (set /a Counter+=1 & set "Line_!counter!=%%i")
if exist version.txt del version.txt >nul
set new_version=%Line_2%
REM echo %Line_2%
if "%new_version%"=="OFFLINE" call :ErrorOffline & exit /b 2
if %current_version% EQU %new_version% call :LatestBuild & exit /b 2
if %current_version% LSS %new_version% call :NewUpdate & exit /b 2
if %current_version% GTR %new_version% call :PreviewBuild & exit /b 2
call :ErrorOffline & exit /b 2
exit /b 2
:6
:About
cls
if exist !license! del !license! >nul
start "" "!main_launcher!"
exit
:7
exit
:a
:DLLDownloaderCheck
cls & title Portable Everything Launcher - Helper Edition - Download Dll Downloader
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/DLLDownloaderPortable/master/launch_dlldownloader.bat" "launch_dlldownloader.bat.1"
cls & if exist launch_dlldownloader.bat.1 del launch_dlldownloader.bat >nul & rename launch_dlldownloader.bat.1 launch_dlldownloader.bat
cls & start launch_dlldownloader.bat
exit /b 2
:b
:PortableEverything
cls & title Portable Everything Launcher - Helper Edition - Download Suite
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/launch_everything.bat" "launch_everything.bat.1"
cls & if exist launch_everything.bat.1 del launch_everything.bat >nul & rename launch_everything.bat.1 launch_everything.bat
cls & start launch_everything.bat
exit /b 2
:c
:QuicklauncherCheck
echo.>.\doc\everything_quicklaunch.txt
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/version.txt" "version.txt"
set Counter=0 & for /f "DELIMS=" %%i in ('type version.txt') do (set /a Counter+=1 & set "Line_!counter!=%%i")
set Max_Lines=!Counter!
cls
set "launcher_counter=1"
:loop_file_quicklauncher
if !launcher_counter! GEQ !Max_Lines! goto :exit_loop_quicklauncher
REM set /a launcher_counter+=2
set /a version_counter=!launcher_counter!+1
set "launcher=!Line_%launcher_counter%!"
set "new_version=!Line_%version_counter%!"
REM echo text without making a new line by saying SET /P var=<text><nul
REM SET /P var=!launcher!<nul
if "!new_version!" NEQ "0" (
if "!launcher!" NEQ "everything" (
if "!launcher!" NEQ "kaerusetup" (
set "quick_launcher=quicklaunch_!launcher!.bat"
if exist launch_!launcher!.bat call launch_!launcher!.bat c
)
)
)
set /a launcher_counter+=2
goto :loop_file_quicklauncher
:exit_loop_quicklauncher
if exist version.txt del version.txt >nul
REM set nag="if it wasnt for http://stackoverflow.com/users/5269570/sam-denty this wouldnt work"
if exist .\doc\everything_quicklaunch.txt del .\doc\everything_quicklaunch.txt >nul
pause
exit /b 2
:d
cls
:UpgradeEverything
set "nag=use the legacy option UPDATE EVERYTHING or FORCE UPDATE EVERYTHING"
:NullExtra
if "!NullExtra!" EQU "1" ( echo.>".\extra\enjoy_the_space.txt")
exit /b 2
:e
title Portable Everything Launcher - Helper Edition - Text-Reader Update Check
cls
call :HelperDownload "https://mariomasta64.me/batch/text-reader/update-text-reader.bat" "update-text-reader.bat"
start "" "update-text-reader.bat"
exit /b 2
:f
call :Download & exit /b 2
:g
call :Launch & exit /b 2
:h
call :Update & exit /b 2
:i
call :Delete & exit /b 2
:j
call :GetAllTheStuff & exit /b 2
:k
call :DeleteAllTheStuff & exit /b 2
:l
if exist .\extra\notfirstrun.txt del .\extra\notfirstrun.txt >nul
:m
echo.>.\doc\everything_quicklaunch.txt
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/version.txt" "version.txt"
set Counter=0 & for /f "DELIMS=" %%i in ('type version.txt') do (set /a Counter+=1 & set "Line_!counter!=%%i")
set Max_Lines=!Counter!
cls
set "launcher_counter=1"
:loop_file
if !launcher_counter! GEQ !Max_Lines! goto :exit_loop
REM set /a launcher_counter+=2
set /a version_counter=!launcher_counter!+1
set "launcher=!Line_%launcher_counter%!"
set "new_version=!Line_%version_counter%!"
REM echo text without making a new line by saying SET /P var=<text><nul
SET /P var=!launcher!<nul
if "!new_version!" NEQ "0" (
if "!launcher!" NEQ "everything" (
if exist launch_!launcher!.bat (
if exist .\extra\notfirstrun.txt (
REM in case version is not set assume "0"
set current_version=0
call launch_!launcher!.bat Version
set current_version=!errorlevel!
) else (
set current_version=0
)
if !current_version! LSS !new_version! (
:: this returns OFFLINE sometimes and im unsure why, it only seems to happen after a certain amount of launchers that are updated to the current version
if "!new_version!" NEQ "OFFLINE" (
echo - update detected - current: !current_version! - new: !new_version!
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/launch_!launcher!.bat" "launch_!launcher!.bat"
if exist launch_!launcher!.bat.1 (
if exist launch_!launcher!.bat del launch_!launcher!.bat >nul
rename launch_!launcher!.bat.1 launch_!launcher!.bat
if exist quicklaunch_!launcher!.bat (
set "quick_launcher=quicklaunch_!launcher!.bat"
call launch_!launcher!.bat c
)
) else (
echo - update failed?
)
) else (
echo - you seem to be offline?
)
) else (
if "!current_version!" EQU "!new_version!" (
echo - you are using the current version - version: !current_version!
) else (
echo - you are using a newer version [should only be dev, if not let me know] - current: !current_version! - new: !new_version!
)
)
) else (
if "!new_version!" NEQ "0" (
echo - launch_!launcher!.bat not found
) else (
REM i should never be shown but i might, one day.
echo - launcher_!launcher!_poc.bat not found
)
)
) else (
echo - not gonna update the current script
)
) else (
echo - no version, not checking.
)
set /a launcher_counter+=2
goto :loop_file
:exit_loop
if not exist .\extra\notfirstrun.txt echo.>.\extra\notfirstrun.txt
if exist version.txt del version.txt >nul
REM set nag="if it wasnt for http://stackoverflow.com/users/5269570/sam-denty this wouldnt work"
if exist .\doc\everything_quicklaunch.txt del .\doc\everything_quicklaunch.txt >nul
pause
exit /b 2
:n
cls
echo if nothing appears in the menu
echo or a download keeps looping or
echo a file is not extracting right
echo press exit the on the launcher
echo then delete the installer from
echo .\extra\ and delete the folder
echo that has the name of the thing
echo you were attempting to use out
echo .\bin\ and try again if it did
echo the same thing again remove -q
echo --show-progress from the place
echo in the launcher, all of them .
echo otherwise leave an issue on my
echo github github.com/mariomasta64
echo.
echo PRESS ENTER TO CONTINUE & pause >nul
exit /b 2
:w
set "launch_now=yes"
:x
if "!Debug!" NEQ "1" exit /b 2
if exist .\testing\ rmdir /s /q .\testing\
mkdir .\testing\
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/version.txt" "version.txt"
set Counter=0 & for /f "DELIMS=" %%i in ('type version.txt') do (set /a Counter+=1 & set "Line_!counter!=%%i")
set Max_Lines=!Counter!
cls
set "launcher_counter=1"
:loop_file_2
if !launcher_counter! GEQ !Max_Lines! goto :exit_loop_2
REM set /a launcher_counter+=2
set "launcher=!Line_%launcher_counter%!"
if not exist "launch_!launcher!.bat" call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/launch_!launcher!.bat" "launch_!launcher!.bat"
if exist "launch_!launcher!.bat" mkdir ".\testing\!launcher!\" & copy "launch_!launcher!.bat" ".\testing\!launcher!\" >nul
if "!launch_now!" EQU "yes" start "" ".\testing\!launcher!\launch_!launcher!.bat"
set /a launcher_counter+=2
goto :loop_file_2
:exit_loop_2
if not exist .\extra\notfirstrun.txt echo.>.\extra\notfirstrun.txt
if exist version.txt del version.txt >nul
exit
:y
cls
pushd "!Folder!\data\Users\MarioMasta64\"
start cmd /c "explorer.exe !CD!"
popd
exit /b 2
:z
call :Null
exit /b 2
REM PROGRAM SPECIFIC STUFF THAT CAN BE EASILY CHANGED BELOW
REM STUFF THAT IS ALMOST IDENTICAL BETWEEN STUFF
:FolderCheck
cls
set "AllUsersProfile=!folder!\data\ProgramData"
set "AppData=!folder!\data\Users\MarioMasta64\AppData\Roaming"
set "CommonProgramFiles=!folder!\data\Program Files\Common Files"
set "CommonProgramFiles(x86)=!folder!\data\Program Files (x86)\Common Files"
set "HomeDrive=!folder!\data"
set "HomePath=!folder!\data\Users\MarioMasta64"
set "LocalAppData=!folder!\data\Users\MarioMasta64\AppData\Local"
set "ProgramData=!folder!\data\ProgramData"
set "ProgramFiles=!folder!\data\Program Files"
set "ProgramFiles(x86)=!folder!\data\Program Files (x86)"
set "ProgramW6432=!folder!\data\ProgramData"
REM set "SystemDrive=!folder!\data"
REM set "SystemRoot=!folder!\Windows"
set "UserName=MarioMasta64"
if "!UserProfile!" neq "!folder!\data\Users\MarioMasta64" set "RealUserProfile=!UserProfile!"
set "UserProfile=!folder!\data\Users\MarioMasta64"
if not exist .\bin\ mkdir .\bin\
if not exist .\data\ mkdir .\data\
if not exist .\doc\ mkdir .\doc\
if not exist .\extra\ mkdir .\extra\
if not exist .\helpers\ mkdir .\helpers\
if not exist .\ini\ mkdir .\ini\
if not exist .\note\ mkdir .\note\
if not exist ".\data\Program Files\Common Files\" mkdir ".\data\Program Files\Common Files\"
if not exist ".\data\Program Files (x86)\Common Files\" mkdir ".\data\Program Files (x86)\Common Files\"
if not exist ".\data\ProgramData\" mkdir ".\data\ProgramData\"
if not exist ".\data\Users\MarioMasta64\" mkdir ".\data\Users\MarioMasta64\"
if not exist ".\data\Users\MarioMasta64\AppData\Local\" mkdir ".\data\Users\MarioMasta64\AppData\Local\"
if not exist ".\data\Users\MarioMasta64\AppData\Roaming\" mkdir ".\data\Users\MarioMasta64\AppData\Roaming\"
if not exist ".\data\Users\MarioMasta64\3D Objects\" mkdir ".\data\Users\MarioMasta64\3D Objects\"
if not exist ".\data\Users\MarioMasta64\Contacts\" mkdir ".\data\Users\MarioMasta64\Contacts\"
if not exist ".\data\Users\MarioMasta64\Desktop\" mkdir ".\data\Users\MarioMasta64\Desktop\"
if not exist ".\data\Users\MarioMasta64\Documents\" mkdir ".\data\Users\MarioMasta64\Documents\"
if not exist ".\data\Users\MarioMasta64\Downloads\" mkdir ".\data\Users\MarioMasta64\Downloads\"
if not exist ".\data\Users\MarioMasta64\Favorites\" mkdir ".\data\Users\MarioMasta64\Favorites\"
if not exist ".\data\Users\MarioMasta64\Links\" mkdir ".\data\Users\MarioMasta64\Links\"
if not exist ".\data\Users\MarioMasta64\Music\" mkdir ".\data\Users\MarioMasta64\Music\"
if not exist ".\data\Users\MarioMasta64\OneDrive\" mkdir ".\data\Users\MarioMasta64\OneDrive\"
if not exist ".\data\Users\MarioMasta64\Pictures\" mkdir ".\data\Users\MarioMasta64\Pictures\"
if not exist ".\data\Users\MarioMasta64\Saved Games\" mkdir ".\data\Users\MarioMasta64\Saved Games\"
if not exist ".\data\Users\MarioMasta64\Searches\" mkdir ".\data\Users\MarioMasta64\Searches\"
if not exist ".\data\Users\MarioMasta64\Videos\" mkdir ".\data\Users\MarioMasta64\Videos\"
exit /b 2
:SettingsCheck
if exist .\ini\settings.ini (
for /f %%C in ('Find /v /c "" ^< .\ini\settings.ini') do set Count=%%C
for /F "delims=" %%i in (.\ini\settings.ini) do set "lastline=%%i"
) else (
set Count=0
)
:Setting1
if "!Count!" LSS "2" (
>.\ini\settings.ini (echo // Nulls Future Items Put In .\extra\ To Save Space)
>>.\ini\settings.ini (echo "NullExtra", 0)
)
set "NullExtra=" & for /F "skip=1 delims=" %%k in (.\ini\settings.ini) do ( set "NullExtra=%%k" & set "NullExtra=!NullExtra:~-1!" & goto :Setting2 )
:Setting2
if "!Count!" LSS "4" (
>>.\ini\settings.ini (echo // Debug)
>>.\ini\settings.ini (echo "Debug", 0)
)
set "Debug=" & for /F "skip=3 delims=" %%k in (.\ini\settings.ini) do ( set "Debug=%%k" & set "Debug=!Debug:~-1!" & goto :Setting3 )
:Setting3
if "!Count!" LSS "6" (
>>.\ini\settings.ini (echo // Do Not Prompt For Confirmation [DANGEROUS])
>>.\ini\settings.ini (echo "NoPrompt", 0)
)
set "NoPrompt=" & for /F "skip=5 delims=" %%l in (.\ini\settings.ini) do ( set "NoPrompt=%%l" & set "NoPrompt=!NoPrompt:~-1!" & goto :Setting4 )
:Setting4
exit /b 2
:Version
echo 47 > .\doc\version.txt
set /p current_version=<.\doc\version.txt
if exist .\doc\version.txt del .\doc\version.txt >nul
exit /b 2
:Credits
cls
if exist !license! exit /b 2
echo ================================================== > !license!
echo = Script by MarioMasta64 = >> !license!
set "extra_space="
if %current_version% LSS 10 set "extra_space= "
echo = Script Version: v%current_version%- release %extra_space%= >> !license!
echo ================================================== >> !license!
echo =You may Modify this WITH consent of the original= >> !license!
echo = creator, as long as you include a copy of this = >> !license!
echo = as you include a copy of the License = >> !license!
echo ================================================== >> !license!
echo = You may also modify this script without = >> !license!
echo = consent for PERSONAL USE ONLY = >> !license!
echo ================================================== >> !license!
cls
title Portable Everything Launcher - Helper Edition - About
for /f "DELIMS=" %%i in (!license!) do (echo %%i)
pause
call :PingInstall
exit /b 2
REM if a script can be used between files then it can be put here and re-written only if it doesnt exist
REM stuff here will not be changed between programs
:SetArch
set arch=
if exist "%PROGRAMFILES(X86)%" set "arch=64"
exit /b 2
:HelperCheck
if not exist launch_helpers.bat call :DownloadHelpers
exit /b 2
:DownloadHelpers
if not exist .\helpers\download.vbs call :CreateDownloadVBS
cscript .\helpers\download.vbs https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/launch_helpers.bat launch_helpers.bat >nul
exit /b 2
:CreateDownloadVBS
echo Dim Arg, download, file > .\helpers\download.vbs
echo Set Arg = WScript.Arguments >> .\helpers\download.vbs
echo. >> .\helpers\download.vbs
echo download = Arg(0) >> .\helpers\download.vbs
echo file = Arg(1) >> .\helpers\download.vbs
echo. >> .\helpers\download.vbs
echo dim xHttp: Set xHttp = CreateObject("MSXML2.ServerXMLHTTP")>> .\helpers\download.vbs
echo dim bStrm: Set bStrm = createobject("Adodb.Stream") >> .\helpers\download.vbs
echo xHttp.Open "GET", download, False >> .\helpers\download.vbs
echo xHttp.Send >> .\helpers\download.vbs
echo. >> .\helpers\download.vbs
echo with bStrm >> .\helpers\download.vbs
echo .type = 1 '//binary >> .\helpers\download.vbs
echo .open >> .\helpers\download.vbs
echo .write xHttp.responseBody >> .\helpers\download.vbs
echo .savetofile file, 2 '//overwrite >> .\helpers\download.vbs
echo end with >> .\helpers\download.vbs
exit /b 2
:HelperDownload
REM v1+ Required
echo 1> .\helpers\version.txt
echo %1> .\helpers\download.txt
echo %2> .\helpers\file.txt
call "!folder!\launch_helpers.bat" Download
exit /b 2
:HelperDownloadWget
REM v3+ Required
echo 3> .\helpers\version.txt
call "!folder!\launch_helpers.bat" DownloadWget
exit /b 2
:HelperExtract
REM v1+ Required
echo 1> .\helpers\version.txt
echo %1> .\helpers\file.txt
echo %2> .\helpers\folder.txt
call "!folder!\launch_helpers.bat" Extract
exit /b 2
:HelperExtract7Zip
REM v27+ Required
echo 27> .\helpers\version.txt
echo %1> .\helpers\file.txt
echo %2> .\helpers\folder.txt
call "!folder!\launch_helpers.bat" Extract7Zip
exit /b 2
:HelperHide
REM v4+ Required
echo 4> .\helpers\version.txt
echo %1> .\helpers\file.txt
call "!folder!\launch_helpers.bat" Hide
exit /b 2
:HelperReplaceText
REM v5+ Required
echo 5> .\helpers\version.txt
echo %1> .\helpers\file.txt
echo %2> .\helpers\oldtext.txt
echo %3> .\helpers\newtext.txt
call "!folder!\launch_helpers.bat" ReplaceText
exit /b 2
:HelperExtractInno
REM v8+ Required
echo 8> .\helpers\version.txt
echo %1> .\helpers\file.txt
echo %2> .\helpers\folder.txt
call "!folder!\launch_helpers.bat" ExtractInno
exit /b 2
:HelperDownloadJava
REM v10+ Required But Always Updated Anyways
echo 9999> .\helpers\version.txt
call "!folder!\launch_helpers.bat" DownloadJava
exit /b 2
:HelperExtractDirectX
REM v11+ Required
echo 11> .\helpers\version.txt
echo %1> .\helpers\file.txt
echo %2> .\helpers\folder.txt
call "!folder!\launch_helpers.bat" ExtractDirectX
exit /b 2
:HelperExtractMSI
REM v11+ Required
echo 11> .\helpers\version.txt
echo %1> .\helpers\file.txt
echo %2> .\helpers\folder.txt
call "!folder!\launch_helpers.bat" ExtractMSI
exit /b 2
:HelperExtractWix
REM v11+ Required
echo 11> .\helpers\version.txt
echo %1> .\helpers\file.txt
echo %2> .\helpers\folder.txt
call "!folder!\launch_helpers.bat" ExtractWix
exit /b 2
:HelperURLScraper
REM v26+ Required
echo 26> .\helpers\version.txt
echo %1> .\helpers\url.txt
echo %2> .\helpers\urlfile.txt
echo %3> .\helpers\searchpattern.txt
echo %4> .\helpers\filepattern.txt
echo %5> .\helpers\filepatternstart.txt
echo %6> .\helpers\filepatternend.txt
echo %7> .\helpers\addstart.txt
echo %9> .\helpers\versionstart.txt
shift
echo %9> .\helpers\versionend.txt
shift
echo %9> .\helpers\fileorlink.txt
shift
echo %9> .\helpers\replace1.txt
shift
echo %9> .\helpers\replaced1.txt
call "!folder!\launch_helpers.bat" URLScraper
exit /b 2
:Test
REM call :HelperRunAsAdmin "cmd" "/c !systemroot!\notepad.exe !folder!\helpers\runasadmin.vbs" "0"
call :HelperRunAsAdmin "!systemroot!\notepad.exe" "!folder!\helpers\runasadmin.vbs" "0"
pause
exit /b 2
:HelperRunAsAdmin
REM v17+ Required
echo 17> .\helpers\version.txt
echo %1> .\helpers\command.txt
echo %2> .\helpers\params.txt
echo "!folder!"> .\helpers\folder.txt
echo %3> .\helpers\mode.txt
call "!folder!\launch_helpers.bat" RunAsAdmin
exit /b 2
:PingInstall
for /F "skip=1 tokens=5" %%a in ('vol %~D0') do echo %%a>serial.txt
set /a count=1
for /f "skip=1 delims=:" %%a in ('CertUtil -hashfile "serial.txt" sha1') do (
if !count! equ 1 set "sha1=%%a"
set/a count+=1
)
set "sha1=%sha1: =%
echo %sha1%
set program=%~n0
echo %program:~7%
echo "https://mariomasta64.me/install/new_install.php?program=%program:~7%^&serial=%sha1%"
if exist new_install.php del new_install.php >nul
if exist serial.txt del serial.txt >nul
REM call :HelperDownload "https://mariomasta64.me/install/new_install.php?program=%program:~7%^&serial=%sha1%" "new_install.php"
if exist new_install.php del new_install.php >nul
if exist serial.txt del serial.txt >nul
exit /b 2
:UpdateWget
cls
call "!folder!\launch_helpers.bat" DownloadWget
exit /b 2
:LatestBuild
cls
title Portable Everything Launcher - Helper Edition - Latest Build :D
echo you are using the latest version!!
echo Current Version: v%current_version%
echo New Version: v%new_version%
echo ENTER TO CONTINUE & pause >nul
start "" "!main_launcher!"
exit
:NewUpdate
cls
title Portable Everything Launcher - Helper Edition - Old Build D:
if "!NoPrompt!" NEQ "1" (
cls
echo !NAG!
set nag="Selection Time!"
echo you are using an older version
echo enter yes or no
echo Current Version: v%current_version%
echo New Version: v%new_version%
set /p choice="Update?: "
if "%choice%"=="yes" call :UpdateNow & exit /b 2
if "%choice%"=="no" exit /b 2
set nag="please enter YES or NO"
goto NewUpdate
)
:UpdateNow
cls & title Portable Everything Launcher - Helper Edition - Updating Launcher
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/!main_launcher!" "!main_launcher!.1"
cls & if exist "!main_launcher!.1" goto ReplacerCreate
cls & call :ErrorOffline
exit /b 2
:ReplacerCreate
cls
echo @echo off > replacer.bat
echo Color 0A >> replacer.bat
echo del "!main_launcher!" >> replacer.bat
echo rename "!main_launcher!.1" "!main_launcher!" >> replacer.bat
echo start "" "!main_launcher!" >> replacer.bat
:: launcher exits, deletes itself, and then exits again. yes. its magic.
echo (goto) 2^ >nul ^& del "%%~f0" ^& exit >> replacer.bat
call :HelperHide "replacer.bat"
exit
:PreviewBuild
cls
title Portable Everything Launcher - Helper Edition - Test Build :0
echo YOURE USING A TEST BUILD MEANING YOURE EITHER
echo CLOSE TO ME OR YOURE SOME SORT OF PIRATE
echo Current Version: v%current_version%
echo New Version: v%new_version%
echo ENTER TO CONTINUE & pause >nul
start "" "!main_launcher!"
exit
:ErrorOffline
cls
set nag="YOU SEEM TO BE OFFLINE PLEASE RECONNECT TO THE INTERNET TO USE THIS FEATURE"
exit /b 2
REM GENERAL PURPOSE SCRIPTS BELOW
:AlphaToNumber
set a=1
set b=2
set c=3
set d=4
set e=5
set f=6
set g=7
set h=8
set i=9
set j=10
set k=11
set l=12
set m=13
set n=14
set o=15
set p=16
set q=17
set r=18
set s=19
set t=20
set u=21
set v=22
set w=23
set x=24
set y=25
set z=26
exit /b 2
:ViewCode
start notepad.exe "%~f0"
exit /b 2
:MakeCopy
:SaveCopy
del "%~f0.bak"
copy "%~f0" "%~f0.bak"
exit /b 2
:Cmd
cls
title Portable Everything Launcher - Helper Edition - Command Prompt - By MarioMasta64
ver
echo (C) Copyright Microsoft Corporation. All rights reserved
echo.
echo nice job finding me. have fun with my little cmd prompt.
echo upon error (more likely than not) i will return to the menu.
echo type "(goto) 2^ >nul" or make me error to return.
echo.
:CmdLoop
set /p "cmd=%cd%>"
if "%cmd%"=="reset-cmd" call :Cmd
%cmd%
echo.
goto CmdLoop
:Relaunch
echo @echo off > relaunch.bat
echo cls >> relaunch.bat
echo Color 0A >> relaunch.bat
echo start %~f0 >> relaunch.bat
:: launcher exits, deletes itself, and then exits again. yes. its magic.
echo (goto) 2^ >nul ^& del "%%~f0" ^& exit >> relaunch.bat
call :HelperHide "relaunch.bat"
exit
REM program specific merge in later?
:GetLaunchers
dir /b /a-d launch_*.bat > .\doc\launchers.txt
set Counter=0
for /f "DELIMS=" %%i in ('type .\doc\launchers.txt') do (
if "%%i" NEQ "launch_dlldownloader.bat" (
set /a Counter+=1
set Line_!counter!=%%i
)
)
if exist .\doc\launchers.txt del .\doc\launchers.txt >nul
exit /b
:GetInfo
if exist "!launchername!.txt" del "!launchername!.txt" >nul
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/info/!launchername!.txt" "!launchername!.txt"
cls
for /f "DELIMS=" %%i in ('type !launchername!.txt') do (
echo %%i
)
if not exist "!launchername!.txt" cls & echo you seem to be offline or there is a problem with the github
if exist "!launchername!.txt" del "!launchername!.txt" >nul
exit /b
:GetDownloads
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/version.txt" "version.txt"
cls
set "num=1"
set "counter=0"
for /f "DELIMS=" %%i in (version.txt) do (
set /a num+=1
:: this line says if num is equal to blah execute this. basically it counts by this many lines it also resets the counter on completion
if "!num!"=="2" (
set /a counter+=1&set "Line_!counter!=%%i"&set num=0
if "!launcher!"=="launch_%%i.bat" (set /a new_line=!counter!*2)
)
)
if exist version.txt del version.txt >nul
set nag="if it wasnt for http://stackoverflow.com/users/5269570/sam-denty this wouldnt work"
exit /b
:GetNewDownloads
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/version.txt" "version.txt"
cls
set "num=1"
set "counter=0"
for /f "DELIMS=" %%i in (version.txt) do (
set /a num+=1
:: this line says if num is equal to blah execute this. basically it counts by this many lines it also resets the counter on completion
if "!num!"=="2" (
if not exist launch_%%i.bat (set /a counter+=1&set "Line_!counter!=%%i")
set num=0
)
)
if exist version.txt del version.txt >nul
set nag="if it wasnt for http://stackoverflow.com/users/5269570/sam-denty this wouldnt work"
exit /b
:Download
call :GetNewDownloads
cls
title Portable Everything Launcher - Helper Edition - Download Launcher
echo !NAG!
set nag=Selection Time!
if "!counter!" EQU "0" set "nag=There Is Nothing Else To Download (For Now)" & exit /b 2
:: first number is which line to start second number is how many lines to count by
echo.
For /L %%C in (1,1,!counter!) Do (
set "numberstr=%%C"
call :strlen numberstr numberlength
set "launcherstr=!Line_%%C!"
call :strlen launcherstr launcherlength
set /a "linelength=!numberlength!+!launcherlength!+2"
set /a "paddinglength=39-!linelength!"
call :GeneratePadding
set /p "=%%C. !Line_%%C!!spaces! " <nul
)
echo.
echo.
echo type menu to return to the main menu
set /p choice="launcher to download: "
set "launchername=!Line_%choice%!"
set "launcher=launch_!launchername!.bat"
if "!choice!"=="menu" exit /b 2
:: cap output somehow
call :Info & exit /b 2
:LauncherCheck
cls
title Portable Everything Launcher - Helper Edition - Check Launcher
set /a verline = !choice! * 2
if not exist "launch_!launchername!.bat" call :UpdateChoiceNow
exit /b 2
:Launch
call :GetLaunchers
cls
title Portable Everything Launcher - Helper Edition - Select Launcher
echo !NAG!
set nag=Selection Time!
if "!counter!" EQU "0" set "nag=There Is Nothing To Launch (Try Using ^"F^" To Download Something)" & exit /b 2
echo.
For /L %%C in (1,1,!counter!) Do (
set "numberstr=%%C"
call :strlen numberstr numberlength
set "launcherstr=!Line_%%C!"
call :strlen launcherstr launcherlength
set /a "linelength=!numberlength!+!launcherlength!+2"
set /a "paddinglength=39-!linelength!"
call :GeneratePadding
set /p "=%%C. !Line_%%C!!spaces! " <nul
)
echo.
echo.
echo type menu to return to the main menu
:: typing "]" here opens cmd prompt. spoopy.
set /p choice="launcher to launch: "
set "launcher=!Line_%choice%!"
if "!choice!"=="menu" exit /b 2
start !launcher!
exit
:Delete
call :GetLaunchers
cls
title Portable Everything Launcher - Helper Edition - Delete Launcher
echo !NAG!
set nag=Selection Time!
if "!counter!" EQU "0" set "nag=There Is Nothing To Delete (Try Using ^"F^" To Download Something)" & exit /b 2
echo.
For /L %%C in (1,1,!counter!) Do (
set "numberstr=%%C"
call :strlen numberstr numberlength
set "launcherstr=!Line_%%C!"
call :strlen launcherstr launcherlength
set /a "linelength=!numberlength!+!launcherlength!+2"
set /a "paddinglength=39-!linelength!"
call :GeneratePadding
set /p "=%%C. !Line_%%C!!spaces! " <nul
)
echo.
echo.
echo type menu to return to the main menu
set /p choice="launcher to delete: "
set "launcher=!Line_%choice%!"
if "!choice!"=="menu" exit /b 2
del "!launcher!" >nul
exit /b 2
:Update
call :GetLaunchers
cls
title Portable Everything Launcher - Helper Edition - Update Launcher
echo !NAG!
set nag=Selection Time!
if "!counter!" EQU "0" set "nag=There Is Nothing To Update (Try Using ^"F^" To Download Something)" & exit /b 2
echo.
For /L %%C in (1,1,!counter!) Do (
set "numberstr=%%C"
call :strlen numberstr numberlength
set "launcherstr=!Line_%%C!"
call :strlen launcherstr launcherlength
set /a "linelength=!numberlength!+!launcherlength!+2"
set /a "paddinglength=39-!linelength!"
call :GeneratePadding
set /p "=%%C. !Line_%%C!!spaces! " <nul
)
echo.
echo.
echo type menu to return to the main menu
set /p choice="launcher to update: "
set "launcher=!Line_%choice%!"
if "!choice!"=="menu" exit /b 2
call :GetDownloads
exit /b 2
:UpdateChoiceNow
cls
if exist "!launcher!" del "!launcher!" >nul
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/!launcher!" "!launcher!"
exit /b 2
:Info
cls
title Portable Everything Launcher - Helper Edition - "!launchername!" Menu
echo !NAG!
set nag=Selection Time!
echo what would you like to do?
echo 1. Download Launcher
echo 2. View More Info
echo back to go back or menu to go back to the menu
set /p choice="action: "
if "!choice!"=="1" call :LauncherCheck
if "!choice!"=="2" call :MoreInfo
if "!choice!"=="back" call :Download
if "!choice!"=="menu" exit /b 2
goto Info
:MoreInfo
call :GetInfo
cls
title Portable "!launchername!" Launcher - More Info
if exist "!launchername!.txt" del "!launchername!.txt" >nul
call :HelperDownload "https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/info/!launchername!.txt" "!launchername!.txt"
cls
if not exist "!launchername!.txt" (
set "nag=No Info Found / Info Download Failed"
echo "Failed To Download https://raw.githubusercontent.com/MarioMasta64/EverythingPortable/master/info/"
goto Info
)
for /f "DELIMS=" %%i in (!launchername!.txt) do (echo %%i)
if exist "!launchername!.txt" del "!launchername!.txt" >nul
pause
goto Info
:About
cls
if exist !license! del !license! >nul
start "" "!main_launcher!"
exit
:GetAllTheStuff
call :HelperDownload "https://github.com/MarioMasta64/EverythingPortable/archive/master.zip" "master.zip"