Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Support for building MSI installers on Windows #1706

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
2 participants

This change adds support for building MSI installer packages for Windows, as per discussion with Ryan on Tuesday. You can check out a sample build at https://github.com/downloads/tjanczuk/node/node.msi.

Building MSIs adds one more prerequisite to the dev environment on Windows: WIX 3.5 toolset which can be downloaded from http://wix.codeplex.com/releases/view/60102. This is only required for building the MSI; building the product alone continues to work without it.

In the simplest form, the MSI can be built with the vcbuild.bat script:

vcbuild retail msi - builds retail node.exe and the MSI
vcbuild nobuild debug msi - builds MSI only using the node.exe already in the debug directory

The vcbuild script will assign the product version to the MSI based on the version number extracted from src\node_version.h. The product version number shows up in the list of installed applications.

The MSI package installs node.exe, LICENSE, and - in case of debug builds only - node.pdb to %programfiles%\nodejs directory.

The MSI displays the license and requires the user to accept it before installation.

Currently the installer project only supports installing x86 builds, but I notice this is an all-up restriction of vcbuild.bat at the moment.

Currently there is no support for side by side installation of different versions. One must uninstall previous version to install a new one.

Currently NPM is not installed as part of the package.

At the organic level, an MSI may be build using the msbuild solution at tools\msi\nodemsi.sln with the following command line:

msbuild tools\msi\nodemsi.sln /t:Clean,Build /p:Configuration=Debug /p:NodeVersion=0.5.7.0

the tools\msi\nodemsi.wixproj can also be integrated in an all-up solution file, but I decided against it since I expect MSI building to be infrequent and not done by majority of node devs on Windows.

Let me know what you think.

Thanks,
Tomek

ry commented Sep 15, 2011

I get this error:

node.vcxproj -> C:\Users\ryan\node\Release\node.exe
C:\Users\ryan\node\tools\msi\nodemsi.wixproj(37,3): error MSB4019: The imported 
project "C:\Program Files\MSBuild\Microsoft\WiX\v3.x\Wix.targets" was not found.
Confirm that the path in the <Import> declaration is correct, and that the file exists 
on disk.

The license file should not be included unless this is intended to be distributed under something other than the MIT license. This is all original code for the Node project - correct?

When you say license should not be included you mean the installer UI or the files being installed?

This is all original code from node, and the license is taken from the root of the enlistment. If you don;t want to install the license we don't have to, but at minimum we should ask the user to accept it during the installation.

Have you installed WIX 3.5 Toolset from http://wix.codeplex.com/releases/view/60102?

ry commented Sep 15, 2011

Oh okay - so the license file is for displaying during install - that's fine. Is it possible to use the plaintext LICENSE file at the root of the Node tree instad of this RTF file? (It would be difficult for us to maintain both files)

I installed WIX now. I'm getting this error:

v8_snapshot.vcxproj -> C:\Users\ryan\node\Release\v8_snapshot.lib
node.vcxproj -> C:\Users\ryan\node\Release\node.exe 
C:\Users\ryan\node\tools\msi\product.wxs(45): error LGHT0094:  
Unresolved reference to symbol 'WixComponentGroup:Product.Generated'
in section 'Product:{CC6C176E-E26C-48EC-8970-F58BD1D046CF}'. 
[C:\Users\ryan\node\tools\msi\nodemsi.wixproj]

Regarding version number, perhaps we can use the fourth component of the product version to reflect the status, e.g. 0.5.7.0 would be pre-release, 0.5.7.1 would be release. Thoughts?

...or it can be the number of commits since the previous version tag, or just a rolling build number.

Unfortunately WIX only supports RTF. We could automatically generate the RTF from TXT using python as a pre-build step, the RTF format is not rocket science.

What command are you using for building? Can you try building node alone first, and then

msbuild tools\msi\nodemsi.sln /t:Clean,Build /p:Configuration=Debug /p:NodeVersion=0.5.7.0 /v:d

The logs should have more information - can you post them in gist?

you should use the same /p:Configuration as the node.exe build of course.

@ry ry closed this in 6fadbec Oct 11, 2011

ry commented Oct 11, 2011

Sorry that this took so long to merge. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment