GratefulLearner
Posts: 3
Joined: Fri Feb 12, 2021 7:48 pm

Custom Action passing existing single letter parameters issue

Fri Feb 12, 2021 9:52 pm

Hello,

I'm trying to pass parameters to a "LaunchexewithDirectory" executable.

Normally if I had a command prompt, the command would look like this:

Sysmon.exe -i C:\Path\TO\XML\xmlconfig.xml -accepteula

How do I pass these parameters to the custom action?


Currently I have:
File Path:[#Sysmon.exe]
Command Line: [ACCEPTEULA]
Working directory:APPDIR\Sysmon_Feb_2021

And in Install Parameters:
Name: I Value:"[APPDIR]"sysmonconfig.xml
NAME: ACCEPTEULA Value:1


What am I doing wrong in formatting? Is there an easier way to get to the exe to launch like this? --> Sysmon.exe -i C:\Path\TO\XML\xmlconfig.xml -accepteula

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom Action passing existing single letter parameters issue

Mon Feb 15, 2021 3:55 pm

Hello and welcome to our forums,

First of all, please note that you can not define, in "Install Parameters" page, a property whose value is based on another property.

If you want to create a property as it follows:
Name: I Value:"[APPDIR]"sysmonconfig.xml
whose value is based on the value of the APPDIR property, you will need to use a "Set installer property" custom action.

Basically, let's consider the following:

Code: Select all

Name: MY_PROPERTY
Value: [APPDIR]sysmonconfig.xml

Code: Select all

Name: MY_PROPERTY_2
Value: -accepteula
Or you can simply do not define the second property at all and just pass the argument as it is.

With that being said, the command line should look as it follows:

File Path:[#Sysmon.exe]
Command Line: -i [MY_PROP] [MY_PROP_2]


or:

File Path:[#Sysmon.exe]
Command Line: -i [MY_PROP] -accepteula


Hope this helps!

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

GratefulLearner
Posts: 3
Joined: Fri Feb 12, 2021 7:48 pm

Re: Custom Action passing existing single letter parameters issue

Mon Feb 15, 2021 10:09 pm

Great thanks! :D

Got it to work, set installer property is a key thing I wasn't aware of.

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom Action passing existing single letter parameters issue

Wed Feb 17, 2021 4:25 pm

You are always welcome!

I am glad everything works as expected now. :D

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

Return to “Common Problems”