如何在NSIS中配置卸载程序的欢迎页面,INSTFILES页面和unistaller完成页面?

时间:2016-02-19 08:29:25

标签: nsis

我想更改卸载程序欢迎页面上的默认文本,例如欢迎页面标题应为"欢迎使用我的卸载设置"我希望标题下面的文字像"安装程序将指导您完成MYAPP的卸载。在开始卸载之前,请确保MYAPP未运行。"    在MUI_UNPAGE_INSTFILES页面上,我希望标题为" Unistall MYAPP"下面我要显示"从您的计算机中移除MYAPP"。在完成页面上,我想要显示" MYAPP已从您的计算机上卸载。点击“完成”#39;关闭设置!" 我在下面这样做 -

!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH

但它显示的是默认文字,例如"已从您的计算机上卸载名称"我想配置它以在页面上显示我自己的文本。我怎么能这样做?

1 个答案:

答案 0 :(得分:0)

您可以覆盖所有字符串,只需在MUI documentation中查找定义。

!include MUI2.nsh
!insertmacro MUI_PAGE_INSTFILES
!define MUI_WELCOMEPAGE_TITLE "Blah blah title"
!define MUI_WELCOMEPAGE_TEXT "Blah blah welcome page text"
!insertmacro MUI_UNPAGE_WELCOME
!define MUI_PAGE_HEADER_TEXT "Header blah"
!define MUI_PAGE_HEADER_SUBTEXT "Subheader blah"
!define MUI_UNCONFIRMPAGE_TEXT_TOP "Blah blah title"
!define MUI_UNCONFIRMPAGE_TEXT_LOCATION "Blah blah location"
!insertmacro MUI_UNPAGE_CONFIRM
!define MUI_PAGE_HEADER_TEXT "Uninstall MYAPP"
!define MUI_PAGE_HEADER_SUBTEXT "Remove MYAPP from your computer"
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "Done blah"
!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "blah blah"
!insertmacro MUI_UNPAGE_INSTFILES
!define MUI_FINISHPAGE_TITLE "Blah blah title"
!define MUI_FINISHPAGE_TEXT "MYAPP has been uninstalled from your computer.Click 'Finish' to close the setup!"
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE English

Section 
SetOutPath "$Temp\MUITest"
WriteUninstaller "$Temp\MUITest\Uninst.exe"
ExecShell "" "$Temp\MUITest\Uninst.exe"
Quit
SectionEnd
Section Uninstall
SetAutoClose false ; Without this you never get to see MUI_INSTFILESPAGE_FINISHHEADER_TEXT
Sleep 3333
Delete "$InstDir\Uninst.exe"
RMDir "$InstDir"
SectionEnd