I'm using the statement
InstType /COMPONENTSONLYONCUSTOMin a setup script and I need to perform an action only if the components list is visible in the components page. Is there a way to test this with a function?
Thanks.
DD
8 posts
InstType /COMPONENTSONLYONCUSTOMin a setup script and I need to perform an action only if the components list is visible in the components page. Is there a way to test this with a function?
!include logiclib.nsh
outfile 'test.exe'
InstType Typical
InstType /COMPONENTSONLYONCUSTOM
page components
page instfiles
section 'section one' sec01
sectionin 1
sectionend
section 'section two' sec02
sectionin 1
sectionend
section 'section three' sec03
sectionin 1
sectionend
Function .onSelChange
GetCurInstType $R0
${If} $R0 == ${NSIS_MAX_INST_TYPES}
MessageBox MB_OK '$R0'
${EndIf}
FunctionEnd
At which point, $R0 is the index of the item or -1 otherwise.!include WinMessages.nsh
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R0 1017
SendMessage $R0 ${CB_FINDSTRINGEXACT} -1 "STR:Search for me case insensitively" $R0
push $R2
push $R1
push $R0
/* ... */
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R0 1017
System::Call "User32::GetWindowText(i $R0, t .R1, i 256)"
SendMessage $R0 ${CB_FINDSTRINGEXACT} -1 "STR:$R1" $R1
SendMessage $R0 ${CB_GETCOUNT} 0 0 $R2
IntOp $R2 $R2 - 1
IntCmp $R1 $R2 +2
MessageBox MB_OK "Do whatever needed if this is not a custom install."
#end
/* ... */
pop $R0
pop $R1
pop $R2