taxilian
taxilian

Reputation: 14324

Is there a way to display a license dialog in a nsis installer even in silent mode?

I'm trying to create a NSIS installer for a plugin I'm working with, but I want it to be as "hands free" as possible. Specifically, I do not want the "click here to close" at the end of the installer; instead, I want the license to come up and when they click "agree" it installs and closes.

I can do this with a silent install, except that the license page doesn't show up either; Is there a way to make the install be silent except for the license page?

Upvotes: 0

Views: 1170

Answers (1)

Anders
Anders

Reputation: 101676

In silent mode only .onInit and Sections are executed, the pages are not executed and there is no way to execute them. To pull this off you would have to fake it with a "custom silent mode":

!include LogicLib.nsh

var mySilent

Function .onInit
${If} ${Silent}
    StrCpy $mySilent 1
    SetAutoClose true ;Auto close InstFiles page
    SetSilent normal
${EndIf}
FunctionEnd

Function SkipInSilent
${IfThen} $mySilent <> 0 ${|} Abort ${|}
FunctionEnd

Page License
Page Directory SkipInSilent
Page Components SkipInSilent
Page InstFiles

Section
SectionEnd

Upvotes: 1

Related Questions