11@ echo off
22title Checking dependencies...
33set scriptVersion = v1.2.2
4+ set currentConfigVersion = v1.2.2
45
56REM Set restart counter variables
67set " restartCount = 0"
@@ -16,7 +17,24 @@ REM Check if script config file exists, if not, go to create it.
1617if not exist .\config\StartupScript.conf (
1718 goto initialSetup
1819) else (
19- goto scriptUpdater
20+ REM Check configuration version
21+ set " configVersion = "
22+ for /f " tokens=1,* delims==" %%a in ('type .\config\StartupScript.conf') do (
23+ if " %%a " == " configVersion" (
24+ set " configVersion = %%b "
25+ goto configVersionFound
26+ )
27+ )
28+ :configVersionFound
29+ REM Compare with expected version
30+ if " %configVersion% " NEQ " %currentConfigVersion% " (
31+ echo [1;31mFollowing an update, your configuration file is outdated.[0m
32+ echo [1mPress any key to update your configuration...
33+ pause > nul
34+ goto initialSetup
35+ ) else (
36+ goto scriptUpdater
37+ )
2038)
2139
2240:scriptUpdater
@@ -208,7 +226,9 @@ if %errorlevel%==2 goto initialSetup
208226
209227:saveSetup
210228title Saving setup...
211- echo # > .\config\StartupScript.conf
229+ echo # Configuration File Version > .\config\StartupScript.conf
230+ echo configVersion=%currentConfigVersion% >> .\config\StartupScript.conf
231+ echo # >> .\config\StartupScript.conf
212232echo # --------------------------------------------------------------------------------------------------------------------------- >> .\config\StartupScript.conf
213233echo # Change the values in the section below >> .\config\StartupScript.conf
214234echo # --------------------------------------------------------------------------------------------------------------------------- >> .\config\StartupScript.conf
0 commit comments