main
bat 72 lines 2.03 KB
Raw
1 @setlocal
2 @echo off
3 SET DOTNET_VERSION=8.0
4 SET SANDBOX_FILES=C:\sandbox
5
6 set /p InstallMethod=<%SANDBOX_FILES%\dotnet.cfg
7
8 pushd "%TEMP%"
9 if "%InstallMethod%"=="EXE" goto EXE
10 if "%InstallMethod%"=="ZIP" goto ZIP
11 goto ERROR_NO_CONFIG
12
13 :ZIP
14 mkdir "%ProgramFiles%\dotnet"
15 if exist %SANDBOX_FILES%\assets\dotnet-sdk-64.zip (
16 tar -oxzf "%SANDBOX_FILES%\assets\dotnet-sdk-64.zip" -C "%ProgramFiles%\dotnet"
17 ) else (
18 goto ERROR_NO_DOTNET
19 )
20 if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-64.zip (
21 tar -oxzf "%SANDBOX_FILES%\assets\windowsdesktop-runtime-64.zip" -C "%ProgramFiles%\dotnet"
22 ) else (
23 goto ERROR_NO_DOTNET
24 )
25 if exist %SANDBOX_FILES%\assets\dotnet-runtime-x86.zip (
26 mkdir "%ProgramFiles(x86)%\dotnet"
27 tar -oxzf "%SANDBOX_FILES%\assets\dotnet-runtime-x86.zip" -C "%ProgramFiles(x86)%\dotnet"
28 )
29 if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.zip (
30 tar -oxzf "%SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.zip" -C "%ProgramFiles(x86)%\dotnet"
31 )
32 goto PROCEED
33
34 :EXE
35 if exist %SANDBOX_FILES%\assets\dotnet-sdk-64.exe (
36 "%SANDBOX_FILES%\assets\dotnet-sdk-64.exe" /install /quiet /norestart
37 ) else (
38 goto ERROR_NO_DOTNET
39 )
40 if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-64.exe (
41 "%SANDBOX_FILES%\assets\windowsdesktop-runtime-64.exe" /install /quiet /norestart
42 ) else (
43 goto ERROR_NO_DOTNET
44 )
45 if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.exe (
46 "%SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.exe" /install /quiet /norestart
47 )
48 goto PROCEED
49
50 :PROCEED
51 regedit /s "%SANDBOX_FILES%\sandbox_registry"
52 endlocal
53 SETX PATH "%PATH%;%ProgramFiles%\dotnet;%ProgramFiles(x86)%\dotnet" /M
54 SET PATH=%PATH%;%ProgramFiles%\dotnet;%ProgramFiles(x86)%\dotnet
55
56 dotnet nuget locals all --clear
57 dotnet help
58
59 popd
60 cd c:\build
61 start "Menu" cmd /c C:\sandbox\runtest_menu.bat
62 goto END
63
64 :ERROR_NO_CONFIG
65 start "ERROR" CMD /c echo ERROR: Host configuration has not been run, run setup_sandbox.bat first ^& pause
66 goto END
67
68
69 :ERROR_NO_DOTNET
70 start "ERROR" CMD /c echo ERROR: Failed to find dotnet install files. Run setup_sandbox.bat again ^& pause
71
72 :END