Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com

I have a custom action condition (in Visual Studio Web Setup Project) that I want  to run for installation of a new or upgraded product. I do not want to run it on repair (and also during uninstall).

First of all I tried “Not Installed” condition. But it doesn't work for version upgrade. I've tried

Not Remove=”ALL” but it also doesn't work for version upgrade( it seems that deleting previous version set the property Remove=”ALL”)

I've tried UPGRADINGPRODUCTCODE , but it is set for the previous version, not for the version being installed.

The article http://www.rsdn.ru/article/install/wininstaller2.xml (sorry, in Russian only) suggests to use IS_MAJOR_UPGRADE ,but the property is applicable for InstalledShield only.

Finally I found combination that is working:

(Not Installed) OR PREVIOUSVERSIONSINSTALLED
Note that brackets are important to evaluate NOT first and condition is case-sensitive).

PREVIOUSVERSIONSINSTALLED is not documented property, I found it when reading msi log and in a few posts(e.g. here: “If the search at the start of the install detects
an older version, it creates the PREVIOUSVERSIONSINSTALLED property,
case-sensitive.“ ).

NOTE: I found that custom action with condition
(Not Installed) OR PREVIOUSVERSIONSINSTALLED works on my development machine, but it was not invoked on my deployment machine until I changed target virtual directory. Mistery ???

Posted on Monday, August 14, 2006 3:05 PM Deployment | Back to top


Comments on this post: Custom action condition to run for a new or upgraded product.

# re: Custom action condition to run for a new or upgraded product.
Requesting Gravatar...
havent tried this
(Not Installed) OR PREVIOUSVERSIONSINSTALLED
But i am happy to c this.

Will this fire on uninstallation too,Because i dont want this to fire.
Left by Prasanth on Feb 06, 2009 2:10 AM

# re: Custom action condition to run for a new or upgraded product.
Requesting Gravatar...
Cool,
Thanks for writing, most people don't bother.
Left by web development company on Aug 28, 2009 8:25 AM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net