WizardSelectComponents() & WizardSelectTasks(), but no WizardSelectType()

563 views
Skip to first unread message

Christian Blackburn

unread,
Mar 25, 2022, 4:48:15 AM3/25/22
to innosetup
Hi Guys,

Unfortunately, there's no WizardSelectType() procedure I can call from InitializeWizard().  How can I work around this?  Basically, I'm checking the type of machine we're installing on at work and then I want to set a specific setup type ([Types]) based on the role the computer has.  

Thanks,
Christian Blackburn

Laurent Combémorel

unread,
Mar 25, 2022, 11:58:46 AM3/25/22
to innosetup
Types are defined by selected components.
Select components depending on the role the computer has.

Selecting a component is done in code by setting True to WizardForm.ComponentsList.Checked[ WizardForm.ComponentsList.Items.IndexOf("description of the component") ].

Christian Blackburn

unread,
Mar 25, 2022, 8:13:47 PM3/25/22
to inno...@googlegroups.com
Hi Laurent,

Thanks for your email.  I'm sorry to hear there only exists such a roundabout way to select a specific Type.  Clearly Inno Setup needs to add an additional command.  Does WizardSelectComponents() not accomplish the same goal? 

Thanks,
Christian Blackburn
Student ID: 001046225
Software Development (2019/07/01)
Mentor: Melanie Koehler


--
You received this message because you are subscribed to a topic in the Google Groups "innosetup" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/innosetup/jobkzP1LRg4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/43764b5f-805f-4cd1-8455-0c893b53e9d0n%40googlegroups.com.

Christian Blackburn

unread,
Apr 10, 2022, 5:58:23 PM4/10/22
to innosetup
Hi Guys,

I wound up solving this one myself and I think it's a lot easier to maintain especially in my program where there's about 100 potential components.  For me at least it's considerably easier to say Type=XYZ, than select/deselect the precise combination of  about 100 components.  Especially when the list of components is also ever changing.  This uses AutoIt to just select the right installation type directly from the installation type ComboBox by name.  

[Files]

;Adds AutoItX Functionality

Source: "AutoItX3.dll"; Flags: dontcopy noencryption 

[Code]

Const…

Var…

    //runs one of many of the commands listed in the AutoItX help file against a particular

    //Window\Control via AutoIt

    procedure AU3_ControlCommand(title:string; text:string; control:string; command:string;

    extra:string; response:string; buffer_len:integer); external

    'AU3_ControlCommand@files:autoitx3.dll';

 

procedure InitializeWizard();

Var

    //stores the response of the autoit command

    strResponse: string;

begin
              //Selects the installation type named “InstallationType”

                AU3_ControlCommand('Installer Window Title',

                '', 'TNewComboBox1', 'SelectString', ‘IntallationType',

                strResponse, 2048)

end;


Thanks,
Christian Blackburn


Laurent Combémorel

unread,
Apr 11, 2022, 9:42:05 AM4/11/22
to innosetup
Hi Christian
I found out a quicker way to do it, with no extra library :

WizardForm.TypesCombo.ItemIndex := WizardForm.TypesCombo.Items.IndexOf('type to set');
WizardForm.TypesCombo.OnChange(WizardForm);

The call to OnChange makes the components checkboxes to be set to the appropriate depending on the type selected.
:)

Gavin Lambert

unread,
Apr 11, 2022, 6:49:53 PM4/11/22
to inno...@googlegroups.com
On 12/04/2022 01:42, Laurent Combémorel wrote:
> WizardForm.TypesCombo.ItemIndex :=
> WizardForm.TypesCombo.Items.IndexOf('type to set');
> WizardForm.TypesCombo.OnChange(WizardForm);
>
> The call to OnChange makes the components checkboxes to be set to the
> appropriate depending on the type selected.
> :)

Bear in mind that this matches on the Description of the type, not the
Name. So be careful if you are translating the descriptions. Using a
{cm:...} value is recommended (also to avoid typos or editing one and
forgetting the other, even if not translating).

Christian Blackburn

unread,
Apr 13, 2022, 5:15:18 PM4/13/22
to innosetup
Hi Laurent and Gavin,

Thanks for your help on this.  I'll give the Inno-native method a try.

Thanks,
Christian Blackburn
Reply all
Reply to author
Forward
0 new messages