diff options
author | Bevan Weiss <bevan.weiss@gmail.com> | 2024-06-26 18:41:08 +1000 |
---|---|---|
committer | Bob Arnson <github@bobs.org> | 2024-07-04 19:25:49 -0400 |
commit | 83d92ef88270a740bc96609f8d967986e4f91e99 (patch) | |
tree | fe41ddf912436110128ecc6fbd8d303bd7db260b /src/test/sandbox/startup.bat | |
parent | 89dc7b47809da06a69811788a1a990e216b81a5c (diff) | |
download | wix-83d92ef88270a740bc96609f8d967986e4f91e99.tar.gz wix-83d92ef88270a740bc96609f8d967986e4f91e99.tar.bz2 wix-83d92ef88270a740bc96609f8d967986e4f91e99.zip |
Added host menu options for EXE / ZIP installation
Removed ARM64/AMD64 folders for dotnet, the Sandbox MUST match the host
here, so no point downloading the installer for the non-host platform.
Debugger could probably be reduced in the same manner, but have not in
this iteration.
Have also added a simple README, just to explain (very basic) operation.
Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
Diffstat (limited to 'src/test/sandbox/startup.bat')
-rw-r--r-- | src/test/sandbox/startup.bat | 67 |
1 files changed, 43 insertions, 24 deletions
diff --git a/src/test/sandbox/startup.bat b/src/test/sandbox/startup.bat index ce0f2bbd..7b9b603f 100644 --- a/src/test/sandbox/startup.bat +++ b/src/test/sandbox/startup.bat | |||
@@ -1,28 +1,19 @@ | |||
1 | @setlocal | 1 | @setlocal |
2 | @echo off | ||
2 | SET DOTNET_VERSION=8.0 | 3 | SET DOTNET_VERSION=8.0 |
3 | SET SANDBOX_FILES=C:\sandbox | 4 | SET SANDBOX_FILES=C:\sandbox |
4 | 5 | ||
6 | set /p InstallMethod=<%SANDBOX_FILES%\dotnet.cfg | ||
7 | |||
5 | pushd "%TEMP%" | 8 | pushd "%TEMP%" |
9 | if "%InstallMethod%"=="EXE" goto EXE | ||
10 | if "%InstallMethod%"=="ZIP" goto ZIP | ||
11 | goto ERROR_NO_CONFIG | ||
6 | 12 | ||
13 | :ZIP | ||
7 | mkdir "%ProgramFiles%\dotnet" | 14 | mkdir "%ProgramFiles%\dotnet" |
8 | REM @if exist %SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-runtime.zip ( | 15 | if exist %SANDBOX_FILES%\dotnet-sdk.zip ( |
9 | REM tar -oxzf "%SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-runtime.zip" -C "%ProgramFiles%\dotnet" | 16 | tar -oxzf "%SANDBOX_FILES%\dotnet-sdk.zip" -C "%ProgramFiles%\dotnet" |
10 | REM ) else ( | ||
11 | REM if %PROCESSOR_ARCHITECTURE%=="ARM64" ( | ||
12 | REM curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-arm64.zip --output dotnet-runtime.zip | ||
13 | REM ) else ( | ||
14 | REM curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-x64.zip --output dotnet-runtime.zip | ||
15 | REM ) | ||
16 | REM if %errorlevel% NEQ 0 ( | ||
17 | REM echo No pre-provided dotnet runtime, and failed to download. Confirm networking is available. | ||
18 | REM goto :ERROR | ||
19 | REM ) | ||
20 | REM tar -oxzf dotnet-runtime.zip -C "%ProgramFiles%\dotnet" | ||
21 | REM del dotnet-runtime.zip | ||
22 | REM ) | ||
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 ( | 17 | ) else ( |
27 | if %PROCESSOR_ARCHITECTURE%=="ARM64" ( | 18 | if %PROCESSOR_ARCHITECTURE%=="ARM64" ( |
28 | curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output dotnet-sdk.zip | 19 | curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output dotnet-sdk.zip |
@@ -31,21 +22,49 @@ REM ) | |||
31 | ) | 22 | ) |
32 | if %errorlevel% NEQ 0 ( | 23 | if %errorlevel% NEQ 0 ( |
33 | echo "No pre-provided dotnet sdk, and failed to download. Confirm networking is available." | 24 | echo "No pre-provided dotnet sdk, and failed to download. Confirm networking is available." |
34 | goto ERROR | 25 | goto ERROR_NO_DOTNET |
35 | ) | 26 | ) |
36 | tar -oxzf dotnet-sdk.zip -C "%ProgramFiles%\dotnet" | 27 | tar -oxzf dotnet-sdk.zip -C "%ProgramFiles%\dotnet" |
37 | del dotnet-sdk.zip | 28 | del dotnet-sdk.zip |
38 | ) | 29 | ) |
30 | goto PROCEED | ||
39 | 31 | ||
40 | @endlocal | 32 | :EXE |
33 | if exist %SANDBOX_FILES%\dotnet-sdk.exe ( | ||
34 | "%SANDBOX_FILES%\dotnet-sdk.exe" /install /quiet /norestart | ||
35 | ) else ( | ||
36 | if %PROCESSOR_ARCHITECTURE%=="ARM64" ( | ||
37 | curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.exe --output dotnet-sdk.exe | ||
38 | ) else ( | ||
39 | curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.exe --output dotnet-sdk.exe | ||
40 | ) | ||
41 | if %errorlevel% NEQ 0 ( | ||
42 | echo "No pre-provided dotnet sdk, and failed to download. Confirm networking is available." | ||
43 | goto ERROR_NO_DOTNET | ||
44 | ) | ||
45 | dotnet-sdk.exe /install /quiet /norestart | ||
46 | ) | ||
47 | goto PROCEED | ||
48 | |||
49 | :PROCEED | ||
50 | endlocal | ||
41 | SETX PATH "%PATH%;%ProgramFiles%\dotnet" /M | 51 | SETX PATH "%PATH%;%ProgramFiles%\dotnet" /M |
42 | SET PATH=%PATH%;%ProgramFiles%\dotnet | 52 | SET PATH=%PATH%;%ProgramFiles%\dotnet |
53 | |||
43 | dotnet nuget locals all --clear | 54 | dotnet nuget locals all --clear |
44 | dotnet help | 55 | dotnet help |
45 | 56 | ||
57 | popd | ||
58 | cd c:\build | ||
59 | start "Menu" cmd /c C:\sandbox\runtest_menu.bat | ||
60 | goto END | ||
46 | 61 | ||
47 | :ERROR | 62 | :ERROR_NO_CONFIG |
63 | start "ERROR" CMD /c echo ERROR: Host configuration has not been run, run setup_sandbox.bat first ^& pause | ||
64 | goto END | ||
48 | 65 | ||
49 | @popd | 66 | |
50 | cd c:\build | 67 | :ERROR_NO_DOTNET |
51 | start cmd /c C:\sandbox\runtest_menu.bat | 68 | start "ERROR" CMD /c echo ERROR: Failed to find dotnet install, and download failed. Run setup_sandbox.bat again ^& pause |
69 | |||
70 | :END | ||