launcher upgrades

added tabbyapi extension installer
This commit is contained in:
deffcolony
2024-07-20 20:05:05 +02:00
parent ea756a0a37
commit 6e830db903
2 changed files with 86 additions and 1 deletions

View File

@@ -1659,7 +1659,8 @@ echo -------------------------------------------------------------
echo What would you like to do?
echo 1. Install TabbyAPI
echo 2. Models [Install Options]
echo 2. Install ST-tabbyAPI-loader Extension
echo 3. Models [Install Options]
echo 0. Back
set /p app_installer_tabbyapi_choice=Choose Your Destiny:
@@ -1677,6 +1678,17 @@ if "%app_installer_tabbyapi_choice%"=="1" (
goto :install_tabbyapi_menu
)
) else if "%app_installer_tabbyapi_choice%"=="2" (
set "caller=app_installer_text_completion_tabbyapi"
if exist "%app_installer_text_completion_dir%\install_tabbyapi_st_ext.bat" (
call %app_installer_text_completion_dir%\install_tabbyapi_st_ext.bat
goto :install_tabbyapi_menu
) else (
echo [%DATE% %TIME%] ERROR: install_tabbyapi_st_ext.bat not found in: %app_installer_text_completion_dir% >> %logs_stl_console_path%
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] install_tabbyapi_st_ext.bat not found in: %app_installer_text_completion_dir%%reset%
pause
goto :install_tabbyapi_menu
)
) else if "%app_installer_tabbyapi_choice%"=="3" (
goto :install_tabbyapi_model_menu
) else if "%app_installer_tabbyapi_choice%"=="0" (
goto :app_installer_text_completion

View File

@@ -0,0 +1,73 @@
@echo off
:install_tabbyapi_st_ext
title STL [INSTALL TABBYAPI ST EXT]
cls
echo %blue_fg_strong%/ Home / Toolbox / App Installer / Text Completion / Install ST-tabbyAPI-loader Extension%reset%
echo -------------------------------------------------------------
REM Scan for user folders
set "user_folders="
for /d %%d in ("%st_install_path%\data\*") do (
if /i not "%%~nxd"=="_storage" if /i not "%%~nxd"=="_uploads" (
set "user_folders=!user_folders!%%~nxd|"
)
)
echo Detected accounts:
echo ================================
REM Remove the trailing pipe character
set "user_folders=%user_folders:~0,-1%"
REM Split user_folders into an array
set i=1
set "user_count=0"
for %%a in (%user_folders:|= %) do (
echo !i!. %cyan_fg_strong%%%a%reset%
set "user_folder_!i!=%%a"
set /a i+=1
set /a user_count+=1
)
echo ================================
REM If only one user folder is found, skip the selection
if %user_count%==1 (
set "selected_user_folder=!user_folder_1!"
goto skip_user_selection
)
:select_user_folder
REM Prompt user to select a folder
echo 0. Cancel
echo.
set "selected_user_folder="
set /p user_choice="Select a folder to install ST-tabbyAPI-loader: "
REM Check if the user wants to exit
if "%user_choice%"=="0" (
exit /b 0
)
REM Get the selected folder name
for /l %%i in (1,1,%user_count%) do (
if "%user_choice%"=="%%i" set "selected_user_folder=!user_folder_%%i!"
)
if "%selected_user_folder%"=="" (
echo %red_fg_strong%[ERROR] Invalid selection. Please enter a number between 1 and %user_count%, or press 0 to cancel.%reset%
pause
goto :create_backup
)
:skip_user_selection
REM Replace backslashes with double backslashes in st_install_path
set "escaped_st_install_path=%st_install_path:\=\\%"
REM install the extension in selected user folder
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing ST-tabbyAPI-loader extension...
cd /d "%st_install_path%\data\%selected_user_folder%\extensions"
git clone https://github.com/theroyallab/ST-tabbyAPI-loader.git
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%ST-tabbyAPI-loader Extension for SillyTavern has been installed successfully.%reset%
pause
goto :install_tabbyapi_menu