1
- :: AUTO_UPDATER
2
1
@ echo off
2
+
3
+ :: Start by setting some version numbers and the title
3
4
COLOR 0F
4
5
SET /p v = < " %appdata% \FakeSandboxProcesses\current_version.txt"
5
- SET uversion = 11
6
+ SET uversion = 10
6
7
TITLE FSP Updater v%uversion%
7
-
8
- :: Wait for internet connection
9
- SET five = 5
10
- SET count = 1
11
-
12
- :ping
13
- ping -n 1 127.0.0.1> NUL
14
- ping -n 1 8.8.8.8 | find " TTL=" > NUL
15
- SET /A count = count+ 1
16
- if %count% GTR %five% exit
17
- if errorlevel== 1 goto ping
8
+ ping -n 5 127.0.0.1> NUL
18
9
19
10
:: Download updater version number
20
11
echo [*] Getting latest updater version number...
21
12
start /wait /MIN powershell -executionpolicy remotesigned -WindowStyle Hidden -Command " (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/Phoenix1747/fake-sandbox/master/updater/uversion', '%appdata% \FakeSandboxProcesses\uversion.txt')"
22
- ping -n 1 127.0.0.1> NUL
13
+ ping -n 2 127.0.0.1> NUL
23
14
24
15
:: Has the version code changed?
25
16
SET /p nuv = < " %appdata% \FakeSandboxProcesses\uversion.txt"
@@ -29,7 +20,7 @@ del %appdata%\FakeSandboxProcesses\uversion.txt
29
20
:: Download FSP version number
30
21
echo [*] Getting latest FSP version number...
31
22
start /wait /MIN powershell -executionpolicy remotesigned -WindowStyle Hidden -Command " (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/Phoenix1747/fake-sandbox/master/updater/version', '%appdata% \FakeSandboxProcesses\version.txt')"
32
- ping -n 1 127.0.0.1> NUL
23
+ ping -n 2 127.0.0.1> NUL
33
24
34
25
:: Has the version code changed?
35
26
SET /p nv = < " %appdata% \FakeSandboxProcesses\version.txt"
@@ -38,7 +29,7 @@ if "%nv%"=="%v%" goto ok
38
29
:: Ask to install the new version
39
30
SET /p version = < " %appdata% \FakeSandboxProcesses\version.txt"
40
31
del " %appdata% \FakeSandboxProcesses\version.txt"
41
- msg * A new version (%version% ) of Fake Sandbox Processes is available!
32
+ msg * A new version (v %version% ) of Fake- Sandbox- Processes is available!
42
33
cls
43
34
echo .
44
35
echo Version %version% is now available!
@@ -49,25 +40,14 @@ if /i %ANSWER%==y goto install
49
40
if /i %ANSWER% == n goto no
50
41
goto unrecog
51
42
52
- :new_updater
53
- echo [*] New updater version found!
54
- echo [*] Downloading latest updater...
55
- start /MIN powershell -executionpolicy remotesigned -WindowStyle Hidden -Command " (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/Phoenix1747/fake-sandbox/master/updater/updater.bat', '%appdata% \FakeSandboxProcesses\updater_new.bat')"
56
- ping -n 1 127.0.0.1> NUL
57
- if exist %appdata% \FakeSandboxProcesses\updater_new.bat (
58
- start /min %appdata% \FakeSandboxProcesses\updater-installer.bat
59
- exit
60
- )
61
- echo An ERROR occured while downloading the new updater. Closing...
62
- exit
63
-
64
43
:: If yes then download and install the new version
65
44
:install
66
45
del %appdata% \FakeSandboxProcesses\fsp-installer_update.bat
67
46
cls
47
+ echo .
68
48
echo [*] Downloading...
69
- start /wait /MIN powershell -executionpolicy remotesigned -WindowStyle Hidden -Command " (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/Phoenix1747/fake-sandbox/master/installer/fsp -installer.bat', '%appdata% \FakeSandboxProcesses\fsp-installer_update.bat')"
70
- ping -n 1 127.0.0.1> NUL
49
+ start /wait /MIN powershell -executionpolicy remotesigned -WindowStyle Hidden -Command " (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/Phoenix1747/fake-sandbox/master/installer/fake-sandbox -installer.bat', '%appdata% \FakeSandboxProcesses\fsp-installer_update.bat')"
50
+ ping -n 2 127.0.0.1> NUL
71
51
if exist %appdata% \FakeSandboxProcesses\fsp-installer_update.bat goto continue
72
52
goto dlerror
73
53
103
83
104
84
:: If there is no new version, delete the version.txt and exit
105
85
:ok
106
- echo - ^ > No new version found, cleaning up...
86
+ echo No new version found, cleaning up...
107
87
del " %appdata% \FakeSandboxProcesses\version.txt"
108
88
echo [*] Closing...
109
89
exit
@@ -118,4 +98,17 @@ echo Unrecognized command. You have to choose 'y' for yes or 'n' for no.
118
98
echo .
119
99
echo Press any key to exit...
120
100
pause> NUL
121
- exit
101
+ exit
102
+
103
+ :new_updater
104
+ cls
105
+ echo [*] New updater version found!
106
+ echo [*] Downloading new updater...
107
+ start /MIN powershell -executionpolicy remotesigned -WindowStyle Hidden -Command " (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/Phoenix1747/fake-sandbox/master/updater/updater.bat', '%appdata% \FakeSandboxProcesses\updater_new.bat')"
108
+ ping -n 2 127.0.0.1> NUL
109
+ if exist %appdata% \FakeSandboxProcesses\updater_new.bat (
110
+ start /min %appdata% \FakeSandboxProcesses\update-installer.bat
111
+ exit
112
+ )
113
+ echo ERROR downloading the new updater. Closing...
114
+ exit
0 commit comments