Condition for a CA during Upgrade
We ship a product as a merge module. The msm installs a network driver via a custom action. If the driver is already installed then the CA must not be run -- it kills networking to install it twice, and unfortunately the CA itself can't check. So I'm using a condition on the CA in the InstallExecuteSequence.
The condition uses AppSearch to check the registry reference count of the driver file, in case it has already been installed by another application, so the condition looks like this:
$C_filt.sys.(guid) = 3 AND FILT_REFCOUNT.(guid) = "blank"
(The FILT_REFCOUNT property has a default value "blank".)
A customer has hit a bug in my merge module during upgrade. With RemoveExistingProducts between InstallValidate and InstallInitialize the driver is uninstalled during RemoveExistingProducts, but is not reinstalled because the reference count was nonzero when AppSeach ran. (The problem does not occur when RemoveExistingProducts is after InstallFinalize, of course.)
In an MSI I could extend the condition to check an ActionProperty set in the Upgrade table, e.g.:
$C_filt.sys.(guid) = 3 AND (UPGRADE OR FILT_REFCOUNT.(guid) = "blank")
This is not ideal; it will allow the upgrade to succeed only if no other application has installed the driver, but unless someone has a clever idea it will do for now.)
However, the extra condition is not possible in a merge module -- the ActionProperty name isn't known to the merge module. And I'd prefer not to have to ask end users to edit the merge module conditions (there are twentyfour CAs, for different OSes etc., making it easy to break) So is there any other way to detect that an upgrade is occurring? Or any other way to change the conditions on the custom actions to add/remove the driver?
Comments
How about making the driver component permanent? Then at uninstall, you can nuke the relevant files and the associated component entry in the registry using the RemoveFile/RemoveRegistry tables.
Not elegant but should work OK.
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
Thanks Ed ... interesting idea! I'll sleep on it.
Ed's ideas are too lumpy for that.
Bill,

I hope you got a refund from your charm school....
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
What a poof. I went to harm school.
Did it stop you being a poof?
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
If it's not a "big" package why not leave it to that?
I don't see any good conditionalizing to prevent the removal of a component during uninstall even during upgrade.
Using Transitive Components could be useful but I'm not sure it would help you in this scenario.
Would you like to reply?
Login or Register to post your comment.