Old 14th April 2017, 09:50   #1
Kalakom
Junior Member
 
Join Date: Apr 2017
Posts: 5
Page SetupType don't work correctly ...

Why the "MessageBox MB_ICONEXCLAMATION|MB_OK sec2" is called then I select the STANDARD radiobutton. I placed this section only in the complete ... ?

Please, compile the example ...

PHP Code:
!include "UMUI.nsh"
!include "LogicLib.nsh"

!define UMUI_SETUPTYPEPAGE_STANDARD "$(UMUI_TEXT_SETUPTYPE_STANDARD_TITLE)"
InstType "$(UMUI_TEXT_SETUPTYPE_STANDARD_TITLE)"
!define UMUI_SETUPTYPEPAGE_COMPLETE "$(UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE)"
InstType "$(UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE)"
!define UMUI_SETUPTYPEPAGE_DEFAULTCHOICE ${UMUI_STANDARD}
!
define MUI_PAGE_CUSTOMFUNCTION_LEAVE leavePageSetupType
!insertmacro UMUI_PAGE_SETUPTYPE 

!insertmacro MUI_LANGUAGE "English"

Section "1" sec1
    SectionIn 1 
# I believe that the section will be selected by STANDARD only
SectionEnd

Section 
"2" sec2
    SectionIn 2 
# I believe that the section will be selected by COMPLETE only
SectionEnd

Function leavePageSetupType

    
${If} ${SectionIsSelected} ${sec1}
      
# In result the MessageBox is called when STANDARD selected and even COMPLETE selected ... why? 
        
MessageBox MB_ICONEXCLAMATION|MB_OK sec1
    
${EndIf}
    ${If} ${
SectionIsSelected} ${sec1}
        
# In result the MessageBox is called when COMPLETE selected and even STANDARD selected ... why? 
        
MessageBox MB_ICONEXCLAMATION|MB_OK sec2
    
${EndIf}
    
FunctionEnd 
Kalakom is offline   Reply With Quote
Old 14th April 2017, 14:54   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,590
You are using ${If} ${SectionIsSelected} ${sec1} in both tests!

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 14th April 2017, 15:46   #3
Kalakom
Junior Member
 
Join Date: Apr 2017
Posts: 5
Yes, thank you - a typo. After making these changes, the problem still remains. If you select the type of installation "Standard" we will see the message sec1 - all right. But when selecting the type of installation "Complete" we will see also the message sec1, but we will not see the message sec2. Although sec2 is registered for the type of installation "Complete". Why does not the sec2 message appear when I select the "Complete" installation type?
Kalakom is offline   Reply With Quote
Old 14th April 2017, 18:01   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,590
Seems to work for me:
PHP Code:
InstType "std"
InstType "cmpl"
page components "" "" leaveit
page directory
page instfiles

Section 
"1" sec1 
    SectionIn 1 
# I believe that the section will be selected by STANDARD only 
SectionEnd 

Section 
"2" sec2 
    SectionIn 2 
# I believe that the section will be selected by COMPLETE only 
SectionEnd 

!include LogicLib.nsh
Function leaveit
    
${If} ${SectionIsSelected} ${sec1
      
# In result the MessageBox is called when STANDARD selected and even COMPLETE selected ... why?  
        
MessageBox MB_ICONEXCLAMATION|MB_OK sec1 
    
${EndIf} 
    ${If} ${
SectionIsSelected} ${sec2
        
# In result the MessageBox is called when COMPLETE selected and even STANDARD selected ... why?  
        
MessageBox MB_ICONEXCLAMATION|MB_OK sec2 
    
${EndIf} 
FunctionEnd 

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump