From 53371537616925ceaf13a2e55a55397eeaf684ad Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 15 Sep 2022 15:14:48 +0530 Subject: [PATCH 1/4] Remove the use of activate.d for the windows installer, since it allows for easier debugging later on --- build.bat | 8 +++----- build.sh | 3 +++ scripts/Start Stable Diffusion UI.cmd | 11 ++++++++++- scripts/start.sh | 3 +++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/build.bat b/build.bat index d1bcaab7..0cc6cf3f 100644 --- a/build.bat +++ b/build.bat @@ -8,6 +8,8 @@ set /p answer=Are you a developer of this project (Y/N)? if /i "%answer:~,1%" NEQ "Y" exit /b +@set PYTHONNOUSERSITE=1 + @mkdir dist\stable-diffusion-ui @echo "Downloading components for the installer.." @@ -15,11 +17,6 @@ if /i "%answer:~,1%" NEQ "Y" exit /b @call conda env create --prefix installer -f environment.yaml @call conda activate .\installer -@echo "Setting up startup scripts.." - -@mkdir installer\etc\conda\activate.d -@copy scripts\post_activate.bat installer\etc\conda\activate.d\ - @echo "Creating a distributable package.." @call conda install -c conda-forge -y conda-pack @@ -37,6 +34,7 @@ if /i "%answer:~,1%" NEQ "Y" exit /b @copy ..\..\LICENSE . @copy "..\..\CreativeML Open RAIL-M License" . @copy "..\..\How to install and run.txt" . +@echo "" > scripts\install_status.txt @echo "Build ready. Zip the 'dist\stable-diffusion-ui' folder." diff --git a/build.sh b/build.sh index 04579d1f..577dcb8b 100755 --- a/build.sh +++ b/build.sh @@ -11,6 +11,8 @@ case $yn in * ) exit;; esac +export PYTHONNOUSERSITE=1 + mkdir -p dist/stable-diffusion-ui echo "Downloading components for the installer.." @@ -38,6 +40,7 @@ cp ../../scripts/start.sh . cp ../../LICENSE . cp "../../CreativeML Open RAIL-M License" . cp "../../How to install and run.txt" . +echo "" > scripts/install_status.txt chmod u+x start.sh diff --git a/scripts/Start Stable Diffusion UI.cmd b/scripts/Start Stable Diffusion UI.cmd index 4f67c7bf..6bf6b290 100644 --- a/scripts/Start Stable Diffusion UI.cmd +++ b/scripts/Start Stable Diffusion UI.cmd @@ -1 +1,10 @@ -installer\Scripts\activate.bat +@call installer\Scripts\activate.bat + +@call conda-unpack + +@call conda --version +@call git --version + +@call scripts\on_env_start.bat + +@pause \ No newline at end of file diff --git a/scripts/start.sh b/scripts/start.sh index d6c75ad8..e077593a 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -4,4 +4,7 @@ source installer/bin/activate conda-unpack +conda --version +git --version + scripts/on_env_start.sh From 5facba441946bb62555591fa3cf8b6c1438b5f11 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Sat, 24 Sep 2022 23:23:35 +0530 Subject: [PATCH 2/4] [installer] No need to go back a folder now, we're already in the right location --- build.bat | 2 +- scripts/on_env_start.bat | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build.bat b/build.bat index 0cc6cf3f..96232c0a 100644 --- a/build.bat +++ b/build.bat @@ -34,7 +34,7 @@ if /i "%answer:~,1%" NEQ "Y" exit /b @copy ..\..\LICENSE . @copy "..\..\CreativeML Open RAIL-M License" . @copy "..\..\How to install and run.txt" . -@echo "" > scripts\install_status.txt +@echo. > scripts\install_status.txt @echo "Build ready. Zip the 'dist\stable-diffusion-ui' folder." diff --git a/scripts/on_env_start.bat b/scripts/on_env_start.bat index 16312a5a..959b5e20 100644 --- a/scripts/on_env_start.bat +++ b/scripts/on_env_start.bat @@ -4,8 +4,6 @@ set PATH=C:\Windows\System32;%PATH% -@cd .. - if exist "scripts\config.bat" ( @call scripts\config.bat ) From 2a46f6b225ea9cd4f357582af0277fe7b5d1b5fc Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 26 Sep 2022 19:19:11 +0530 Subject: [PATCH 3/4] Make the new installer work with existing installations (made with the old installer) --- scripts/Start Stable Diffusion UI.cmd | 9 +++++++++ scripts/on_env_start.bat | 2 ++ 2 files changed, 11 insertions(+) diff --git a/scripts/Start Stable Diffusion UI.cmd b/scripts/Start Stable Diffusion UI.cmd index 6bf6b290..e34c2b36 100644 --- a/scripts/Start Stable Diffusion UI.cmd +++ b/scripts/Start Stable Diffusion UI.cmd @@ -1,3 +1,10 @@ +@echo off + +@REM Delete the post-activate hook from the old installer +@if exist "installer\etc\conda\activate.d\post_activate.bat" ( + del "installer\etc\conda\activate.d\post_activate.bat" +) + @call installer\Scripts\activate.bat @call conda-unpack @@ -5,6 +12,8 @@ @call conda --version @call git --version +@cd installer + @call scripts\on_env_start.bat @pause \ No newline at end of file diff --git a/scripts/on_env_start.bat b/scripts/on_env_start.bat index 959b5e20..16312a5a 100644 --- a/scripts/on_env_start.bat +++ b/scripts/on_env_start.bat @@ -4,6 +4,8 @@ set PATH=C:\Windows\System32;%PATH% +@cd .. + if exist "scripts\config.bat" ( @call scripts\config.bat ) From e67843638fafeea7cff3334d909c81c2f2b3f6f4 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 26 Sep 2022 20:11:33 +0530 Subject: [PATCH 4/4] Fix errors with the new installer --- scripts/Start Stable Diffusion UI.cmd | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/Start Stable Diffusion UI.cmd b/scripts/Start Stable Diffusion UI.cmd index e34c2b36..f3af626c 100644 --- a/scripts/Start Stable Diffusion UI.cmd +++ b/scripts/Start Stable Diffusion UI.cmd @@ -1,9 +1,7 @@ @echo off @REM Delete the post-activate hook from the old installer -@if exist "installer\etc\conda\activate.d\post_activate.bat" ( - del "installer\etc\conda\activate.d\post_activate.bat" -) +echo. > installer\etc\conda\activate.d\post_activate.bat @call installer\Scripts\activate.bat @@ -14,6 +12,6 @@ @cd installer -@call scripts\on_env_start.bat +@call ..\scripts\on_env_start.bat @pause \ No newline at end of file