Skip to content

Commit

Permalink
No longer support downloading within the Sandbox. Just error instead.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bevanweiss committed Jun 27, 2024
1 parent 19d411b commit 8110f4a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 41 deletions.
8 changes: 4 additions & 4 deletions src/test/sandbox/runtest_menu.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ REM If we do offer the debugger, we better show the IP address too, since it see
REM to change for each invocation of the Sandbox environment
for /f "tokens=2 delims=[]" %%a in ('ping -n 1 -4 ""') do set IPAddr=%%a
@if %PROCESSOR_ARCHITECTURE%=="ARM64" (
@if exist C:\sandbox\Debugger\ARM64\msvsmon.exe (
set "MsVsMonPath=C:\sandbox\Debugger\ARM64\msvsmon.exe /noauth /anyuser /nosecuritywarn"
@if exist C:\sandbox\assets\Debugger\ARM64\msvsmon.exe (
set "MsVsMonPath=C:\sandbox\assets\Debugger\ARM64\msvsmon.exe /noauth /anyuser /nosecuritywarn"
)
) else (
@if exist C:\sandbox\Debugger\x64\msvsmon.exe (
set "MsVsMonPath=C:\sandbox\Debugger\x64\msvsmon.exe /noauth /anyuser /nosecuritywarn"
@if exist C:\sandbox\assets\Debugger\x64\msvsmon.exe (
set "MsVsMonPath=C:\sandbox\assets\Debugger\x64\msvsmon.exe /noauth /anyuser /nosecuritywarn"
)
)
FOR /F "tokens=* USEBACKQ" %%F IN (`powershell -Command "[System.Net.Dns]::GetHostEntry('localhost').HostName"`) DO (
Expand Down
27 changes: 18 additions & 9 deletions src/test/sandbox/setup_sandbox.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@setlocal
@setlocal enabledelayedexpansion
@echo off
SET DOTNET_VERSION=8.0

Expand All @@ -20,19 +20,28 @@ goto MENU

:EXE
echo EXE> dotnet.cfg
if not exist .\assets mkdir .\assets
if %PROCESSOR_ARCHITECTURE%=="ARM64" (
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.exe --output ".\dotnet-sdk.exe"
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.exe --output ".\assets\dotnet-sdk-64.exe"
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-arm64.exe --output ".\assets\windowsdesktop-runtime-64.exe"
) else (
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.exe --output ".\dotnet-sdk.exe"
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.exe --output ".\assets\dotnet-sdk-64.exe"
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-x86.exe --output ".\assets\windowsdesktop-runtime-x86.exe"
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-x64.exe --output ".\assets\windowsdesktop-runtime-64.exe"
)
goto VSDEBUG

:ZIP
echo ZIP> dotnet.cfg
if not exist .\assets mkdir .\assets
if %PROCESSOR_ARCHITECTURE%=="ARM64" (
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output ".\dotnet-sdk.zip"
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output ".\assets\dotnet-sdk-64.zip"
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-arm64.zip --output ".\assets\windowsdesktop-runtime-64.zip"
) else (
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output ".\dotnet-sdk.zip"
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output ".\assets\dotnet-sdk-64.zip"
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-x64.zip --output ".\assets\windowsdesktop-runtime-64.zip"
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-x86.zip --output ".\assets\dotnet-runtime-x86.zip"
curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/windowsdesktop-runtime-win-x86.zip --output ".\assets\windowsdesktop-runtime-x86.zip"
)
goto VSDEBUG

Expand All @@ -49,15 +58,15 @@ if not "!VsInstallDir!"=="" (
echo.
echo Have found VisualStudio Debugger at '%VsInstallDir%'
set /P "Confirm=Do you wish to copy it for use by the Sandbox? (Y / N):"
if "%Confirm%"=="Y" goto VSDEBUG_COPY
if "%Confirm%"=="y" goto VSDEBUG_COPY
if "!Confirm!"=="Y" goto VSDEBUG_COPY
if "!Confirm!"=="y" goto VSDEBUG_COPY
goto END
)
goto END

:VSDEBUG_COPY
if not exist Debugger (mkdir Debugger)
XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\Debugger\" /E /Y > nul
if not exist ".\assets\Debugger" (mkdir ".\assets\Debugger")
XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\assets\Debugger\" /E /Y > nul
echo Debugger files copied


Expand Down
57 changes: 29 additions & 28 deletions src/test/sandbox/startup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,45 @@ goto ERROR_NO_CONFIG

:ZIP
mkdir "%ProgramFiles%\dotnet"
if exist %SANDBOX_FILES%\dotnet-sdk.zip (
tar -oxzf "%SANDBOX_FILES%\dotnet-sdk.zip" -C "%ProgramFiles%\dotnet"
if exist %SANDBOX_FILES%\assets\dotnet-sdk-64.zip (
tar -oxzf "%SANDBOX_FILES%\assets\dotnet-sdk-64.zip" -C "%ProgramFiles%\dotnet"
) else (
if %PROCESSOR_ARCHITECTURE%=="ARM64" (
curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output dotnet-sdk.zip
) else (
curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output dotnet-sdk.zip
)
if %errorlevel% NEQ 0 (
echo "No pre-provided dotnet sdk, and failed to download. Confirm networking is available."
goto ERROR_NO_DOTNET
)
tar -oxzf dotnet-sdk.zip -C "%ProgramFiles%\dotnet"
del dotnet-sdk.zip
goto ERROR_NO_DOTNET
)
if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-64.zip (
tar -oxzf "%SANDBOX_FILES%\assets\windowsdesktop-runtime-64.zip" -C "%ProgramFiles%\dotnet"
) else (
goto ERROR_NO_DOTNET
)
if exist %SANDBOX_FILES%\assets\dotnet-runtime-x86.zip (
mkdir "%ProgramFiles(x86)%\dotnet"
tar -oxzf "%SANDBOX_FILES%\assets\dotnet-runtime-x86.zip" -C "%ProgramFiles(x86)%\dotnet"
)
if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.zip (
tar -oxzf "%SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.zip" -C "%ProgramFiles(x86)%\dotnet"
)
goto PROCEED

:EXE
if exist %SANDBOX_FILES%\dotnet-sdk.exe (
"%SANDBOX_FILES%\dotnet-sdk.exe" /install /quiet /norestart
if exist %SANDBOX_FILES%\assets\dotnet-sdk-64.exe (
"%SANDBOX_FILES%\assets\dotnet-sdk-64.exe" /install /quiet /norestart
) else (
if %PROCESSOR_ARCHITECTURE%=="ARM64" (
curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.exe --output dotnet-sdk.exe
) else (
curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.exe --output dotnet-sdk.exe
)
if %errorlevel% NEQ 0 (
echo "No pre-provided dotnet sdk, and failed to download. Confirm networking is available."
goto ERROR_NO_DOTNET
)
dotnet-sdk.exe /install /quiet /norestart
goto ERROR_NO_DOTNET
)
if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-64.exe (
"%SANDBOX_FILES%\assets\windowsdesktop-runtime-64.exe" /install /quiet /norestart
) else (
goto ERROR_NO_DOTNET
)
if exist %SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.exe (
"%SANDBOX_FILES%\assets\windowsdesktop-runtime-x86.exe" /install /quiet /norestart
)
goto PROCEED

:PROCEED
endlocal
SETX PATH "%PATH%;%ProgramFiles%\dotnet" /M
SET PATH=%PATH%;%ProgramFiles%\dotnet
SETX PATH "%PATH%;%ProgramFiles%\dotnet;%ProgramFiles(x86)%\dotnet" /M
SET PATH=%PATH%;%ProgramFiles%\dotnet;%ProgramFiles(x86)%\dotnet

dotnet nuget locals all --clear
dotnet help
Expand All @@ -65,6 +66,6 @@ goto END


:ERROR_NO_DOTNET
start "ERROR" CMD /c echo ERROR: Failed to find dotnet install, and download failed. Run setup_sandbox.bat again ^& pause
start "ERROR" CMD /c echo ERROR: Failed to find dotnet install files. Run setup_sandbox.bat again ^& pause

:END

0 comments on commit 8110f4a

Please sign in to comment.