-
Notifications
You must be signed in to change notification settings - Fork 7
/
start_goanimateoffline.bat
1098 lines (1022 loc) · 40.6 KB
/
start_goanimateoffline.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
:: GoAnimate Offline Launcher
:: Author: joseph the animator#2292
:: License: MIT
set WRAPPER_VER=1.2.3
title GoAnimate Offline v%WRAPPER_VER% [Initializing...]
::::::::::::::::::::
:: Initialization ::
::::::::::::::::::::
:: Stop commands from spamming stuff, cleans up the screen
@echo off && cls
:: Lets variables work or something idk im not a nerd
SETLOCAL ENABLEDELAYEDEXPANSION
:: Make sure we're starting in the correct folder, and that it worked (otherwise things would go horribly wrong)
pushd "%~dp0"
if !errorlevel! NEQ 0 goto error_location
if not exist utilities ( goto error_location )
if not exist wrapper ( goto error_location )
if not exist server ( goto error_location )
goto noerror_location
:error_location
echo Doesn't seem like this script is in a GoAnimate Offline folder.
pause && exit
:noerror_location
:: patch detection
if exist "patch.jpg" goto patched
:: Prevents CTRL+C cancelling (please close with 0) and keeps window open when crashing
if "%~1" equ "point_insertion" goto point_insertion
start "" /wait /B "%~F0" point_insertion
exit
:point_insertion
:: Check *again* because it seems like sometimes it doesn't go into dp0 the first time???
pushd "%~dp0"
if !errorlevel! NEQ 0 goto error_location
if not exist utilities ( goto error_location )
if not exist wrapper ( goto error_location )
if not exist server ( goto error_location )
:: Create checks folder if nonexistent
if not exist "utilities\checks" md utilities\checks
:: Operator, attention!
if not exist "utilities\checks\disclaimer.txt" (
echo DISCLAIMER
echo:
echo GoAnimate Offline is a project to preserve the original GoAnimate flash-based themes.
echo We believe they should be archived for others to use and learn about in the future.
echo All business themes have been removed, please use Vyond Studio if you wish to get those.
echo This is still unlawful use of copyrighted material, but ^(in our opinion^) morally justifiable use.
echo:
echo We are not affiliated in any form with Vyond or GoAnimate Inc. We generate no profit from this.
echo We do not wish to promote piracy, and we avoid distributing content that is still in use by GoAnimate Inc.
echo We have tried to reduce any harm we could do to GoAnimate Inc while making this project.
echo:
echo Excluding Adobe Flash and GoAnimate Inc's assets, Wrapper: Offline is free/libre software.
echo You are free to redistribute and/or modify it under the terms of the MIT ^(aka Expat^) license,
echo except for some dependencies which have different licenses with slightly different rights.
echo Read the LICENSE file in Offline's base folder and the licenses in utilities/sourcecode for more info.
echo:
echo By continuing to use GoAnimate Offline, you acknowledge the nature of this project, and your right to use it.
echo If you object to any of this, feel free to close Wrapper: Offline now.
echo You will be allowed to accept 20 seconds after this message has appeared.
echo:
PING -n 21 127.0.0.1>nul
echo If you still want to use GoAnimate Offline, press Y. If you no longer want to, press N.
:disclaimacceptretry
set /p ACCEPTCHOICE= Response:
echo:
if not '!acceptchoice!'=='' set acceptchoice=%acceptchoice:~0,1%
if /i "!acceptchoice!"=="y" goto disclaimaccepted
if /i "!acceptchoice!"=="n" exit
goto disclaimacceptretry
:disclaimaccepted
echo:
echo Sorry for all the legalese, let's get back on track.
echo You've accepted the disclaimer. To reread it, remove this file. > utilities\checks\disclaimer.txt
)
:: Welcome, Director Ford!
echo Wrapper: Offline
echo A project from VisualPlugin adapted by Joseph Animate 2021
echo Version !WRAPPER_VER!
echo:
:: Confirm measurements to proceed.
set SUBSCRIPT=y
echo Loading settings...
if not exist utilities\config.bat ( goto configmissing )
call utilities\config.bat
echo:
if !VERBOSEWRAPPER!==y ( echo Verbose mode activated. && echo:)
goto configavailable
:: Restore config
:configmissing
echo Settings are missing for some reason?
echo Restoring...
goto configcopy
:returnfromconfigcopy
if not exist utilities\config.bat ( echo Something is horribly wrong. You may be in a read-only system/admin folder. & pause & exit )
call utilities\config.bat
:configavailable
::::::::::::::::::::::
:: Dependency Check ::
::::::::::::::::::::::
if !SKIPCHECKDEPENDS!==y (
echo Checking dependencies has been skipped.
echo:
goto skip_dependency_install
)
if !VERBOSEWRAPPER!==n (
echo Checking for dependencies...
echo:
)
title Wrapper: Offline v!WRAPPER_VER! [Checking dependencies...]
:: Preload variables
set NEEDTHEDEPENDERS=n
set ADMINREQUIRED=n
set FLASH_DETECTED=n
set FLASH_CHROMIUM_DETECTED=n
set FLASH_FIREFOX_DETECTED=n
set NODEJS_DETECTED=n
set HTTPSERVER_DETECTED=n
set HTTPSCERT_DETECTED=n
if !INCLUDEDCHROMIUM!==y set BROWSER_TYPE=chrome
:: Flash Player
if !VERBOSEWRAPPER!==y ( echo Checking for Flash installation... )
if exist "!windir!\SysWOW64\Macromed\Flash\*pepper.exe" set FLASH_CHROMIUM_DETECTED=y
if exist "!windir!\System32\Macromed\Flash\*pepper.exe" set FLASH_CHROMIUM_DETECTED=y
if exist "!windir!\SysWOW64\Macromed\Flash\*plugin.exe" set FLASH_FIREFOX_DETECTED=y
if exist "!windir!\System32\Macromed\Flash\*plugin.exe" set FLASH_FIREFOX_DETECTED=y
if !BROWSER_TYPE!==chrome (
if !FLASH_CHROMIUM_DETECTED!==n (
echo Flash for Chrome could not be found.
echo:
set NEEDTHEDEPENDERS=y
set ADMINREQUIRED=y
goto flash_checked
) else (
echo Flash is installed.
echo:
set FLASH_DETECTED=y
goto flash_checked
)
)
if !BROWSER_TYPE!==firefox (
if !FLASH_FIREFOX_DETECTED!==n (
echo Flash for Firefox could not be found.
echo:
set NEEDTHEDEPENDERS=y
set ADMINREQUIRED=y
goto flash_checked
) else (
echo Flash is installed.
echo:
set FLASH_DETECTED=y
goto flash_checked
)
)
:: just assume chrome it's what everyone uses
if !BROWSER_TYPE!==n (
if !FLASH_CHROMIUM_DETECTED!==n (
echo Flash for Chrome could not be found.
echo:
set NEEDTHEDEPENDERS=y
set ADMINREQUIRED=y
goto flash_checked
) else (
echo Flash is installed.
echo:
set FLASH_DETECTED=y
goto flash_checked
)
)
:flash_checked
:: Node.js
if !VERBOSEWRAPPER!==y ( echo Checking for Node.js installation... )
for /f "delims=" %%i in ('npm -v 2^>nul') do set output=%%i
IF "!output!" EQU "" (
echo Node.js could not be found.
echo:
set NEEDTHEDEPENDERS=y
set ADMINREQUIRED=y
goto httpserver_checked
) else (
echo Node.js is installed.
echo:
set NODEJS_DETECTED=y
)
:nodejs_checked
:: http-server
if !VERBOSEWRAPPER!==y ( echo Checking for http-server installation... )
npm list -g | findstr "http-server" >nul
if !errorlevel! == 0 (
echo http-server is installed.
echo:
set HTTPSERVER_DETECTED=y
) else (
echo http-server could not be found.
echo:
set NEEDTHEDEPENDERS=y
)
:httpserver_checked
:: HTTPS cert
if !VERBOSEWRAPPER!==y ( echo Checking for HTTPS certificate... )
certutil -store -enterprise root | findstr "WOCRTV3" >nul
if !errorlevel! == 0 (
echo HTTPS cert installed.
echo:
set HTTPSCERT_DETECTED=y
) else (
:: backup check in case non-admin method used
if exist "utilities\checks\httpscert.txt" (
echo HTTPS cert probably installed.
echo:
set HTTPSCERT_DETECTED=y
) else (
echo HTTPS cert could not be found.
echo:
set NEEDTHEDEPENDERS=y
)
)
popd
:: Assumes nothing is installed during a dry run
if !DRYRUN!==y (
echo Let's just ignore anything we just saw above.
echo Nothing was found. Nothing exists. It's all fake.
set NEEDTHEDEPENDERS=y
set ADMINREQUIRED=y
set FLASH_DETECTED=n
set FLASH_CHROMIUM_DETECTED=n
set FLASH_FIREFOX_DETECTED=n
set NODEJS_DETECTED=n
set HTTPSERVER_DETECTED=n
set HTTPSCERT_DETECTED=n
set BROWSER_TYPE=n
)
::::::::::::::::::::::::
:: Dependency Install ::
::::::::::::::::::::::::
if !NEEDTHEDEPENDERS!==y (
if !SKIPDEPENDINSTALL!==n (
echo:
echo Installing missing dependencies...
echo:
) else (
echo Skipping dependency install.
goto skip_dependency_install
)
) else (
echo All dependencies are available.
echo Turning off checking dependencies...
echo:
:: Initialize vars
set CFG=utilities\config.bat
set TMPCFG=utilities\tempconfig.bat
:: Loop through every line until one to edit
if exist !tmpcfg! del !tmpcfg!
set /a count=1
for /f "tokens=1,* delims=0123456789" %%a in ('find /n /v "" ^< !cfg!') do (
set "line=%%b"
>>!tmpcfg! echo(!line:~1!
set /a count+=1
if !count! GEQ 14 goto linereached
)
:linereached
:: Overwrite the original setting
echo set SKIPCHECKDEPENDS=y>> !tmpcfg!
echo:>> !tmpcfg!
:: Print the last of the config to our temp file
more +15 !cfg!>> !tmpcfg!
:: Make our temp file the normal file
copy /y !tmpcfg! !cfg! >nul
del !tmpcfg!
:: Set in this script
set SKIPCHECKDEPENDS=y
goto skip_dependency_install
)
title GoAnimate v!WRAPPER_VER! [Installing dependencies...]
:: Preload variables
set INSTALL_FLAGS=ALLUSERS=1 /norestart
set SAFE_MODE=n
if /i "!SAFEBOOT_OPTION!"=="MINIMAL" set SAFE_MODE=y
if /i "!SAFEBOOT_OPTION!"=="NETWORK" set SAFE_MODE=y
set CPU_ARCHITECTURE=what
if /i "!processor_architecture!"=="x86" set CPU_ARCHITECTURE=32
if /i "!processor_architecture!"=="AMD64" set CPU_ARCHITECTURE=64
if /i "!PROCESSOR_ARCHITEW6432!"=="AMD64" set CPU_ARCHITECTURE=64
:: Check for admin if installing Flash or Node.js
:: Skipped in Safe Mode, just in case anyone is running Wrapper in safe mode... for some reason
:: and also because that was just there in the code i used for this and i was like "eh screw it why remove it"
if !ADMINREQUIRED!==y (
if !VERBOSEWRAPPER!==y ( echo Checking for Administrator rights... && echo:)
if /i not "!SAFE_MODE!"=="y" (
fsutil dirty query !systemdrive! >NUL 2>&1
if /i not !ERRORLEVEL!==0 (
color cf
if !VERBOSEWRAPPER!==n ( cls )
echo:
echo ERROR
echo:
if !FLASH_DETECTED!==n (
if !NODEJS_DETECTED!==n (
echo GoAnimate Offline needs to install Flash and Node.js.
) else (
echo GoAnimate Offline needs to install Flash.
)
) else (
echo GoAnimate Offline needs to install Node.js.
)
echo To do this, it must be started with Admin rights.
echo:
echo Close this window and re-open Wrapper: Offline as an Admin.
echo ^(right-click start_wrapper.bat and click "Run as Administrator"^)
echo:
if !DRYRUN!==y (
echo ...yep, dry run is going great so far, let's skip the exit
pause
goto postadmincheck
)
pause
exit
)
)
if !VERBOSEWRAPPER!==y ( echo Admin rights detected. && echo:)
)
:postadmincheck
:: Flash Player
if !FLASH_DETECTED!==n (
:start_flash_install
echo Installing Flash Player...
echo:
if !BROWSER_TYPE!==n (
:: Ask what type of browser is being used.
echo What web browser do you use? If it isn't here,
echo look up whether it's based on Chromium or Firefox.
echo If it's not based on either, then
echo Wrapper: Offline will not be able to install Flash.
echo Unless you know what you're doing and have a
echo version of Flash made for your browser, please
echo install a Chrome or Firefox based browser.
echo:
echo Enter 1 for Chrome
echo Enter 2 for Firefox
echo Enter 3 for Edge
echo Enter 4 for Opera
echo Enter 5 for Brave
echo Enter 6 for Chrome-based browser
echo Enter 7 for Firefox-based browser
echo Enter 0 for a non-standard browser ^(skips install^)
:browser_ask
set /p FLASHCHOICE=Response:
echo:
if "!flashchoice!"=="1" goto chromium_chosen
if "!flashchoice!"=="2" goto firefox_chosen
if "!flashchoice!"=="3" goto chromium_chosen
if "!flashchoice!"=="4" goto chromium_chosen
if "!flashchoice!"=="5" goto chromium_chosen
if "!flashchoice!"=="6" goto chromium_chosen
if "!flashchoice!"=="7" goto firefox_chosen
if "!flashchoice!"=="0" echo Flash will not be installed.&& goto after_flash_install
echo You must pick a browser.&& goto browser_ask
:chromium_chosen
set BROWSER_TYPE=chrome && if !VERBOSEWRAPPER!==y ( echo Chromium-based browser picked. && echo:) && goto escape_browser_ask
:firefox_chosen
set BROWSER_TYPE=firefox && if !VERBOSEWRAPPER!==y ( echo Firefox-based browser picked. ) && goto escape_browser_ask
)
:escape_browser_ask
echo To install Flash Player, GoAnimate Offline must kill any currently running web browsers.
echo Please make sure any work in your browser is saved before proceeding.
echo GoAnimate Offline will not continue installation until you press a key.
echo:
pause
echo:
:: Summon the Browser Slayer
if !DRYRUN!==y (
echo The users brought down the batch script upon the Browser Slayer, and in his defeat entombed him in the unactivated code.
goto lurebrowserslayer
)
echo Rip and tear, until it is done.
for %%i in (firefox,palemoon,iexplore,microsoftedge,chrome,chrome64,opera,brave) do (
if !VERBOSEWRAPPER!==y (
taskkill /f /im %%i.exe /t
wmic process where name="%%i.exe" call terminate
) else (
taskkill /f /im %%i.exe /t >nul
wmic process where name="%%i.exe" call terminate >nul
)
)
:lurebrowserslayer
echo:
if !BROWSER_TYPE!==chrome (
echo Starting Flash for Chrome installer...
if not exist "utilities\installers\flash_windows_chromium.msi" (
echo ...erm. Bit of an issue there actually. The installer doesn't exist.
echo A normal copy of GoAnimate Offline should come with one.
echo You may be able to find a copy on this website:
echo https://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html
echo Although Flash is needed, Offline will continue launching.
pause
)
if !DRYRUN!==n ( msiexec /i "utilities\installers\flash_windows_chromium.msi" !INSTALL_FLAGS! /quiet )
)
if !BROWSER_TYPE!==firefox (
echo Starting Flash for Firefox installer...
if not exist "utilities\installers\flash_windows_firefox.msi" (
echo ...erm. Bit of an issue there actually. The installer doesn't exist.
echo A normal copy of GoAnimate Offline should come with one.
echo You may be able to find a copy on this website:
echo https://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html
echo Although Flash is needed, Offline will try to install anything else it can.
pause
goto after_flash_install
)
if !DRYRUN!==n ( msiexec /i "utilities\installers\flash_windows_firefox.msi" !INSTALL_FLAGS! /quiet )
)
echo Flash has been installed.
echo:
)
:after_flash_install
:: Node.js
if !NODEJS_DETECTED!==n (
echo Installing Node.js...
echo:
:: Install Node.js
if !CPU_ARCHITECTURE!==64 (
if !VERBOSEWRAPPER!==y ( echo 64-bit system detected, installing 64-bit Node.js. )
if not exist "utilities\installers\node_windows_x64.msi" (
echo We have a problem. The 64-bit Node.js installer doesn't exist.
echo A normal copy of GoAnimate Offline should come with one.
echo You should be able to find a copy on this website:
echo https://nodejs.org/en/download/
echo Although Node.js is needed, Offline will try to install anything else it can.
pause
goto after_nodejs_install
)
echo Proper Node.js installation doesn't seem possible to do automatically.
echo You can just keep clicking next until it finishes, and GoAnimate Offline will continue once it closes.
if !DRYRUN!==n ( msiexec /i "utilities\installers\node_windows_x64.msi" !INSTALL_FLAGS! )
goto nodejs_installed
)
if !CPU_ARCHITECTURE!==32 (
if !VERBOSEWRAPPER!==y ( echo 32-bit system detected, installing 32-bit Node.js. )
if not exist "utilities\installers\node_windows_x32.msi" (
echo We have a problem. The 32-bit Node.js installer doesn't exist.
echo A normal copy of GoAnimate Offline should come with one.
echo You should be able to find a copy on this website:
echo https://nodejs.org/en/download/
echo Although Node.js is needed, Offline will try to install anything else it can.
pause
goto after_nodejs_install
)
echo Proper Node.js installation doesn't seem possible to do automatically.
echo You can just keep clicking next until it finishes, and GoAnimate Offline will continue once it closes.
if !DRYRUN!==n ( msiexec /i "utilities\installers\node_windows_x32.msi" !INSTALL_FLAGS! )
goto nodejs_installed
)
if !CPU_ARCHITECTURE!==what (
echo:
echo Well, this is a little embarassing.
echo Wrapper: Offline can't tell if you're on a 32-bit or 64-bit system.
echo Which means it doesn't know which version of Node.js to install...
echo:
echo If you have no idea what that means, press 1 to just try anyway.
echo If you're in the future with newer architectures or something
echo and you know what you're doing, then press 3 to keep going.
echo:
:architecture_ask
set /p CPUCHOICE= Response:
echo:
if "!cpuchoice!"=="1" if !DRYRUN!==n ( msiexec /i "utilities\installers\node_windows_x32.msi" !INSTALL_FLAGS! ) && if !VERBOSEWRAPPER!==y ( echo Attempting 32-bit Node.js installation. ) && goto nodejs_installed
if "!cpuchoice!"=="3" echo Node.js will not be installed. && goto after_nodejs_install
echo You must pick one or the other.&& goto architecture_ask
)
:nodejs_installed
echo Node.js has been installed.
set NODEJS_DETECTED=y
echo:
goto install_cert
)
:after_nodejs_install
:: http-server
if !HTTPSERVER_DETECTED!==n (
if !NODEJS_DETECTED!==y (
echo Installing http-server...
echo:
:: Skip in dry run, not much use to run it
if !DRYRUN!==y (
echo ...actually, nah, let's skip this part.
goto httpserverinstalled
)
:: Attempt to install through NPM normally
call npm install http-server -g
:: Double check for installation
echo Checking for http-server installation again...
npm list -g | find "http-server" > nul
if !errorlevel! == 0 (
goto httpserverinstalled
) else (
echo:
echo Online installation attempt failed. Trying again from local files...
echo:
if not exist "utilities\installers\http-server-master" (
echo Well, we'd try that if the files existed.
echo A normal copy of Wrapper: Offline should come with them.
echo You should be able to find a copy on this website:
echo https://www.npmjs.com/package/http-server
echo Although http-server is needed, Offline will try to install anything else it can.
pause
goto after_nodejs_install
)
call npm install utilities\installers\http-server-master -g
goto triplecheckhttpserver
)
:: Triple check for installation
echo Checking for http-server installation AGAIN...
:triplecheckhttpserver
npm list -g | find "http-server" > nul
if !errorlevel! == 0 (
goto httpserverinstalled
) else (
echo:
echo Local file installation failed. Something's not right.
echo Unless this was intentional, ask for support or install http-server manually.
echo Enter "npm install http-server -g" into a command prompt.
echo:
pause
exit
)
) else (
color cf
echo:
echo http-server is missing, but somehow Node.js has not been installed yet.
echo Seems either the install failed, or GoAnimate Offline managed to skip it.
echo If installing directly from nodejs.org does not work, something is horribly wrong.
echo Please ask for help in the #support channel on Discord, or email me.
pause
exit
)
:httpserverinstalled
echo http-server has been installed.
echo:
goto install_cert
)
:: Install HTTPS certificate
:install_cert
if !HTTPSCERT_DETECTED!==n (
echo Installing HTTPS certificate...
echo:
if not exist "server\the.crt" (
echo ...except it doesn't exist for some reason.
echo GoAnimate Offline requires this to run.
echo You should get a "the.crt" file from someone else, or redownload Wrapper: Offline.
echo Offline has nothing left to do since it can't launch without the.crt, so it will close.
pause
exit
)
:: Check for admin
if /i not "!SAFE_MODE!"=="y" (
fsutil dirty query !systemdrive! >NUL 2>&1
if /i not !ERRORLEVEL!==0 (
if !VERBOSEWRAPPER!==n ( cls )
echo For GoAnimate Offline to work, it needs an HTTPS certificate to be installed.
echo If you have administrator privileges, you should reopen start_wrapper.bat as Admin.
echo ^(do this by right-clicking start_goanimateoffline.bat and click "Run as Administrator"^)
echo:
echo If you can't do that, there's another method, but it's less reliable and is done per-browser.
echo:
echo Press Y if you have admin access, and press N if you don't.
:certaskretry
set /p CERTCHOICE= Response:
echo:
if not '!certchoice!'=='' set certchoice=%certchoice:~0,1%
if /i "!certchoice!"=="y" echo This window will now close so you can restart it with admin. & pause & exit
if /i "!certchoice!"=="n" goto certnonadmin
echo You must answer Yes or No. && goto certaskretry
:: Non-admin cert install
pushd utilities
start SilentCMD open_http-server.bat
popd
echo:
echo A web browser window will open.
echo When you see a security notice, go past it.
echo This is completely harmless in a local setting like this.
echo If you see a message like this on the real internet, you should stay away.
:: Pause to allow startup
PING -n 8 127.0.0.1>nul
if !INCLUDEDCHROMIUM!==n (
if !CUSTOMBROWSER!==n (
start https://localhost:4664/certbypass.html
) else (
start !CUSTOMBROWSER! https://localhost:4664/certbypass.html >nul
)
) else (
pushd utilities\ungoogled-chromium
start chrome.exe --user-data-dir=the_profile https://localhost:4664/certbypass.html >nul
popd
)
pause
echo:
echo If you intend on using another browser, you'll have to do this again by going to the server page and passing the security message.
echo You've used a non-admin method of installing the HTTPS certificate. To redo the process, delete this file. > utilities\checks\httpscert.txt
goto after_cert_install
)
)
pushd server
if !VERBOSEWRAPPER!==y (
if !DRYRUN!==n ( certutil -addstore -f -enterprise -user root the.crt )
) else (
if !DRYRUN!==n ( certutil -addstore -f -enterprise -user root the.crt >nul )
)
set ADMINREQUIRED=y
popd
)
:after_cert_install
:: Alert user to restart Wrapper without running as Admin
if !ADMINREQUIRED!==y (
color 20
if !VERBOSEWRAPPER!==n ( cls )
echo:
echo Dependencies needing Admin now installed^^!
echo:
echo GoAnimate Offline no longer needs Admin rights,
echo please restart normally by double-clicking.
echo:
echo If you saw this from running normally,
echo Wrapper: Offline should continue normally after a restart.
echo:
if !DRYRUN!==y (
echo ...you enjoying the dry run experience? Skipping closing.
pause
color 0f
goto skip_dependency_install
)
pause
exit
)
color 0f
echo All dependencies now installed^^! Continuing with GoAnimate Offline boot.
echo:
:skip_dependency_install
::::::::::::::::::::::::
:: Starting GoAnimate ::
::::::::::::::::::::::::
title GoAnimate Offline v!WRAPPER_VER! [Loading...]
:: Close existing node apps
:: Hopefully fixes EADDRINUSE errors??
if !VERBOSEWRAPPER!==y (
echo Closing any existing node and/or PHP apps...
if !DRYRUN!==n ( TASKKILL /IM node.exe /F )
if !DRYRUN!==n ( TASKKILL /IM php.exe /F )
echo:
) else (
if !DRYRUN!==n ( TASKKILL /IM node.exe /F 2>nul )
if !DRYRUN!==n ( TASKKILL /IM php.exe /F 2>nul )
)
:: Start Node.js, http-server and PHP for VFProxy
echo Loading Node.js, http-server and PHP ^(for VFProxy only^)...
pushd utilities
if !VERBOSEWRAPPER!==y (
if !DRYRUN!==n ( start /MIN open_http-server.bat )
if !DRYRUN!==n ( start /MIN open_nodejs.bat )
if !DRYRUN!==n ( start /MIN open_vfproxy_php.bat )
) else (
if !DRYRUN!==n ( start SilentCMD open_http-server.bat )
if !DRYRUN!==n ( start SilentCMD open_nodejs.bat )
if !DRYRUN!==n ( start SilentCMD open_vfproxy_php.bat )
)
popd
:: Pause to allow startup
:: Prevents the video list opening too fast
PING -n 6 127.0.0.1>nul
:: Open Wrapper in preferred browser
if !INCLUDEDCHROMIUM!==n (
if !CUSTOMBROWSER!==n (
echo Opening GoAnimate Offline in your default browser...
if !DRYRUN!==n ( start http://localhost:4343 )
) else (
echo Opening GoAnimate Offline in your set browser...
echo If this does not work, you may have set the path wrong.
if !DRYRUN!==n ( start !CUSTOMBROWSER! http://localhost:4343 )
)
) else (
echo Opening GoAnimate Offline using included Chromium...
pushd utilities\ungoogled-chromium
if !APPCHROMIUM!==y (
if !DRYRUN!==n ( start chrome.exe --user-data-dir=the_profile --app=http://localhost:4343 )
) else (
if !DRYRUN!==n ( start chrome.exe --user-data-dir=the_profile http://localhost:4343 )
)
popd
)
echo GoAnimate Offline has been started^^! The video list should now be open.
::::::::::::::::
:: Post-Start ::
::::::::::::::::
title GoAnimate Offline v!WRAPPER_VER!
if !VERBOSEWRAPPER!==y ( goto wrapperstarted )
:wrapperstartedcls
cls
:wrapperstarted
echo:
echo GoAnimate Offline v!WRAPPER_VER! running
echo A project from VisualPlugin adapted by Joseph Animate 2021
echo:
if !VERBOSEWRAPPER!==n ( echo DON'T CLOSE THIS WINDOW^^! Use the quit option ^(0^) when you're done. )
if !VERBOSEWRAPPER!==y ( echo Verbose mode is on, see the two extra CMD windows for extra output. )
if !DRYRUN!==y ( echo Don't forget, nothing actually happened, this was a dry run. )
if !JUSTIMPORTED!==y ( echo Note: You'll need to reload the editor for your file to appear. )
:: Hello, code wanderer. Enjoy seeing all the secret options easily instead of finding them yourself.
echo:
echo Enter 1 to reopen the video list
echo Enter 2 to import a file
echo Enter 3 to open the server page
echo Enter ? to open the FAQ
echo Enter clr to clean up the screen
echo Enter 0 to close Wrapper: Offline
set /a _rand=(!RANDOM!*67/32768)+1
if !_rand!==25 echo Enter things you think'll show a secret if you're feeling adventurous
:wrapperidle
echo:
set /p CHOICE=Choice:
if "!choice!"=="0" goto exitwrapperconfirm
set FUCKOFF=n
if "!choice!"=="1" goto reopen_webpage
if "!choice!"=="2" goto start_importer
if "!choice!"=="3" goto open_server
if "!choice!"=="?" goto open_faq
if /i "!choice!"=="clr" goto wrapperstartedcls
if /i "!choice!"=="cls" goto wrapperstartedcls
if /i "!choice!"=="clear" goto wrapperstartedcls
:: funni options
if "!choice!"=="43" echo OH MY GOD. FOURTY THREE CHARS. NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO & goto wrapperidle
if /i "!choice!"=="benson" echo watch benson on youtube & goto wrapperidle
if /i "!choice!"=="ford" echo what up son & goto wrapperidle
if /i "!choice!"=="no" echo stahp & goto wrapperidle
if /i "!choice!"=="yes" echo Alright. & goto wrapperidle
if /i "!choice!"=="fuck off" goto youfuckoff
if /i "!choice!"=="fuck you" echo No, fuck you. & goto wrapperidle
if /i "!choice!"=="sex" echo that's fake & goto wrapperidle
if /i "!choice!"=="watch benson on youtube" goto w_a_t_c_h
if /i "!choice!"=="browser slayer" goto slayerstestaments
if /i "!choice!"=="patch" goto patchtime
if /i "!choice!"=="random" goto sayarandom
if /i "!choice!"=="narutofan420" echo i am narutofan420 i am a naruto fan i watch naruto i watched all 3 series and still watch it & goto wrapperidle
if /i "!choice!"=="die" echo die please & goto wrapperidle
if /i "!choice!"=="aaron doan" echo YOU^^!^^!^^! Noo Wrapper Is Patched Forever^^!^^!^^! Cries And Hits You So Many Times & goto wrapperidle
if /i "!choice!"=="spark" echo WHY DID SOMEONE FUCK UP THE LAUNCHER? & goto wrapperidle
:: dev options
if /i "!choice!"=="amnesia" goto wipe_save
if /i "!choice!"=="restart" goto restart
if /i "!choice!"=="folder" goto open_files
echo Time to choose. && goto wrapperidle
:reopen_webpage
if !INCLUDEDCHROMIUM!==n (
if !CUSTOMBROWSER!==n (
echo Opening GoAnimate Offline in your default browser...
start http://localhost:4343
) else (
echo Opening GoAnimate Offline in your set browser...
start !CUSTOMBROWSER! http://localhost:4343 >nul
)
) else (
echo Opening GoAnimate Offline using included Chromium...
pushd utilities\ungoogled-chromium
if !APPCHROMIUM!==y (
start chrome.exe --user-data-dir=the_profile --app=http://localhost:4343 >nul
) else (
start chrome.exe --user-data-dir=the_profile http://localhost:4343 >nul
)
popd
)
goto wrapperidle
:open_server
if !INCLUDEDCHROMIUM!==n (
if !CUSTOMBROWSER!==n (
echo Opening the server page in your default browser...
start https://localhost:4664
) else (
echo Opening the server page in your set browser...
start !CUSTOMBROWSER! https://localhost:4664 >nul
)
) else (
echo Opening the server page using included Chromium...
pushd utilities\ungoogled-chromium
if !APPCHROMIUM!==y (
start chrome.exe --user-data-dir=the_profile --app=https://localhost:4664 >nul
) else (
start chrome.exe --user-data-dir=the_profile https://localhost:4664 >nul
)
popd
)
goto wrapperidle
:open_files
pushd ..
echo Opening the GoAnimate-offline folder...
start explorer.exe GoAnimate-offline
popd
goto wrapperidle
:start_importer
echo Opening the importer...
call utilities\import.bat
cls
title GoAnimate Offline v!WRAPPER_VER!
set JUSTIMPORTED=y
goto wrapperstartedcls
:youfuckoff
echo You fuck off.
set FUCKOFF=y
goto wrapperidle
:open_faq
echo Opening the FAQ...
start notepad.exe FAQ.txt
goto wrapperidle
:wipe_save
call utilities\reset_install.bat
if !errorlevel! equ 1 goto wrapperidle
:: flows straight to restart below
:restart
TASKKILL /IM node.exe /F
start "" /wait /B "%~F0" point_insertion
exit
:w_a_t_c_h
echo watch benson on youtube
echo watch benson on youtube
echo watch benson on youtube
echo watch benson on youtube
echo watch benson on youtube
echo wa
goto wrapperidle
:patchtime
echo:
echo would you like to patch whoper online
echo press y or n
:patchtimeretry
set /p PATCHCHOICE= Response:
echo:
if not '!patchchoice!'=='' set patchchoice=%patchchoice:~0,1%
if /i "!patchchoice!"=="y" echo too bad B^) & goto wrapperidle
if /i "!patchchoice!"=="n" echo good & goto wrapperidle
echo yes or no question here && goto patchtimeretry
:sayarandom
:: welcome to "inside jokes with no context" land
set /a _rand=!RANDOM!*15/32767
if !_rand!==0 echo stress level ^>0
if !_rand!==1 echo Something random.
if !_rand!==2 echo oisjdoiajfgmafvdsdg
if !_rand!==3 echo my head is unscrewed & echo what do i need it for
if !_rand!==4 echo when you're eating popcorn you're eating busted nuts
if !_rand!==5 echo chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
if !_rand!==6 echo when u nut so hard that ur roblox crashes
if !_rand!==7 echo seven seven seven seven seven seven seven seven seven seven seven seven seven seven seven seven
if !_rand!==8 echo DONT ASK HOW I GOT IT OR YOU WILL BE BANNED FROM MY CHANNEL WITH NO SECOND CHANCES
if !_rand!==9 echo everything you know is wrong & echo black is white up is down and short is long
if !_rand!==10 echo It's a chekcpoint.
if !_rand!==11 echo Another monday... & echo Another mind-numbing, run-of-the-mill monday... & echo ANOTHER MUNDANE, MORIBUND, HUMDRUM MONDAY!
if !_rand!==12 echo try typing "with style" when exiting
if !_rand!==13 echo elmo
if !_rand!==14 echo gnorm gnat says: trans rights are human rights
if !_rand!==15 echo wrapper inline
goto wrapperidle
:slayerstestaments
echo:
echo In the first age,
PING -n 3 127.0.0.1>nul
echo In the first battle,
PING -n 3 127.0.0.1>nul
echo When the shadows first lengthened,
PING -n 4 127.0.0.1>nul
echo One stood.
PING -n 3 127.0.0.1>nul
echo Slowed by the waste of unoptimized websites,
PING -n 4 127.0.0.1>nul
echo His soul harvested by the trackers of Google
PING -n 5 127.0.0.1>nul
echo And exposed beyond anonymity,
PING -n 4 127.0.0.1>nul
echo He chose the path of perpetual torment.
PING -n 6 127.0.0.1>nul
echo In his ravenous hatred,
PING -n 3 127.0.0.1>nul
echo He found no peace,
PING -n 3 127.0.0.1>nul
echo And with boiling blood,
PING -n 3 127.0.0.1>nul
echo He scoured the search results,
PING -n 4 127.0.0.1>nul
echo Seeking vengeance against the companies who had wronged him.
PING -n 6 127.0.0.1>nul
echo He wore the crown of the Taskkillers,
PING -n 4 127.0.0.1>nul
echo and those that tasted the bite of his sword
PING -n 5 127.0.0.1>nul
echo named him...
PING -n 3 127.0.0.1>nul
echo the Browser Slayer.
PING -n 3 127.0.0.1>nul
:: here comes something that looks awesome normaly but is disgusting when escaped for batch
:: credit to http://www.gamers.org/~fpv/doomlogo.html
echo ^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^= ^=^=^=^=^=^=^=^=^=^=^=^=^=^=^= ^=^=^=^=^=^=^=^=^=^=^=^=^=^=^= ^=^=^=^=^=^=^=^= ^=^=^=^=^=^=^=^=
echo ^\^\ ^. ^. ^. ^. ^. ^. ^.^\^\ //^. ^. ^. ^. ^. ^. ^.^\^\ //^. ^. ^. ^. ^. ^. ^.^\^\ ^\^\^. ^. ^.^\^\// ^. ^. //
echo ^|^|^. ^. ^._____^. ^. ^.^|^| ^|^|^. ^. ^._____^. ^. ^.^|^| ^|^|^. ^. ^._____^. ^. ^.^|^| ^|^| ^. ^. ^.^\/ ^. ^. ^.^|^|
echo ^|^| ^. ^.^|^| ^|^|^. ^. ^|^| ^|^| ^. ^.^|^| ^|^|^. ^. ^|^| ^|^| ^. ^.^|^| ^|^|^. ^. ^|^| ^|^|^. ^. ^. ^. ^. ^. ^. ^|^|
echo ^|^|^. ^. ^|^| ^|^| ^. ^.^|^| ^|^|^. ^. ^|^| ^|^| ^. ^.^|^| ^|^|^. ^. ^|^| ^|^| ^. ^.^|^| ^|^| ^. ^| ^. ^. ^. ^. ^.^|^|
echo ^|^| ^. ^.^|^| ^|^|^. _-^|^| ^|^|-_ ^.^|^| ^|^|^. ^. ^|^| ^|^| ^. ^.^|^| ^|^|^. _-^|^| ^|^|-_^.^|^\ ^. ^. ^. ^. ^|^|
echo ^|^|^. ^. ^|^| ^|^|-^' ^|^| ^|^| ^`-^|^| ^|^| ^. ^.^|^| ^|^|^. ^. ^|^| ^|^|-^' ^|^| ^|^| ^`^|^\_ ^. ^.^|^. ^.^|^|
echo ^|^| ^. _^|^| ^|^| ^|^| ^|^| ^|^| ^|^|_ ^. ^|^| ^|^| ^. _^|^| ^|^| ^|^| ^|^| ^|^\ ^`-_/^| ^. ^|^|
echo ^|^|_-^' ^|^| ^.^|/ ^|^| ^|^| ^\^|^. ^|^| ^`-_^|^| ^|^|_-^' ^|^| ^.^|/ ^|^| ^|^| ^| ^\ / ^|-_^.^|^|
echo ^|^| ^|^|_-^' ^|^| ^|^| ^`-_^|^| ^|^| ^|^| ^|^|_-^' ^|^| ^|^| ^| ^\ / ^| ^`^|^|
echo ^|^| ^`^' ^|^| ^|^| ^`^' ^|^| ^|^| ^`^' ^|^| ^|^| ^| ^\ / ^| ^|^|
echo ^|^| ^.^=^=^=^' ^`^=^=^=^. ^.^=^=^=^'^.^`^=^=^=^. ^.^=^=^=^' /^=^=^. ^| ^\/ ^| ^|^|
echo ^|^| ^.^=^=^' ^\_^|-_ ^`^=^=^=^. ^.^=^=^=^' _^|_ ^`^=^=^=^. ^.^=^=^=^' _-^|/ ^`^=^= ^\/ ^| ^|^|
echo ^|^| ^.^=^=^' _-^' ^`-_ ^`^=^' _-^' ^`-_ ^`^=^' _-^' ^`-_ /^| ^\/ ^| ^|^|
echo ^|^| ^.^=^=^' _-^' ^`-__^\^._-^' ^`-_^./__-^' ^`^' ^|^. /^| ^| ^|^|
echo ^|^|^.^=^=^' _-^' ^`^' ^| /^=^=^.^|^|
echo ^=^=^' _-^' ^\/ ^`^=^=
echo ^\ _-^' ^`-_ /
echo ^`^'^' ^`^`^'
goto wrapperidle
::::::::::::::
:: Shutdown ::
::::::::::::::
:: Confirmation before shutting down
:exitwrapperconfirm
echo:
echo Are you sure you want to quit GoAnimate Offline?
echo Be sure to save all your work.
echo Type Y to quit, and N to go back.
:exitwrapperretry
set /p EXITCHOICE= Response:
echo:
if /i "!exitchoice!"=="y" goto point_extraction
if /i "!exitchoice!"=="yes" goto point_extraction
if /i "!exitchoice!"=="n" goto wrapperstartedcls
if /i "!exitchoice!"=="no" goto wrapperstartedcls
if /i "!exitchoice!"=="with style" goto exitwithstyle
echo You must answer Yes or No. && goto exitwrapperretry