Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
windows/msi: add start menu links when installing
Browse files Browse the repository at this point in the history
  • Loading branch information
japj authored and piscisaureus committed Jun 2, 2012
1 parent e2126e0 commit 9434487
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 5 deletions.
4 changes: 4 additions & 0 deletions tools/msvs/msi/nodemsi.wixproj
Expand Up @@ -42,6 +42,10 @@
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
</WixExtension>
<WixExtension Include="WiXUtilExtension">
<HintPath>$(WixExtDir)\WiXUtilExtension.dll</HintPath>
<Name>WiXUtilExtension</Name>
</WixExtension>
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<Target Name="BeforeBuild">
Expand Down
44 changes: 39 additions & 5 deletions tools/msvs/msi/product.wxs
@@ -1,14 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

<?define ProductName = "node.js" ?>
<?define ProductDescription = "Evented I/O for V8 javascript" ?>
<?define ProductAuthor = "Joyent, Inc. and other Node contributors" ?>

This comment has been minimized.

Copy link
@japj

japj Jun 3, 2012

Author

@piscisaureus hmm, $(var.ProductAuthor) is also used in writing to the registry and that now includes the "and other Node contributors" part, so it will be HKCU\Software\Joyent, Inc. and other Node contributors*

Was that intentional?


<?define repoDir="$(var.ProjectDir)..\..\..\" ?>
<?define sourcedir="$(var.repoDir)\$(var.Configuration)\" ?>

<Product Id="*"
Name="node.js"
Name="$(var.ProductName)"
Language="1033"
Version="$(var.ProductVersion)"
Manufacturer="Joyent, Inc"
Manufacturer="$(var.ProductAuthor)"
UpgradeCode="1d60944c-b9ce-4a71-a7c0-0384eb884baa">

<Package InstallerVersion="200" Compressed="yes" />
Expand All @@ -19,8 +24,13 @@
DowngradeErrorMessage="A later version of node.js is already installed. Setup will now exit." />

<Directory Id="TARGETDIR" Name="SourceDir">

<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="Node.js"/>
</Directory>

<Directory Id="$(var.ProgramFilesFolderId)">
<Directory Id="NodeRoot" Name="nodejs">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="nodejs">

This comment has been minimized.

Copy link
@japj

japj Jun 3, 2012

Author

Oops, apparently this broke the adding [NodeRoot] to the PATH, I'll send a seperate pull request to fix it

<Directory Id="NodeModulesFolder" Name="node_modules">
<Directory Id="NPMFolder" Name="npm">
<Component Id="npmrc" Guid="55B2B03F-8F32-4D62-A54A-FA428615591D">
Expand Down Expand Up @@ -56,6 +66,7 @@
<?endif?>
</Directory>
</Directory>

<Directory Id="AppDataFolder">
<Directory Id="NPMAppData" Name="npm">
<Component Id="npmappdata_folder" Guid="994B1F7F-60CD-4792-A96D-63BC7FFF29BF" Permanent="yes">
Expand All @@ -69,6 +80,28 @@
</Directory>
</Directory>

<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="9b1ab94a-8f54-4f19-a5c4-b890de474162">
<Shortcut Id="ApplicationStartMenuShortcut" Name="Node.js"
Description="$(var.ProductDescription)" Target="[APPLICATIONROOTDIRECTORY]node.exe"
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
<util:InternetShortcut Id="OnlineWebsiteShortcut"
Name="Node.js website"
Target="http://nodejs.org"/>
<util:InternetShortcut Id="OnlineDocumentationShortcut"
Name="Node.js documentation"
Target="http://nodejs.org/dist/v$(var.ProductVersion)/docs/api/"/>
<Shortcut Id="UninstallProduct"

This comment has been minimized.

Copy link
@domenic

domenic Jun 3, 2012

All of these shortcuts are recommended against in Microsoft UX guidelines. The uninstall one is especially evil.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa511447.aspx

This comment has been minimized.

Copy link
@japj

japj Jun 3, 2012

Author

Ah, I was not aware of that guideline. Looking at it I am wondering how we can 'correctly' map things described in that guideline to node.js.

We don't have a way to "access things directly from your program" (this is related to help files and websites in that guideline), since the only program we ship is node.exe. Executing it will just give a repl, there is no default way to navigate to the website or help pages from within the repl.

As for the uninstaller, both Python(2.7) and Ruby(1.9) Windows installers put an uninstall link in the start menu, so I thought it was common enough to do so. If we really don't want it then we can just remove it.

This comment has been minimized.

Copy link
@domenic

domenic via email Jun 3, 2012

This comment has been minimized.

Copy link
@japj

japj Jun 3, 2012

Author

The website contains a link to the current 'stable' documentation (at the moment this is 0.6.18) and does not provide an easy way to navigate to documentation for a specific version of node (i.e. current unstable is 0.7.9). The documentation link goes directly to the documentation of the specific version you installed.

We could also include generated documentation in the installer and provide a link to that, but that is still under discussion I believe.

Btw, how do we deal with a side by side installation of 32 and 64 bit node.js? The guideline states not to include version numbers, but is x86/x64 as part of the link name acceptable? (I know VS2010 has multiple command prompt entries in the start menu for 32 and 64 bit development)

This comment has been minimized.

Copy link
@domenic

domenic via email Jun 3, 2012

This comment has been minimized.

Copy link
@piscisaureus

piscisaureus Jun 4, 2012

@domenic

I agree that the uninstall and home page links are debatable. Luckily we'll have plenty of time to reconsider before windows 8 drops :-)

Name="Uninstall Node.js"
Target="[SystemFolder]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Uninstalls $(var.ProductName)" />
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\$(var.ProductAuthor)\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>


<ComponentGroup Id="allfiles">
<ComponentRef Id="nodeexe"/>
<ComponentRef Id="npmcmd"/>
Expand All @@ -79,9 +112,10 @@
<?if $(var.Configuration) = Debug ?>
<ComponentRef Id="nodepdb"/>
<?endif?>
<ComponentRef Id="ApplicationShortcut" />
</ComponentGroup>

<Feature Id="nodejs" Title="node.js engine" Level="1" Description="evented I/O for V8 javascript">
<Feature Id="nodejs" Title="node.js engine" Level="1" Description="$(var.ProductDescription)">
<ComponentGroupRef Id="allfiles" />
<ComponentGroupRef Id="Product.Generated" />
</Feature>
Expand Down

1 comment on commit 9434487

@piscisaureus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@japj No that wasn't intentional, I didn't realize. IMHO the registry key should just be "joyent/node.js" or even "node.js/node.js".

Please sign in to comment.