RobwEllis
Posts: 7
Joined: Thu Jul 02, 2009 11:20 pm

Custom Action Command Line Arguments

Hi,

I have created a custom action to which I need to pass two arguments representing the target folder and a flag to tell the custom action exe whether this is an upgrade or a first time installation.

The target folder works fine by passing APPDIR and I thought that the Installed property would be the one to use for the other information I need but it just doesn't seem to be set.

The Custom Action is set to run at time of Install, Synchronous exection with check return code, Immediate execution and Always execute and without an Execution condition.

The command line is [Installed] [APPDIR]

Any idea what I am doing wrong?

Cheers

Rob
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Custom Action Command Line Arguments

Hi Rob,

Please note that the "Installed" property is set only if the package is installed on the machine, it cannot be used to determine an upgrade. An upgrade process can be detected by using two properties:
OLDPRODUCTS - this property is set in the upgrading MSI if the package found an older version installed on the target machine
UPGRADINGPRODUCTCODE - this property is set in the MSI which is being upgraded if the package is uninstalled by a newer version

These properties are set to one or more Product Codes (GUIDs).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
RobwEllis
Posts: 7
Joined: Thu Jul 02, 2009 11:20 pm

Re: Custom Action Command Line Arguments

Cosmin,

Perfect - Thanks!

Rob

Return to “Common Problems”