Currently I'm developing a installation package via NSIS for our products, however, our product manager doesn't like the default style of MUI_PAGE_COMPONENTS, so i wonder how could i implement a component page via NSIS while remove the description box and when the mouse hover on the component item the tooltip will give out the description
Asked
Active
Viewed 886 times
2 Answers
3
!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

Anders
- 97,548
- 12
- 110
- 164
-
Great, that's what I need, I thought i have to write a custom dll and called from the script though, much appreciated! – whossa Aug 03 '12 at 02:15