If you don't want to always be calculating version numbers, you can also do
this:

       <UpgradeVersion Minimum="1.0.0"
                       IncludeMinimum="yes"
                       Maximum="same-version-as-in-Product-element"
                       IncludeMaximum="no"
                       Property="OLDERVERSIONBEINGUPGRADED" />

I personally always set Minimum to "0" because that way I never have to
worry about what my minimum version number was or about some pre-release
build getting left behind.

Many people also use this table to implement downgrade protection.

-----Original Message-----
From: Sohail Somani [mailto:soh...@taggedtype.net] 
Sent: Wednesday, August 11, 2010 12:44 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Silly but simple question about upgrades

First, I love WiX. I don't think I can say that enough. Windows 
Installer is a huge pain and this product makes it bearable and almost fun.

Ok, enough sucking up. I am reading the section about upgrades here:

   http://wix.sourceforge.net/manual-wix3/major_upgrade.htm

It appears that the recommendation is to generate the Product Id every 
time. In addition to this, I am also generating the Package Id every 
time. In fact, when I want an installation to overwrite the existing 
installation (by uninstalling and installing on top), I am only leaving 
the UpgradeCode as static.

Specifically, here are the relevant sections of my wxs file:

   <Product Id="*"
            UpgradeCode="A-GUID"
            Name="Product SDK"
            Language="1033"
            Version="1.0.1"
            Manufacturer="Company Inc.">

     <Package Id="*"
              Description="Product SDK"
              Manufacturer="Company Inc."
              InstallerVersion="200"
              Compressed="yes" />

     <Upgrade Id="SAME-GUID-AS-A-GUID">
       <!--
           The Maximum version should be one less than the current
           minor version (or 0 if negative).

           The Minimum version should be the first in this product
           series
       -->
       <UpgradeVersion Minimum="1.0.0"
                       IncludeMinimum="yes"
                       Maximum="1.0.0"
                       IncludeMaximum="yes"
                       Property="OLDERVERSIONBEINGUPGRADED" />
     </Upgrade>

     <InstallExecuteSequence>
       <RemoveExistingProducts After="InstallInitialize"/>
     </InstallExecuteSequence>

Does this sound like a silly, dangerous thing to do or am I a genius?

Thanks in advance.

-- 
Sohail Somani
--
iBlog : http://uint32t.blogspot.com
iTweet: http://twitter.com/somanisoftware
iCode : http://bitbucket.org/cheez



----------------------------------------------------------------------------
--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to