From 6694b203e078cc1ed77a0e8c46a91ea130ee1ee3 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Mon, 3 Dec 2018 01:06:25 -0500 Subject: [PATCH] Finishing touches 2 --- windows-installer/BuildInstaller.bat | 6 +++++- windows-installer/new-install/staging.bat | 21 +++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/windows-installer/BuildInstaller.bat b/windows-installer/BuildInstaller.bat index b431a70b..0b8cd9fd 100644 --- a/windows-installer/BuildInstaller.bat +++ b/windows-installer/BuildInstaller.bat @@ -26,6 +26,8 @@ if ["%SVZIP%"] == [""] ( :: Operate on install archives +type NUL > "%SCRIPTDIR%\new-install\staging.txt" + if exist "%SCRIPTDIR%\Installer.7z" ( if ["%SVZIP%"] == [""] ( echo. @@ -60,4 +62,6 @@ if exist "%SCRIPTDIR%\Patch_x64.7z" ( "%SVZIP%" a "%SCRIPTDIR%\Patch_x64.7z" "%SCRIPTDIR%\new-install\" ) copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2_x64.sfx" + "%SCRIPTDIR%\sfx\config-patch.txt" + "%SCRIPTDIR%\Patch_x64.7z" "%SCRIPTDIR%\SRB2-%SRB2VERSIONNAME%-x64-Patch.exe" -) \ No newline at end of file +) + +del /f /q "%SCRIPTDIR%\new-install\staging.txt" diff --git a/windows-installer/new-install/staging.bat b/windows-installer/new-install/staging.bat index 63b29795..1e010538 100644 --- a/windows-installer/new-install/staging.bat +++ b/windows-installer/new-install/staging.bat @@ -29,6 +29,15 @@ set "STAGINGDIR=%STAGINGDIR:~0,-1%" for %%d in ("%STAGINGDIR%") do set INSTALLDIR=%%~dpd set "INSTALLDIR=%INSTALLDIR:~0,-1%" +:: FAILSAFE: Check if staging.txt exists in the directory +:: If not, exit, so we don't mess up anything by accident. + +if exist "%STAGINGDIR%\staging.txt" ( + echo. +) else ( + exit +) + :: Check if we need to create %userprofile%\SRB2 set "USERDIR=%INSTALLDIR%" @@ -90,11 +99,11 @@ echo f | xcopy /y "%STAGINGDIR%\LICENSE.txt" "%USERDIR%\LICENSE.txt" echo f | xcopy /y "%STAGINGDIR%\LICENSE-3RD-PARTY.txt" "%USERDIR%\LICENSE-3RD-PARTY.txt" echo Your game data and mods folder is: > "%USERDIR%\! Data and Mods Go Here !.txt" echo. >> "%USERDIR%\! Data and Mods Go Here !.txt" -echo "%USERDIR%" >> "%USERDIR%\! Data and Mods Go Here !.txt" +echo %USERDIR% >> "%USERDIR%\! Data and Mods Go Here !.txt" echo. >> "%USERDIR%\! Data and Mods Go Here !.txt" echo Your install folder is: >> "%USERDIR%\! Data and Mods Go Here !.txt" echo. >> "%USERDIR%\! Data and Mods Go Here !.txt" -echo "%INSTALLDIR%" >> "%USERDIR%\! Data and Mods Go Here !.txt" +echo %INSTALLDIR% >> "%USERDIR%\! Data and Mods Go Here !.txt" echo. >> "%USERDIR%\! Data and Mods Go Here !.txt" echo To run SRB2, go to: >> "%USERDIR%\! Data and Mods Go Here !.txt" echo. >> "%USERDIR%\! Data and Mods Go Here !.txt" @@ -186,7 +195,11 @@ for %%F in ("%STAGINGDIR%\*") DO ( if ["%%~nxF"] == ["staging.bat"] ( echo. ) else ( - move "%STAGINGDIR%\%%~nxF" "%INSTALLDIR%\%%~nxF" + if ["%%~nxF"] == ["staging.txt"] ( + echo. + ) else ( + move "%STAGINGDIR%\%%~nxF" "%INSTALLDIR%\%%~nxF" + ) ) ) @@ -222,7 +235,7 @@ if ["%OLDINSTALLCHANGED%"] == ["1"] ( "%systemroot%\explorer.exe" "%USERDIR%" echo Finished! You may find your game data in this folder: > %TEMP%\srb2msgprompt.txt echo. >> %TEMP%\srb2msgprompt.txt - echo %USERDIR% >> %TEMP%\srb2msgprompt.txt + echo %USERDIR% >> %TEMP%\srb2msgprompt.txt echo. >> %TEMP%\srb2msgprompt.txt echo To run SRB2, go to: Start Menu ^> Programs ^> Sonic Robo Blast 2. >> %TEMP%\srb2msgprompt.txt %MSGEXE% "%username%" < %TEMP%\srb2msgprompt.txt