aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorBevan Weiss <bevan.weiss@gmail.com>2024-06-26 18:41:08 +1000
committerBob Arnson <github@bobs.org>2024-07-04 19:25:49 -0400
commit83d92ef88270a740bc96609f8d967986e4f91e99 (patch)
treefe41ddf912436110128ecc6fbd8d303bd7db260b /src/test
parent89dc7b47809da06a69811788a1a990e216b81a5c (diff)
downloadwix-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')
-rw-r--r--src/test/sandbox/README2
-rw-r--r--src/test/sandbox/setup_sandbox.bat59
-rw-r--r--src/test/sandbox/startup.bat67
3 files changed, 88 insertions, 40 deletions
diff --git a/src/test/sandbox/README b/src/test/sandbox/README
new file mode 100644
index 00000000..dd5a1e04
--- /dev/null
+++ b/src/test/sandbox/README
@@ -0,0 +1,2 @@
11. Run setup_sandbox.bat from the Host, pick whether you want to use the EXE or the ZIP to install Dotnet. The chosen option will be automatically downloaded.
22. Once you have built Wix Toolset and wish to perform integration testing, you can just launch the Sandbox by double-clicking (or executing) TestSandbox.wsb \ No newline at end of file
diff --git a/src/test/sandbox/setup_sandbox.bat b/src/test/sandbox/setup_sandbox.bat
index c4378f52..dc462324 100644
--- a/src/test/sandbox/setup_sandbox.bat
+++ b/src/test/sandbox/setup_sandbox.bat
@@ -2,20 +2,41 @@
2@echo off 2@echo off
3SET DOTNET_VERSION=8.0 3SET DOTNET_VERSION=8.0
4 4
5if not exist AMD64 (mkdir AMD64) 5:MENU
6if not exist ARM64 (mkdir ARM64) 6cls
7REM if not exist VSTest (mkdir VSTest) 7echo [0] Setup EXE install of DotNet for Sandbox
8 8echo [1] Setup ZIP install of DotNet for Sandbox
9@echo on 9echo [q] Quit
10REM curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-x64.zip --output ".\AMD64\dotnet-runtime.zip" 10set /P "Option=Please select install option: "
11curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output ".\AMD64\dotnet-sdk.zip" 11if "%Option%"=="q" goto END
12REM curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-arm64.zip --output ".\ARM64\dotnet-runtime.zip" 12if "%Option%"=="0" goto EXE
13curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output ".\ARM64\dotnet-sdk.zip" 13if "%Option%"=="1" goto ZIP
14@echo off 14
15:MENUERROR
16cls
17echo ERROR: Invalid Option Selected!!
18pause
19goto MENU
20
21:EXE
22echo EXE> dotnet.cfg
23if %PROCESSOR_ARCHITECTURE%=="ARM64" (
24 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.exe --output ".\dotnet-sdk.exe"
25) else (
26 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.exe --output ".\dotnet-sdk.exe"
27)
28goto VSDEBUG
15 29
16REM curl -L0 https://aka.ms/vs/17/release/RemoteTools.amd64ret.enu.exe --output ".\AMD64\RemoteTools.exe" 30:ZIP
17REM curl -L0 https://aka.ms/vs/17/release/RemoteTools.arm64ret.enu.exe --output ".\ARM64\RemoteTools.exe" 31echo ZIP> dotnet.cfg
32if %PROCESSOR_ARCHITECTURE%=="ARM64" (
33 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output ".\dotnet-sdk.zip"
34) else (
35 curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output ".\dotnet-sdk.zip"
36)
37goto VSDEBUG
18 38
39:VSDEBUG
19for /f "usebackq tokens=*" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Debugger.Remote -property installationPath`) do ( 40for /f "usebackq tokens=*" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Debugger.Remote -property installationPath`) do (
20 set VsInstallDir=%%i 41 set VsInstallDir=%%i
21) 42)
@@ -28,12 +49,18 @@ if not "!VsInstallDir!"=="" (
28 echo. 49 echo.
29 echo Have found VisualStudio Debugger at '%VsInstallDir%' 50 echo Have found VisualStudio Debugger at '%VsInstallDir%'
30 set /P "Confirm=Do you wish to copy it for use by the Sandbox? (Y / N):" 51 set /P "Confirm=Do you wish to copy it for use by the Sandbox? (Y / N):"
31 echo Confirm = %Confirm% 52 if "%Confirm%"=="Y" goto VSDEBUG_COPY
32 @if "%Confirm%"=="Y" or "%Confirm%"="y" ( 53 if "%Confirm%"=="y" goto VSDEBUG_COPY
33 XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\Debugger\" /E /Y 54 goto END
34 )
35) 55)
56goto END
57
58:VSDEBUG_COPY
59if not exist Debugger (mkdir Debugger)
60XCOPY "%VsInstallDir%\Common7\IDE\Remote Debugger\*" ".\Debugger\" /E /Y > nul
61echo Debugger files copied
36 62
37 63
64:END
38pause 65pause
39@endlocal 66@endlocal
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
2SET DOTNET_VERSION=8.0 3SET DOTNET_VERSION=8.0
3SET SANDBOX_FILES=C:\sandbox 4SET SANDBOX_FILES=C:\sandbox
4 5
6set /p InstallMethod=<%SANDBOX_FILES%\dotnet.cfg
7
5pushd "%TEMP%" 8pushd "%TEMP%"
9if "%InstallMethod%"=="EXE" goto EXE
10if "%InstallMethod%"=="ZIP" goto ZIP
11goto ERROR_NO_CONFIG
6 12
13:ZIP
7mkdir "%ProgramFiles%\dotnet" 14mkdir "%ProgramFiles%\dotnet"
8REM @if exist %SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-runtime.zip ( 15if exist %SANDBOX_FILES%\dotnet-sdk.zip (
9REM tar -oxzf "%SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-runtime.zip" -C "%ProgramFiles%\dotnet" 16 tar -oxzf "%SANDBOX_FILES%\dotnet-sdk.zip" -C "%ProgramFiles%\dotnet"
10REM ) else (
11REM if %PROCESSOR_ARCHITECTURE%=="ARM64" (
12REM curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-arm64.zip --output dotnet-runtime.zip
13REM ) else (
14REM curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-x64.zip --output dotnet-runtime.zip
15REM )
16REM if %errorlevel% NEQ 0 (
17REM echo No pre-provided dotnet runtime, and failed to download. Confirm networking is available.
18REM goto :ERROR
19REM )
20REM tar -oxzf dotnet-runtime.zip -C "%ProgramFiles%\dotnet"
21REM del dotnet-runtime.zip
22REM )
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)
30goto PROCEED
39 31
40@endlocal 32:EXE
33if 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)
47goto PROCEED
48
49:PROCEED
50endlocal
41SETX PATH "%PATH%;%ProgramFiles%\dotnet" /M 51SETX PATH "%PATH%;%ProgramFiles%\dotnet" /M
42SET PATH=%PATH%;%ProgramFiles%\dotnet 52SET PATH=%PATH%;%ProgramFiles%\dotnet
53
43dotnet nuget locals all --clear 54dotnet nuget locals all --clear
44dotnet help 55dotnet help
45 56
57popd
58cd c:\build
59start "Menu" cmd /c C:\sandbox\runtest_menu.bat
60goto END
46 61
47:ERROR 62:ERROR_NO_CONFIG
63start "ERROR" CMD /c echo ERROR: Host configuration has not been run, run setup_sandbox.bat first ^& pause
64goto END
48 65
49@popd 66
50cd c:\build 67:ERROR_NO_DOTNET
51start cmd /c C:\sandbox\runtest_menu.bat 68start "ERROR" CMD /c echo ERROR: Failed to find dotnet install, and download failed. Run setup_sandbox.bat again ^& pause
69
70:END