netrustPS
Posts: 40
Joined: Tue Dec 20, 2016 4:40 am

Install prerequisite based on product name condition

I need to create an installer that can determine whether to install a prerequisite based on the condition of whether a specific program using a specific name is installed.

For example I have "Program Alpha" and "Program Alpha Custom", which these two programs have the exact same version, product code, upgrade code etc. For all intents and purposes it is the same program except for the name. Depending on the name of what is installed I will need to run a different script.

How would I go about doing this as I do not see an option to check by Product Name. Do I need to write a custom exe for this check?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Install prerequisite based on product name condition

Hello,
I need to create an installer that can determine whether to install a prerequisite based on the condition of whether a specific program using a specific name is installed.
A prerequisite will be installed based its install conditions defined in the Prerequisite Install Conditions Tab. The Install Conditions section allows you to condition the prerequisite based on custom searches.

Since you want to condition the prerequisite installation based on the condition of whether a specific program using a specific name is installed, then you can use the Registry value with a specified content criteria from the Edit Prerequisite Search Dialog.

If the ProductName is not saved in the registry, then you can create a custom .exe. You can enumerate the products with a specified upgrade code using the MsiEnumRelatedProducts function.
For each installed product you can use the MsiGetProductInfo function which returns product information (in your case, INSTALLPROPERTY_INSTALLEDPRODUCTNAME).

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”