From 79f7f29604387259a798d599e3f1048c86e26323 Mon Sep 17 00:00:00 2001 From: Obie Hinojosa Date: Wed, 23 Oct 2024 21:30:26 -0500 Subject: [PATCH] fix broken mod deletion code & add folder backup --- installer-windows.bat | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/installer-windows.bat b/installer-windows.bat index cc2ec5f..73a254e 100644 --- a/installer-windows.bat +++ b/installer-windows.bat @@ -2,7 +2,9 @@ cd /D "%~dp0" +set root="%USERPROFILE%\AppData\Roaming\.minecraft" set modfolder="%USERPROFILE%\AppData\Roaming\.minecraft\mods" +set cusdate=M%DATE:~4,2%D%DATE:~7,2%Y%DATE:~10,4% echo "################" echo SCRIPT STARTING @@ -11,12 +13,19 @@ echo. @timeout /t 1 >nul 2>&1 echo Updating Mods... - cd /d %modfolder% + cd /d %root% curl -k "https://git.adolin.xyz/saru/lobotomy-mod-pack/raw/branch/main/mods.tar.gz" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8" -H "Accept-Language: en-US,en;q=0.5" -H "Accept-Encoding: gzip, deflate, br, zstd" -H "Prefer: safe" -H "Alt-Used: git.adolin.xyz" -H "Connection: keep-alive" -H "Upgrade-Insecure-Requests: 1" -H "Sec-Fetch-Dest: document" -H "Sec-Fetch-Mode: navigate" -H "Sec-Fetch-Site: same-origin" -H "Authorization: token ***REMOVED***" -o mods.tar.gz + + Compressing and backing up existing mods... + tar -czf mods-backup-%cusdate%.tar.gz mods/ @timeout /t 2 >nul 2>&1 - del *.jars + + Deleting existing mods... + @RD /S /Q mods + @MD mods + @timeout /t 2 >nul 2>&1 tar -xvzf mods.tar.gz -C %modfolder%