13

I create a script to auto install all my dev stack on Windows.

I have a problem with Node.js

What's the command line to install node-v0.10.23-x64.msi in C:\Tools silently?

Thanks.

foozoor
  • 463
  • 1
  • 5
  • 16

4 Answers4

12

I found it.

This is the correct way to install Node.js on Windows silently in a custom directory.

msiexec.exe /i node-v0.10.23-x64.msi INSTALLDIR="C:\Tools\NodeJS" /quiet
foozoor
  • 463
  • 1
  • 5
  • 16
8
msiexec.exe /i node-v0.10.23-x64.msi /qn
  • /i means normal install
  • /qn means no UI

I do not known how to set the destination, you can read documentation here, and check if msi supports it:

http://www.advancedinstaller.com/user-guide/msiexec.html

Pierre Arnaud
  • 10,212
  • 11
  • 77
  • 108
damphat
  • 18,246
  • 8
  • 45
  • 59
  • I already tried that but Node.js is not available from cmd (not in the PATH) after installation and I don't find how to specify a destination. – foozoor Dec 14 '13 at 15:02
  • Can you specify TARGETDIR? Have you close cmd.exe and open it again? – damphat Dec 14 '13 at 15:47
3

This will do the exact installation as doing it manual from the UI

msiexec /i node-v6.11.2-x64.msi TARGETDIR="C:\Program Files\nodejs\" ADDLOCAL="NodePerfCtrSupport,NodeEtwSupport,DocumentationShortcuts,EnvironmentPathNode,EnvironmentPathNpmModules,npm,NodeRuntime,EnvironmentPath" /qn
user1026570
  • 51
  • 1
  • 5
3

To expand a little on foozar's answer, which works.

msiexec.exe /i node-v0.10.23-x64.msi INSTALLDIR="C:\Tools\NodeJS" /quiet

Note that /quiet may be better replaced with /passive:

  • Passive shows the status bar, and more importantly, prompts the user for the admin password if needed.
  • Quiet mode will just fail if the installer doesn't have privileges.
henrycarteruk
  • 12,708
  • 2
  • 36
  • 40
Mike
  • 31
  • 3