How to set Launch program according to components selected in Inno Setup?

poortip

I have designed my installer using Inno Setup to display 2 components for the user to select. According to his/her selection, the Finish page at the end will show Launch program checkbox(es). The default value for the checkbox is false if both components have been selected.

So far, so good.

Now, I want that if only one of the components is selected for installation by the user, the default value of the checkbox should be true.

Following are the Component and Run sections of the installer,

[Components]
Name: "Component1"; Description: "Component1"; Types: full;
Name: "Component2"; Description: "Component2"; Types: full custom; 

[Run]
Filename: "{localappdata}\MyInstaller\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent unchecked; Components:Component1;
Filename: "{localappdata}\MyInstaller\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(TestAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent unchecked; Components:Component2

I understand that what I want, requires some scripting to be done. I am at a loss at what to do.

Please guide.

TLama

The Components parameter allows you to use boolean expression operators so for your case you may write two pairs of entries where one is for unchecked check box and the second for checked. The rest of what you need is writing an expression:

[Components]
Name: "Component1"; Description: "Component1";
Name: "Component2"; Description: "Component2";

[Run]
; this is the entry pair for unchecked check box; it is shown if both components
; are selected
Filename: "{app}\MyProg1.exe"; Flags: nowait postinstall skipifsilent unchecked; Components: Component1 and Component2;
Filename: "{app}\MyProg2.exe"; Flags: nowait postinstall skipifsilent unchecked; Components: Component1 and Component2;
; this is the entry pair for checked check box; it is shown only when the given
; component is selected and the other not
Filename: "{app}\MyProg1.exe"; Flags: nowait postinstall skipifsilent; Components: Component1 and not Component2;
Filename: "{app}\MyProg2.exe"; Flags: nowait postinstall skipifsilent; Components: Component2 and not Component1;

That will produce:

  • no check box if no component is selected
  • two unchecked check boxes if both components are selected
  • one checked check box if only one of the components is selected

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Inno Setup - See how many components are selected

From Dev

Inno Setup - Disable dropdown list on Selected Components Menu

From Dev

Inno Setup how to set the AppId after user has selected destination directory?

From Dev

Inno Setup how to set the AppId after user has selected destination directory?

From Dev

Inno Setup - How to set permissions of installation folder

From Dev

Inno Setup Run code according to setup type

From Dev

Inno Setup - How to increase the separation between all the components of the component list?

From Dev

How to set session in php according to the language selected?

From Dev

How to disable Next button if no component is selected in Inno Setup?

From Dev

Inno Setup: how to make a change option on "Uninstall or change a program"

From Dev

Inno Setup: How to put the installer itself in the installed program

From Dev

Inno Setup: How to automatically run program after /verysilent install?

From Dev

Automatic update of Inno Setup program

From Dev

How to set a global environment variable from Inno Setup installer?

From Dev

How to set inno setup script parameters from final builder?

From Dev

Inno setup compiler How to set launching image during app loading

From Dev

How to set inno setup script parameters from final builder?

From Dev

Inno Setup Set TInputQueryWizardPage Height

From Java

Prechecked or unchecked components in Inno Setup custom install

From Dev

Larger "Select Components" page in Inno Setup

From Dev

Inno Setup Components graphical refresh issue

From Dev

Inno Setup: Suppress warning if other component selected

From Dev

Inno setup: create a log of selected items

From Dev

Inno Setup rename file if component selected

From Dev

Inno setup: create a log of selected items

From Dev

Inno Setup: Suppress warning if other component selected

From Dev

How to set a button background and back according to selected state not pressed state

From Dev

JQuery Datepicker/Datetimepicker - How to set MaxDate in java according to a selected option

From Dev

Inno Setup: Run program without showing a checkbox

Related Related

  1. 1

    Inno Setup - See how many components are selected

  2. 2

    Inno Setup - Disable dropdown list on Selected Components Menu

  3. 3

    Inno Setup how to set the AppId after user has selected destination directory?

  4. 4

    Inno Setup how to set the AppId after user has selected destination directory?

  5. 5

    Inno Setup - How to set permissions of installation folder

  6. 6

    Inno Setup Run code according to setup type

  7. 7

    Inno Setup - How to increase the separation between all the components of the component list?

  8. 8

    How to set session in php according to the language selected?

  9. 9

    How to disable Next button if no component is selected in Inno Setup?

  10. 10

    Inno Setup: how to make a change option on "Uninstall or change a program"

  11. 11

    Inno Setup: How to put the installer itself in the installed program

  12. 12

    Inno Setup: How to automatically run program after /verysilent install?

  13. 13

    Automatic update of Inno Setup program

  14. 14

    How to set a global environment variable from Inno Setup installer?

  15. 15

    How to set inno setup script parameters from final builder?

  16. 16

    Inno setup compiler How to set launching image during app loading

  17. 17

    How to set inno setup script parameters from final builder?

  18. 18

    Inno Setup Set TInputQueryWizardPage Height

  19. 19

    Prechecked or unchecked components in Inno Setup custom install

  20. 20

    Larger "Select Components" page in Inno Setup

  21. 21

    Inno Setup Components graphical refresh issue

  22. 22

    Inno Setup: Suppress warning if other component selected

  23. 23

    Inno setup: create a log of selected items

  24. 24

    Inno Setup rename file if component selected

  25. 25

    Inno setup: create a log of selected items

  26. 26

    Inno Setup: Suppress warning if other component selected

  27. 27

    How to set a button background and back according to selected state not pressed state

  28. 28

    JQuery Datepicker/Datetimepicker - How to set MaxDate in java according to a selected option

  29. 29

    Inno Setup: Run program without showing a checkbox

HotTag

Archive