matt777
Posts: 3
Joined: Fri Jul 07, 2023 5:25 pm

run commands at end of install

Hello. I have an MSI from a vendor that works fine. This MSI, once installed, has its own command line .EXE. Running this .EXE allows you to make settings to the software that gets installed. How would I pass parameters to the MSI on the command line that in turn would execute this .EXE at the end of the MSI installer?

Example: msiexec /i "%path to MSI%\acme.msi" SCHEDULE=Daily TYPE=Full where schedule=daily and type=full are being set by calling the .EXE that gets installed by this software.

This software is good but you have to install it first, then you can call the .EXE to configure the software. I want to modify their .MSI so we can install & configure it at the same time.

Thank you.
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: run commands at end of install

Hello and welcome to our forums,

I'm afraid I do not quite understand your scenario here.

So basically you are trying to install an MSI and then launch a subsequent EXE (that is installed by the MSI)?

If so, then perhaps you can add the MSI as a feature-based prerequisite and then use a "Launch File" custom action scheduled at the end of the installation that will launch the EXE with the required parameters.

Adding prerequisite

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
matt777
Posts: 3
Joined: Fri Jul 07, 2023 5:25 pm

Re: run commands at end of install

Hi. Thanks for the feedback. I guess another way I could ask this. How do I create custom command line switches for my .MSI that when used will run a custom action? example:

msiexec /i "%path to .MSI file\My.MSI%" PATCHOPTIONS=BIOS, FIRMWARE UPDATETYPE=MANUALUPDATES

Where patchoptions and updatetypes are my custom command line switches and each in turn would execute an .EXE that was installed by the MSI ?
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: run commands at end of install

Hello,

Thank you for your followup on this and for sharing the details with me.

In order to achieve what you want, we can proceed as it follows:

- for each custom action, create a property with a value, e.g.:

EXECUTE_CUSTOM_ACTION_A with the default value of "false"

We can then, in "Custom Actions" page, condition a custom action to be executed based on the value, e.g.:

Code: Select all

EXECUTE_CUSTOM_ACTION_A = "true"
This way, the custom action will only be executed if the above property has the value "true" (i.e. the user sets it in the command line), otherwise it will not.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
matt777
Posts: 3
Joined: Fri Jul 07, 2023 5:25 pm

Re: run commands at end of install

Thank you!!
Liviu
Posts: 1325
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: run commands at end of install

You're always welcome!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”