Common Installation with Components Choice

From NSIS Wiki
Jump to navigationJump to search
Author: Red Wine (talk, contrib)


Description

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

The Code

name 'sections test'
outfile 'sectest.exe'
 
!include "Sections.nsh"
 
Insttype "/CUSTOMSTRING=Please make your choice"
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

License

This script is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this code.

Permission is granted to anyone to use this script for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this script must not be misrepresented; you must not claim that you wrote the original code. If you use this script in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered versions must be plainly marked as such, and must not be misrepresented as being the original script.
  3. This notice may not be removed or altered from any distribution.