diff --git a/Start Stable Diffusion UI.cmd b/Start Stable Diffusion UI.cmd index 149913a1..d07e743c 100644 --- a/Start Stable Diffusion UI.cmd +++ b/Start Stable Diffusion UI.cmd @@ -4,7 +4,7 @@ echo. & echo "Stable Diffusion UI - v2.5" & echo. set PATH=C:\Windows\System32;%PATH% -set RUN_CMD_FILENAME="Start Stable Diffusion UI.cmd" +set START_CMD_FILENAME="Start Stable Diffusion UI.cmd" set SD_BASE_DIR=%cd% diff --git a/installer/bootstrap/check-install-dir.bat b/installer/bootstrap/check-install-dir.bat index 303106be..b2509b00 100644 --- a/installer/bootstrap/check-install-dir.bat +++ b/installer/bootstrap/check-install-dir.bat @@ -13,7 +13,7 @@ if /i "%answer:~,1%" NEQ "c" ( ) xcopy "%SD_BASE_DIR%" "%suggested_dir%" /s /i /Y /Q - echo Please run the %RUN_CMD_FILENAME% file inside %suggested_dir% . Do not use this folder anymore > "%SD_BASE_DIR%/READ_ME - DO_NOT_USE_THIS_FOLDER.txt" + echo Please run the %START_CMD_FILENAME% file inside %suggested_dir% . Do not use this folder anymore > "%SD_BASE_DIR%/READ_ME - DO_NOT_USE_THIS_FOLDER.txt" cd %suggested_dir% ) \ No newline at end of file diff --git a/installer/installer/app.py b/installer/installer/app.py index 75580700..5dea5fb9 100644 --- a/installer/installer/app.py +++ b/installer/installer/app.py @@ -3,11 +3,12 @@ import json # config PROJECT_REPO_URL = 'https://github.com/cmdr2/stable-diffusion-ui.git' -DEFAULT_UPDATE_BRANCH = 'main' +DEFAULT_UPDATE_BRANCH = 'installer_new' PROJECT_REPO_DIR_NAME = 'project_repo' STABLE_DIFFUSION_REPO_DIR_NAME = 'stable-diffusion' +START_CMD_FILE_NAME = os.environ['START_CMD_FILENAME'] LOG_FILE_NAME = 'run.log' CONFIG_FILE_NAME = 'config.json' diff --git a/installer/installer/tasks/apply_project_update.py b/installer/installer/tasks/apply_project_update.py index 7993f66c..5c930bf5 100644 --- a/installer/installer/tasks/apply_project_update.py +++ b/installer/installer/tasks/apply_project_update.py @@ -1,17 +1,26 @@ from os import path import shutil -from installer import app, helpers +from installer import app def run(): is_developer_mode = app.config.get('is_developer_mode', False) - if not is_developer_mode: - # @xcopy sd-ui-files\ui ui /s /i /Y - # @copy sd-ui-files\scripts\on_sd_start.bat scripts\ /Y - # @copy "sd-ui-files\scripts\Start Stable Diffusion UI.cmd" . /Y + if is_developer_mode: + return - installer_src_path = path.join(app.project_repo_dir_path, 'installer') - ui_src_path = path.join(app.project_repo_dir_path, 'ui') - engine_src_path = path.join(app.project_repo_dir_path, 'engine') + installer_src_path = path.join(app.project_repo_dir_path, 'installer') + ui_src_path = path.join(app.project_repo_dir_path, 'ui') + engine_src_path = path.join(app.project_repo_dir_path, 'engine') - shutil.copytree(ui_src_path, app.ui_dir_path, dirs_exist_ok=True) + start_cmd_src_path = path.join(app.project_repo_dir_path, app.START_CMD_FILE_NAME) + start_cmd_dst_path = path.join(app.SD_BASE_DIR, app.START_CMD_FILE_NAME) + + shutil.rmtree(app.installer_dir_path, ignore_errors=True) + shutil.rmtree(app.ui_dir_path, ignore_errors=True) + shutil.rmtree(app.engine_dir_path, ignore_errors=True) + + shutil.copytree(installer_src_path, app.installer_dir_path, dirs_exist_ok=True) + shutil.copytree(ui_src_path, app.ui_dir_path, dirs_exist_ok=True) + shutil.copytree(engine_src_path, app.engine_dir_path, dirs_exist_ok=True) + + shutil.copy(start_cmd_src_path, start_cmd_dst_path)