-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathInstall.bat
More file actions
35 lines (24 loc) · 791 Bytes
/
Copy pathInstall.bat
File metadata and controls
35 lines (24 loc) · 791 Bytes
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
@echo off
setlocal enableextensions enabledelayedexpansion
pushd %~dp0
rem try to find MSBuild in VS2017
rem the "correct" way is to use a COM API. not easy here.
FOR %%E in (Enterprise, Professional, Community) DO (
set "MSBUILD_EXE=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\%%E\MSBuild\15.0\Bin\MSBuild.exe"
if exist "!MSBUILD_EXE!" goto :build
)
echo Could not find MSBuild 15
popd
exit /b 1
:build
set "CONFIG=Release"
set "PLATFORM=Any CPU"
"%MSBUILD_EXE%" /target:Restore "/p:Configuration=%CONFIG%" "/p:Platform=%PLATFORM%" %* || goto :error
"%MSBUILD_EXE%" /m "/p:Configuration=%CONFIG%" "/p:Platform=%PLATFORM%" /p:InstallAddin=True %* || goto :error
goto :exit
:error
for %%x in (%CMDCMDLINE%) do if /i "%%~x" == "/c" pause
popd
exit /b %ERRORLEVEL%
:exit
popd