Nullsoft Installer Switches

Common command line parameters for installers built using the NSIS are: /S runs the installer or uninstaller silently. /D sets the default installation directory. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces. Only absolute paths are supported. More information about.

Active3 years, 6 months ago

How to make a Nullsoft Scriptable Install System (NSIS) installer silent?

From Wikipedia:

'Nullsoft Scriptable Install System (NSIS), est un logiciel libre contrôlable par script, qui permet la création d'installateurs pour Windows. Il a été initialement développé par Nullsoft, la société créatrice de Winamp. NSIS est une alternative aux produits commerciaux, comme InstallShield.

The NSIS compiler program makensis compiles scripts like the following example into executable installation programs. Each line in the script contains a single command.'

Nathan
3,8675 gold badges32 silver badges56 bronze badges
kiriloffkiriloff
15.2k31 gold badges110 silver badges192 bronze badges

1 Answer

Command line usage

1. MakeNSIS usage

Compile a NSIS (.nsi) script o generate installer

Example

2. Installer usage

Some options

Nullsoft Installer Switches
  • /S runs the installer or uninstaller silently
  • /D sets the default installation directory ($INSTDIR), overriding InstallDir and InstallerDirRegKey. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces. Only absolute paths are supported.

Examples

Silent installers / uninstallers

  • To check whether installer is silent, use IfSilent

  • To skip some insructions in silent mode (user interaction, creation of window), use jump instruction

Example

Nullsoft Installer Silent Uninstall

In this example, message box is displayed iif installer is silent. +2 means that nex instruction is skipped if IfSilent is true. 0 means hat compiler should go to next instruction if IfSilent is false.

  • To set an installer in silent mode (just for a while), use SetSilent in .onInit method. Options are silent for silent mode and normal for non silent mode.

  • To set installer | unsinstaller silent, you can also use

    SilentInstall silent

    SilentUnInstall silent

  • In silent mode, all screens from installer itself are not displayed. However, message boxes and all other screens not flagged with SF_SELECTED may be displayed. To make installer fully silent, use either instruction jump (in general), or flag /SD IDOK | IDCANCEL (for OK|CANCEL messsage boxes).

    MessageBox MB_OK|MB_ICONINFORMATION 'This is not a silent installer' /SD IDOK

Here, if silent mode is on, message box is not displayed and behaves as with user OK. Beware of the options order there

  • If some information should be gathered from user in silent mode, some more options can be passed to function .onInit with GetOptions,

like here:

Nullsoft Installer Switches

References

Leif Gruenwoldt
11.1k4 gold badges50 silver badges61 bronze badges
kiriloffkiriloff

Nullsoft Installer Command Line Switches

15.2k31 gold badges110 silver badges192 bronze badges
Nullsoft Installer Switches

Nullsoft Installer Silent Switches

Nullsoft Installer Switches

Nullsoft Installer Command Line Options

Not the answer you're looking for? Browse other questions tagged buildinstallernsissilentsilent-installer or ask your own question.