diff options
author | João Reis <reis@janeasystems.com> | 2015-07-02 16:48:59 +0100 |
---|---|---|
committer | Alexis Campailla <alexis@janeasystems.com> | 2015-07-22 09:30:11 -0400 |
commit | 14db629497d0eb97a5f0fbb70cf3e534e460deec (patch) | |
tree | 5269613909952925ce56dd95b3e1dbb2f51d404a | |
parent | 8e80528453aca0354422162e09c7c9f4700ddb1e (diff) | |
download | node-14db629497d0eb97a5f0fbb70cf3e534e460deec.tar.gz |
win,msi: correct installation path registry keys
Since install is per machine only, installation path should be stored
in local machine instead of current user. The registry stores HKLM in
different places for 32 and 64 bit applications, so the installer will
not suggest the old path when upgrading from 32 to 64 bit version.
Fixes #5592
Fixes #25087
PR-URL: https://github.com/joyent/node/pull/25640
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
-rwxr-xr-x | tools/msvs/msi/product.wxs | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index 2ce00a44b..3c3eb685b 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -33,6 +33,14 @@ <Property Id="INSTALLDIR"> <RegistrySearch Id="InstallPathRegistry" Type="raw" + Root="HKLM" + Key="$(var.RegistryKeyPath)" + Name="InstallPath"/> + <!-- Also need to search under HKCU to support upgrading from old + versions. If we wanted to disable backward compatibility, this + second search could be deleted. --> + <RegistrySearch Id="InstallPathRegistryCU" + Type="raw" Root="HKCU" Key="$(var.RegistryKeyPath)" Name="InstallPath"/> @@ -44,8 +52,9 @@ Description="Install the core Node.js runtime (node.exe)." Absent="disallow"> <ComponentRef Id="NodeExecutable"/> + <ComponentRef Id="NodeRegistryEntries"/> <ComponentRef Id="NodeVarsScript"/> - <ComponentRef Id="NodeStartMenuAndRegistryEntries"/> + <ComponentRef Id="NodeStartMenu"/> <ComponentRef Id="AppData" /> <ComponentGroupRef Id="Product.Generated"/> @@ -117,6 +126,20 @@ <File Id="node.exe" KeyPath="yes" Source="$(var.SourceDir)\node.exe"/> </Component> + <Component Id="NodeRegistryEntries"> + <RegistryValue Root="HKLM" + Key="$(var.RegistryKeyPath)" + Name="InstallPath" + Type="string" + Value="[INSTALLDIR]" + KeyPath="yes"/> + <RegistryValue Root="HKLM" + Key="$(var.RegistryKeyPath)" + Name="Version" + Type="string" + Value="$(var.ProductVersion)"/> + </Component> + <Component Id="NodeVarsScript"> <File Id="nodevars.bat" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\nodevars.bat"/> </Component> @@ -139,18 +162,15 @@ </DirectoryRef> <DirectoryRef Id="ApplicationProgramsFolder"> - <Component Id="NodeStartMenuAndRegistryEntries"> + <Component Id="NodeStartMenu"> + <!-- RegistryValue needed because every Component must have a KeyPath. + Because of ICE43, the Root must be HKCU. --> <RegistryValue Root="HKCU" - Key="$(var.RegistryKeyPath)" - Name="InstallPath" - Type="string" - Value="[INSTALLDIR]" + Key="$(var.RegistryKeyPath)\Components" + Name="NodeStartMenuShortcuts" + Type="integer" + Value="1" KeyPath="yes"/> - <RegistryValue Root="HKCU" - Key="$(var.RegistryKeyPath)" - Name="Version" - Type="string" - Value="$(var.ProductVersion)"/> <Shortcut Id="NodeVarsScriptShortcut" Name="Node.js command prompt" Target="[%ComSpec]" |