mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Conditionally setting an install parameter in silent mode

Hello,

I am rather new to Advanced Installer. My company is using version 10.7.1 in a project I maintain and we have just come to a customer requirement to pass an optional path parameter to the setup during silent installation. The parameter - if present on the command line - shell be used for creating a registry value out of its contents, however, after having made some custom processing on it. In short, if it is a path to a mapped network drive, the custom processing converts the path to a UNC path. If not present at all, the value for the registry defaults to the [SETUPEXEDIR] installer property. The custom processing and the creation of the registry entry are both carried out by an embedded tool we call once during initial installation currently passing the value of [SETUPEXEDIR] to that tool. Now I would like to conditionally pass the value of the command line parameter instead, if present.

Could you please provide me with an idea how I can implement this using Advanced Installer?

Thanks in advance.

Milen Tilev
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Conditionally setting an install parameter in silent mod

Hello Milen and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve what you want you can set (or not) the above property from command line when launching your setup package. For example you can use a command line like this:

Code: Select all

setup.exe MY_PROP="myValue"
Also, please keep in mind that only public properties can be set through the command line.

Then, you can conditionally set another installer property (e.g. PARAM_PROP) to MY_PROP or to SETUPEXEDIR property value. Finally, you can pass the PARAM_PROP property to your processing custom action. Here are the steps to proceed:
- go to "Custom Actions" page and add (before your processing custom action) two "Set installer property" custom actions with sequence like this:
  • Property: PARAM_PROP
    Value: [MY_PROP]
    Condition: MY_PROP

    Property: PARAM_PROP
    Value: [SETUPEXEDIR]
    Condition: NOT MY_PROP
- build and run your project.

Let us know if this helped, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Re: Conditionally setting an install parameter in silent mod

Hello Daniel,

thank you, that perfectly did the job! :)

Regards,

Milen
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Conditionally setting an install parameter in silent mod

You're always welcome Milen.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”