If it does not make sense to install the common files without the application, or the application without the common files (eg. the files are dependencies of the application), then simply don't list them as [Components]
at all (components are just a UI thing):
[Components]
Name: app1; Description: "Application 1"
Name: app2; Description: "Application 2"
Name: app3; Description; "Application 3"
[Files]
Filename: ...\app1.exe; ...; Components: app1
Filename: ...\app2.exe; ...; Components: app2
Filename: ...\app3.exe; ...; Components: app3
Filename: ...\common.dll; ...; Components: app1 app2
This will install common.dll
if either or both of app1 or app2 are selected, but not if neither are. It does not matter whether app3 is selected or not. (Note that if a file is common to all of your components then you can just leave out the Components:
parameter entirely.)
In order to guarantee that at least one component is selected you will need to walk through the WizardForm.ComponentsList
in the NextButtonClick
of wpSelectComponents
, or (if you don't mind hard-coding the names of all the components) ensure that IsComponentSelected
returns true when supplied with the names of all components.