Which command line parameters can be used to configure installers?

From NSIS Wiki
Jump to navigationJump to search

These options are also documented in the NSIS documentation here.

  • /S
    Silent installation
  • /NCRC
    Skip CRC check of the installer, ignored if CRCCheck force was set in the installer
    • Related to: CRCCheck
  • /D=C:\Bla or /D=C:\Path with spaces
    Set installation folder ($INSTDIR)
    • Must be the last parameter on the command line and must not contain quotes even if the path contains blank spaces.
    • Related to: $INSTDIR

Note that command line options can be ignored or overridden by the author of an installer.

Case-sensitivity

The above command line options are all case-sensitive, so /S will work, but /s won't. If you need them to work in a case-insensitive matter you have to provide some glue code in .onInit such as this one for "silent" functionality:

${GetParameters} $R0
${GetOptionsS} $R0 "/s" $0
IfErrors +2 0
SetSilent silent
ClearErrors

Also see

See function _tWinMain in Source\exehead\Main.c.