summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoão Reis <reis@janeasystems.com>2017-11-17 17:54:06 +0000
committerJoão Reis <reis@janeasystems.com>2017-11-28 23:11:15 +0000
commit04566d3698fac6c6afc7896619c92cc2e05d1440 (patch)
treef30b2d1189c974ed4a97a81307a6297604728df1
parent41c45fd6d2fbd6c2bf6fcfe8fd8894031503e169 (diff)
downloadnode-new-04566d3698fac6c6afc7896619c92cc2e05d1440.tar.gz
build,win,msi: support WiX with VS2017
PR-URL: https://github.com/nodejs/node/pull/17101 Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com>
-rw-r--r--BUILDING.md2
-rw-r--r--vcbuild.bat20
2 files changed, 19 insertions, 3 deletions
diff --git a/BUILDING.md b/BUILDING.md
index cd819b4b47..e6d575f827 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -209,6 +209,8 @@ Prerequisites:
* Basic Unix tools required for some tests,
[Git for Windows](http://git-scm.com/download/win) includes Git Bash
and tools which can be included in the global `PATH`.
+* **Optional** (to build the MSI): the [WiX Toolset v3.11](http://wixtoolset.org/releases/)
+ and the [Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension).
If the path to your build directory contains a space, the build will likely fail.
diff --git a/vcbuild.bat b/vcbuild.bat
index a765bcb439..a15620e726 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -192,12 +192,24 @@ if %target_arch%==x64 if %msvs_host_arch%==amd64 set vcvarsall_arg=amd64
:vs-set-2017
if defined target_env if "%target_env%" NEQ "vs2017" goto vs-set-2015
echo Looking for Visual Studio 2017
+call tools\msvs\vswhere_usability_wrapper.cmd
+if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
+if defined msi (
+ echo Looking for WiX installation for Visual Studio 2017...
+ if not exist "%WIX%\SDK\VS2017" (
+ echo Failed to find WiX install for Visual Studio 2017
+ echo VS2017 support for WiX is only present starting at version 3.11
+ goto vs-set-2015
+ )
+ if not exist "%VCINSTALLDIR%\..\MSBuild\Microsoft\WiX" (
+ echo Failed to find the Wix Toolset Visual Studio 2017 Extension
+ goto vs-set-2015
+ )
+)
@rem check if VS2017 is already setup, and for the requested arch
if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2017
@rem need to clear VSINSTALLDIR for vcvarsall to work as expected
set "VSINSTALLDIR="
-call tools\msvs\vswhere_usability_wrapper.cmd
-if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
@rem prevent VsDevCmd.bat from changing the current working directory
set "VSCMD_START_DIR=%CD%"
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg%
@@ -354,7 +366,9 @@ if not defined msi goto run
:msibuild
echo Building node-v%FULLVERSION%-%target_arch%.msi
-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
+set "msbsdk="
+if defined WindowsSDKVersion set "msbsdk=/p:WindowsTargetPlatformVersion=%WindowsSDKVersion:~0,-1%"
+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
if errorlevel 1 goto exit
if not defined sign goto upload