@echo off echo Checking and installing necessary software... REM Base Directory (can be updated if necessary) set BASE_DIR=.\kohya_ss\ REM Check and install Python python --version > NUL 2>&1 if %errorlevel% NEQ 0 ( echo Installing Python 3.10.6... powershell -Command "& {Invoke-WebRequest -Uri 'https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe' -OutFile 'python-3.10.6-amd64.exe'}" if %errorlevel% NEQ 0 ( echo Failed to download Python installer. exit /b ) start /wait python-3.10.6-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 del python-3.10.6-amd64.exe ) else ( echo Python already installed. ) REM Check and install Git git --version > NUL 2>&1 if %errorlevel% NEQ 0 ( echo Installing Git... powershell -Command "& {Invoke-WebRequest -Uri 'https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.3/Git-2.41.0.3-64-bit.exe' -OutFile 'Git-2.41.0.3-64-bit.exe'}" if %errorlevel% NEQ 0 ( echo Failed to download Git installer. exit /b ) start /wait Git-2.41.0.3-64-bit.exe /VERYSILENT del Git-2.41.0.3-64-bit.exe ) else ( echo Git already installed. ) REM Check and install Visual Studio 2015, 2017, 2019, and 2022 redistributable echo Checking for Visual Studio redistributable... reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64 /v Version >NUL 2>&1 if %errorlevel% NEQ 0 ( echo Installing Visual Studio 2015, 2017, 2019, and 2022 redistributable... powershell -Command "& {Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vc_redist.x64.exe' -OutFile 'vc_redist.x64.exe'}" if %errorlevel% NEQ 0 ( echo Failed to download Visual Studio redistributable installer. exit /b ) start /wait vc_redist.x64.exe /install /quiet /norestart del vc_redist.x64.exe ) else ( echo Visual Studio redistributable already installed. ) echo Cloning kohya_ss repository... git clone https://github.com/bmaltais/kohya_ss.git if %errorlevel% NEQ 0 ( echo Failed to clone repository. exit /b ) echo Listing the contents of the cloned repository... dir %BASE_DIR% echo Changing directory to the cloned repository... cd %BASE_DIR% echo Running setup.bat... call setup.bat echo Setup completed successfully! pause