diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/sandbox/startup.bat | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/test/sandbox/startup.bat b/src/test/sandbox/startup.bat new file mode 100644 index 00000000..0f1b33d8 --- /dev/null +++ b/src/test/sandbox/startup.bat | |||
@@ -0,0 +1,48 @@ | |||
1 | @setlocal | ||
2 | SET DOTNET_VERSION=8.0 | ||
3 | SET SANDBOX_FILES=C:\sandbox | ||
4 | |||
5 | pushd "%TEMP%" | ||
6 | |||
7 | mkdir "%ProgramFiles%\dotnet" | ||
8 | @if exist %SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-runtime.zip ( | ||
9 | tar -oxzf "%SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-runtime.zip" -C "%ProgramFiles%\dotnet" | ||
10 | ) else ( | ||
11 | if %PROCESSOR_ARCHITECTURE%=="ARM64" ( | ||
12 | curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-arm64.zip --output dotnet-runtime.zip | ||
13 | ) else ( | ||
14 | curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-x64.zip --output dotnet-runtime.zip | ||
15 | ) | ||
16 | if %errorlevel$ NEQ 0 ( | ||
17 | echo No pre-provided dotnet runtime, and failed to download. Confirm networking is available. | ||
18 | goto :ERROR | ||
19 | ) | ||
20 | tar -oxzf dotnet-runtime.zip -C "%ProgramFiles%\dotnet" | ||
21 | del dotnet-runtime.zip | ||
22 | ) | ||
23 | |||
24 | @if exist %SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-sdk.zip ( | ||
25 | tar -oxzf "%SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-sdk.zip" -C "%ProgramFiles%\dotnet" | ||
26 | ) else ( | ||
27 | if %PROCESSOR_ARCHITECTURE%=="ARM64" ( | ||
28 | curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output dotnet-sdk.zip | ||
29 | ) else ( | ||
30 | curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output dotnet-runtime.zip | ||
31 | ) | ||
32 | if %errorlevel$ NEQ 0 echo "No pre-provided dotnet sdk, and failed to download. Confirm networking is available." goto exit | ||
33 | tar -oxzf dotnet-sdk.zip -C "%ProgramFiles%\dotnet" | ||
34 | del dotnet-sdk.zip | ||
35 | ) | ||
36 | |||
37 | @endlocal | ||
38 | SETX PATH "%PATH%;%ProgramFiles%\dotnet" /M | ||
39 | SET PATH=%PATH%;%ProgramFiles%\dotnet | ||
40 | dotnet nuget locals all --clear | ||
41 | dotnet help | ||
42 | |||
43 | |||
44 | :ERROR | ||
45 | |||
46 | @popd | ||
47 | cd c:\build | ||
48 | start cmd | ||