简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM