mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-27 11:40:52 +00:00
Adjustments
This commit is contained in:
parent
5687c3b0e6
commit
9186f259cb
2 changed files with 8 additions and 116 deletions
|
@ -153,7 +153,11 @@ mkdir "%OLDINSTALLDIR%"
|
||||||
|
|
||||||
set OLDINSTALLCHANGED=
|
set OLDINSTALLCHANGED=
|
||||||
|
|
||||||
if ["%MoveOldExesDlls%"] == [""] goto MoveOldInstallNewFiles
|
if ["%MoveOldExesDlls%"] == ["1"] (
|
||||||
|
goto MoveOldInstallExeDll
|
||||||
|
) else (
|
||||||
|
goto MoveOldInstallNewFiles
|
||||||
|
)
|
||||||
|
|
||||||
: MoveOldInstallExeDll
|
: MoveOldInstallExeDll
|
||||||
|
|
||||||
|
|
|
@ -34,110 +34,6 @@ if ["%PROCEED%"] == ["1"] (
|
||||||
exit
|
exit
|
||||||
)
|
)
|
||||||
|
|
||||||
: DeleteAllPrompt
|
|
||||||
|
|
||||||
:: TODO: Let's DUMMY this out for now -- I'm not confident that a full-folder
|
|
||||||
:: deletion wouldn't be disastrous for edge-cases. E.g., what if we somehow got
|
|
||||||
:: Program Files as the folder to delete? Or C:\?
|
|
||||||
::
|
|
||||||
:: Let's just delete individual files, attempt to delete the folder if it is
|
|
||||||
:: empty, then leave it up to the user to clear the rest. Yes, their data
|
|
||||||
:: and mods will be left alone by the uninstaller.
|
|
||||||
::
|
|
||||||
:: mazmazz 12/2/2018
|
|
||||||
|
|
||||||
set DELETEALL=
|
|
||||||
|
|
||||||
goto DeleteFiles
|
|
||||||
|
|
||||||
echo Do you want to delete your game data and mods? In folder:
|
|
||||||
echo %USERDIR%
|
|
||||||
|
|
||||||
set /p DELETEALL="[Yes/no] "
|
|
||||||
|
|
||||||
if /I ["%DELETEALL:~0,1%"] == ["n"] (
|
|
||||||
set DELETEALL=
|
|
||||||
goto DeleteFiles
|
|
||||||
)
|
|
||||||
|
|
||||||
if /I ["%DELETEALL%"] == ["y"] (
|
|
||||||
echo Type Yes or No
|
|
||||||
goto DeleteAllPrompt
|
|
||||||
) else (
|
|
||||||
if /I ["%DELETEALL%"] == ["yes"] (
|
|
||||||
set DELETEALL=1
|
|
||||||
) else (
|
|
||||||
echo.
|
|
||||||
goto DeleteAllPrompt
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
:: TODO: Would be nice to have an additional prompt asking
|
|
||||||
:: Are you REALLY sure you want to delete your data? You cannot
|
|
||||||
:: recover it!
|
|
||||||
|
|
||||||
: DeleteAll
|
|
||||||
|
|
||||||
:: Dummy out for now
|
|
||||||
|
|
||||||
goto DeleteFiles
|
|
||||||
|
|
||||||
:: Failsafe to not delete the directory if, SOMEHOW,
|
|
||||||
:: your install dir or user dir is C:\
|
|
||||||
set SAMEFAILSAFE=
|
|
||||||
|
|
||||||
:: Don't delete the install folder until the very last step of the script!
|
|
||||||
if ["%DELETEALL%"] == ["1"] (
|
|
||||||
echo "Deleting all data"
|
|
||||||
:: TODO: This is wrong! The idea for this check is to see if the user
|
|
||||||
:: somehow installed SRB2 in C:\. So we obviously don't want to do
|
|
||||||
:: full folder deletion
|
|
||||||
::
|
|
||||||
:: However, the %CD% == %INSTALLDIR% check doesn't work properly
|
|
||||||
:: because CD doesn't update when you change the directory?
|
|
||||||
:: So maybe it will just delete files anyway. I'm really not sure.
|
|
||||||
::
|
|
||||||
if /I ["%CD%"] == ["%INSTALLDIR%"] cd \
|
|
||||||
if /I ["%CD%"] == ["%INSTALLDIR%"] (
|
|
||||||
echo Install directory is the same as your drive root!
|
|
||||||
if /I ["%USERDIR%"] == ["%INSTALLDIR%"] (
|
|
||||||
echo Let's just delete files instead...
|
|
||||||
echo.
|
|
||||||
set DELETEALL=
|
|
||||||
goto DeleteFiles
|
|
||||||
)
|
|
||||||
set SAMEFAILSAFE=1
|
|
||||||
) else (
|
|
||||||
echo.
|
|
||||||
)
|
|
||||||
|
|
||||||
if /I ["%USERDIR%"] == ["%INSTALLDIR%"] goto AllDone
|
|
||||||
|
|
||||||
if /I ["%CD%"] == ["%USERDIR%"] cd \
|
|
||||||
if /I ["%CD%"] == ["%USERDIR%"] (
|
|
||||||
echo User data directory is the same as your drive root!
|
|
||||||
if ["%SAMEFAILSAFE%"] == ["1"] (
|
|
||||||
echo Let's just delete files instead...
|
|
||||||
echo.
|
|
||||||
set DELETEALL=
|
|
||||||
goto DeleteFiles
|
|
||||||
) else (
|
|
||||||
echo Let's not delete any user folders...
|
|
||||||
goto AllDone
|
|
||||||
)
|
|
||||||
) else (
|
|
||||||
rmdir /s /q "%USERDIR%"
|
|
||||||
if ["%SAMEFAILSAFE%"] == ["1"] (
|
|
||||||
echo Let's delete your installation files...
|
|
||||||
echo.
|
|
||||||
set DELETEALL=
|
|
||||||
goto DeleteFiles
|
|
||||||
) else (
|
|
||||||
goto AllDone
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
: DeleteFiles
|
: DeleteFiles
|
||||||
|
|
||||||
for /F "usebackq tokens=*" %%A in ("%INSTALLDIR%\uninstall-list.txt") do (
|
for /F "usebackq tokens=*" %%A in ("%INSTALLDIR%\uninstall-list.txt") do (
|
||||||
|
@ -237,15 +133,7 @@ if ["%FINALPROMPT%"] == ["Press Enter key to exit."] (
|
||||||
|
|
||||||
: DeferredDelete
|
: DeferredDelete
|
||||||
|
|
||||||
cd \
|
|
||||||
|
|
||||||
:: Now let's delete our installation folder!
|
:: Now let's delete our installation folder!
|
||||||
:: If we're not DELETEALL, just attempt to remove the install dir in case it's empty
|
cd \
|
||||||
::
|
start "" /b "cmd" /s /c " del /q /f "%INSTALLDIR%\uninstall.bat"&timeout /t 2 > NUL&rmdir "%INSTALLDIR%"&exit /b "
|
||||||
:: Dummy out for now
|
|
||||||
:: if ["%DELETEALL%"] == ["1"] (
|
|
||||||
if ["0"] == ["1"] (
|
|
||||||
start "" /b "cmd" /s /c " rmdir /s /q "%INSTALLDIR%"&exit /b "
|
|
||||||
) else (
|
|
||||||
start "" /b "cmd" /s /c " del /q /f "%INSTALLDIR%\uninstall.bat"&timeout /t 2 > NUL&rmdir "%INSTALLDIR%"&exit /b "
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in a new issue