-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Fix msi installer for Visual Studio versions != 2013 #25569
Conversation
LGTM with one suggestion: I don't have an older version of VS here to reproduce the problem @richardlau had with WiX 3.6, but if WiX 3.9 is required for any version of VS we can add |
@orangemocha @piscisaureus @joaocgreis Do we actually support building node on Windows with Visual Studio < 2013? I get the following error when building it with Visual Studio 2010:
|
@misterdjules That output looks like gyp has decided to generate project files for a later version (2013?). On our systems that only have Visual Studio 2010 the generated cares.vcxproj file has ToolsVersion="4.0". Looking at vcbuild.bat in the v0.10 branch it does seem odd that the batch file attempts to set the GYP_MSVS_VERSION env variable but it looks like it's doing this after gyp has already run (and thus wouldn't affect it) so gyp will attempt to autodetect the Visual Studio version to target. |
@richardlau Right, this has been fixed by @orangemocha with a74425b. I was just confused, thank you for pointing me again in the right direction 👍 |
@orangemocha @joaocgreis Added more info output in misterdjules@84cd9a7. @joaocgreis I could not find a way to make WiX's |
84cd9a7
to
96232ce
Compare
@orangemocha Changed VStudio to Visual Studio according to your latest comment, thank you! |
@misterdjules Sorry for the delay, I wanted to try it with older versions of WiX to be sure. On my system it works:
Just to be sure we are on the same page:
|
Aside from the Wix RequiredVersion pointed out by @joaocgreis , the output changes LGTM. |
@joaocgreis Yes, I had the same change in mind. Since then I found out that this works correctly in v0.12, but fails to display any diagnostic in v0.10. I don't know what the reason for that difference in behavior is. Anyway, if we can't figure it out, we can still add this change so that when it's merged in v0.12 we'll get a better diagnostic for such errors. Thoughts? |
@misterdjules The error messages were not very clear, but it seems that supporting older versions of WiX is simple. I just renamed the custom action source file to be C++ and it worked, seems that older versions of Wix include a header with I tested with WiX 3.8 and was able to install the MSI. According to the installation log, the custom action ran fine. |
51a98b9
to
c9572fe
Compare
@joaocgreis Excellent, thank you very much for investigating this! I merged your commit in this PR. @joaocgreis @orangemocha LGTY? |
@orangemocha @joaocgreis Also, I squashed two of my commits into one, but the others should be kept separate in my opinion. |
@misterdjules Only one suggestion (sorry for noticing this only now): To determine what version of VS to pick from the WiX folder, you use a property called
This works as it is now, so either way, with or without this change, LGTM. |
The original change that added support for running custom actions during the install process (e7c84f8) assumed that Visual Studio 2013 is used to generate the installer file. However, that is not always the case, and older versions of Visual Studio should allow users to generate Windows installer files. This change makes the custom actions visual studio project use the visual studio version that is found by vcbuild.bat.
Older WiX versions included a header with extern "C" declaration, hence the custom action source must be C++.
65a0021
to
24a7113
Compare
@joaocgreis Thanks again, updated 👍 |
Backport commit a58b174 from branch v0.12. Original commit message: vcbuild.bat calls python configure before setting GYP_MSVS_VERSION, so SelectVisualStudioVersion (tools\gyp\pylib\gyp\MSVSVersion.py) defaults to 'auto' and selects VS 2005. vcbuild sets the environment in the current shell, so this issue would manifest itself only on the first invocation of the script in any given shell windows. Reviewed-By: Julien Gilli <jgilli@fastmail.fm> PR-URL: #20109 Conflicts: vcbuild.bat Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: #25569
Issue: #25348 The gyp/project files don't explicitly specify a subsystem version, which results in the default being used. The default changed from VS 2010 to VS 2012 and later. Backport 3122052, which itself backports e8d0850 from io.js. Original commit message follows: Chrome still runs on Windows XP, so there is no reason that iojs couldn't. PR: nodejs/node#512 (cherry picked from commit e8d0850) Reviewed-By: Julien Gilli <julien.gilli@joyent.com> PR-URL: #25367 Conflicts: node.gyp Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: #25569
The original change that added support for running custom actions during the install process (e7c84f8) assumed that Visual Studio 2013 is used to generate the installer file. However, that is not always the case, and older versions of Visual Studio should allow users to generate Windows installer files. This change makes the custom actions visual studio project use the visual studio version that is found by vcbuild.bat. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: #25569
Older WiX versions included a header with extern "C" declaration, hence the custom action source must be C++. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: #25569
This is a port of nodejs/node-v0.x-archive@16bcd68 . Original commit message: The original change that added support for running custom actions during the install process (nodejs/node-v0.x-archive@e7c84f8) assumed that Visual Studio 2013 is used to generate the installer file. However, that is not always the case, and older versions of Visual Studio should allow users to generate Windows installer files. This change makes the custom actions visual studio project use the visual studio version that is found by vcbuild.bat. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: nodejs/node-v0.x-archive#25569 PR-URL: nodejs#2365 Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
This is a port of nodejs/node-v0.x-archive@e192f61 . Original commit message: Older WiX versions included a header with extern "C" declaration, hence the custom action source must be C++. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: nodejs/node-v0.x-archive#25569 PR-URL: nodejs#2365 Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
This is a port of nodejs/node-v0.x-archive@16bcd68 . Original commit message: The original change that added support for running custom actions during the install process (nodejs/node-v0.x-archive@e7c84f8) assumed that Visual Studio 2013 is used to generate the installer file. However, that is not always the case, and older versions of Visual Studio should allow users to generate Windows installer files. This change makes the custom actions visual studio project use the visual studio version that is found by vcbuild.bat. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: nodejs/node-v0.x-archive#25569 PR-URL: #2365 Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
This is a port of nodejs/node-v0.x-archive@e192f61 . Original commit message: Older WiX versions included a header with extern "C" declaration, hence the custom action source must be C++. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: nodejs/node-v0.x-archive#25569 PR-URL: #2365 Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
This is a port of 16bcd68 . Original commit message: The original change that added support for running custom actions during the install process (e7c84f8) assumed that Visual Studio 2013 is used to generate the installer file. However, that is not always the case, and older versions of Visual Studio should allow users to generate Windows installer files. This change makes the custom actions visual studio project use the visual studio version that is found by vcbuild.bat. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: nodejs/node-v0.x-archive#25569
This is a port of e192f61 . Original commit message: Older WiX versions included a header with extern "C" declaration, hence the custom action source must be C++. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: nodejs/node-v0.x-archive#25569
This is a port of 16bcd68 . Original commit message: The original change that added support for running custom actions during the install process (e7c84f8) assumed that Visual Studio 2013 is used to generate the installer file. However, that is not always the case, and older versions of Visual Studio should allow users to generate Windows installer files. This change makes the custom actions visual studio project use the visual studio version that is found by vcbuild.bat. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: nodejs/node-v0.x-archive#25569 PR-URL: #2843 Reviewed-By: rvagg - Rod Vagg <rod@vagg.org> Reviewed-By: orangemocha - Alexis Campailla <orangemocha@nodejs.org> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
This is a port of e192f61 . Original commit message: Older WiX versions included a header with extern "C" declaration, hence the custom action source must be C++. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: nodejs/node-v0.x-archive#25569 PR-URL: #2843 Reviewed-By: rvagg - Rod Vagg <rod@vagg.org> Reviewed-By: orangemocha - Alexis Campailla <orangemocha@nodejs.org> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
This is a port of 16bcd68 . Original commit message: The original change that added support for running custom actions during the install process (e7c84f8) assumed that Visual Studio 2013 is used to generate the installer file. However, that is not always the case, and older versions of Visual Studio should allow users to generate Windows installer files. This change makes the custom actions visual studio project use the visual studio version that is found by vcbuild.bat. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: nodejs#25569 PR-URL: nodejs/node#2843 Reviewed-By: rvagg - Rod Vagg <rod@vagg.org> Reviewed-By: orangemocha - Alexis Campailla <orangemocha@nodejs.org> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
This is a port of e192f61 . Original commit message: Older WiX versions included a header with extern "C" declaration, hence the custom action source must be C++. Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: nodejs#25569 PR-URL: nodejs/node#2843 Reviewed-By: rvagg - Rod Vagg <rod@vagg.org> Reviewed-By: orangemocha - Alexis Campailla <orangemocha@nodejs.org> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
After landing e7c84f8, the release process on the Windows build machine was broken. The problem was that the following Visual Studio versions and tools had been installed on that machine, in the following order:
As a result, The WiX SDK was not installed for Visual Studio 2013, because that's taken care of during the WiX installation process. At that time, Visual Studio 2013 was not installed on that machine.
However,
vcbuild.bat
would use Visual Studio 2013 anyway because it could find the correspondingvcvarsall.bat
file. So it would detect that it can run thecustom_actions
project (which has a requirement on the platform toolset that corresponds to Visual Studio 2013), but when it would be time to include the WiX SDK's header for Visual Studio 2013, it would not find it and the Windows installer generation process would fail.This commit makes the
custom_actions
project not use any hardcoded value related to the Visual Studio version used to generate the Windows installer. Instead,msbuild
passes the Visual Studio version number thatvcbuild.bat
detects to thecustom_actions
project.In my case, I had to re-run the WiX installer process to install the WiX SDK for Visual Studio 2013, because I wanted to release the next v0.10.x release with the same compiler than the one that had been used for a while now (since September 2014, when Visual Studio 2013 was installed on that build machine). However this PR fixes the problem for users who don't have access to Visual Studio 2013 for some reason, and I think it just improves the user experience in general (better error messages, etc.). It will come in handy when/if we update the compiler used to build official releases to Visual Studio 2015.
This PR also backports 3122052 and a58b174 as they deal and fix issues about generating installers and binaries on Windows machines with different Visual Studio versions.
/cc @joyent/node-collaborators @joyent/node-tsc