dadxs
Posts: 1
Joined: Thu Sep 10, 2020 11:53 pm

Issues passing a command line parameter to a custom action

Hello

I have an exe that I try to pass a command line argument during installation. I never receive the value that I am passing:

msiexec /i MyProject.msi /qn CONNECTIONSTRING="ggggg"

My setup is attached.
I am not sure where my error is
Attachments
2020-09-10_18h56_23.png
2020-09-10_18h56_23.png (22.85 KiB) Viewed 1693 times
Catalin
Posts: 6597
Joined: Wed Jun 13, 2018 7:49 am

Re: Issues passing a command line parameter to a custom action

Hello and welcome to our forums,

Please accept my apologies for the delayed reply.

The issue you are encountering here may be due to the fact that installer properties are not "quite" available during the deferred/rollback/commit stages of the installation.

Installer Properties are available only during the immediate stage of the install execution process. After this stage is complete all property values are set to empty strings.

The exception to this rule is the special CustomActionData property which keeps its values through all of the stages even during deferred, rollback and commit.

For more information about this, please have a look over our "How to access installer properties from deferred custom actions" article.

With that being said, what we might need to do here is launch our EXE through another custom action. For instance, we can use a PowerShell script to do so.

All you need to do is:

- replace your current custom action with a "Run PowerShell script inline" custom action

- schedule it accordingly

- use the "Parameter Values" field to retrieve the value of the property:

powershell_property_commit.png
powershell_property_commit.png (243.07 KiB) Viewed 1361 times
Hope this helps!

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

Return to “Common Problems”