Browse Source

win,msi: create npm folder in AppData directory

Create the empty npm folder in Roaming\Appdata so that non-Administrator
users have a place to store global packages. This fixes the error Error:
ENOENT, stat error that occurs when a user tries to run the npm install
<package> command.

Bug: https://github.com/joyent/node/issues/8141
PR: https://github.com/joyent/node/pull/8838
Reviewed-by: Bert Belder <bertbelder@gmail.com>
v0.10
Steven Rockarts 10 years ago
committed by Bert Belder
parent
commit
18d413d299
  1. 12
      tools/msvs/msi/product.wxs

12
tools/msvs/msi/product.wxs

@ -46,6 +46,7 @@
<ComponentRef Id="NodeExecutable"/> <ComponentRef Id="NodeExecutable"/>
<ComponentRef Id="NodeVarsScript"/> <ComponentRef Id="NodeVarsScript"/>
<ComponentRef Id="NodeStartMenuAndRegistryEntries"/> <ComponentRef Id="NodeStartMenuAndRegistryEntries"/>
<ComponentRef Id="AppData" />
<ComponentGroupRef Id="Product.Generated"/> <ComponentGroupRef Id="Product.Generated"/>
<Feature Id="NodePerfCtrSupport" <Feature Id="NodePerfCtrSupport"
@ -70,6 +71,7 @@
<ComponentRef Id="NpmCmdScript"/> <ComponentRef Id="NpmCmdScript"/>
<ComponentRef Id="NpmBashScript"/> <ComponentRef Id="NpmBashScript"/>
<ComponentRef Id="NpmConfigurationFile"/> <ComponentRef Id="NpmConfigurationFile"/>
<ComponentRef Id="AppData" />
<ComponentGroupRef Id="NpmSourceFiles"/> <ComponentGroupRef Id="NpmSourceFiles"/>
</Feature> </Feature>
@ -184,6 +186,16 @@
</Component> </Component>
</Directory> </Directory>
</Directory> </Directory>
<Directory Id="AppDataFolder">
<Directory Id="AppDataDir" Name="npm">
<Component Id="AppData" Guid="D3B35D0E-D0F9-4D11-A773-D4608E90E1D1">
<CreateFolder />
<RemoveFolder Id="AppDataDir" On="uninstall" />
<RegistryValue Root="HKCU" Key="$(var.RegistryKeyPath)\Components" Type="string" Value="" />
</Component>
</Directory>
</Directory>
</DirectoryRef> </DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder"> <DirectoryRef Id="ApplicationProgramsFolder">

Loading…
Cancel
Save