开发者

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 th开发者_运维技巧e 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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜