SDutt
Posts: 16
Joined: Fri Oct 17, 2025 8:35 am

Using command line parameters to select prerequisites to be installed (for silent install)

Hello,

In my installer project, I have some prerequisites to be installed before the main package.
These prerequisites show up in the PrerequisitesDlg during installation, where they can be checked or unchecked.

But for a silent install, for example, if the command line is:
"MyApp.exe" /exenoui /qn /norestart MY_PROP1="false"

where MY_PROP1 represents some other property, how do I add parameters to select a particular prerequisite, say if the prerequisite name is PreReq1?

Thanks in advance,
SDutt
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Using command line parameters to select prerequisites to be installed (for silent install)

Hello SDutt,

Normally, this should be achieved via the "/prereqs" argument, but we have a small bug here that we will fix in a future version of Advanced Installer.

Until a fix will be available, we can use the "Condition" field associated with your pre-install prerequisites (in the "Prerequisites" page, under the "Installation" tab).
Screenshot_88.png
Screenshot_88.png (2.99 KiB) Viewed 5585 times

And then, from the command line, you could launch the EXE as it follows:

Code: Select all

setup.exe /exenoui /qn MY_PROP="1"
Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
SDutt
Posts: 16
Joined: Fri Oct 17, 2025 8:35 am

Re: Using command line parameters to select prerequisites to be installed (for silent install)

Hello Catalin,

If I have multiple such prerequisites, how do I associate a different property with each of them?

For example, if I have PreReq1 and PreReq2, and I want to install only PreReq2 and not PreReq1. In that case, I would need different properties to be associated with each such prerequisite.

Thanks again,
SDutt
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Using command line parameters to select prerequisites to be installed (for silent install)

Hello SDutt,

We can set as many properties as we want, so this approach works for all prerequisites.

We can have, for example, PREREQ_1, PREREQ_2 and so on.

Do you want to only cover silent installations here? Because if not, we might have some issues during a full UI installation as these properties have to be set in order for the prerequisites to be installed.

What the above means is that, during a full UI installation, besides the selection dialog that is presented to the user, we would need to set these properties ourselves - via a "Set property" custom action.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
SDutt
Posts: 16
Joined: Fri Oct 17, 2025 8:35 am

Re: Using command line parameters to select prerequisites to be installed (for silent install)

Hello Catalin,

Yes, we need both options, a full UI as well as a silent install.

For the full UI, I believe just checking/ unchecking the prerequisites in the PrerequisitesDlg would handle this. Is a property required here too?

Thank you,
SDutt
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Using command line parameters to select prerequisites to be installed (for silent install)

Hello SDutt,
For the full UI, I believe just checking/ unchecking the prerequisites in the PrerequisitesDlg would handle this. Is a property required here too?
Here, it is not enough to just check the prerequisite because the condition check is evaluated before the selection dialog is even displayed.

A possible solution would be to use a SetProperty custom action, added without sequence (so we can schedule it on a dialog) and then added as an "Init Event" on "PreparePrereqDlg" dialog.
Screenshot_90.png
Screenshot_90.png (110.24 KiB) Viewed 5542 times

This event will only be executed when the setup runs with full UI, otherwise it will be skipped during a silent installation since no dialogs are spawned at all.

Please note that this is a workaround only until we fix the boostrapper's "/prereqs" argument.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Using command line parameters to select prerequisites to be installed (for silent install)

Hello SDutt,

This has been fixed in version 23.5.1 of Advanced Installer.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”