From 6ae12f29e4828ea327f699cea928a7c393caeedd Mon Sep 17 00:00:00 2001 From: Henk Date: Sun, 29 May 2022 00:25:53 +0200 Subject: [PATCH] (Un)Installer improvements Inno Setup has proven limited in its ability to uninstall because its hard to keep up to date which folders it should ask or keep and not everyone has used the Offline Installer yet wishes to use an uninstaller. This commit adds a new uninstall script which my future versions of the uninstaller will look for to delete the files. Eliminating the risk of the setup accidentally deleting your stories. If the proper Inno Setup uninstaller is detected the script will terminate itself and launch that first, to ensure the entire uninstallation is handled. If not, it will warn you before removing anything. It will also get rid of the virtual KoboldAI drives and we can update it trough normal git means. --- Uninstall.bat | 32 ++++++++++++++++++++++++++++++++ update-koboldai.bat | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Uninstall.bat diff --git a/Uninstall.bat b/Uninstall.bat new file mode 100644 index 00000000..422655de --- /dev/null +++ b/Uninstall.bat @@ -0,0 +1,32 @@ +@echo off +cd /D %~dp0 +TITLE KoboldAI Uninstall Helper +SET /P M=nul +for /d %%D in (*) do if not "%%~nxD"=="stories" if not "%%~nxD"=="userscripts" if not "%%~nxD"=="settings" if not "%%~nxD"=="softprompts" if not "%%~nxD"=="models" if not "%%~nxD"=="Uninstall" rmdir /S /Q %%~nxD +for %%i in (*) do if not "%%i"=="Uninstall.bat" del /q "%%i" +set /P DM=Would you like to delete the models folder? (Y/n) : +IF %DM%==Y rmdir models /s /q +IF %DM%==y rmdir models /s /q +set DM=N +set /P DM=Would you like to delete all other user folders? (y/N) : +IF %DM%==Y rmdir stories userscripts settings softprompts /s /q +IF %DM%==y rmdir stories userscripts settings softprompts /s /q +del Uninstall.bat \ No newline at end of file diff --git a/update-koboldai.bat b/update-koboldai.bat index 05ae280e..26e9ec17 100644 --- a/update-koboldai.bat +++ b/update-koboldai.bat @@ -50,4 +50,4 @@ git remote add origin %origin% git fetch --all git checkout %branch% -f git reset --hard origin/%branch% -cmd /k \ No newline at end of file +%windir%\system32\timeout -t 10 \ No newline at end of file