簡體   English   中英

如何為不同的 NSIS 安裝程序頁面設置不同的 header 位圖?

[英]How to set different header bitmaps for different NSIS installer's pages?

How can i set different bitmaps for different pages, say, i want to set a bitmap to be header of license page and another bitmap to be header of directory page?

NSIS 的設計初衷並非如此,但沒有什么能阻止您在 pre 和/或 show 回調函數中調整頁面:

!include MUI2.nsh
!define MUI_HEADERIMAGE

!insertmacro MUI_PAGE_WELCOME

!define MUI_PAGE_CUSTOMFUNCTION_PRE resetimg
!insertmacro MUI_PAGE_COMPONENTS

!define MUI_PAGE_CUSTOMFUNCTION_PRE setdirimg
!insertmacro MUI_PAGE_DIRECTORY

!define MUI_PAGE_CUSTOMFUNCTION_PRE resetimg
!insertmacro MUI_PAGE_COMPONENTS

!insertmacro MUI_LANGUAGE "English"

!macro fixheaderimgafterupdate
;Ugly way to trigger a repaint
GetDlgItem $0 $hwndparent 1046
ShowWindow $0 0
ShowWindow $0 1
!macroend

Function setdirimg
File "/oname=$PLUGINSDIR\hdrdir.bmp" "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
SetBrandingImage /IMGID=1046 "$PLUGINSDIR\hdrdir.bmp"
!insertmacro fixheaderimgafterupdate
FunctionEnd

Function resetimg
#SetBrandingImage /IMGID=1046 "$PLUGINSDIR\modern-header.bmp" ;This also works, but does not deal with stretching etc
!insertmacro MUI_HEADERIMAGE_INIT ""
!insertmacro fixheaderimgafterupdate
FunctionEnd

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM