Repository navigation
Windows installer always installs to C:/Program Files #6057
Description
Activity
- changed the title
[-]Node always installs to C:/Program Files[/-][+]Windows installer always installs to C:/Program Files[/+]on Apr 5, 2016 - addedwindowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.installIssues and PRs related to installing Node.js and its installers.Issues and PRs related to installing Node.js and its installers.
on Apr 5, 2016 - addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Apr 5, 2016 eljefedelrodeodeljefe commented
on Apr 6, 2016 ContributorMore actionsI can confirm there is a bug (I consider it as such) at least on Windows 7. Windows 10 works fine though. @mscdex @Fishrock123 this would need re-labeling.
eljefedelrodeodeljefe commented
on Apr 6, 2016 ContributorMore actions@balane can you run
msinfo32and copy-paste the result here. I just did a fresh install after I bought a OEM Professional version and there it did work as expected. Before, I tested with modern_ie. So good news for us is it is not affecting everyone on windows...hopefully.- removedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Apr 6, 2016 What exactly are you looking for from the msinfo32 result?
eljefedelrodeodeljefe commented
on Apr 7, 2016 ContributorMore actionsBuild number of Windows, Architecture etc. Before I go debugging I wanted to have as much information as possible. Minus security relevant stuff of course...
OS Name Microsoft Windows 7 Enterprise
Version 6.1.7601 Service Pack 1 Build 7601
Other OS Description Not Available
OS Manufacturer Microsoft Corporation
System Manufacturer Dell Inc.
System Model Latitude E6510
System Type x64-based PC
Processor Intel(R) Core(TM) i7 CPU Q 740 @ 1.73GHz, 1734 Mhz, 4 Core(s), 8 Logical Processor(s)
BIOS Version/Date Dell Inc. A16, 12/5/2013
SMBIOS Version 2.6
Windows Directory C:\Windows
System Directory C:\Windows\system32
Boot Device \Device\HarddiskVolume2
Locale United States
Hardware Abstraction Layer Version = "6.1.7601.17514"
Time Zone Central Daylight Time
Installed Physical Memory (RAM) 8.00 GB
Total Physical Memory 7.93 GB
Available Physical Memory 4.17 GB
Total Virtual Memory 15.9 GB
Available Virtual Memory 12.4 GB
Page File Space 7.93 GBcc @joaocgreis , our MSI expert.
I could not reproduce this. I tried to create the registry values that the installer reads (
Software/Node.jsunderHKLMandHKCU) and those are read correctly but the path chosen by the user is always used.@balane can you try to create a installation log? Use:
msiexec /i <filename>.msi /l*v InstallLog.txteljefedelrodeodeljefe commented
on Apr 7, 2016 ContributorMore actionsHmm. I couldn't reproduce (again) neither, even though it was reproducable earlier. It's likely related to Windows being under whatever circumstances. Just installing again then solves it though. I would vote for closing this until there is some logged reproduction. @joaocgreis
msiexec /i C:\Users\myusername\Downloads\somepackage.msi /L*v install.txtwould be logging sufficiently I assume?From a quick glance through the log file looks like it's saying that it correctly installed to C:/apps/nodejs but it absolutely did not.
The directory change is happening on the client side...
MSI (c) (F4:48) [16:08:46:758]: PROPERTY CHANGE: Modifying INSTALLDIR property. Its current value is 'C:\Program Files\nodejs\'. Its new value: 'C:\apps\nodejs\'....but never makes it to the server side...
MSI (s) (58:9C) [16:08:57:831]: Ignoring disallowed property INSTALLDIRThis results in the server-side using the default value...
MSI (s) (58:9C) [16:08:57:984]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'C:\Program Files\nodejs\'.It's what happens on the server side that counts.
The problem is that INSTALLDIR needs to be added to the SecureCustomProperties MSI property. Something like this:
diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index eed53e4..dcd6b90 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -45,6 +45,7 @@ <Property Id="ARPPRODUCTICON" Value="NodeIcon"/> <Property Id="ApplicationFolderName" Value="nodejs"/> <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/> + <Property Id="SecureCustomProperties" Value="INSTALLDIR"/> <Property Id="INSTALLDIR"> <RegistrySearch Id="InstallPathRegistry"
(To answer the next logical question... Sorry, NO, I can't submit a PR for this right now.)
eljefedelrodeodeljefe commented
on May 3, 2016 ContributorMore actions@joaocgreis does @mcnameej's patch seem reasonable (does to me)? I can make the PR and give it a try, but would need someone to review.
With the tips from above, I could finally reproduce this. On Windows 7 64-bit, node 4.4.2 64-bit:
- In the Administrator account, use the Group Policy Editor to enable
Always install with elevated privileges, from bothUserandComputer ConfigurationunderAdministrative Template,All Settings. - Switch to a user with a non-Administrator account, install node. This issue happens.
The patch above seems to be the way to fix this (thanks @mcnameej!). @eljefedelrodeodeljefe if you can make a PR, that'd be great! I'll review and can test in Windows 7.
There are two other things I'd investigate here. From the WiX documentation, there is a
Secureattribute that could be used instead, something like<Property Id="INSTALLDIR" Secure="yes">(@eljefedelrodeodeljefe can you give this a try first?). Also, some other properties are ignored but it seems that they are set correctly in the server side. I'd be happy if the fix installs with the MSI andINSTALLDIRin different drives, both nonC:. I can test this when I review.- In the Administrator account, use the Group Policy Editor to enable
- added a commit that references this issue
on Sep 26, 2016 - added a commit that references this issue
on Oct 10, 2016 - added a commit that references this issue
on Oct 11, 2016 - added a commit that references this issue
on Nov 18, 2016 - added a commit that references this issue
on Jul 27, 2026
I prefer to install all of my dev apps in one directory (C:/apps) but when using the Node.js Windows installer it always gets installed in C:/Program Files regardless of what I put in the installer.
64-bit_