NSIS Scroll License Welcome Screen

邮差的信 提交于 2019-12-10 23:18:37

问题


I have an installer that is having problems interacting with the scroll license plugin. The installer works great without the plugin, this is what the plugin has me include:

!

include MUI.nsh

!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_LICENSE "EULA.txt"

unction LicenseShow
 ScrollLicense::Set /NOUNLOAD
FunctionEnd

Function .onGUIEnd
 ScrollLicense::Unload
FunctionEnd

Section A 
Section End

The problem I run into is here. If the Welcome page displays BEFORE the License page it will not be able to progress to the next screen because it is looking for a scroll bar and accept button. If I remove the WELCOME page everything works fine. Does anyone have experience with this plugin? or how I can get the plugin to ignore the MUI_PAGE_WELCOME?

!insertmacro MUI_PAGE_WELCOME <--- If I remove this Welcome page everything works great!
!insertmacro MUI_PAGE_LICENSE "eula.rtf" 
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

回答1:


Try moving the line:

!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow

Below the line (more specifically, directly above the MUI_PAGE_LICENSE line):

!insertmacro MUI_PAGE_WELCOME

I used ExampleCheckBox.nsi as supplied from the ScrollLicense plugin and reproduced your behavior when I had:

!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE ExampleCheckBox.nsi

The problem went away when I moved the !define line to after the MUI_PAGE_WELCOME.

!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_LICENSE ExampleCheckBox.nsi

I'm not familiar with this plugin but I suspect there is some kind of side-effect that disables the Next button of the next displayed page...




回答2:


I think what you are missing is how the example needs to fit into the "flow" of the other MUI pages.

!include MUI.nsh

;;this goes before the License page if you want it first.
!insertmacro MUI_PAGE_WELCOME

;;now add the example stuff
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_LICENSE "EULA.txt" ;;update for what file you want to include!

Function LicenseShow
    ScrollLicense::Set /NOUNLOAD
FunctionEnd

Function .onGUIEnd
    ScrollLicense::Unload
FunctionEnd

;;now continue with the rest of the pages
;;and we *don't* repeat the MUI_PAGE_LICENSE
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES


来源:https://stackoverflow.com/questions/10389025/nsis-scroll-license-welcome-screen

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!