简体   繁体   English

即使在静默模式下,有没有办法在nsis安装程序中显示许可证对话框?

[英]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. 我正在尝试为正在使用的插件创建NSIS安装程序,但我希望它尽可能“免提”。 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. 在静默模式下,仅执行.onInit和Sections,不执行页面,并且无法执行它们。 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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