Skip to content

Commit 87c885b

Browse files
joaocgreisMylesBorins
authored andcommitted
build,win,msi: support WiX with VS2017
PR-URL: #17101 Reviewed-By: Nikolai Vavilov <[email protected]>
1 parent bd55a79 commit 87c885b

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

BUILDING.md

+2
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ Prerequisites:
209209
* Basic Unix tools required for some tests,
210210
[Git for Windows](http://git-scm.com/download/win) includes Git Bash
211211
and tools which can be included in the global `PATH`.
212+
* **Optional** (to build the MSI): the [WiX Toolset v3.11](http://wixtoolset.org/releases/)
213+
and the [Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension).
212214

213215
If the path to your build directory contains a space, the build will likely fail.
214216

vcbuild.bat

+17-3
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,24 @@ if %target_arch%==x64 if %msvs_host_arch%==amd64 set vcvarsall_arg=amd64
192192
:vs-set-2017
193193
if defined target_env if "%target_env%" NEQ "vs2017" goto vs-set-2015
194194
echo Looking for Visual Studio 2017
195+
call tools\msvs\vswhere_usability_wrapper.cmd
196+
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
197+
if defined msi (
198+
echo Looking for WiX installation for Visual Studio 2017...
199+
if not exist "%WIX%\SDK\VS2017" (
200+
echo Failed to find WiX install for Visual Studio 2017
201+
echo VS2017 support for WiX is only present starting at version 3.11
202+
goto vs-set-2015
203+
)
204+
if not exist "%VCINSTALLDIR%\..\MSBuild\Microsoft\WiX" (
205+
echo Failed to find the Wix Toolset Visual Studio 2017 Extension
206+
goto vs-set-2015
207+
)
208+
)
195209
@rem check if VS2017 is already setup, and for the requested arch
196210
if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2017
197211
@rem need to clear VSINSTALLDIR for vcvarsall to work as expected
198212
set "VSINSTALLDIR="
199-
call tools\msvs\vswhere_usability_wrapper.cmd
200-
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
201213
@rem prevent VsDevCmd.bat from changing the current working directory
202214
set "VSCMD_START_DIR=%CD%"
203215
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg%
@@ -354,7 +366,9 @@ if not defined msi goto run
354366

355367
:msibuild
356368
echo Building node-v%FULLVERSION%-%target_arch%.msi
357-
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
369+
set "msbsdk="
370+
if defined WindowsSDKVersion set "msbsdk=/p:WindowsTargetPlatformVersion=%WindowsSDKVersion:~0,-1%"
371+
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
358372
if errorlevel 1 goto exit
359373

360374
if not defined sign goto upload

0 commit comments

Comments
 (0)