NSIS:从函数调用MUI“U页面”许可证,但获取;XPStyle无效“;错误
我有一个带有“许可条款和条件”复选框的自定义对话框,其中复选框的文本实际上是一个链接,该链接应该显示许可对话框NSIS:从函数调用MUI“U页面”许可证,但获取;XPStyle无效“;错误,nsis,Nsis,我有一个带有“许可条款和条件”复选框的自定义对话框,其中复选框的文本实际上是一个链接,该链接应该显示许可对话框 ; === LicenseLink (type: Link) === ${NSD_CreateLink} 132.96u 100.92u 107.29u 14.15u "License terms and conditions." Pop $hCtl_welcome_LicenseLink ${NSD_OnClick} $hCtl_welcome_LicenseLink ShowLic
; === LicenseLink (type: Link) ===
${NSD_CreateLink} 132.96u 100.92u 107.29u 14.15u "License terms and conditions."
Pop $hCtl_welcome_LicenseLink
${NSD_OnClick} $hCtl_welcome_LicenseLink ShowLicense
现在在函数“ShowLicense”中,我尝试调用
!insertmacro MUI_PAGE_LICENSE
但是得到一个错误:
错误:函数中的命令XPStyle无效
很明显,我的做法是错误的,我无法解释错误。如果有任何关于如何解决这个问题的想法,我会很高兴
谢谢 您不能调用
!insertmacro MUI_PAGE_许可证
动态地,页数在编译时确定
但是,您可以跳过页面以实现此目的:
InstallDir "$Temp\Test"
!include MUI2.nsh
!include nsDialogs.nsh
!include WinMessages.nsh
!include LogicLib.nsh
!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipLicensePage
!insertmacro MUI_PAGE_LICENSE "${__FILE__}"
Page Custom InfoPageCreate InfoPageValidate
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English
Var ShowLicensePage
Function SkipLicensePage
${IfThen} $ShowLicensePage = 0 ${|} Abort ${|} ; Skip it the first time
FunctionEnd
Function OnShowLicense
SendMessage $hWndParent ${WM_COMMAND} 3 "" ; Click the (hidden) back button
FunctionEnd
Var InstDirCtl
Function InfoPageCreate
StrCpy $ShowLicensePage 1
GetDlgItem $0 $hWndParent 3
ShowWindow $0 0 ; Hide the back button
!insertmacro MUI_HEADER_TEXT "Blah blah" "blah blah blah"
nsDialogs::Create 1018
Pop $0
${NSD_CreateText} 0 13u 100% 12u "$InstDir"
Pop $InstDirCtl
${NSD_CreateLink} 2u 40u -4u 12u "License"
Pop $0
${NSD_OnClick} $0 OnShowLicense
nsDialogs::Show
FunctionEnd
Function InfoPageValidate
${NSD_GetText} $InstDirCtl $InstDir
FunctionEnd
您正在尝试创建一个“输入”页面+instfiles页面安装程序吗?@Anders-我希望我正确理解您的问题:但是,是的,我正在尝试在同一页面上创建一个包含Installpath和“同意许可条款”的页面。然后用户只需单击install并完成安装程序。