Archive: GetCurInstType get 0 not 32


GetCurInstType get 0 not 32
hi,

GetCurInstType must get 32 if InstType Custom is choosen.
The function get 0 if only one section choosen.
The function get 32 if more as one section choosen.

!include "MUI.nsh"

Name "test"
OutFile "test.exe"
XPStyle on
ShowInstDetails show

InstType "Point1"
InstType "/CUSTOMSTRING=Point2"

!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"

Section "Sec1" test_section_id
SectionIn 1
GetCurInstType $0
MessageBox MB_OK $0
SectionEnd

Section /o "Sec2"
SectionIn 32
SectionEnd

Section /o "Sec3"
SectionIn 32
SectionEnd

Section /o "Sec4"
SectionIn 32
SectionEnd

Thanks.


32 is still an installation type for the one-based SectionIn count. If you want the three last sections to not be in the first installation type, don't use SectionIn at all.


OK!

docu: .onSelChange
Selection changes include both section selection and installation type change.

does Selection change mean only manualy change of checkboxes in the list with sections, and not manually change of dropdown wiht InstType?

I'v thought, GetCurInstType get 32 in both cases:
if I choose custom InstType in the dropdown or
if I change selection by section and dropdown changes
to custom InstType on the basis of SectionIn.

!include "MUI.nsh"

Name "test"
OutFile "test.exe"
XPStyle on
ShowInstDetails show

InstType "Point1"
InstType "/CUSTOMSTRING=Point2"

!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"

Section "sec1_id" sec1_id
SectionEnd

Section "sec2_id" sec2_id
SectionEnd

Section "sec3_id" sec3_id
SectionEnd

Section "sec4_id" sec4_id
SectionEnd

Function .onSelChange
GetCurInstType $0
MessageBox MB_OK $0
FunctionEnd


Thank You!


"Selection change" doesn't mean change with the drop-down list. "Installation type change", on the other hand, does refer to the drop-down list.


The GetCurInstType returns only 0 when select "custom" from dropdown menu
I am still confused about the function GetCurInstType, it seems the return value of it changed to 32 only when any of the checkbox of section has been changed, not by selecting the “custom” from the dropdown list of insttype. But in users manual, it says: “The value of ${NSIS_MAX_INST_TYPES} (32 by default) means that the custom install type was selected.” Doesn’t it mean that the custom insttype was selected from the dropdown menu?


find answer to my question in another post
Kichik said:GetCurInstType returns the installation type according to the selection. If the user selected Custom but selected the same components that would be selected for another installation type, GetCurInstType will not return Custom.