main
bat 75 lines 2.93 KB
Raw
1 @setlocal enabledelayedexpansion
2 @echo off
3 SET DOTNET_VERSION=8.0
4
5 :MENU
6 cls
7 echo [0] Setup EXE install of DotNet for Sandbox
8 echo [1] Setup ZIP install of DotNet for Sandbox
9 echo [q] Quit
10 set /P "Option=Please select install option: "
11 if "%Option%"=="q" goto END
12 if "%Option%"=="0" goto EXE
13 if "%Option%"=="1" goto ZIP
14
15 :MENUERROR
16 cls
17 echo ERROR: Invalid Option Selected!!
18 pause
19 goto MENU
20
21 :EXE
22 echo EXE> dotnet.cfg
23 if not exist .\assets mkdir .\assets
24 if %PROCESSOR_ARCHITECTURE%=="ARM64" (
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 (
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" (
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 (
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
48 :VSDEBUG
49 for /f "usebackq tokens=*" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Debugger.Remote -property installationPath`) do (
50 set VsInstallDir=%%i
51 )
52 if "!VsInstallDir!"=="" (
53 for /f "usebackq tokens=*" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease -latest -requires Microsoft.VisualStudio.Debugger.Remote -property installationPath`) do (
54 set VsInstallDir=%%i
55 )
56 )
57 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):"
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
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
73 :END
74 pause
75 @endlocal