MattFielder
Posts: 22
Joined: Thu Jan 05, 2012 9:49 pm
Contact:  Website

Hide label if anything other than upgrade

Sun Mar 25, 2012 11:03 pm

I have a label on the Exit Dialog that I only want to have visible only if an upgrade is being performed.

Using the ControlConditions - i've successfully added a condition of "not installed" and an action of "hide" - this works as expected. The issue is the exit dialog is also called on uninstall - and the label shows in that case. I've tried various combinations of setting the labels visibility property and showing hiding the custom condition but havent' quite been able to get what I want, although I'm sure it's a simple thing.

What I want is:
First time install OR Upgrade: hide the lable
Upgrade: show the label

Any help would be appreciated.

Thanks

mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Hide label if anything other than upgrade

Mon Mar 26, 2012 11:27 am

Hello,

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

You can use either depending if the label is part of the target or upgrading MSI.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MattFielder
Posts: 22
Joined: Thu Jan 05, 2012 9:49 pm
Contact:  Website

Re: Hide label if anything other than upgrade

Tue Mar 27, 2012 2:53 am

Thanks for the suggestion --- i got it working now. Wanted to post back with the solution i came up with in case anyone else finds this thread and has the same issue. I defined two seperate custom actions. Both set the label to "hide" in the action. One is "NOT OLDPRODUCTS". The other is a predefined item checking if an uninstall is in progress. If either condition is hit, the label is hidden - if not, it's an installation that is being upgraded and the message shows as expected.

Return to “Common Problems”