small fixes

+fixed if else bug in backup menu
+changed variables for vsbuildtools
+changed text for backup question
+changed variable in ssl
This commit is contained in:
deffcolony
2024-07-09 23:55:24 +02:00
parent 1e7496720e
commit e0a6b15c4d
4 changed files with 15 additions and 16 deletions

View File

@@ -4347,8 +4347,7 @@ REM Check if 7-Zip is installed
7z > nul 2>&1
if %errorlevel% neq 0 (
goto :7zip_prompt
)
else (
) else (
goto :backup_options
)
@@ -4376,6 +4375,7 @@ if "%zip_choice%"=="1" (
goto :toolbox
)
cls
:backup_options
echo %blue_fg_strong%/ Home / Toolbox / Backup%reset%
echo -------------------------------------------------------------

View File

@@ -17,16 +17,15 @@ if "%silentMode%"=="true" (
set "outputRedirection="
)
:: Set the SSL certificate directory and files
set "SILLYTAVERN_DIR=%~dp0..\..\..\SillyTavern"
set "CERT_DIR=%SILLYTAVERN_DIR%\certs"
REM Set the SSL certificate directory and files
set "CERT_DIR=%st_install_path%\certs"
set "CERT_FILE=%CERT_DIR%\cert.pem"
set "KEY_FILE=%CERT_DIR%\privkey.pem"
set "CERT_INFO_FILE=%CERT_DIR%\SillyTavernSSLInfo.txt"
set "ERROR_LOG=%CERT_DIR%\error_log.txt"
:: Check if the SillyTavern directory exists
if not exist "%SILLYTAVERN_DIR%" (
if not exist "%st_install_path%" (
echo Please install SillyTavern first.
if "%pauseRequired%"=="true" pause
endlocal

View File

@@ -2,23 +2,23 @@
:install_vsbuildtools
REM Check if file exists
if not exist "%~dp0bin\vs_buildtools.exe" (
if not exist "%bin_dir%\vs_buildtools.exe" (
REM Check if the folder exists
if not exist "%~dp0bin" (
mkdir "%~dp0bin"
if not exist "%bin_dir%" (
mkdir "%bin_dir%"
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Created folder: "bin"
) else (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO] "bin" folder already exists.%reset%
)
curl -L -o "%~dp0bin\vs_buildtools.exe" "https://aka.ms/vs/17/release/vs_BuildTools.exe"
curl -L -o "%bin_dir%\vs_buildtools.exe" "https://aka.ms/vs/17/release/vs_BuildTools.exe"
) else (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO] "vs_buildtools.exe" file already exists. Downloading latest version...%reset%
del "%~dp0bin\vs_buildtools.exe"
curl -L -o "%~dp0bin\vs_buildtools.exe" "https://aka.ms/vs/17/release/vs_BuildTools.exe"
del "%bin_dir%\vs_buildtools.exe"
curl -L -o "%bin_dir%\vs_buildtools.exe" "https://aka.ms/vs/17/release/vs_BuildTools.exe"
)
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing Visual Studio BuildTools 2022...
start "" "%~dp0bin\vs_buildtools.exe" --norestart --passive --downloadThenInstall --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools
start "" "%bin_dir%\vs_buildtools.exe" --norestart --passive --downloadThenInstall --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%When install is finished:%reset%
pause

View File

@@ -63,10 +63,10 @@ set "escaped_st_install_path=%st_install_path:\=\\%"
REM Prompt user for custom name
set "use_custom_name=N"
set "custom_name="
set /p rename_choice="Do you want to give the backup file a custom name? (default is backup_datetime) (Y/N): "
set /p rename_choice="Give backup file a custom name? (Default is st_backup_DATE_TIME.7z) [Y/N]: "
if /i "%rename_choice%"=="Y" (
set "use_custom_name=Y"
set /p custom_name="Enter the custom name for the backup file (without extension): "
set /p custom_name="Enter custom name for backup file (without extension): "
) else if "%rename_choice%"=="" (
set "use_custom_name=N"
)
@@ -96,7 +96,7 @@ if "%use_custom_name%"=="Y" (
REM Create a backup using 7zip
7z a "%st_backup_path%\%backup_filename%" "%st_install_path%\data\%selected_user_folder%\*"
echo %green_fg_strong%Backup created at %st_backup_path%\%backup_filename%%reset%
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%Backup created at %st_backup_path%\%backup_filename%%reset%
pause
endlocal