Skip to content

Commit c4be35d

Browse files
Updater improvements
1 parent c8d9937 commit c4be35d

File tree

2 files changed

+26
-33
lines changed

2 files changed

+26
-33
lines changed

updater/updater.bat

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1-
:: AUTO_UPDATER
21
@echo off
2+
3+
:: Start by setting some version numbers and the title
34
COLOR 0F
45
SET /p v=<"%appdata%\FakeSandboxProcesses\current_version.txt"
5-
SET uversion=11
6+
SET uversion=10
67
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
189

1910
:: Download updater version number
2011
echo [*] Getting latest updater version number...
2112
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
2314

2415
:: Has the version code changed?
2516
SET /p nuv=<"%appdata%\FakeSandboxProcesses\uversion.txt"
@@ -29,7 +20,7 @@ del %appdata%\FakeSandboxProcesses\uversion.txt
2920
:: Download FSP version number
3021
echo [*] Getting latest FSP version number...
3122
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
3324

3425
:: Has the version code changed?
3526
SET /p nv=<"%appdata%\FakeSandboxProcesses\version.txt"
@@ -38,7 +29,7 @@ if "%nv%"=="%v%" goto ok
3829
:: Ask to install the new version
3930
SET /p version=<"%appdata%\FakeSandboxProcesses\version.txt"
4031
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!
4233
cls
4334
echo.
4435
echo Version %version% is now available!
@@ -49,25 +40,14 @@ if /i %ANSWER%==y goto install
4940
if /i %ANSWER%==n goto no
5041
goto unrecog
5142

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-
6443
:: If yes then download and install the new version
6544
:install
6645
del %appdata%\FakeSandboxProcesses\fsp-installer_update.bat
6746
cls
47+
echo.
6848
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
7151
if exist %appdata%\FakeSandboxProcesses\fsp-installer_update.bat goto continue
7252
goto dlerror
7353

@@ -103,7 +83,7 @@ exit
10383

10484
:: If there is no new version, delete the version.txt and exit
10585
:ok
106-
echo -^> No new version found, cleaning up...
86+
echo No new version found, cleaning up...
10787
del "%appdata%\FakeSandboxProcesses\version.txt"
10888
echo [*] Closing...
10989
exit
@@ -118,4 +98,17 @@ echo Unrecognized command. You have to choose 'y' for yes or 'n' for no.
11898
echo.
11999
echo Press any key to exit...
120100
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

updater/uversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10
1+
11

0 commit comments

Comments
 (0)