简体   繁体   English

NSIS中的MUI页面顺序

[英]MUI pages order in NSIS

How to change order of pages depending on some clauses? 如何根据某些条款更改页面顺序? For example, there are 2 radiobuttons on custom page - 'repair programm' and 'uninstall programm'. 例如,自定义页面上有2个单选按钮-“修复程序”和“卸载程序”。 When I select 'repair programm' next should show 5 pages and when I select another radiobutton should be 2 pages. 当我选择“修复程序”时,下一个应该显示5页,而当我选择另一个单选按钮时应该显示2页。 And is it possible use in uninstaller install pages and vice versa? 可以在卸载程序安装页面中使用吗,反之亦然?

MUI_UNPAGE_CONFIRM does not really make sense in a installer, other than that you can use all page types in both the installer and uninstaller. MUI_UNPAGE_CONFIRM在安装程序中实际上没有意义,除了可以在安装程序和卸载程序中使用所有页面类型之外。

To skip a page you must call Abort in the pre callback function for that page. 要跳过页面,您必须在该页面的预回调函数中调用Abort You can also jump directly to a specific page . 您也可以直接跳到特定页面

!include MUI2.nsh
!include LogicLib.nsh

Var pagemode
Function selectpagemode
MessageBox MB_YESNO "Mode A?" IDNO nope
    StrCpy $pagemode "A"
    Return
    nope:
    StrCpy $pagemode "B"
FunctionEnd

Function onlymodeA
${IfThen} $pagemode != "A" ${|} Abort ${|}
FunctionEnd
Function onlymodeB
${IfThen} $pagemode == "A" ${|} Abort ${|}
FunctionEnd

!define MUI_PAGE_CUSTOMFUNCTION_LEAVE selectpagemode
!insertmacro MUI_PAGE_WELCOME 

;Mode A
!define MUI_PAGE_CUSTOMFUNCTION_PRE onlymodeA
!insertmacro MUI_PAGE_LICENSE "${__FILE__}"
!define MUI_PAGE_CUSTOMFUNCTION_PRE onlymodeA
!insertmacro MUI_PAGE_COMPONENTS

;Mode B
!define MUI_PAGE_CUSTOMFUNCTION_PRE onlymodeB
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_PRE onlymodeB
!insertmacro MUI_PAGE_LICENSE "${__FILE__}"

!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English

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

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