我使用这段代码来改变 MUI_WELCOMEFINISH_BITMAP
欢迎页的文字和标题。
Function MyWelcomeShowCallback
SendMessage $mui.WelcomePage.Text ${WM_SETTEXT} 0 "STR:$(MUI_TEXT_WELCOME_INFO_TEXT)$\n$\nVersion: foo.bar"
FunctionEnd
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\bg2_2.bmp"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_WELCOMEPAGE_TITLE "Title"
!define MUI_WELCOMEPAGE_TEXT "Text"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW MyWelcomeShowCallback
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
我想修改两次位图,一次是欢迎页,一次是结束页。不幸的是,我想改变两次位图,一次是欢迎页,一次是结束页,可惜 !define MUI_WELCOMEFINISHPAGE_BITMAP $bmp
只能使用一次。我知道可以在 Welcome.nsh
但我宁愿把所有的东西都定义在 .nsi
脚本。如何为欢迎页和结束页设置不同的图片?实质上,如何改变if的值?!defined
被用来创建它。
没有定义你可以设置使用不同的图片,但是你可以在页面显示之前覆盖图片。
Function ForceWizard1
SetOverWrite on
File "/oname=$PLUGINSDIR\modern-wizard.bmp" "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp"
SetOverWrite lastused
FunctionEnd
Function ForceWizard2
SetOverWrite on
File "/oname=$PLUGINSDIR\modern-wizard.bmp" "${NSISDIR}\Contrib\Graphics\Wizard\orange-nsis.bmp"
SetOverWrite lastused
FunctionEnd
!include MUI2.nsh
!define MUI_PAGE_CUSTOMFUNCTION_PRE ForceWizard1
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!define MUI_PAGE_CUSTOMFUNCTION_PRE ForceWizard2
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English