Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Condition for a CA during Upgrade

Updated: 23 May 2010 | 8 comments
Alan Sinclair 2's picture
0 0 Votes
Login to vote

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?

discussion Filed Under:

Comments

EdT's picture
04
Dec
2008
0 Votes 0
Login to vote

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.

Alan Sinclair 2's picture
04
Dec
2008
0 Votes 0
Login to vote

Thanks Ed ... interesting idea! I'll sleep on it.

Bill MacEachern's picture
05
Dec
2008
0 Votes 0
Login to vote

Ed's ideas are too lumpy for that.

EdT's picture
05
Dec
2008
0 Votes 0
Login to vote

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.

Bill MacEachern's picture
05
Dec
2008
0 Votes 0
Login to vote

What a poof. I went to harm school.

EdT's picture
05
Dec
2008
0 Votes 0
Login to vote

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.

AngelD's picture
06
Dec
2008
0 Votes 0
Login to vote

quote:
Originally posted by: Alan Sinclair

(The problem does not occur when RemoveExistingProducts is after InstallFinalize, of course.)


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.

AngelD's picture
06
Dec
2008
0 Votes 0
Login to vote

Using Transitive Components could be useful but I'm not sure it would help you in this scenario.