Passing custom command-line arguments? - Advanced Installer Community
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Passing custom command-line arguments?

Hello,

How to pass custom command-line arguments and how to make the installer receive them?

:?:
K
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Passing custom command-line arguments?

Hi,

I'm afraid I don't fully understand what is your scenario. Can you please give me more details about your scenario (maybe exemplify)?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Passing custom command-line arguments?

Hello,

You run the installer in the command-prompt and pass the values.

For example: installer.exe /A5 /A6 just like passing installer.exe /quiet

And the installer will get the values A5 and A6 to a property.

Is it clear or do you need more information?

:?:
K
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Passing custom command-line arguments?

Hi,

Yes, in order to achieve this you can send the name of the property along with its value from the command line as in the example below:
  • installer.exe PROP1=A5 PROP2=A6
Let me know if this helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Passing custom command-line arguments?

Thanks. This was very helpful.

:D
K
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Passing custom command-line arguments?

My pleasure to help you.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Passing custom command-line arguments?

Hello,

I have created custom properties as you explained. I have created few custom properties in the Install Parameters section. Those properties are "Mercury", "LogFile". Also I have created a Execute inline script code at Install Execution Stage with the following code,

Code: Select all

Msgbox Session.Property("Mercury")
This needs to show a message box with the value passed on the "Mercury" property. I run the installer like this,

Code: Select all

"installer.exe" Mercury=123 LogFile=1
However it is not passing anything. What is the issue here? It is not getting the command-line arguments passed.
K
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Passing custom command-line arguments?

Hi,

The problem is that you use private properties which values are not passed from the UI stage to the Install stage. So, in order to achieve what you want you need to use public properties instead (only uppercase letters).

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Passing custom command-line arguments?

It worked. Thank you.
K
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Passing custom command-line arguments?

You're welcome. I'm glad you got this working.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”