aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorBevan Weiss <bevan.weiss@gmail.com>2024-06-27 18:34:50 +1000
committerBob Arnson <github@bobs.org>2024-07-04 19:25:49 -0400
commit596b4c4ae90b757b069a97ef40de67a7d1f9ab73 (patch)
tree18edf9a51f46ac0724180f1db5d3b0d368f4050c /src/test
parent83d92ef88270a740bc96609f8d967986e4f91e99 (diff)
downloadwix-596b4c4ae90b757b069a97ef40de67a7d1f9ab73.tar.gz
wix-596b4c4ae90b757b069a97ef40de67a7d1f9ab73.tar.bz2
wix-596b4c4ae90b757b069a97ef40de67a7d1f9ab73.zip
No longer support downloading within the Sandbox. Just error instead.
Install both the x64 AND the x86 versions of Windows Desktop Runtime. Needed for the Burn Integration tests. And having dotnet files in the sandbox directory was annoying, so put them all into an assets directory Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/sandbox/runtest_menu.bat8
-rw-r--r--src/test/sandbox/setup_sandbox.bat27
-rw-r--r--src/test/sandbox/startup.bat57
3 files changed, 51 insertions, 41 deletions
diff --git a/src/test/sandbox/runtest_menu.bat b/src/test/sandbox/runtest_menu.bat
index fc6ad93e..cc7bd4cf 100644
--- a/src/test/sandbox/runtest_menu.bat
+++ b/src/test/sandbox/runtest_menu.bat
@@ -8,12 +8,12 @@ REM If we do offer the debugger, we better show the IP address too, since it see
8REM to change for each invocation of the Sandbox environment 8REM to change for each invocation of the Sandbox environment
9for /f "tokens=2 delims=[]" %%a in ('ping -n 1 -4 ""') do set IPAddr=%%a 9for /f "tokens=2 delims=[]" %%a in ('ping -n 1 -4 ""') do set IPAddr=%%a
10@if %PROCESSOR_ARCHITECTURE%=="ARM64" ( 10@if %PROCESSOR_ARCHITECTURE%=="ARM64" (
11 @if exist C:\sandbox\Debugger\ARM64\msvsmon.exe ( 11 @if exist C:\sandbox\assets\Debugger\ARM64\msvsmon.exe (
12 set "MsVsMonPath=C:\sandbox\Debugger\ARM64\msvsmon.exe /noauth /anyuser /nosecuritywarn" 12 set "MsVsMonPath=C:\sandbox\assets\Debugger\ARM64\msvsmon.exe /noauth /anyuser /nosecuritywarn"
13 ) 13 )
14) else ( 14) else (
15 @if exist C:\sandbox\Debugger\x64\msvsmon.exe ( 15 @if exist C:\sandbox\assets\Debugger\x64\msvsmon.exe (
16 set "MsVsMonPath=C:\sandbox\Debugger\x64\msvsmon.exe /noauth /anyuser /nosecuritywarn" 16 set "MsVsMonPath=C:\sandbox\assets\Debugger\x64\msvsmon.exe /noauth /anyuser /nosecuritywarn"
17 ) 17 )
18) 18)
19FOR /F "tokens=* USEBACKQ" %%F IN (`powershell -Command "[System.Net.Dns]::GetHostEntry('localhost').HostName"`) DO ( 19FOR /F "tokens=* USEBACKQ" %%F IN (`powershell -Command "[System.Net.Dns]::GetHostEntry('localhost').HostName"`) DO (
diff --git a/src/test/sandbox/setup_sandbox.bat b/src/test/sandbox/setup_sandbox.bat
index dc462324..fac7ec4c 100644
--- a/src/test/sandbox/setup_sandbox.bat
+++ b/src/test/sandbox/setup_sandbox.bat
@@ -1,4 +1,4 @@
1@setlocal 1@setlocal enabledelayedexpansion
2@echo off 2@echo off
3SET DOTNET_VERSION=8.0 3SET DOTNET_VERSION=8.0
4 4
@@ -20,19 +20,28 @@ goto MENU
20 20
21:EXE 21:EXE
22echo EXE> dotnet.cfg 22echo EXE> dotnet.cfg
23if not exist .\assets mkdir .\assets
23if %PROCESSOR_ARCHITECTURE%=="ARM64" ( 24if %PROCESSOR_ARCHITECTURE%=="ARM64" (
24 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.exe --output ".\dotnet-sdk.exe" 25 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.exe --output ".\assets\dotnet-sdk-64.exe"
26 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-arm64.exe --output ".\assets\windowsdesktop-runtime-64.exe"
25) else ( 27) else (
26 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.exe --output ".\dotnet-sdk.exe" 28 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.exe --output ".\assets\dotnet-sdk-64.exe"
29 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-x86.exe --output ".\assets\windowsdesktop-runtime-x86.exe"
30 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-x64.exe --output ".\assets\windowsdesktop-runtime-64.exe"
27) 31)
28goto VSDEBUG 32goto VSDEBUG
29 33
30:ZIP 34:ZIP
31echo ZIP> dotnet.cfg 35echo ZIP> dotnet.cfg
36if not exist .\assets mkdir .\assets
32if %PROCESSOR_ARCHITECTURE%=="ARM64" ( 37if %PROCESSOR_ARCHITECTURE%=="ARM64" (
33 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output ".\dotnet-sdk.zip" 38 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output ".\assets\dotnet-sdk-64.zip"
39 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-arm64.zip --output ".\assets\windowsdesktop-runtime-64.zip"
34) else ( 40) else (
35 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output ".\dotnet-sdk.zip" 41 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output ".\assets\dotnet-sdk-64.zip"
42 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-x64.zip --output ".\assets\windowsdesktop-runtime-64.zip"
43 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-x86.zip --output ".\assets\dotnet-runtime-x86.zip"
44 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-x86.zip --output ".\assets\windowsdesktop-runtime-x86.zip"
36) 45)
37goto VSDEBUG 46goto VSDEBUG
38 47
@@ -49,15 +58,15 @@ if not "!VsInstallDir!"=="" (
49 echo. 58 echo.
50 echo Have found VisualStudio Debugger at '%VsInstallDir%' 59 echo Have found VisualStudio Debugger at '%VsInstallDir%'
51 set /P "Confirm=Do you wish to copy it for use by the Sandbox? (Y / N):" 60 set /P "Confirm=Do you wish to copy it for use by the Sandbox? (Y / N):"
52 if "%Confirm%"=="Y" goto VSDEBUG_COPY 61 if "!Confirm!"=="Y" goto VSDEBUG_COPY
53 if "%Confirm%"=="y" goto VSDEBUG_COPY 62 if "!Confirm!"=="y" goto VSDEBUG_COPY
54 goto END 63 goto END
55) 64)
56goto END 65goto END
57 66
58:VSDEBUG_COPY 67:VSDEBUG_COPY
59if not exist Debugger (mkdir Debugger) 68if not exist ".\assets\Debugger" (mkdir ".\assets\Debugger")
60XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\Debugger\" /E /Y > nul 69XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\assets\Debugger\" /E /Y > nul
61echo Debugger files copied 70echo Debugger files copied
62 71
63 72
diff --git a/src/test/sandbox/startup.bat b/src/test/sandbox/startup.bat
index 7b9b603f..8feaddd1 100644
--- a/src/test/sandbox/startup.bat
+++ b/src/test/sandbox/startup.bat
@@ -12,44 +12,45 @@ goto ERROR_NO_CONFIG
12 12
13:ZIP 13:ZIP
14mkdir "%ProgramFiles%\dotnet" 14mkdir "%ProgramFiles%\dotnet"
15if exist %SANDBOX_FILES%\dotnet-sdk.zip ( 15if exist %SANDBOX_FILES%\assets\dotnet-sdk-64.zip (
16 tar -oxzf "%SANDBOX_FILES%\dotnet-sdk.zip" -C "%ProgramFiles%\dotnet" 16 tar -oxzf "%SANDBOX_FILES%\assets\dotnet-sdk-64.zip" -C "%ProgramFiles%\dotnet"
17) else ( 17) else (
18 if %PROCESSOR_ARCHITECTURE%=="ARM64" ( 18 goto ERROR_NO_DOTNET
19 curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output dotnet-sdk.zip 19)
20 ) else ( 20if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-64.zip (
21 curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output dotnet-sdk.zip 21 tar -oxzf "%SANDBOX_FILES%\assets\windowsdesktop-runtime-64.zip" -C "%ProgramFiles%\dotnet"
22 ) 22) else (
23 if %errorlevel% NEQ 0 ( 23 goto ERROR_NO_DOTNET
24 echo "No pre-provided dotnet sdk, and failed to download. Confirm networking is available." 24)
25 goto ERROR_NO_DOTNET 25if exist %SANDBOX_FILES%\assets\dotnet-runtime-x86.zip (
26 ) 26 mkdir "%ProgramFiles(x86)%\dotnet"
27 tar -oxzf dotnet-sdk.zip -C "%ProgramFiles%\dotnet" 27 tar -oxzf "%SANDBOX_FILES%\assets\dotnet-runtime-x86.zip" -C "%ProgramFiles(x86)%\dotnet"
28 del dotnet-sdk.zip 28)
29if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.zip (
30 tar -oxzf "%SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.zip" -C "%ProgramFiles(x86)%\dotnet"
29) 31)
30goto PROCEED 32goto PROCEED
31 33
32:EXE 34:EXE
33if exist %SANDBOX_FILES%\dotnet-sdk.exe ( 35if exist %SANDBOX_FILES%\assets\dotnet-sdk-64.exe (
34 "%SANDBOX_FILES%\dotnet-sdk.exe" /install /quiet /norestart 36 "%SANDBOX_FILES%\assets\dotnet-sdk-64.exe" /install /quiet /norestart
35) else ( 37) else (
36 if %PROCESSOR_ARCHITECTURE%=="ARM64" ( 38 goto ERROR_NO_DOTNET
37 curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.exe --output dotnet-sdk.exe 39)
38 ) else ( 40if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-64.exe (
39 curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.exe --output dotnet-sdk.exe 41 "%SANDBOX_FILES%\assets\windowsdesktop-runtime-64.exe" /install /quiet /norestart
40 ) 42) else (
41 if %errorlevel% NEQ 0 ( 43 goto ERROR_NO_DOTNET
42 echo "No pre-provided dotnet sdk, and failed to download. Confirm networking is available." 44)
43 goto ERROR_NO_DOTNET 45if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.exe (
44 ) 46 "%SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.exe" /install /quiet /norestart
45 dotnet-sdk.exe /install /quiet /norestart
46) 47)
47goto PROCEED 48goto PROCEED
48 49
49:PROCEED 50:PROCEED
50endlocal 51endlocal
51SETX PATH "%PATH%;%ProgramFiles%\dotnet" /M 52SETX PATH "%PATH%;%ProgramFiles%\dotnet;%ProgramFiles(x86)%\dotnet" /M
52SET PATH=%PATH%;%ProgramFiles%\dotnet 53SET PATH=%PATH%;%ProgramFiles%\dotnet;%ProgramFiles(x86)%\dotnet
53 54
54dotnet nuget locals all --clear 55dotnet nuget locals all --clear
55dotnet help 56dotnet help
@@ -65,6 +66,6 @@ goto END
65 66
66 67
67:ERROR_NO_DOTNET 68:ERROR_NO_DOTNET
68start "ERROR" CMD /c echo ERROR: Failed to find dotnet install, and download failed. Run setup_sandbox.bat again ^& pause 69start "ERROR" CMD /c echo ERROR: Failed to find dotnet install files. Run setup_sandbox.bat again ^& pause
69 70
70:END 71:END