【问题标题】:Use 2 welcome/finish page images in nsis在 nsis 中使用 2 个欢迎/完成页面图像
【发布时间】:2020-04-24 06:45:18
【问题描述】:

我正在使用此代码更改欢迎页面的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 中更改bmp 路径,但我宁愿在.nsi 脚本中定义所有内容。如何为欢迎页面和完成页面设置不同的图像?从本质上讲,如果使用!defined 创建它,如何更改值。

【问题讨论】:

    标签: installation nsis


    【解决方案1】:

    没有定义你可以设置使用不同的图像,但你可以在页面显示之前覆盖图像:

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-11-13
      • 1970-01-01
      • 2013-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-03
      相关资源
      最近更新 更多