dive2xs
5th December 2005 17:51 UTC
Install Options - "either" but not "both"
I have a program that has two types of installations. One is for type "a" equipment, and the other is for type "b" equipment.
Both programs do the same thing but they are different builds.
I want a single installer, where you must chose either option a or option b. Not both.
I have been trying to figure this one out, and I have tried searching, but no good results.
Comm@nder21
5th December 2005 18:46 UTC
have a look at "Sections.nsh" in your {NSIS ROOT}\Include folder :)
Anders
5th December 2005 19:24 UTC
i would suggest either using a InstallOptions(custom) page where the user selects or a components page with two sections with the radio button logic (as commander suggested)
dive2xs
5th December 2005 19:33 UTC
Ok I like the sections.nsh option. This will work fine.
I am having trouble figuring out how to tie this in. I have 2 radio buttons, basically copied the one section.nsi script, and deleted all except 2 selections. I renamed the selections. Tested the modified one-section.nsi and it works fine.
How to I tie this into my MUI based script? how do I get from "g1o1" to ";Installer Sections-Section 'Ethernet'"
;--------------------------------
; Sections
Section "Ethernet (Network) connection." g1o1
SectionEnd
Section /o "Serial (RS-232) connection." g1o2
SectionEnd
;--------------------------------
; Functions
; $1 stores the status of group 1
Function .onInit
StrCpy $1 ${g1o1} ; Group 1 - Option 1 is selected by default
FunctionEnd
Function .onSelChange
!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${g1o1}
!insertmacro RadioButton ${g1o2}
!insertmacro EndRadioButtons
FunctionEnd
;--------------------------------
;Installer Sections
Section "Ethernet"
SetOutPath "$INSTDIR"
File "program.exe"
File "Documentation.doc"
Anders
6th December 2005 04:49 UTC
you could put all files that are common between the two programs in a hidden section and just the the File instruction for each unique program in its own section (Ethernet (Network) connection./Serial (RS-232) connection.)