Edited the installer to support SRB2Kart

There is a LOT that can go wrong here, so I'm not gonna make this a priority for v1.0.2. If someone else wants to take a crack at maintaining this though, and fixing any and all inconsistencies, then feel free.
This commit is contained in:
TehRealSalt 2018-12-05 20:39:42 -05:00
parent df191639bd
commit d16c47ccb6
11 changed files with 80 additions and 85 deletions

View file

@ -48,28 +48,28 @@ if exist "%SCRIPTDIR%\Installer.7z" (
if NOT ["%SVZIP%"] == [""] ( if NOT ["%SVZIP%"] == [""] (
"%SVZIP%" a "%SCRIPTDIR%\Installer.7z" "%SCRIPTDIR%\staging\*" "%SVZIP%" a "%SCRIPTDIR%\Installer.7z" "%SCRIPTDIR%\staging\*"
) )
copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2.sfx" + "%SCRIPTDIR%\sfx\config-installer.txt" + "%SCRIPTDIR%\Installer.7z" "%SCRIPTDIR%\SRB2-%SRB2VERSIONNAME%-Installer.exe" copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2.sfx" + "%SCRIPTDIR%\sfx\config-installer.txt" + "%SCRIPTDIR%\Installer.7z" "%SCRIPTDIR%\SRB2Kart-%SRB2VERSIONNAME%-Installer.exe"
) )
if exist "%SCRIPTDIR%\Patch.7z" ( if exist "%SCRIPTDIR%\Patch.7z" (
if NOT ["%SVZIP%"] == [""] ( if NOT ["%SVZIP%"] == [""] (
"%SVZIP%" a "%SCRIPTDIR%\Patch.7z" "%SCRIPTDIR%\staging\*" "%SVZIP%" a "%SCRIPTDIR%\Patch.7z" "%SCRIPTDIR%\staging\*"
) )
copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2.sfx" + "%SCRIPTDIR%\sfx\config-patch.txt" + "%SCRIPTDIR%\Patch.7z" "%SCRIPTDIR%\SRB2-%SRB2VERSIONNAME%-Patch.exe" copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2.sfx" + "%SCRIPTDIR%\sfx\config-patch.txt" + "%SCRIPTDIR%\Patch.7z" "%SCRIPTDIR%\SRB2Kart-%SRB2VERSIONNAME%-Patch.exe"
) )
if exist "%SCRIPTDIR%\Installer_x64.7z" ( if exist "%SCRIPTDIR%\Installer_x64.7z" (
if NOT ["%SVZIP%"] == [""] ( if NOT ["%SVZIP%"] == [""] (
"%SVZIP%" a "%SCRIPTDIR%\Installer_x64.7z" "%SCRIPTDIR%\staging\*" "%SVZIP%" a "%SCRIPTDIR%\Installer_x64.7z" "%SCRIPTDIR%\staging\*"
) )
copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2_x64.sfx" + "%SCRIPTDIR%\sfx\config-installer.txt" + "%SCRIPTDIR%\Installer_x64.7z" "%SCRIPTDIR%\SRB2-%SRB2VERSIONNAME%-x64-Installer.exe" copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2_x64.sfx" + "%SCRIPTDIR%\sfx\config-installer.txt" + "%SCRIPTDIR%\Installer_x64.7z" "%SCRIPTDIR%\SRB2Kart-%SRB2VERSIONNAME%-x64-Installer.exe"
) )
if exist "%SCRIPTDIR%\Patch_x64.7z" ( if exist "%SCRIPTDIR%\Patch_x64.7z" (
if NOT ["%SVZIP%"] == [""] ( if NOT ["%SVZIP%"] == [""] (
"%SVZIP%" a "%SCRIPTDIR%\Patch_x64.7z" "%SCRIPTDIR%\staging\*" "%SVZIP%" a "%SCRIPTDIR%\Patch_x64.7z" "%SCRIPTDIR%\staging\*"
) )
copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2_x64.sfx" + "%SCRIPTDIR%\sfx\config-patch.txt" + "%SCRIPTDIR%\Patch_x64.7z" "%SCRIPTDIR%\SRB2-%SRB2VERSIONNAME%-x64-Patch.exe" copy /y /b "%SCRIPTDIR%\sfx\7zsd_LZMA2_x64.sfx" + "%SCRIPTDIR%\sfx\config-patch.txt" + "%SCRIPTDIR%\Patch_x64.7z" "%SCRIPTDIR%\SRB2Kart-%SRB2VERSIONNAME%-x64-Patch.exe"
) )
del /f /q "%SCRIPTDIR%\staging\new-install\staging.txt" del /f /q "%SCRIPTDIR%\staging\new-install\staging.txt"

View file

@ -1,5 +1,5 @@
Windows Install Builder Windows Install Builder
for SRB2 for SRB2Kart
This installer is much like the 7-Zip self-extracting archive, except This installer is much like the 7-Zip self-extracting archive, except
this allows for scripting the post-install step. this allows for scripting the post-install step.
@ -9,7 +9,7 @@ and program shortcuts.
The included install scripts manage the game data location depending on the The included install scripts manage the game data location depending on the
install location -- if installed in Program Files or AppData\Local, the install location -- if installed in Program Files or AppData\Local, the
game data location is set to %UserProfile%\SRB2. game data location is set to %UserProfile%\SRB2Kart.
Program shortcuts are also added, as well as an uninstaller that Program shortcuts are also added, as well as an uninstaller that
will remove the icons and also selectively uninstall the core game files. will remove the icons and also selectively uninstall the core game files.
@ -31,7 +31,7 @@ How to Use
3. Set the text in VersionFilename.txt to the version identifier for the 3. Set the text in VersionFilename.txt to the version identifier for the
installer's filename. installer's filename.
* e.g., v2121 for v2.1.21, from "SRB2-v2121-Installer.exe" * e.g., v102 for v1.0.2, from "SRB2Kart-v102-Installer.exe"
* Also look through sfx/config-installer.txt and sfx/config-patch.txt * Also look through sfx/config-installer.txt and sfx/config-patch.txt
and update the version strings. Templating is TODO. and update the version strings. Templating is TODO.

View file

@ -1 +1 @@
v2121 v102

View file

@ -3,21 +3,19 @@
GUIFlags="8+32+64+4096" GUIFlags="8+32+64+4096"
GUIMode="1" GUIMode="1"
Title="Sonic Robo Blast 2 v2.1.21" Title="Sonic Robo Blast 2 Kart v1.0.2"
BeginPrompt="Sonic Robo Blast 2 v2.1.21\nFull Installer\n\nSelect a folder to install SRB2 in.\n\nIf you install in \"AppData\\Local\" or \"Program Files\", your game data will be saved to:\n%UserProfile%\\SRB2\n\nOtherwise, your game data will be in the installation folder.\n\nShortcuts will be created in your Start Menu." BeginPrompt="Sonic Robo Blast 2 Kart v1.0.2\nFull Installer\n\nSelect a folder to install SRB2Kart in.\n\nIf you install in \"AppData\\Local\" or \"Program Files\", your game data will be saved to:\n%UserProfile%\\SRB2Kart\n\nOtherwise, your game data will be in the installation folder.\n\nShortcuts will be created in your Start Menu."
ExtractPathText="Installation folder: (no exclamation points, please!)" ExtractPathText="Installation folder: (no exclamation points, please!)"
InstallPath="%LocalAppData%\\SRB2" InstallPath="%LocalAppData%\\SRB2Kart"
ExtractTitle="Installing..." ExtractTitle="Installing..."
ExtractDialogText="Installing SRB2 v2.1.21...\n\nCheck out our modding community!\nWe make levels, characters, and much more!\n\nVisit http://www.srb2.org/mods" ExtractDialogText="Installing SRB2Kart v1.0.2...\n\nCheck out our modding community!\nWe make levels, characters, and much more!\n\nVisit http://www.srb2.org/mods"
Shortcut="Pu,{%%T\\srb2win.exe},{},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2},{%%T\\},{%%T\\srb2win.exe},{0}" Shortcut="Pu,{%%T\\srb2kart.exe},{},{SRB2Kart},{Sonic Robo Blast 2 Kart (SRB2Kart), a Kart racer built on the SRB2 engine.},{SRB2Kart},{%%T\\},{%%T\\srb2kart.exe},{0}"
Shortcut="Pu,{%%T\\srb2win.exe},{-win},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2 (Windowed)},{%%T\\},{%%T\\srb2win.exe},{0}" Shortcut="Pu,{%%T\\srb2kart.exe},{-win},{SRB2Kart},{Sonic Robo Blast 2 Kart (SRB2Kart), a Kart racer built on the SRB2 engine.},{SRB2Kart (Windowed)},{%%T\\},{%%T\\srb2kart.exe},{0}"
Shortcut="Pu,{%%T\\srb2win.exe},{-opengl},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2 (OpenGL)},{%%T\\},{%%T\\srb2win.exe},{0}" Shortcut="Pu,{%%T\\srb2kart.exe},{-opengl},{SRB2Kart},{Sonic Robo Blast 2 Kart (SRB2Kart), a Kart racer built on the SRB2 engine.},{SRB2Kart (OpenGL)},{%%T\\},{%%T\\srb2kart.exe},{0}"
Shortcut="Pu,{%%T\\srb2win.exe},{-opengl -win},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2 (OpenGL, Windowed)},{%%T\\},{%%T\\srb2win.exe},{0}" Shortcut="Pu,{%%T\\srb2kart.exe},{-opengl -win},{SRB2Kart},{Sonic Robo Blast 2 Kart (SRB2Kart), a Kart racer built on the SRB2 engine.},{SRB2Kart (OpenGL, Windowed)},{%%T\\},{%%T\\srb2kart.exe},{0}"
Shortcut="Pu,{%%T\\srb2dd.exe},{},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2 (DirectDraw)},{%%T\\},{%%T\\srb2dd.exe},{0}" Shortcut="Pu,{%%T\\uninstall.exe},{},{SRB2Kart},{Sonic Robo Blast 2 Kart (SRB2Kart), a Kart racer built on the SRB2 engine.},{Uninstall SRB2Kart},{%%T\\},{shell32.dll},{31}"
Shortcut="Pu,{%%T\\srb2dd.exe},{-win},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2 (DirectDraw, Windowed)},{%%T\\},{%%T\\srb2dd.exe},{0}"
Shortcut="Pu,{%%T\\uninstall.exe},{},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{Uninstall SRB2},{%%T\\},{shell32.dll},{31}"
RunProgram="nowait:\"%%T\\new-install\\staging.bat\"" RunProgram="nowait:\"%%T\\new-install\\staging.bat\""

View file

@ -3,21 +3,19 @@
GUIFlags="8+32+64+4096" GUIFlags="8+32+64+4096"
GUIMode="1" GUIMode="1"
Title="Sonic Robo Blast 2 v2.1.21" Title="Sonic Robo Blast 2 Kart v1.0.2"
BeginPrompt="Sonic Robo Blast 2 v2.1.21\nPatch Installer\n\nYou must have at least v2.1.15 to use this patch.\n\nSelect your current SRB2 folder.\n\nShortcuts will be created in your Start Menu." BeginPrompt="Sonic Robo Blast 2 Kart v1.0.2\nPatch Installer\n\nYou must have at least v1.0.0 to use this patch.\n\nSelect your current SRB2Kart folder.\n\nShortcuts will be created in your Start Menu."
ExtractPathText="Current SRB2 folder: (no exclamation points, please!)" ExtractPathText="Current SRB2Kart folder: (no exclamation points, please!)"
InstallPath="%LocalAppData%\\SRB2" InstallPath="%LocalAppData%\\SRB2Kart"
ExtractTitle="Installing..." ExtractTitle="Installing..."
ExtractDialogText="Installing SRB2 v2.1.21...\n\nCheck out our modding community!\nWe make levels, characters, and much more!\n\nVisit http://www.srb2.org/mods" ExtractDialogText="Installing SRB2Kart v1.0.2...\n\nCheck out our modding community!\nWe make levels, characters, and much more!\n\nVisit http://www.srb2.org/mods"
Shortcut="Pu,{%%T\\srb2win.exe},{},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2},{%%T\\},{%%T\\srb2win.exe},{0}" Shortcut="Pu,{%%T\\srb2kart.exe},{},{SRB2Kart},{Sonic Robo Blast 2 Kart (SRB2Kart), a Kart racer built on the SRB2 engine.},{SRB2Kart},{%%T\\},{%%T\\srb2kart.exe},{0}"
Shortcut="Pu,{%%T\\srb2win.exe},{-win},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2 (Windowed)},{%%T\\},{%%T\\srb2win.exe},{0}" Shortcut="Pu,{%%T\\srb2kart.exe},{-win},{SRB2Kart},{Sonic Robo Blast 2 Kart (SRB2Kart), a Kart racer built on the SRB2 engine.},{SRB2Kart (Windowed)},{%%T\\},{%%T\\srb2kart.exe},{0}"
Shortcut="Pu,{%%T\\srb2win.exe},{-opengl},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2 (OpenGL)},{%%T\\},{%%T\\srb2win.exe},{0}" Shortcut="Pu,{%%T\\srb2kart.exe},{-opengl},{SRB2Kart},{Sonic Robo Blast 2 Kart (SRB2Kart), a Kart racer built on the SRB2 engine.},{SRB2Kart (OpenGL)},{%%T\\},{%%T\\srb2kart.exe},{0}"
Shortcut="Pu,{%%T\\srb2win.exe},{-opengl -win},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2 (OpenGL, Windowed)},{%%T\\},{%%T\\srb2win.exe},{0}" Shortcut="Pu,{%%T\\srb2kart.exe},{-opengl -win},{SRB2Kart},{Sonic Robo Blast 2 Kart (SRB2Kart), a Kart racer built on the SRB2 engine.},{SRB2Kart (OpenGL, Windowed)},{%%T\\},{%%T\\srb2kart.exe},{0}"
Shortcut="Pu,{%%T\\srb2dd.exe},{},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2 (DirectDraw)},{%%T\\},{%%T\\srb2dd.exe},{0}" Shortcut="Pu,{%%T\\uninstall.exe},{},{SRB2Kart},{Sonic Robo Blast 2 Kart (SRB2Kart), a Kart racer built on the SRB2 engine.},{Uninstall SRB2Kart},{%%T\\},{shell32.dll},{31}"
Shortcut="Pu,{%%T\\srb2dd.exe},{-win},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{SRB2 (DirectDraw, Windowed)},{%%T\\},{%%T\\srb2dd.exe},{0}"
Shortcut="Pu,{%%T\\uninstall.exe},{},{Sonic Robo Blast 2},{Sonic Robo Blast 2 (SRB2), a 3D Sonic the Hedgehog fangame.},{Uninstall SRB2},{%%T\\},{shell32.dll},{31}"
RunProgram="nowait:\"%%T\\new-install\\staging.bat\"" RunProgram="nowait:\"%%T\\new-install\\staging.bat\""

View file

@ -3,8 +3,8 @@
GUIFlags="1+2+8" GUIFlags="1+2+8"
GUIMode="2" GUIMode="2"
Title="Uninstall SRB2" Title="Uninstall SRB2Kart"
BeginPrompt="Are you sure you want to uninstall Sonic Robo Blast 2?\n\nYour game data and mods will be preserved, as well as\nany extra files in your install folder." BeginPrompt="Are you sure you want to uninstall Sonic Robo Blast 2 Kart?\n\nYour game data and mods will be preserved, as well as\nany extra files in your install folder."
InstallPath="%%S" InstallPath="%%S"

View file

@ -1,11 +0,0 @@
SRB2 Install Instructions
1. Move every file from the "new-install" folder to this main install folder.
2. DELETE "staging.bat" and "staging.txt"! These can mess up your installation if run by accident!
3. Optionally, create a folder in your user profile named "SRB2". This is where your game data and addons may live. For example,
C:\Users\[User]\SRB2
4. Run the game! Double-click srb2win.exe -- or see if you have Start Menu icons under "Sonic Robo Blast 2".

View file

@ -0,0 +1,11 @@
SRB2Kart Install Instructions
1. Move every file from the "new-install" folder to this main install folder.
2. DELETE "staging.bat" and "staging.txt"! These can mess up your installation if run by accident!
3. Optionally, create a folder in your user profile named "SRB2Kart". This is where your game data and addons may live. For example,
C:\Users\[User]\SRB2Kart
4. Run the game! Double-click srb2kart.exe -- or see if you have Start Menu icons under "SRB2Kart".

View file

@ -11,5 +11,4 @@ r_opengl.dll
SDL2.dll SDL2.dll
SDL2_mixer.dll SDL2_mixer.dll
smpeg2.dll smpeg2.dll
srb2dd.exe srb2kart.exe
srb2win.exe

View file

@ -4,18 +4,18 @@ setlocal enabledelayedexpansion
cls cls
:: SRB2 Install Staging :: SRB2Kart Install Staging
:: ::
:: This accomplishes the following tasks: :: This accomplishes the following tasks:
:: ::
:: 1. Creates a user profile folder if SRB2 is installed in AppData or Program Files, and config.cfg is not already in the install folder :: 1. Creates a user profile folder if SRB2Kart is installed in AppData or Program Files, and config.cfg is not already in the install folder
:: ::
:: 2. Moves old installation files into old-install :: 2. Moves old installation files into old-install
:: ::
:: 3. Moves new installaton files into install folder :: 3. Moves new installaton files into install folder
:: ::
:: Get Parent folder (the SRB2 install folder) :: Get Parent folder (the SRB2Kart install folder)
:: ::
:: https://wiert.me/2011/08/30/batch-file-to-get-parent-directory-not-the-directory-of-the-batch-file-but-the-parent-of-that-directory/ :: https://wiert.me/2011/08/30/batch-file-to-get-parent-directory-not-the-directory-of-the-batch-file-but-the-parent-of-that-directory/
@ -62,16 +62,16 @@ mkdir "!INSTALLDIR!\install-dummy"
:: TODO elevate automatically :: TODO elevate automatically
if errorlevel 1 ( if errorlevel 1 (
echo Finish installing SRB2 with these steps: echo Finish installing SRB2Kart with these steps:
echo. echo.
echo 1. Go to your SRB2 install folder echo 1. Go to your SRB2Kart install folder
echo. echo.
echo !INSTALLDIR! echo !INSTALLDIR!
echo. echo.
echo 2. Copy all files from the "new-install" subfolder into the main folder echo 2. Copy all files from the "new-install" subfolder into the main folder
echo and DELETE staging.bat and staging.txt!!! echo and DELETE staging.bat and staging.txt!!!
echo. echo.
echo 3. Optionally, create a folder in your user profile named "SRB2". echo 3. Optionally, create a folder in your user profile named "SRB2Kart".
echo This is where your game data and addons may live. echo This is where your game data and addons may live.
echo To create the folder, go here: echo To create the folder, go here:
echo. echo.
@ -92,7 +92,7 @@ if errorlevel 1 (
: CheckUserDir : CheckUserDir
:: Check if we need to create !userprofile!\SRB2 :: Check if we need to create !userprofile!\SRB2Kart
set "USERDIR=!INSTALLDIR!" set "USERDIR=!INSTALLDIR!"
@ -130,7 +130,7 @@ goto MoveOldInstall
: SetUserDir : SetUserDir
: CheckPermissionsUserDir : CheckPermissionsUserDir
set "USERDIR=!UserProfile!\SRB2" set "USERDIR=!UserProfile!\SRB2Kart"
:: Check for permissions and create the folder :: Check for permissions and create the folder
if exist "!USERDIR!\*" ( if exist "!USERDIR!\*" (
@ -170,18 +170,18 @@ echo !INSTALLDIR! >> "!USERDIR!\^! Data and Mods Go Here ^!.txt"
echo. >> "!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 To run SRB2, go to: >> "!USERDIR!\^! Data and Mods Go Here ^!.txt"
echo. >> "!USERDIR!\^! Data and Mods Go Here ^!.txt" echo. >> "!USERDIR!\^! Data and Mods Go Here ^!.txt"
echo Start Menu ^> Programs ^> Sonic Robo Blast 2 >> "!USERDIR!\^! Data and Mods Go Here ^!.txt" echo Start Menu ^> Programs ^> SRB2Kart >> "!USERDIR!\^! Data and Mods Go Here ^!.txt"
:: Copy path to install folder :: Copy path to install folder
set "SCRIPT=!TEMP!\!RANDOM!-!RANDOM!-!RANDOM!-!RANDOM!.vbs" set "SCRIPT=!TEMP!\!RANDOM!-!RANDOM!-!RANDOM!-!RANDOM!.vbs"
echo Set oWS = WScript.CreateObject("WScript.Shell") >> "!SCRIPT!" echo Set oWS = WScript.CreateObject("WScript.Shell") >> "!SCRIPT!"
echo sLinkFile = "!USERDIR!\^! SRB2 Install Folder ^!.lnk" >> "!SCRIPT!" echo sLinkFile = "!USERDIR!\^! SRB2Kart Install Folder ^!.lnk" >> "!SCRIPT!"
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> "!SCRIPT!" echo Set oLink = oWS.CreateShortcut(sLinkFile) >> "!SCRIPT!"
echo oLink.TargetPath = "!INSTALLDIR!" >> "!SCRIPT!" echo oLink.TargetPath = "!INSTALLDIR!" >> "!SCRIPT!"
echo oLink.WorkingDirectory = "!INSTALLDIR!" >> "!SCRIPT!" echo oLink.WorkingDirectory = "!INSTALLDIR!" >> "!SCRIPT!"
echo oLink.Arguments = "" >> "!SCRIPT!" echo oLink.Arguments = "" >> "!SCRIPT!"
echo oLink.IconLocation = "!INSTALLDIR!\srb2win.exe,0" >> "!SCRIPT!" echo oLink.IconLocation = "!INSTALLDIR!\srb2kart.exe,0" >> "!SCRIPT!"
echo oLink.Save >> "!SCRIPT!" echo oLink.Save >> "!SCRIPT!"
cscript /nologo "!SCRIPT!" cscript /nologo "!SCRIPT!"
del "!SCRIPT!" del "!SCRIPT!"
@ -190,12 +190,12 @@ del "!SCRIPT!"
set "SCRIPT=!TEMP!\!RANDOM!-!RANDOM!-!RANDOM!-!RANDOM!.vbs" set "SCRIPT=!TEMP!\!RANDOM!-!RANDOM!-!RANDOM!-!RANDOM!.vbs"
echo Set oWS = WScript.CreateObject("WScript.Shell") >> "!SCRIPT!" echo Set oWS = WScript.CreateObject("WScript.Shell") >> "!SCRIPT!"
echo sLinkFile = "!INSTALLDIR!\^! SRB2 Data Folder ^!.lnk" >> "!SCRIPT!" echo sLinkFile = "!INSTALLDIR!\^! SRB2Kart Data Folder ^!.lnk" >> "!SCRIPT!"
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> "!SCRIPT!" echo Set oLink = oWS.CreateShortcut(sLinkFile) >> "!SCRIPT!"
echo oLink.TargetPath = "!USERDIR!" >> "!SCRIPT!" echo oLink.TargetPath = "!USERDIR!" >> "!SCRIPT!"
echo oLink.WorkingDirectory = "!USERDIR!" >> "!SCRIPT!" echo oLink.WorkingDirectory = "!USERDIR!" >> "!SCRIPT!"
echo oLink.Arguments = "" >> "!SCRIPT!" echo oLink.Arguments = "" >> "!SCRIPT!"
echo oLink.IconLocation = "!INSTALLDIR!\srb2win.exe,0" >> "!SCRIPT!" echo oLink.IconLocation = "!INSTALLDIR!\srb2kart.exe,0" >> "!SCRIPT!"
echo oLink.Save >> "!SCRIPT!" echo oLink.Save >> "!SCRIPT!"
cscript /nologo "!SCRIPT!" cscript /nologo "!SCRIPT!"
del "!SCRIPT!" del "!SCRIPT!"
@ -288,9 +288,9 @@ echo !USERDIR! > "!INSTALLDIR!\uninstall-userdir.txt"
echo uninstall.bat>> "!INSTALLDIR!\uninstall-list.txt" echo uninstall.bat>> "!INSTALLDIR!\uninstall-list.txt"
echo uninstall-list.txt>> "!INSTALLDIR!\uninstall-list.txt" echo uninstall-list.txt>> "!INSTALLDIR!\uninstall-list.txt"
echo uninstall-userdir.txt>> "!INSTALLDIR!\uninstall-list.txt" echo uninstall-userdir.txt>> "!INSTALLDIR!\uninstall-list.txt"
:: *ahem* Prints as ^! SRB2 Data Folder ^!.lnk :: *ahem* Prints as ^! SRB2Kart Data Folder ^!.lnk
:: We need to escape the exclamations (^^!) and the carets themselves (^^^^) :: We need to escape the exclamations (^^!) and the carets themselves (^^^^)
echo ^^^^^^! SRB2 Data Folder ^^^^^^!.lnk>> "!INSTALLDIR!\uninstall-list.txt" echo ^^^^^^! SRB2Kart Data Folder ^^^^^^!.lnk>> "!INSTALLDIR!\uninstall-list.txt"
:: Add the uninstall list files to the uninstall EXE :: Add the uninstall list files to the uninstall EXE
@ -317,7 +317,7 @@ for %%F in ("!STAGINGDIR!\*") DO (
: Finished : Finished
del /q /f "!INSTALLDIR!\^! SRB2 INSTALL INSTRUCTIONS ^!.txt" del /q /f "!INSTALLDIR!\^! SRB2KART INSTALL INSTRUCTIONS ^!.txt"
set MSGEXE= set MSGEXE=
if exist "!SystemRoot!\System32\msg.exe" ( if exist "!SystemRoot!\System32\msg.exe" (
@ -330,30 +330,30 @@ if exist "!SystemRoot!\System32\msg.exe" (
if ["!OLDINSTALLCHANGED!"] == ["1"] ( if ["!OLDINSTALLCHANGED!"] == ["1"] (
"!systemroot!\explorer.exe" /select, "!OLDINSTALLDIR!" "!systemroot!\explorer.exe" /select, "!OLDINSTALLDIR!"
echo Finished^^! Some of your old installation files were moved to the "old-install" folder. > !TEMP!\srb2msgprompt.txt echo Finished^^! Some of your old installation files were moved to the "old-install" folder. > !TEMP!\srb2kartmsgprompt.txt
echo. >> !TEMP!\srb2msgprompt.txt echo. >> !TEMP!\srb2kartmsgprompt.txt
echo If you no longer need these files, you may delete the folder safely. >> !TEMP!\srb2msgprompt.txt echo If you no longer need these files, you may delete the folder safely. >> !TEMP!\srb2kartmsgprompt.txt
echo. >> !TEMP!\srb2msgprompt.txt echo. >> !TEMP!\srb2kartmsgprompt.txt
echo To run SRB2, go to: Start Menu ^> Programs ^> Sonic Robo Blast 2. >> !TEMP!\srb2msgprompt.txt echo To run SRB2Kart, go to: Start Menu ^> Programs ^> SRB2Kart. >> !TEMP!\srb2kartmsgprompt.txt
!MSGEXE! "!username!" < !TEMP!\srb2msgprompt.txt !MSGEXE! "!username!" < !TEMP!\srb2kartmsgprompt.txt
del !TEMP!\srb2msgprompt.txt del !TEMP!\srb2kartmsgprompt.txt
) else ( ) else (
if /I ["!USERDIR!"] == ["!INSTALLDIR!"] ( if /I ["!USERDIR!"] == ["!INSTALLDIR!"] (
"!systemroot!\explorer.exe" "!INSTALLDIR!" "!systemroot!\explorer.exe" "!INSTALLDIR!"
echo Finished^^! > !TEMP!\srb2msgprompt.txt echo Finished^^! > !TEMP!\srb2kartmsgprompt.txt
echo. >> !TEMP!\srb2msgprompt.txt echo. >> !TEMP!\srb2kartmsgprompt.txt
echo To run SRB2, go to: Start Menu ^> Programs ^> Sonic Robo Blast 2. >> !TEMP!\srb2msgprompt.txt echo To run SRB2Kart, go to: Start Menu ^> Programs ^> SRB2Kart. >> !TEMP!\srb2kartmsgprompt.txt
!MSGEXE! "!username!" < !TEMP!\srb2msgprompt.txt !MSGEXE! "!username!" < !TEMP!\srb2kartmsgprompt.txt
del !TEMP!\srb2msgprompt.txt del !TEMP!\srb2kartmsgprompt.txt
) else ( ) else (
"!systemroot!\explorer.exe" "!USERDIR!" "!systemroot!\explorer.exe" "!USERDIR!"
echo Finished^^! You may find your game data in this folder: > !TEMP!\srb2msgprompt.txt echo Finished^^! You may find your game data in this folder: > !TEMP!\srb2kartmsgprompt.txt
echo. >> !TEMP!\srb2msgprompt.txt echo. >> !TEMP!\srb2kartmsgprompt.txt
echo !USERDIR! >> !TEMP!\srb2msgprompt.txt echo !USERDIR! >> !TEMP!\srb2kartmsgprompt.txt
echo. >> !TEMP!\srb2msgprompt.txt echo. >> !TEMP!\srb2kartmsgprompt.txt
echo To run SRB2, go to: Start Menu ^> Programs ^> Sonic Robo Blast 2. >> !TEMP!\srb2msgprompt.txt echo To run SRB2Kart, go to: Start Menu ^> Programs ^> SRB2Kart. >> !TEMP!\srb2kartmsgprompt.txt
!MSGEXE! "!username!" < !TEMP!\srb2msgprompt.txt !MSGEXE! "!username!" < !TEMP!\srb2kartmsgprompt.txt
del !TEMP!\srb2msgprompt.txt del !TEMP!\srb2kartmsgprompt.txt
) )
) )

View file

@ -15,7 +15,7 @@ if ["%1"] == ["/y"] (
set "PROCEED=1" set "PROCEED=1"
) else ( ) else (
set PROCEED= set PROCEED=
set /p PROCEED="Are you sure you want to uninstall SRB2? [yes/no] " set /p PROCEED="Are you sure you want to uninstall SRB2Kart? [yes/no] "
if /I ["!PROCEED:~0,1!"] == ["n"] exit if /I ["!PROCEED:~0,1!"] == ["n"] exit
if /I ["!PROCEED!"] == ["y"] ( if /I ["!PROCEED!"] == ["y"] (
@ -46,7 +46,7 @@ mkdir "!INSTALLDIR!\uninstall-dummy"
:: TODO elevate automatically :: TODO elevate automatically
if errorlevel 1 ( if errorlevel 1 (
echo We need Administrator Rights to uninstall SRB2. echo We need Administrator Rights to uninstall SRB2Kart.
echo. echo.
echo Try running this uninstaller by right-clicking on the icon echo Try running this uninstaller by right-clicking on the icon
echo and click "Run as administrator" echo and click "Run as administrator"
@ -105,7 +105,7 @@ echo Deleting your program icons...
echo. echo.
cd \ cd \
rmdir /s /q "!AppData!\Microsoft\Windows\Start Menu\Programs\Sonic Robo Blast 2" rmdir /s /q "!AppData!\Microsoft\Windows\Start Menu\Programs\SRB2Kart"
:: Check if our install folder is non-empty :: Check if our install folder is non-empty
@ -133,7 +133,7 @@ if /I NOT ["!USERDIR!"] == ["!INSTALLDIR!"] (
: Final : Final
echo All done^^! Visit http://www.srb2.org if you want to play SRB2 again^^! echo All done^^! Visit http://www.srb2.org if you want to play SRB2Kart again^^!
echo. echo.
set "FINALPROMPT=Press Enter key to exit." set "FINALPROMPT=Press Enter key to exit."