user21993098
user21993098

Reputation: 21

Inno Setup /components commandline switch does change the components selected

I have a Inno Setup script which has components and based on those components specific installation takes place. If I run manually, then installation works fine based on components checked. But if I run installer silently by passing /components="component1", still it installs component which was installed before using the manual installation.

If I have installed component2 manually and later try to install component1 through command prompt, it still installs component2 only. I'm not sure whether it is related to previous installation or not. Is there a way to pass components name as parameter through command line?

This is a sample script to mimic my problem.

[Types]
Name: "custom"; Description: "Custom installation";
Name: "compact"; Description: "Compact installation";

[Components]
Name: "component1"; Description: "Component 1"; Types: custom
Name: "component2"; Description: "Component 2"; Types: compact

Syntax used on command line

$Release\mysetup.exe /verysilent /components="component2"

Upvotes: 2

Views: 340

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202534

If you have multiple Types, you have to first select the iscustom type before you can choose components. And in your case, as you actually cannot select the components (as you have no iscustom type), you basically only need to select the type using the /TYPE switch. The components will be selected along.

mysetup.exe /TYPE=custom

Basically, the command-line switches won't allow you doing, what the GUI cannot do. As the documentation for /COMPONENTS says:

If no custom type is defined, this parameter is ignored.

Upvotes: 1

Related Questions