mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Redownload micromamba if the download failed midway; Start the script in the script's directory, not where it was run from
This commit is contained in:
parent
94cf660848
commit
29d9ce03ab
@ -17,6 +17,7 @@ set MAMBA_ROOT_PREFIX=%cd%\installer_files\mamba
|
|||||||
set INSTALL_ENV_DIR=%cd%\installer_files\env
|
set INSTALL_ENV_DIR=%cd%\installer_files\env
|
||||||
set MICROMAMBA_DOWNLOAD_URL=https://github.com/cmdr2/stable-diffusion-ui/releases/download/v1.1/micromamba.exe
|
set MICROMAMBA_DOWNLOAD_URL=https://github.com/cmdr2/stable-diffusion-ui/releases/download/v1.1/micromamba.exe
|
||||||
set REPO_URL=https://github.com/cmdr2/InvokeAI.git
|
set REPO_URL=https://github.com/cmdr2/InvokeAI.git
|
||||||
|
set umamba_exists=F
|
||||||
@rem Change the download URL to an InvokeAI repo's release URL
|
@rem Change the download URL to an InvokeAI repo's release URL
|
||||||
|
|
||||||
@rem figure out whether git and conda needs to be installed
|
@rem figure out whether git and conda needs to be installed
|
||||||
@ -30,10 +31,13 @@ if "%ERRORLEVEL%" NEQ "0" set PACKAGES_TO_INSTALL=%PACKAGES_TO_INSTALL% conda
|
|||||||
call git --version >.tmp1 2>.tmp2
|
call git --version >.tmp1 2>.tmp2
|
||||||
if "%ERRORLEVEL%" NEQ "0" set PACKAGES_TO_INSTALL=%PACKAGES_TO_INSTALL% git
|
if "%ERRORLEVEL%" NEQ "0" set PACKAGES_TO_INSTALL=%PACKAGES_TO_INSTALL% git
|
||||||
|
|
||||||
|
call "%MAMBA_ROOT_PREFIX%\micromamba.exe" --version >.tmp1 2>.tmp2
|
||||||
|
if "%ERRORLEVEL%" EQU "0" set umamba_exists=T
|
||||||
|
|
||||||
@rem (if necessary) install git and conda into a contained environment
|
@rem (if necessary) install git and conda into a contained environment
|
||||||
if "%PACKAGES_TO_INSTALL%" NEQ "" (
|
if "%PACKAGES_TO_INSTALL%" NEQ "" (
|
||||||
@rem download micromamba
|
@rem download micromamba
|
||||||
if not exist "%MAMBA_ROOT_PREFIX%\micromamba.exe" (
|
if "%umamba_exists%" == "F" (
|
||||||
echo "Downloading micromamba from %MICROMAMBA_DOWNLOAD_URL% to %MAMBA_ROOT_PREFIX%\micromamba.exe"
|
echo "Downloading micromamba from %MICROMAMBA_DOWNLOAD_URL% to %MAMBA_ROOT_PREFIX%\micromamba.exe"
|
||||||
|
|
||||||
mkdir "%MAMBA_ROOT_PREFIX%"
|
mkdir "%MAMBA_ROOT_PREFIX%"
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
# This enables a user to install this project without manually installing conda and git.
|
# This enables a user to install this project without manually installing conda and git.
|
||||||
|
|
||||||
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
echo "Installing InvokeAI.."
|
echo "Installing InvokeAI.."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
@ -34,6 +36,7 @@ export MAMBA_ROOT_PREFIX="$(pwd)/installer_files/mamba"
|
|||||||
INSTALL_ENV_DIR="$(pwd)/installer_files/env"
|
INSTALL_ENV_DIR="$(pwd)/installer_files/env"
|
||||||
MICROMAMBA_DOWNLOAD_URL="https://micro.mamba.pm/api/micromamba/${OS_NAME}-${OS_ARCH}/latest"
|
MICROMAMBA_DOWNLOAD_URL="https://micro.mamba.pm/api/micromamba/${OS_NAME}-${OS_ARCH}/latest"
|
||||||
REPO_URL="https://github.com/cmdr2/InvokeAI.git"
|
REPO_URL="https://github.com/cmdr2/InvokeAI.git"
|
||||||
|
umamba_exists="F"
|
||||||
|
|
||||||
# figure out whether git and conda needs to be installed
|
# figure out whether git and conda needs to be installed
|
||||||
if [ -e "$INSTALL_ENV_DIR" ]; then export PATH="$INSTALL_ENV_DIR/bin:$PATH"; fi
|
if [ -e "$INSTALL_ENV_DIR" ]; then export PATH="$INSTALL_ENV_DIR/bin:$PATH"; fi
|
||||||
@ -43,10 +46,12 @@ PACKAGES_TO_INSTALL=""
|
|||||||
if ! hash "conda" &>/dev/null; then PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL conda"; fi
|
if ! hash "conda" &>/dev/null; then PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL conda"; fi
|
||||||
if ! hash "git" &>/dev/null; then PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL git"; fi
|
if ! hash "git" &>/dev/null; then PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL git"; fi
|
||||||
|
|
||||||
|
if "$MAMBA_ROOT_PREFIX/micromamba" --version &>/dev/null; then umamba_exists="T"; fi
|
||||||
|
|
||||||
# (if necessary) install git and conda into a contained environment
|
# (if necessary) install git and conda into a contained environment
|
||||||
if [ "$PACKAGES_TO_INSTALL" != "" ]; then
|
if [ "$PACKAGES_TO_INSTALL" != "" ]; then
|
||||||
# download micromamba
|
# download micromamba
|
||||||
if [ ! -e "$MAMBA_ROOT_PREFIX/micromamba" ]; then
|
if [ "$umamba_exists" == "F" ]; then
|
||||||
echo "Downloading micromamba from $MICROMAMBA_DOWNLOAD_URL to $MAMBA_ROOT_PREFIX/micromamba"
|
echo "Downloading micromamba from $MICROMAMBA_DOWNLOAD_URL to $MAMBA_ROOT_PREFIX/micromamba"
|
||||||
|
|
||||||
mkdir -p "$MAMBA_ROOT_PREFIX"
|
mkdir -p "$MAMBA_ROOT_PREFIX"
|
||||||
|
Loading…
Reference in New Issue
Block a user