How can I install two products with one Inno Setup

2020-02-13 06:17发布

问题:

I have two products: a Client and an Admin product. There may be a case when the user wants to install one, the other, or both. How do I do this in Inno Setup?

I am relatively new to Inno Setup. I have tried to use Components and Types but so far only get a dropdown of single choices. I would like a set of checkboxes (or whatever) that allow the user to select what they are installing.

回答1:

In the [Types] section, configure one custom type (the iscustom flag).

Then in the Components section, add two components for the custom installation.

[Types]
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: client; Description: "Client product"; Types: custom
Name: admin; Description: "Admin product"; Types: custom

[Files]
Source: "client.exe"; DestDir: "{app}"; Components: client
Source: "admin.exe"; DestDir: "{app}"; Components: admin


An alternative to the iscustom setup type is using the AlwaysShowComponentsList directive.