Hello,

I have WIX project for product, which needs updates periodically.
Also I block downgrade installations.
There is a dialog in WIX, which allows to select between per user/per 
machine installation.

Uninstall previous installations is handled using "Upgrade" table:
>     <Upgrade Id="$(var.UpgradeCode)">
>       <UpgradeVersion Property="OLDAPPFOUND"
>                       Minimum="1.0.0.0" IncludeMinimum="yes"
>                       Maximum="$(var.version)" IncludeMaximum="no"
>                       OnlyDetect="no" />
>       <UpgradeVersion Property="NEWAPPFOUND"
>                       Minimum="$(var.version)" IncludeMinimum="no"
>                       OnlyDetect="yes"/>
>     </Upgrade>


Sequences:
>     <AdminExecuteSequence />
>
>     <InstallExecuteSequence>
>       <FindRelatedProducts Before="LaunchConditions" /><!-- search for 
> installed products using Upgrade table -->
>       <RemoveExistingProducts After="InstallInitialize" /> <!-- remove 
> products, found in FindRelatedProducts -->
>     </InstallExecuteSequence>
>
>     <InstallUISequence>
>       <FindRelatedProducts Before="LaunchConditions" />
>     </InstallUISequence>

To protect from downgrade I use <Condition> element in <Package>:
>     <Condition
>        Message='A later version of "[ProductName]" is already installed: 
> {[NEWAPPFOUND]}. Setup will now exit.'
>        >NOT NEWAPPFOUND</Condition>

So information, found in FindRelatedProducts, is used for 2 tasks:
- uninstall previously installed  products in action RemoveExistingProducts
- block downgrade installations calculating condition of Package. As I 
understand conditions validated in action LaunchConditions
So FindRelatedProducts must be executed before these 2 actions.

Also I have such properties (by default setup is per machine):
>       <Property Id="ALLUSERS" Value="1" />
>       <Property Id="ASSISTANCE_USERS">all</Property>
There is UI dialog, where user can change these properties to switch to 
per-user install.

The problem happens when first product is installed per-user.
If upgrade installation is launched, FindRelatedProducts is launched 
before UI dialog with selection per-user/per-machine. At this moment 
ALLUSERS has its default value "1". So FindRelatedProducts suppose that 
new installation will be per-machine (it is incorrect, because later 
user can switch to per-user installation in UI dialog). So 
FindRelatedProducts skips previous per-user installation with message in 
install log:
> MSI (c) (4C:38) [09:58:38:093]: FindRelatedProducts: current install is 
> per-machine.  Related install for product '{OLD-PRODUCT-UID}' is per-user.  
> Skipping...

Old product is not uninstalled and I have list of all versions of my 
product in add/remove products Windows applet.

As I understand the reason of problem is that FindRelatedProducts 
executed before UI dialog with selection between per-user/per-machine.

But I can not make FindRelatedProducts running after this dialog because 
FindRelatedProducts results is also used by LaunchConditions, which must 
run before UI dialogs.

How this problem must be solved? How to make FindRelatedProducts find 
previous per-user installation?

--
Thanks!

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to