Common Installation with Components Choice: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 44: Line 44:
</highlight-nsis>
</highlight-nsis>


 
[[Category:Code Examples]]
[[Category:Section Management Functions]]
[[Category:Section Management Functions]]

Revision as of 07:45, 20 December 2006

Author: Red Wine (talk, contrib)


Description

The following example on how to create a common installation with components choise provived for the subject at this forum thread.

The Code

name 'sections test'
outfile 'sectest.exe'
 
!include "Sections.nsh"
 
Insttype "/CUSTOMSTRING=Please make your choise"
Insttype "English Interface"
Insttype "French Interface"
 
page components
page instfiles
 
Section "Common FIles (Required)" 
  SectionIn RO
    # common files here
SectionEnd
 
Section "English Language Files" SEC_ENG 
  SectionIn 1
    # ENG files here
SectionEnd
 
Section /o "French Language Files" SEC_FRA 
  SectionIn 2
    # FRA files here
SectionEnd
 
Function .onInit
  StrCpy $1 ${SEC_ENG}
FunctionEnd
 
Function .onSelChange
  !insertmacro StartRadioButtons $1
   !insertmacro RadioButton ${SEC_ENG}
   !insertmacro RadioButton ${SEC_FRA}
  !insertmacro EndRadioButtons
FunctionEnd