@joebigelow / wix-1 / commits / 596b4c4a

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>

Bevan Weiss committed Jun 27, 2024 at 18:34 UTC 596b4c4ae90b757b069a97ef40de67a7d1f9ab73
3 files changed +51 -41
src/test/sandbox/runtest_menu.bat
+4 -4
@@ -8,12 +8,12 @@ REM If we do offer the debugger, we better show the IP address too, since it see
8 REM to change for each invocation of the Sandbox environment
9 for /f "tokens=2 delims=[]" %%a in ('ping -n 1 -4 ""') do set IPAddr=%%a
10 @if %PROCESSOR_ARCHITECTURE%=="ARM64" (
11 - @if exist C:\sandbox\Debugger\ARM64\msvsmon.exe (
12 - set "MsVsMonPath=C:\sandbox\Debugger\ARM64\msvsmon.exe /noauth /anyuser /nosecuritywarn"
11 + @if exist C:\sandbox\assets\Debugger\ARM64\msvsmon.exe (
12 + set "MsVsMonPath=C:\sandbox\assets\Debugger\ARM64\msvsmon.exe /noauth /anyuser /nosecuritywarn"
13 )
14 ) else (
15 - @if exist C:\sandbox\Debugger\x64\msvsmon.exe (
16 - set "MsVsMonPath=C:\sandbox\Debugger\x64\msvsmon.exe /noauth /anyuser /nosecuritywarn"
15 + @if exist C:\sandbox\assets\Debugger\x64\msvsmon.exe (
16 + set "MsVsMonPath=C:\sandbox\assets\Debugger\x64\msvsmon.exe /noauth /anyuser /nosecuritywarn"
17 )
18 )
19 FOR /F "tokens=* USEBACKQ" %%F IN (`powershell -Command "[System.Net.Dns]::GetHostEntry('localhost').HostName"`) DO (
src/test/sandbox/setup_sandbox.bat
+18 -9
@@ -1,4 +1,4 @@
1 -@setlocal
1 +@setlocal enabledelayedexpansion
2 @echo off
3 SET DOTNET_VERSION=8.0
4
@@ -20,19 +20,28 @@ goto MENU
20
21 :EXE
22 echo EXE> dotnet.cfg
23 +if not exist .\assets mkdir .\assets
24 if %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"
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"
31 )
32 goto VSDEBUG
33
34 :ZIP
35 echo ZIP> dotnet.cfg
36 +if not exist .\assets mkdir .\assets
37 if %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"
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"
45 )
46 goto VSDEBUG
47
@@ -49,15 +58,15 @@ if not "!VsInstallDir!"=="" (
58 echo.
59 echo Have found VisualStudio Debugger at '%VsInstallDir%'
60 set /P "Confirm=Do you wish to copy it for use by the Sandbox? (Y / N):"
52 - if "%Confirm%"=="Y" goto VSDEBUG_COPY
53 - if "%Confirm%"=="y" goto VSDEBUG_COPY
61 + if "!Confirm!"=="Y" goto VSDEBUG_COPY
62 + if "!Confirm!"=="y" goto VSDEBUG_COPY
63 goto END
64 )
65 goto END
66
67 :VSDEBUG_COPY
59 -if not exist Debugger (mkdir Debugger)
60 -XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\Debugger\" /E /Y > nul
68 +if not exist ".\assets\Debugger" (mkdir ".\assets\Debugger")
69 +XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\assets\Debugger\" /E /Y > nul
70 echo Debugger files copied
71
72
src/test/sandbox/startup.bat
+29 -28
@@ -12,44 +12,45 @@ goto ERROR_NO_CONFIG
12
13 :ZIP
14 mkdir "%ProgramFiles%\dotnet"
15 -if exist %SANDBOX_FILES%\dotnet-sdk.zip (
16 - tar -oxzf "%SANDBOX_FILES%\dotnet-sdk.zip" -C "%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 - if %PROCESSOR_ARCHITECTURE%=="ARM64" (
19 - curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output dotnet-sdk.zip
20 - ) else (
21 - curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output dotnet-sdk.zip
22 - )
23 - if %errorlevel% NEQ 0 (
24 - echo "No pre-provided dotnet sdk, and failed to download. Confirm networking is available."
25 - goto ERROR_NO_DOTNET
26 - )
27 - tar -oxzf dotnet-sdk.zip -C "%ProgramFiles%\dotnet"
28 - del dotnet-sdk.zip
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
33 -if exist %SANDBOX_FILES%\dotnet-sdk.exe (
34 - "%SANDBOX_FILES%\dotnet-sdk.exe" /install /quiet /norestart
35 +if exist %SANDBOX_FILES%\assets\dotnet-sdk-64.exe (
36 + "%SANDBOX_FILES%\assets\dotnet-sdk-64.exe" /install /quiet /norestart
37 ) 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
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 endlocal
51 -SETX PATH "%PATH%;%ProgramFiles%\dotnet" /M
52 -SET PATH=%PATH%;%ProgramFiles%\dotnet
52 +SETX PATH "%PATH%;%ProgramFiles%\dotnet;%ProgramFiles(x86)%\dotnet" /M
53 +SET PATH=%PATH%;%ProgramFiles%\dotnet;%ProgramFiles(x86)%\dotnet
54
55 dotnet nuget locals all --clear
56 dotnet help
@@ -65,6 +66,6 @@ goto END
66
67
68 :ERROR_NO_DOTNET
68 -start "ERROR" CMD /c echo ERROR: Failed to find dotnet install, and download failed. Run setup_sandbox.bat again ^& pause
69 +start "ERROR" CMD /c echo ERROR: Failed to find dotnet install files. Run setup_sandbox.bat again ^& pause
70
71 :END