2020-06-12 00:18:40 +03:00
|
|
|
@echo off
|
2020-06-17 04:17:32 +03:00
|
|
|
setlocal enabledelayedexpansion
|
2020-06-04 06:51:06 +03:00
|
|
|
|
|
|
|
:: This command launches a Visual Studio solution with environment variables required to use a local version of the .NET Core SDK.
|
|
|
|
|
|
|
|
:: This tells .NET Core to use the same dotnet.exe that build scripts use
|
2020-06-12 00:18:40 +03:00
|
|
|
set DOTNET_ROOT=%~dp0.dotnet
|
|
|
|
set DOTNET_ROOT(x86)=%~dp0.dotnet\x86
|
2020-06-04 06:51:06 +03:00
|
|
|
|
|
|
|
:: This tells .NET Core not to go looking for .NET Core in other places
|
2020-06-12 00:18:40 +03:00
|
|
|
set DOTNET_MULTILEVEL_LOOKUP=0
|
2020-06-04 06:51:06 +03:00
|
|
|
|
|
|
|
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
|
2020-06-12 00:18:40 +03:00
|
|
|
set PATH=%DOTNET_ROOT%;%PATH%
|
2020-06-04 06:51:06 +03:00
|
|
|
|
2020-09-25 18:06:34 +03:00
|
|
|
call restore.cmd
|
|
|
|
|
2020-06-12 00:18:40 +03:00
|
|
|
if not exist "%DOTNET_ROOT%\dotnet.exe" (
|
2020-06-04 06:51:06 +03:00
|
|
|
echo [ERROR] .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
|
2020-06-12 00:18:40 +03:00
|
|
|
:: Prefer the VS in the developer command prompt if we're in one, followed by whatever shows up in the current search path.
|
2020-06-17 04:17:32 +03:00
|
|
|
set "DEVENV=%DevEnvDir%devenv.exe"
|
|
|
|
|
|
|
|
if exist "%DEVENV%" (
|
|
|
|
:: Fully qualified works
|
2020-06-24 01:10:54 +03:00
|
|
|
set "COMMAND=start "" /B "%ComSpec%" /S /C ""%DEVENV%" "%~dp0Winforms.sln"""
|
2020-06-17 04:17:32 +03:00
|
|
|
) else (
|
|
|
|
where devenv.exe /Q
|
|
|
|
if !errorlevel! equ 0 (
|
|
|
|
:: On the PATH, use that.
|
2020-06-24 01:10:54 +03:00
|
|
|
set "COMMAND=start "" /B "%ComSpec%" /S /C "devenv.exe "%~dp0Winforms.sln"""
|
2020-06-17 04:17:32 +03:00
|
|
|
) else (
|
2020-06-12 00:18:40 +03:00
|
|
|
:: Can't find devenv.exe, let file associations take care of it
|
2020-06-17 04:17:32 +03:00
|
|
|
set "COMMAND=start /B .\Winforms.sln"
|
2020-06-12 00:18:40 +03:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2020-06-17 04:17:32 +03:00
|
|
|
%COMMAND%
|