Thanks for clarifying that.

This now works for me.

I have made my upgrade display a modified WelcomeDlg, first by adding a 
custom WelcomeDlg as described here:
http://www.dizzymonkeydesign.com/blog/misc/adding-and-customizing-dlgs-in-wix-3/

Then I modified the description text control on that dialog to display 
the value of a new property:
               <Control Id="Description" Type="Text" X="135" Y="80" 
Width="220" Height="60" Transparent="yes" NoPrefix="yes" 
Text="[RESOLVER_WELCOME_TEXT]" />

Then I define the value of that property, depending on whether we are 
installing or upgrading:
    <!-- welcome dialog text depends on if we are installing or 
replacing -->
    <CustomAction
      Id="IsInstalling"
      Property="RESOLVER_WELCOME_TEXT"
      Value="This will install Resolver One ${VERSION}." />
    <CustomAction
      Id="IsUpgrading"
      Property="RESOLVER_WELCOME_TEXT"
      Value="This will install Resolver One ${VERSION}, replacing the 
version that is already installed." />
    <InstallUISequence>
      <Custom
        Action="IsInstalling"
        Before="Resolver_WelcomeDlg">NOT OLDERVERSIONDETECTED</Custom>
      <Custom
        Action="IsUpgrading"
        Before="Resolver_WelcomeDlg">OLDERVERSIONDETECTED</Custom>
    </InstallUISequence>

Where 'OLDERVERSIONDETECTED' is my property used to detect previously 
installed versions:
    <!-- remove old versions when installing -->
    <Upgrade Id="7890536C-CD55-4E4A-87D8-078D67AC8EA4">
      <UpgradeVersion
        Property="OLDERVERSIONDETECTED"
        OnlyDetect="no"
        Minimum="0.0.0.1"
        IncludeMinimum="yes" />
    </Upgrade>
    <InstallExecuteSequence>
        <RemoveExistingProducts After="InstallFinalize" />
    </InstallExecuteSequence>


Note that I specify no 'Maximum' or 'IncludeMaximum' in my 
UpgradeVersion tag, because I want to let users downgrade if they want 
to. I notice a lot of tutorials forbid this, but surely a user should be 
allowed to do whatever they think best, for example to workaround new 
bugs in your application.

Best regards,

    Jonathan

Blair wrote:
> In most UIs based on Windows Installer and as a matter of WI transactions,
> major upgrades are simply installations that happen, as a side effect, to
> remove previous version(s). If you are using Windows Installer's progress
> bar, you may get one or two additional "passes" of the progress bar as the
> only widely noticeable side effect.
>
> -----Original Message-----
> From: Jonathan Hartley [mailto:tart...@tartley.com] 
> Sent: Wednesday, September 30, 2009 9:07 AM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] major upgrades just reinstall, overwriting previous
>
> Ah, good question. The version that ultimately ends up installed is 
> indeed the new version.
>
> A moment reflecting on your response makes me think that maybe I have 
> confused myself by expecting to see some change to the UI during an 
> upgrade, as opposed to during a fresh install, and perhaps this is not 
> to be expected unless I specifically ask for it.
>
> I shall go and read up on configuring the UI to be different during 
> upgrades, at least to add a single step notify the user of what is going on.
>
> Many thanks for clearing the mists of my myopia, if I have indeed now 
> got the right end of the stick.
>
>     Jonathan
>
>
>
> Rob Hamflett wrote:
>   
>>  > It does not remove the old version. It overwrites the old install, and
>>     
> after it is done, there is 
>   
>> only one item listed in 'Add or Remove Programs'.
>>
>> I'm not sure I understand this.  What do you mean by "it does not remove
>>     
> the old version?"  Because 
>   
>> you then say that it overwrites the old version and there is only one item
>>     
> listed in ARP.  That 
>   
>> sounds like an update to me.  Is the version in ARP the old version?
>>
>> Rob
>>
>> Jonathan Hartley wrote:
>>   
>>     
>>> Hi all.
>>>
>>> I'm trying to add major updates. (Actually I'm migrating our Wix config 
>>> from 2 to 3, and I can't see what I did to break major updates in the 
>>> process.)
>>>
>>> I followed the tutorials and read the docs at (and many others)
>>> http://www.tramontana.co.hu/wix/lesson4.php#4.1
>>> http://wix.sourceforge.net/manual-wix3/major_upgrade.htm
>>> http://wix.sourceforge.net/manual-wix3/wix_xsd_upgradeversion.htm
>>>
>>> I create an msi, I install it. I bump my version number (in both the 
>>> product tag, and the upgradeversion tag) I build this new msi. When I 
>>> install this new msi, it simply installs as if nothing had previously 
>>> been installed. The UI looks exactly as though this is a first-time 
>>> install, not an upgrade. It does not remove the old version. It 
>>> overwrites the old install, and after it is done, there is only one item 
>>> listed in 'Add or Remove Programs'.
>>>
>>> Sorry to post about what is doubtless a simple mistake on my part 
>>> somewhere, but I've been over this a hundred times the last few days, 
>>> and can't see what I'm doing wrong. I been over my xml with a fine tooth 
>>> comb, trying many different combinations of things:
>>>     * manually declaring the PREVIOUSVERSIONSINSTALLED property (as 
>>> below) or not
>>>     * Using a fixed Product Id rather than "*"
>>>          (which is what we used to (wrongly?) do under Wix2)
>>>     * Changing the RemoveExistingProducts to different points in the 
>>> install execute sequence
>>>     * Putting the xml through WixCop.
>>>
>>> My wxs follows, with irrelevant bits removed:
>>>
>>>     <Product
>>>         Name="$(var.longname)"
>>>         Id="*"
>>>         UpgradeCode="7890536C-CD55-4E4A-87D8-078D67AC8EA4"
>>>         Version="0.0.5002"
>>>         Manufacturer="Resolver Systems Ltd"
>>>         Language="1033"
>>>         Codepage="1252">
>>>         <Package
>>>             Id="*"
>>>             Keywords="Installer"
>>>             Description="$(var.longname) Installer"
>>>             Comments="Installs $(var.longname) on your system."
>>>             Manufacturer="Resolver Systems Ltd"
>>>             InstallerVersion="200"
>>>             Compressed="yes"
>>>             Languages="1033"
>>>             SummaryCodepage="1252" />
>>>
>>>    <!-- Snip: UI, .NET2.0 requirement, metadata for Add or Remove 
>>> Programs, Media tag -->
>>>
>>>         <!-- remove previous versions of resolver before installing -->
>>>         <Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
>>>         <Upgrade Id="7890536C-CD55-4E4A-87D8-078D67AC8EA4">
>>>             <UpgradeVersion
>>>                 Property="PREVIOUSVERSIONSINSTALLED"
>>>                 OnlyDetect="no"
>>>                 Minimum="0.0.0.1"
>>>                 IncludeMinimum="yes"
>>>                 Maximum="0.0.5002"
>>>                 IncludeMaximum="no" />
>>>         </Upgrade>
>>>         <InstallExecuteSequence>
>>>             <RemoveExistingProducts Before="InstallInitialize" />
>>>         </InstallExecuteSequence>
>>>
>>>   <!-- Snip: Directory, File, Component tags -->
>>>
>>>   <!-- Snip: Feature and CompenentRef tags -->
>>>
>>> </product>
>>>
>>>     
>>>       
>>
>>     
> ----------------------------------------------------------------------------
> --
>   
>> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay 
>> ahead of the curve. Join us from November 9&#45;12, 2009. Register
>>     
> now&#33;
>   
>> http://p.sf.net/sfu/devconf
>> _______________________________________________
>> WiX-users mailing list
>> WiX-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>
>>   
>>     
>
>   

-- 
Jonathan Hartley      Made of meat.      http://tartley.com
tart...@tartley.com   +44 7737 062 225   twitter/skype: tartley



------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to