File size: 2,327 Bytes
17bd1ee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@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