Hightower
Posts: 9
Joined: Tue Aug 23, 2016 1:42 pm

Install parameters from commandline

Hi all,

I need set some property from command line. This property will configure Custom Action like executing condition or set parameters in launching file > Command line.

Is there some way how to run setup.exe with parameters and work with that parameters in project?

Thanks a lot
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install parameters from commandline

Hi and welcome to Advanced Installer forums.

You can set properties using the command line and use them as parameters for your custom action. For example you can run an EXE package from command line like described below:

Code: Select all

myPackage.exe MY_PROP="myValue"
Then, you can use for your custom action the property MY_PROP.

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

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Hightower
Posts: 9
Joined: Tue Aug 23, 2016 1:42 pm

Re: Install parameters from commandline

Hi,

i tryed this, but i cant make it work. In Builds, Package Type is Exe with resources next to it
In install parameters, there is Property "RunCustomAction" = "true"
EditProperty.png
EditProperty.png (3.57 KiB) Viewed 14461 times
Custom action has condition RunCustomAction="true"
CustomAction.PNG
CustomAction.PNG (24.21 KiB) Viewed 14461 times
But when I run Setup.exe RunCustomAction="false", that custom action still run.

I dont know what is wrong.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install parameters from commandline

Hi,

Please keep in mind that a private property (which name contains lowercase letters) cannot pass its changed value from the UI stage to the Install stage. So, the new value that you set for it from command line will not be passed to the Install Execution stage. In order to achieve this, you need to use a public property which name contains only uppercase letters (i.e. RUNCUSTOMACTION).

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Hightower
Posts: 9
Joined: Tue Aug 23, 2016 1:42 pm

Re: Install parameters from commandline

Hi, thank you, I didnt know this. Can you help me with another question? I need run custom action in different directory [SourceDir]/../MyDirectory/Action.exe where /../ is upper directory, do you know how to do this?

Thanks lot
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install parameters from commandline

Hi,

The way you try to run a custom action from an upper folder is correct, but the problem may appear because of the "\" character that you add after the [SourceDir] property. The path of that property already contains that character at the end, so if you add another one after it, that character will get duplicated and the path will not be valid anymore. Can you remove it and see if it works (i.e. [SourceDir]..\MyDirectory\Action.exe)?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Hightower
Posts: 9
Joined: Tue Aug 23, 2016 1:42 pm

Re: Install parameters from commandline

Thank you :)
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install parameters from commandline

You're welcome. Glad to help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
agyorgyi
Posts: 8
Joined: Thu Jan 09, 2020 4:28 pm

Re: Install parameters from commandline

Hi all,
I've tried to set certain install parameters from command line but it didn't work
For example :
App_setup.exe SiteName="site.name.com" ServerIP="192.168.11.128"
The install process used default values.

Of course, these parameters were defined in the installer project.

What could I do?
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Install parameters from commandline

Hello Agyorgyi,

Please keep in mind that private properties (which contain lowercase letters, e.g. SiteName) cannot be set from the command line.

Only public properties (only uppercase letters) can - e.g. SITENAME="your_value".

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
agyorgyi
Posts: 8
Joined: Thu Jan 09, 2020 4:28 pm

Re: Install parameters from commandline

Dear Catalin,
you've saved my day!
Thank you very much!
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Install parameters from commandline

You are always welcome, Agyorgyi!

I am glad I could help.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”