Setting a Radio button property using msiexec - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

GlennWilson
Posts: 33
Joined: Wed Sep 01, 2010 2:22 pm

Setting a Radio button property using msiexec

Hi,

I have a project in which I set a property based on the user's selection of a radio button. The way it works is I have a Radio Group called RADIO_GROUP with two Radio buttons called RadioA and RadioB with values of RadA and RadB respectively. I have a published event which checks the value of the selected Radio button and sets a property MY_PROPERTY to one of two values based on the user's selection.

This works fine for the GUI. However, we want to automate the installation of the MSI using msiexec and limiting the the GUI to the basic user interface. What I would like to do is set the RADIO_GROUP property to either RadA or RadB in order to set the MY_PROPERTY value. OK, so I hear you ask, why not set the MY_PROPERTY value directly? Because in the real world, the string I need to set is too long and we wouldn't want installers to set this value to something arbitary, it needs to be one of two values only.

When I set the RADIO_GROUP property to "RadA" or "RadB" the MY_PROPERTY is not set. Is there a way to set this property based on the value of the RADIO_GROUP property when running the install using msiexec?

msiexec /i MyInstaller.msi RADIO_GROUP="RadA" - does not set the MY_PROPERTY to the text required when RadA is requested.

Glenn
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Setting a Radio button property using msiexec

Hi Glenn,

You can use a Property Set with Formatted custom action to set the property of MY_PROPERTY to the value of RADIO_GROUP. Let me know if it helps.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
GlennWilson
Posts: 33
Joined: Wed Sep 01, 2010 2:22 pm

Re: Setting a Radio button property using msiexec

Hi Gabriel,

Thanks for the response. I don't actually want to set the MY_PROPERTY value to that of RADIO_GROUP. What I want to do is set the RADIO_GROUP value from the commandline and set the MY_PROPERTY value to something else based on the value of RADIO_GROUP.

In pseudo-code:

Code: Select all

if (RADIO_GROUP == "RadA")
{
MY_PROPERTY = "Very long text associated with the value RadA";
}
if (RADIO_GROUP == "RadB"
{
MY_PROPERTY = "Some other text which is also very long and based on the value RadB";
}
I'm not sure whether this is possible using the Property Set With Formatted feature.

Glenn
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Setting a Radio button property using msiexec

Hi Glenn,

Create two Property Set with Formatted custom actions, each setting MY_PROPERTY to one of your two values. Condition both custom actions using the RADIO_GROUP property, so that only one of these two custom actions execute depending on whether their condition is true or false.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”