/build/static/layout/Breadcrumb_cap_w.png

custom action conditions for install

What conditions do I use for a custom action in a merge module such that the action runs only on initial install of an application and does not run on upgrade or repair? Likewise, I need a condition that runs another CA at uninstall only. (This is an embarrassingly newbie question despite my doing packaging for years!)

We have several apps which need to set the same DWORD registry flag. The apps can be installed together (independently) on the same machine, so the flag must not be unset if one app is uninstalled while another is in place. Unfortunately the only permissible values for the flag are zero (or unset) and one.

I coded a C dll to be called from two custom actions to manage a "reference count" (in the registry, separate from the flag). When an app is installed the first CA increments the refcount, and when uninstalled the other CA decrements the refcount. When the refcount is zero, the flag is cleared. This goes in a merge module, to be included in all relevant apps. But I can't get the conditions right for the custom actions.

Please enlighten me.

0 Comments   [ + ] Show comments

Answers (2)

Posted by: yuri 13 years ago
Orange Belt
0
Condition to use at initial install -> If NOT Installed Then ...
Condition to use at removal -> If REMOVE="ALL" Then ...
Posted by: anadem 13 years ago
Yellow Belt
0
> NOT Installed
> REMOVE="ALL"

Thanks! I so should have remembered!
But unfortunately those are also true during an upgrade.

"REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE" works to suppress the CA during uninstall phase of an upgrade.

Is there a *generic* way to tell if an install is an upgrade? I know the property from the Upgrade table can be used, but because these CAs are in a merge module, the Upgrade table property is indeterminate (unless I can convince the consumers of the merge module to use a pre-defined property name.) So, is there any other way to know it's an upgrade?
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ