This repository has been archived by the owner. It is now read-only.

Windows installer: add support for side-by-side installations #2924

Open
mcartoixa opened this Issue Mar 13, 2012 · 11 comments

Comments

Projects
None yet
7 participants
@mcartoixa

On windows, it should be possible to find information about node installation (version, path) in the registry.

Basic use case: the development of a MSBuild task that would encapsulate node.exe (and its output) without relying on it being in the current PATH (very convenient in continuous integration scenarios).

@mcartoixa

This comment has been minimized.

Show comment Hide comment
@mcartoixa

mcartoixa Mar 13, 2012

I have already done the same thing for OpenCover (cf. mcartoixa/opencover@134ac7e#L5R93).

I could contribute to this if needed/desired.

I have already done the same thing for OpenCover (cf. mcartoixa/opencover@134ac7e#L5R93).

I could contribute to this if needed/desired.

@ghost ghost assigned piscisaureus Mar 13, 2012

@isaacs

This comment has been minimized.

Show comment Hide comment
@isaacs

isaacs Mar 14, 2012

Patch welcome. Please sign the CLA http://nodejs.org/cla.html. @igorzi or @piscisaureus must +1 it.

isaacs commented Mar 14, 2012

Patch welcome. Please sign the CLA http://nodejs.org/cla.html. @igorzi or @piscisaureus must +1 it.

@mcartoixa

This comment has been minimized.

Show comment Hide comment
@mcartoixa

mcartoixa Mar 15, 2012

I have changed (cf. 8b72423) the installation to be per machine (as opposed to per user):

  • processes that use this information may run under a different user than the one who installed node.js (think continuous integration).
  • binaries are installed in %ProgramFiles(x86)% anyway.

Would that be a problem?

I have changed (cf. 8b72423) the installation to be per machine (as opposed to per user):

  • processes that use this information may run under a different user than the one who installed node.js (think continuous integration).
  • binaries are installed in %ProgramFiles(x86)% anyway.

Would that be a problem?

@igorzi

This comment has been minimized.

Show comment Hide comment
@igorzi

igorzi Mar 15, 2012

@mcartoixa does this still put %appdata%\npm on the path?

igorzi commented Mar 15, 2012

@mcartoixa does this still put %appdata%\npm on the path?

@mcartoixa

This comment has been minimized.

Show comment Hide comment
@mcartoixa

mcartoixa Mar 16, 2012

@igorzi: yes it does. But then it makes no sense to have a per machine install set up a user specific path so I'll revert to a per user install.

There is a catch though: right now this user specific path is set at the system level (ie it is set for all users). But obviously, only the user that installed node.js has access to it... So I will change the setup so that this path is set at the user level.

Note: a Windows friendly npm would handle this user specific path by itself (don't require it to be in the path, assume that it exists for the current user, and create it if necessary). I don't know if this is even possible (I'm very new to the whole node.js stack), but this would certainly be desirable (e.g. in the per machine scenario).

@igorzi: yes it does. But then it makes no sense to have a per machine install set up a user specific path so I'll revert to a per user install.

There is a catch though: right now this user specific path is set at the system level (ie it is set for all users). But obviously, only the user that installed node.js has access to it... So I will change the setup so that this path is set at the user level.

Note: a Windows friendly npm would handle this user specific path by itself (don't require it to be in the path, assume that it exists for the current user, and create it if necessary). I don't know if this is even possible (I'm very new to the whole node.js stack), but this would certainly be desirable (e.g. in the per machine scenario).

@mcartoixa

This comment has been minimized.

Show comment Hide comment
@mcartoixa

mcartoixa Mar 16, 2012

Quick follow up: if this path could be shared by all users, maybe the CommonAppDataFolder property could be considered.

Quick follow up: if this path could be shared by all users, maybe the CommonAppDataFolder property could be considered.

@isaacs

This comment has been minimized.

Show comment Hide comment
@isaacs

isaacs Mar 16, 2012

@mcartoixa The app data folder is set as a variable in the builtin npmrc file.

C:\>cat "C:\Program Files (x86)\nodejs\node_modules\npm\npmrc"
prefix=${APPDATA}\npm

As a result, even though there is a single install for all users, it's still going to use the current user's settings.

However! The MSI doesn't put ${APPDATA}\npm in the %Path% for anyone except the user doing the installing, so that's a problem for the multiuser case.

The vast majority of Windows users are using Windows on a single-user machine, so it's not so terrible. However, it would be nice to have a solution, even if it wasn't the default, to perhaps configure npm to use a shared global install location (with the caveat that global installs will have to be done as an Administrator), or perhaps an option to update the %Path% of all users somehow to include their respective %APPDATA%\npm folder.

isaacs commented Mar 16, 2012

@mcartoixa The app data folder is set as a variable in the builtin npmrc file.

C:\>cat "C:\Program Files (x86)\nodejs\node_modules\npm\npmrc"
prefix=${APPDATA}\npm

As a result, even though there is a single install for all users, it's still going to use the current user's settings.

However! The MSI doesn't put ${APPDATA}\npm in the %Path% for anyone except the user doing the installing, so that's a problem for the multiuser case.

The vast majority of Windows users are using Windows on a single-user machine, so it's not so terrible. However, it would be nice to have a solution, even if it wasn't the default, to perhaps configure npm to use a shared global install location (with the caveat that global installs will have to be done as an Administrator), or perhaps an option to update the %Path% of all users somehow to include their respective %APPDATA%\npm folder.

@mcartoixa

This comment has been minimized.

Show comment Hide comment
@mcartoixa

mcartoixa Mar 16, 2012

Or (I understand this is related to another project) :

  • have npm use %ALLUSERSPROFILE% instead of %APPDATA%. This is accessible by all users.
  • the process that creates the npm subfolder should grant writing rights to all users. The MSI could do that.

I'll leave it at that for the current issue. Thanks for the heads up.

Or (I understand this is related to another project) :

  • have npm use %ALLUSERSPROFILE% instead of %APPDATA%. This is accessible by all users.
  • the process that creates the npm subfolder should grant writing rights to all users. The MSI could do that.

I'll leave it at that for the current issue. Thanks for the heads up.

@sblom

This comment has been minimized.

Show comment Hide comment
@sblom

sblom Feb 7, 2013

Still trying to work out how this interacts with near-term aspirations to support side-by-side installation of multiple Node versions, so holding off for now. We still want to make this happen.

sblom commented Feb 7, 2013

Still trying to work out how this interacts with near-term aspirations to support side-by-side installation of multiple Node versions, so holding off for now. We still want to make this happen.

@jasnell

This comment has been minimized.

Show comment Hide comment
@jasnell

jasnell May 18, 2015

Member

@orangemocha ... still relevant?

Member

jasnell commented May 18, 2015

@orangemocha ... still relevant?

@orangemocha

This comment has been minimized.

Show comment Hide comment
@orangemocha

orangemocha May 20, 2015

Member

Yes. Changing the title based on this comment: joyent#2948 (comment)

Only partially. Please keep issue #2924 open, because we're still working on figuring out the right way to let multiple versions live side by side, and we'll get more registry structure created correctly then. Meanwhile, there is a registry key being created, but it's not quite what you originally requested--i.e. it's installer-specific and doesn't include a version number yet.

Member

orangemocha commented May 20, 2015

Yes. Changing the title based on this comment: joyent#2948 (comment)

Only partially. Please keep issue #2924 open, because we're still working on figuring out the right way to let multiple versions live side by side, and we'll get more registry structure created correctly then. Meanwhile, there is a registry key being created, but it's not quite what you originally requested--i.e. it's installer-specific and doesn't include a version number yet.

@orangemocha orangemocha changed the title from Windows installer should add installation information to registry to Windows installer: add support for side-by-side installations May 20, 2015

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