Skip to content

Commit 44ab4f0

Browse files
joaocgreisgibfahn
authored andcommitted
build,win,msi: support WiX with VS2017
PR-URL: #17101 Reviewed-By: Nikolai Vavilov <[email protected]>
1 parent 8a000e8 commit 44ab4f0

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

BUILDING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ Prerequisites:
218218
* Basic Unix tools required for some tests,
219219
[Git for Windows](http://git-scm.com/download/win) includes Git Bash
220220
and tools which can be included in the global `PATH`.
221+
* **Optional** (to build the MSI): the [WiX Toolset v3.11](http://wixtoolset.org/releases/)
222+
and the [Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension).
221223

222224
If the path to your build directory contains a space, the build will likely fail.
223225

vcbuild.bat

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,24 @@ if %target_arch%==x64 if %msvs_host_arch%==amd64 set vcvarsall_arg=amd64
187187
:vs-set-2017
188188
if defined target_env if "%target_env%" NEQ "vs2017" goto vs-set-2015
189189
echo Looking for Visual Studio 2017
190+
call tools\msvs\vswhere_usability_wrapper.cmd
191+
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
192+
if defined msi (
193+
echo Looking for WiX installation for Visual Studio 2017...
194+
if not exist "%WIX%\SDK\VS2017" (
195+
echo Failed to find WiX install for Visual Studio 2017
196+
echo VS2017 support for WiX is only present starting at version 3.11
197+
goto vs-set-2015
198+
)
199+
if not exist "%VCINSTALLDIR%\..\MSBuild\Microsoft\WiX" (
200+
echo Failed to find the Wix Toolset Visual Studio 2017 Extension
201+
goto vs-set-2015
202+
)
203+
)
190204
@rem check if VS2017 is already setup, and for the requested arch
191205
if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2017
192206
@rem need to clear VSINSTALLDIR for vcvarsall to work as expected
193207
set "VSINSTALLDIR="
194-
call tools\msvs\vswhere_usability_wrapper.cmd
195-
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
196208
@rem prevent VsDevCmd.bat from changing the current working directory
197209
set "VSCMD_START_DIR=%CD%"
198210
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg%
@@ -349,7 +361,9 @@ if not defined msi goto run
349361

350362
:msibuild
351363
echo Building node-v%FULLVERSION%-%target_arch%.msi
352-
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:PlatformToolset=%PLATFORM_TOOLSET% /p:GypMsvsVersion=%GYP_MSVS_VERSION% /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% %noetw_msi_arg% %noperfctr_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
364+
set "msbsdk="
365+
if defined WindowsSDKVersion set "msbsdk=/p:WindowsTargetPlatformVersion=%WindowsSDKVersion:~0,-1%"
366+
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build %msbsdk% /p:PlatformToolset=%PLATFORM_TOOLSET% /p:GypMsvsVersion=%GYP_MSVS_VERSION% /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% %noetw_msi_arg% %noperfctr_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
353367
if errorlevel 1 goto exit
354368

355369
if not defined sign goto upload

0 commit comments

Comments
 (0)