forked from dotnet/diagnostics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-vs.cmd
37 lines (29 loc) · 913 Bytes
/
start-vs.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@echo off
setlocal enabledelayedexpansion
set "SDK_LOC=%~dp0.dotnet"
set "SLN_OR_PROJ=%~dp0diagnostics.sln"
set "DOTNET_ROOT=%SDK_LOC%"
set "DOTNET_ROOT(x86)=%SDK_LOC%\x86"
set DOTNET_MULTILEVEL_LOOKUP=0
set "DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=%DOTNET_ROOT%"
set PATH=%DOTNET_ROOT%;%PATH%
:: Restore before doing this
if not exist "%DOTNET_ROOT%\dotnet.exe" (
echo [ERROR] SDK has not yet been installed.
exit /b 1
)
set "DEVENV=%DevEnvDir%devenv.exe"
if exist "%DEVENV%" (
:: Fully qualified works
set "COMMAND=start "" /B "%ComSpec%" /S /C ""%DEVENV%" "%SLN_OR_PROJ%"""
) else (
where devenv.exe /Q
if !errorlevel! equ 0 (
:: On the PATH, use that.
set "COMMAND=start "" /B "%ComSpec%" /S /C "devenv.exe "%SLN_OR_PROJ%"""
) else (
:: Can't find VS, let file associations take care of it
set "COMMAND=start /B %SLN_OR_PROJ%"
)
)
%COMMAND%