From fc7b68d3b0f2d94b824ab0c5b4bd5b5de44e411c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Wed, 11 Dec 2019 05:51:23 +0000 Subject: [PATCH 1/2] build,win: support building MSI with VS2019 Explicitly pass the WiX SDK directory when building the MSI. WiX doesn't (yet?) have a directory for VS2019, so use the one for VS2017 which should be compatible. --- .gitignore | 5 +++++ tools/msvs/msi/custom_actions.vcxproj | 16 ++++++++-------- vcbuild.bat | 10 +++++----- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index e50393f003c5d1..db2597b042b84a 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,8 @@ /*.swp /out /*.txt +/*.msi +/*.wixpdb # === Rules for artifacts of `./configure` === /icu_config.gypi @@ -58,6 +60,9 @@ _UpgradeReport_Files/ *.wixobj /tools/msvs/genfiles/ /npm.wxs +/tools/msvs/msi/Release/ +/tools/msvs/msi/obj/ +/tools/msvs/msi/x64/ # Exclude MSVS files used for .msi file generation !tools/msvs/msi/custom_actions.vcxproj !tools/msvs/msi/nodemsi.sln diff --git a/tools/msvs/msi/custom_actions.vcxproj b/tools/msvs/msi/custom_actions.vcxproj index 3716f07ff6de3d..077f29a52fadac 100644 --- a/tools/msvs/msi/custom_actions.vcxproj +++ b/tools/msvs/msi/custom_actions.vcxproj @@ -81,7 +81,7 @@ Disabled - $(WIX)sdk\VS$(GypMsvsVersion)\inc;%(AdditionalIncludeDirectories) + $(WixSdkDir)\inc;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -91,7 +91,7 @@ msi.lib;dutil.lib;wcautil.lib;version.lib;%(AdditionalDependencies) - $(WIX)sdk\VS$(GypMsvsVersion)\lib\x86;%(AdditionalLibraryDirectories) + $(WixSdkDir)\lib\x86;%(AdditionalLibraryDirectories) custom_actions.def true Windows @@ -100,7 +100,7 @@ Disabled - $(WIX)sdk\VS$(GypMsvsVersion)\inc;%(AdditionalIncludeDirectories) + $(WixSdkDir)\inc;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -110,7 +110,7 @@ msi.lib;dutil.lib;wcautil.lib;version.lib;%(AdditionalDependencies) - $(WIX)sdk\VS$(GypMsvsVersion)\lib\x64;%(AdditionalLibraryDirectories) + $(WixSdkDir)\lib\x64;%(AdditionalLibraryDirectories) custom_actions.def true Windows @@ -120,7 +120,7 @@ MaxSpeed true - $(WIX)sdk\VS$(GypMsvsVersion)\inc;%(AdditionalIncludeDirectories) + $(WixSdkDir)\inc;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) MultiThreaded true @@ -134,7 +134,7 @@ msi.lib;dutil.lib;wcautil.lib;version.lib;%(AdditionalDependencies) - $(WIX)sdk\VS$(GypMsvsVersion)\lib\x86;%(AdditionalLibraryDirectories) + $(WixSdkDir)\lib\x86;%(AdditionalLibraryDirectories) custom_actions.def true Windows @@ -146,7 +146,7 @@ MaxSpeed true - $(WIX)sdk\VS$(GypMsvsVersion)\inc;%(AdditionalIncludeDirectories) + $(WixSdkDir)\inc;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) MultiThreaded true @@ -160,7 +160,7 @@ msi.lib;dutil.lib;wcautil.lib;version.lib;%(AdditionalDependencies) - $(WIX)sdk\VS$(GypMsvsVersion)\lib\x64;%(AdditionalLibraryDirectories) + $(WixSdkDir)\lib\x64;%(AdditionalLibraryDirectories) custom_actions.def true Windows diff --git a/vcbuild.bat b/vcbuild.bat index 1e142a658bc68c..51f823c4054985 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -252,9 +252,10 @@ echo Looking for Visual Studio 2019 set "VCINSTALLDIR=" call tools\msvs\vswhere_usability_wrapper.cmd "[16.0,17.0)" if "_%VCINSTALLDIR%_" == "__" goto vs-set-2017 +set "WIXSDKDIR=%WIX%\SDK\VS2017" if defined msi ( echo Looking for WiX installation for Visual Studio 2019... - if not exist "%WIX%\SDK\VS2017" ( + if not exist "%WIXSDKDIR%" ( echo Failed to find WiX install for Visual Studio 2019 echo VS2019 support for WiX is only present starting at version 3.11 goto vs-set-2017 @@ -277,7 +278,6 @@ if errorlevel 1 goto vs-set-2017 if defined DEBUG_HELPER @ECHO ON :found_vs2019 echo Found MSVS version %VisualStudioVersion% -set GYP_MSVS_VERSION=2019 set PLATFORM_TOOLSET=v142 goto msbuild-found @@ -287,9 +287,10 @@ if defined target_env if "%target_env%" NEQ "vs2017" goto msbuild-not-found echo Looking for Visual Studio 2017 call tools\msvs\vswhere_usability_wrapper.cmd "[15.0,16.0)" if "_%VCINSTALLDIR%_" == "__" goto msbuild-not-found +set "WIXSDKDIR=%WIX%\SDK\VS2017" if defined msi ( echo Looking for WiX installation for Visual Studio 2017... - if not exist "%WIX%\SDK\VS2017" ( + if not exist "%WIXSDKDIR%" ( echo Failed to find WiX install for Visual Studio 2017 echo VS2017 support for WiX is only present starting at version 3.11 goto msbuild-not-found @@ -312,7 +313,6 @@ if errorlevel 1 goto msbuild-not-found if defined DEBUG_HELPER @ECHO ON :found_vs2017 echo Found MSVS version %VisualStudioVersion% -set GYP_MSVS_VERSION=2017 set PLATFORM_TOOLSET=v141 goto msbuild-found @@ -474,7 +474,7 @@ if not defined msi goto install-doctools echo Building node-v%FULLVERSION%-%target_arch%.msi 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% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo +msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build %msbsdk% /p:PlatformToolset=%PLATFORM_TOOLSET% /p:WixSdkDir="%WIXSDKDIR%" /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% %noetw_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo if errorlevel 1 goto exit if not defined sign goto upload From 5e4cc4c78b8d8eb22ad14d3457e71ecdc46d40fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Wed, 11 Dec 2019 06:53:03 +0000 Subject: [PATCH 2/2] fixup! build,win: support building MSI with VS2019 --- vcbuild.bat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vcbuild.bat b/vcbuild.bat index 51f823c4054985..3754d5f1b5715c 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -278,6 +278,7 @@ if errorlevel 1 goto vs-set-2017 if defined DEBUG_HELPER @ECHO ON :found_vs2019 echo Found MSVS version %VisualStudioVersion% +set GYP_MSVS_VERSION=2019 set PLATFORM_TOOLSET=v142 goto msbuild-found @@ -313,6 +314,7 @@ if errorlevel 1 goto msbuild-not-found if defined DEBUG_HELPER @ECHO ON :found_vs2017 echo Found MSVS version %VisualStudioVersion% +set GYP_MSVS_VERSION=2017 set PLATFORM_TOOLSET=v141 goto msbuild-found