如果存在两个 MUI_PAGE_INSTFILES,如何更改 MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT

How to change MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT if exists two MUI_PAGE_INSTFILES

我已成功自定义安装后标题/副标题中显示的消息:

!define APP_NAME 'Test15'

name ${APP_NAME}
outfile '${APP_NAME}.exe'
showinstdetails show
InstallDir '$PROGRAMFILES${APP_NAME}'

!include 'mui.nsh'

Var CompletedText
CompletedText $CompletedText


Var MUI_HeaderText
Var MUI_HeaderSubText
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "$MUI_HeaderText"
!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "$MUI_HeaderSubText"


!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"


Section "One"
    MessageBox MB_OK "Section One"
SectionEnd



Section -"Post"
  ;MessageBox MB_OK "Section Post"
  StrCpy $CompletedText "My custom text"
  StrCpy $MUI_HeaderText "My custom header text"
  StrCpy $MUI_HeaderSubText "My custom header subText"
  ;MessageBox MB_OK "OUTING Section Post"
SectionEnd

我的问题是,当我需要添加第二部分安装时(这是一项新的强制性要求),然后无法修改/自定义消息标题/副标题显示在结束:

!define APP_NAME 'Test15'

name ${APP_NAME}
outfile '${APP_NAME}.exe'
showinstdetails show
InstallDir '$PROGRAMFILES${APP_NAME}'

!include 'mui.nsh'

Var CompletedText
CompletedText $CompletedText


Var MUI_HeaderText
Var MUI_HeaderSubText
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "$MUI_HeaderText"
!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "$MUI_HeaderSubText"


!insertmacro MUI_PAGE_INSTFILES

;This my second part instalation!!
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"


Section "One"
   MessageBox MB_OK "Section One"
SectionEnd



Section -"Post"
  ;MessageBox MB_OK "Section Post"
  StrCpy $CompletedText "My custom text"
  StrCpy $MUI_HeaderText "My custom header text"
  StrCpy $MUI_HeaderSubText "My custom header subText"
  ;MessageBox MB_OK "OUTING Section Post"
SectionEnd

现在,Title/Subtitle 的末尾始终显示相同的消息:"Installation Complete" // "Setup was completed successfully."。尽管如此,'completed' 文本值修改成功 ("My custom text").

拜托,谁能帮帮我?

提前致谢!

如果您仔细阅读 MUI 文档,您会在 "Page settings" 部分找到:

Page settings apply to a single page and should be set before inserting a page macro. The same settings can be used for installer and uninstaller pages. You have to repeat the setting if you want it to apply to multiple pages.

只有 "Interface settings" 下列出的定义是全局的。

!include MUI.nsh
!define MUI_PAGE_HEADER_TEXT "Install page #1"
!define MUI_PAGE_HEADER_SUBTEXT "Foo foo foo"
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "Did part 1"
!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "..."
!insertmacro MUI_PAGE_INSTFILES
!define MUI_PAGE_HEADER_TEXT "Install page #2"
!define MUI_PAGE_HEADER_SUBTEXT "Bar bar bar!"
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "All done"
!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "ZZZzzz.."
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"