First of all, did your initial installer have an Upgrade Code specified?  If it 
did then this will 
be fairly straightforward.  To make a Major Upgrade, take your current WiX file 
and:
Change the Product Version
Change the Product Code
Change the Package Code
Leave the Upgrade Code the same

Create an Upgrade table like this:
<Upgrade Id="YOUR-UPGRADE-GUID">
   <UpgradeVersion Property="OLDAPPFOUND" IncludeMinimum="yes" 
Minimum="0.0.0.0" IncludeMaximum="no" 
Maximum="THIS-PRODUCT-VERSION"/>
   <UpgradeVersion Property="NEWAPPFOUND" IncludeMinimum="no" 
Minimum="THIS-PRODUCT-VERSION" 
OnlyDetect="yes"/>
</Upgrade>

Changing YOUR-UPGRADE-GUID and THIS-PRODUCT-VERSION for the appropriate values.

Add RemoveExistingProducts to the InstallExecuteSequence.  There are a few 
places you can add it, 
with differing affects.  See here:
http://msdn2.microsoft.com/en-us/library/aa371197.aspx

The NEWAPPFOUND bit is for stopping downgrade.  If you don't care about this 
you can omit that entry 
in the Upgrade Table and ignore the following.  Otherwise:
Add a custom error like this:
<UI>
   <Error Id="2000">There is a later version of this product installed</Error>
<UI>

Create a Custom Action like this:
<CustomAction Id="NewerVersionDetected" Error="2000"/>

and finally add this to your execute sequences:
<Custom Action="NewerVersionDetected" 
After="FindRelatedProducts">NEWAPPFOUND</Custom>

Hoe that helps,

Rob


Carter Sanders wrote:
> What I'd really like is a pointer to a working example of a Major 
> Upgrade.  The fine tutorial at http://www.tramontana.co.hu/wix/  has a 
> lot of info about patches and minor upgrades, but no explicit working 
> examples of major upgrades. I've been trying for quite some time to get 
> this working.
> 
> What I'm experiencing is this-
> 
> Either I get a double install, or a broken install. If I set OnlyDetect 
> to yes, I get a double install when I try to do an upgrade (two 
> instances of my program in add/remove programs) . If I set OnlyDetect to 
> "no", at the end of my upgrade, the entire installation is deleted and I 
> have a corrupted install.
> 
> 
> Here's my Upgrade table-
> 
>            <Upgrade Id="9C471B34-F15F-44EA-8F25-131B6952A0CA">
> 
>                  <UpgradeVersion OnlyDetect="no" 
> Property="PREVIOUSVERSIONINSTALLED" IncludeMinimum='yes' Minimum='0.0.1'/>
> 
>            </Upgrade>
> 
> 
> I don't see any suggestion of where the PREVIOUSVERSIONINSTALLED 
> property should be used once it's populated. Do I have to write a custom 
> action, or is there some  mainstream way of using it? I tried adding it 
> as a condition to the  Welcome Maintenance dialog, but that didn't seem 
> to work.
> 
> Thanks for any help.
> 
> 
> 
> -Carter
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to