简体   繁体   English

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

[英]How to change MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT if exists two MUI_PAGE_INSTFILES

I have managed to customize the message shown in the title / subtitle after installation: 安装后,我已设法自定义标题/副标题中显示的消息:

!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

My problem is that when I need to add a second part installation ( it is a new mandatory requirement ), and then not get modify / customize messages title / subtitle shown at the end: 我的问题是,当我需要添加第二部分安装( 这是一项新的强制性要求 )时,却没有获得最后显示的修改/自定义消息标题/副标题:

!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

Now, the same message is always displayed at the end for Title/Subtitle: "Installation Complete" // "Setup was completed successfully.". 现在,标题/副标题的末尾总是显示相同的消息:“安装完成” //“安装成功完成”。 Nevertheless, the 'completed' text value is modified successfully ("My custom text"). 但是,“完成”文本值已成功修改(“我的自定义文本”)。

Please, can anyone help me? 拜托,有人可以帮我吗?

Thanks in advance! 提前致谢!

If you read the MUI documentation carefully you will find this in the "Page settings" section: 如果您仔细阅读了MUI文档,则会在“页面设置”部分中找到以下内容:

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 . 如果要将其应用于多个页面,则必须重复该设置

Only the defines listed under "Interface settings" are global. 只有“接口设置”下列出的定义是全局的。

!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"

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

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