0

目前我正在通过 NSIS 为我们的产品开发安装包,但是,我们的产品经理不喜欢 MUI_PAGE_COMPONENTS 的默认样式,所以我想知道如何在删除描述框和鼠标时通过 NSIS 实现组件页面将鼠标悬停在组件项上,工具提示将给出描述

4

2 回答 2

2
!define MUI_COMPONENTSPAGE_NODESC
!include MUI2.nsh
!include LogicLib.nsh

!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English

Section Foo SID_FOO
SectionEnd
Section Bar SID_BAR
SectionEnd
Section Baz SID_BAZ
SectionEnd

var ttip

!define WS_POPUP 0x80000000
!define TTF_SUBCLASS    0x010
!define /math TTM_ACTIVATE ${WM_USER} + 1
!define /math TTM_ADDTOOL ${WM_USER} + 4
!define /math TTM_SETTOOLINFO ${WM_USER} + 9
!define /math TTM_TRACKACTIVATE ${WM_USER} + 17
!define /math TTM_TRACKPOSITION ${WM_USER} + 18
!define /math TTM_POP ${WM_USER} + 28
!define /math TTM_POPUP ${WM_USER} + 34

Function .onMouseOverSection
${If} $0 = -1
killtip:
    SendMessage $ttip ${TTM_ACTIVATE} 0 0
    Return
${EndIf}
StrCpy $2 ""
${If} $ttip = 0
    System::Call 'USER32::CreateWindowEx(i${WS_EX_TOPMOST},t"tooltips_class32",i,i${WS_POPUP},i,i,i,i,i0,i,i,i)i.r2'
    StrCpy $ttip $2
${EndIf}
StrCpy $1 ""
${Select} $0
${Case} ${SID_FOO}
    StrCpy $1 "Foo?"
${Case} ${SID_BAR}
    StrCpy $1 "BarBarBar"
${Case} ${SID_BAZ}
    StrCpy $1 "Baaaaaaaaaaaaaaaaaz!!!"
${EndSelect}
FindWindow $3 "#32770" "" $HWNDPARENT
System::Call '*(i40,i${TTF_SUBCLASS},i$3,i0x408,i,i,i,i,i0,tr1)i.r1'
SendMessage $2 ${TTM_ADDTOOL} 0 $1
SendMessage $ttip ${TTM_SETTOOLINFO} 0 $1
SendMessage $ttip ${TTM_ACTIVATE} 1 0
SendMessage $ttip ${TTM_TRACKACTIVATE} 1 $1
System::Free $1
${If} $2 <> 0
    ;BUGFIX: Sometimes we get an initial onMouseOverSection call with no place to show a tip
    System::Call 'USER32::IsWindowVisible(ir3)i.r0'
    ${IfThen} $0 = 0 ${|} goto killtip ${|}
${EndIf}
FunctionEnd
于 2012-08-01T16:38:14.827 回答
0
!define MUI_COMPONENTSPAGE_NODESC 

将从组件页面中删除描述

于 2012-08-01T13:42:43.917 回答