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.”
# Example script
Name "Example1"
OutFile "example1.exe"
InstallDir "$PROGRAMFILES\Example1"
Page Directory
Page InstFiles
Section
SetOutPath $INSTDIR
File ..\makensis.exe
SectionEnd
Command line usage
1. MakeNSIS usage
Compile a NSIS (.nsi) script o generate installer
Example
2. Installer usage
Some options
Examples
Silent installers / uninstallers
To check whether installer is silent, use
IfSilentTo skip some insructions in silent mode (user interaction, creation of window), use jump instruction
Example
In this example, message box is displayed iif installer is silent.
+2means that nex instruction is skipped if IfSilent is true.0means hat compiler should go to next instruction if IfSilent is false.To set an installer in silent mode (just for a while), use
SetSilentin.onInitmethod. Options aresilentfor silent mode andnormalfor non silent mode.To set installer | unsinstaller silent, you can also use
SilentInstall silentSilentUnInstall silentIn 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 IDOKHere, if silent mode is on, message box is not displayed and behaves as with user OK.
Beware of the options order there
like here:
References
NSIS silent install 1
NSIS silent install 2
NSIS silent install 3