WIX downgrade prevention warning is showing at wrong time

I have a strange problem with WIX installer. It has custom action preventing application to install when newer version present:

<Upgrade Id='SOME_GUID'>
  <UpgradeVersion OnlyDetect='yes' Property='SELFFOUND'
    Minimum='$(var.Version)' IncludeMinimum='yes'
    Maximum='$(var.Version)' IncludeMaximum='yes' />
  <UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND'
    Minimum='$(var.Version)' IncludeMinimum='no' />

  <Custom Action='AlreadyUpdated' After='FindRelatedProducts'>SELFFOUND</Custom>
  <Custom Action='NoDowngrade' After='FindRelatedProducts'>NEWERFOUND</Custom>

<CustomAction Id='AlreadyUpdated' Error='$(var.ProductName) has already been updated to $(var.Version) or newer.' />
<CustomAction Id='NoDowngrade' Error='A later version of $(var.ProductName) is already installed.' />

Nothing special - all as in WIX tutorial. I use Mondo UI with few own custom dialogs.

<UIRef Id="WixUI_Mondo" />

The problem is that custom action "NoDowngrade" executes after I click "Install" button, after all configuration steps passed. I expected to see the message immediately after launching installer. I checked the installExecuteSEquence in installer table using Orca util - "AlreadyUpdated" CA has Sequence = 27. FindRelatedProducts event have Sequence=25. 27 is used by other my action, "NoDowngrade", almost the same as "AlreadyUpdated". The first UI dialog should be displaied on Sequence = 49 I suppose - PrepareDlg has this value in InstallUISequence. Looks like nothing can happen between FindRelatedProducts and PrepareDlg showing except of my custom actions.

But surprisingly, installation log says opposite:

MSI (c) (90:88) [13:08:03:768]: Running UISequence
MSI (c) (90:88) [13:08:03:768]: PROPERTY CHANGE: Adding EXECUTEACTION property. Its value is 'INSTALL'.
MSI (c) (90:88) [13:08:03:768]: **Doing action: FindRelatedProducts**
Action 13:08:03: FindRelatedProducts. Searching for related applications
Action start 13:08:03: FindRelatedProducts.
FindRelatedProducts: Found application: {E25981A8-83D3-4183-B53C-F6E70FC9D1E0}
MSI (c) (90:88) [13:08:03:769]: PROPERTY CHANGE: Adding SELFFOUND property. Its value is '{E25981A8-83D3-4183-B53C-F6E70FC9D1E0}'.
Action ended 13:08:03: FindRelatedProducts. Return value 1.
MSI (c) (90:88) [13:08:03:770]: Doing action: PrepareDlg
MSI (s) (2C:84) [13:08:10:658]: Running ExecuteSequence
MSI (s) (2C:84) [13:08:10:658]: **Doing action: FindRelatedProducts**
Action 13:08:10: FindRelatedProducts. Searching for related applications
Action start 13:08:10: FindRelatedProducts.
MSI (s) (2C:84) [13:08:10:660]: Skipping FindRelatedProducts action: already done on client side
Action ended 13:08:10: FindRelatedProducts. Return value 0.
MSI (s) (2C:84) [13:08:10:660]: Doing action: AppSearch
Action 13:08:10: AppSearch. Searching for installed applications
Action start 13:08:10: AppSearch.
MSI (s) (2C:84) [13:08:10:662]: Skipping AppSearch action: already done on client side
Action ended 13:08:10: AppSearch. Return value 0.
MSI (s) (2C:84) [13:08:10:662]: **Doing action: AlreadyUpdated**
Action 13:08:10: AlreadyUpdated. 
Action start 13:08:10: AlreadyUpdated.
APS DTE Axiom Server has already been updated to or newer.
MSI (s) (2C:84) [13:08:12:420]: Product: APS DTE Axiom Server -- APS DTE Axiom Server has already been updated to or newer.

Action ended 13:08:12: AlreadyUpdated. Return value 3.

So we can see that FindRelatedProducts tried to execute twice, but AlreadyUpdated CA executed only with second try. Tutorials doesn't say anything about placing this CA in InstallUISEquence. Is it needed, or maybe it is not a good approach if it isn't there? Or can you recommend a better solution to this problem?


Repeat the InstallExecuteSequence section for the InstallUISequence as well. You want the checks to occur during the dialogs, so they're part of the InstallUISequence. You also want them to occur during InstallExecuteSequence in case the user does a quiet install, skipping the UI.

  <Custom Action='AlreadyUpdated' After='FindRelatedProducts'>SELFFOUND</Custom>
  <Custom Action='NoDowngrade'    After='FindRelatedProducts'>NEWERFOUND</Custom>

  <Custom Action='AlreadyUpdated' After='FindRelatedProducts'>SELFFOUND</Custom>
  <Custom Action='NoDowngrade'    After='FindRelatedProducts'>NEWERFOUND</Custom>

Use MajorUpgrade instead.

Need Your Help

Creating a web server control to mimic jquery autocomplete API

javascript jquery vb.net jquery-autocomplete custom-server-controls

I am attempting to create a ASP .Net (VB.Net) custom control for an auto-complete drop down that uses jQuery auto-complete.

How to play HLS video in Android?

android html5 webview stock twitch

Here is stream video from justin.com or twitch.tv this CHANNEL

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.