I use something like this all the time:
<Condition Message="A newer version of [ProductName] is already
installed. You must uninstall that package before this one can be
installed.">Installed OR NOT NEWERVERSIONDETECTED</Condition>
<Upgrade Id="PUT-GUID-HERE">
<UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes"
Property="NEWERVERSIONDETECTED" />
<UpgradeVersion Maximum="$( var.Version)" IncludeMaximum="no"
Property="OLDERVERSIONBEINGUPGRADED" />
</Upgrade>
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anurag Katre
(Excell Data Corporation)
Sent: Monday, June 09, 2008 10:32
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Problem with UpgradeCode
Thanks for the info Blair. I have modified the code as you mentioned below . I
can see that the web service now gets updated with the latest version, however
when I run the msi again on the latest version already installed, it doesn't
pop up any message for me which means the below condition remains undetected.
<Condition Message="You already have a newer version of Web Service installed.
To install an older version, please first remove the newer version using
Add/Remove Programs">
NOT NEWERVERSIONDETECTED
</Condition>
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Blair Murri
Sent: Saturday, June 07, 2008 3:19 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Problem with UpgradeCode
Typically, the UpgradeVersion element that you named 'NEWERVERSIONDETECTED' is
used in a launch condition to prevent downgrades, and the UpgradeVersion
element you named 'OLDERVERSIONBEINGUPGRADED' should not have OnlyDetect set to
'yes'.
OnlyDetect means "Don't remove this product you found with a matching
UpgradeCode when you run RemoveExistingProducts since I am doing something else
with the property I declared".
Remove the OnlyDetect attribute from the OLDERVERSIONBEINGUPGRADED
UpgradeVersion element (keep that attribute in the NEWERVERSIONDETECTED one)
and add the following element in with your other Condition elements:
<Condition Message="You already have a newer version of Web Service
installed. To install an older version, please first remove the newer version
using Add/Remove Programs">
NOT NEWERVERSIONDETECTED
</Condition>
Hope this helps.
________________________________________
From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Anurag Katre (Excell
Data Corporation) [EMAIL PROTECTED]
Sent: Friday, June 06, 2008 7:33 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Problem with UpgradeCode
Hi I am creating a wix installer using the code below. Although I am using the
"UpgradeCode" , the msi does not replace the already installed web service code
with the new one. Is there something that I am missing? Please help.
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
<?define ProductVersion = "1.0.0.0" ?> <Product
Id="03e2f7fa-729e-4376-94de-64f766c10822" UpgradeCode
='8a61000f-715b-4591-a985-1bafe03731a9' Name="Web Service" Language="1033"
Version="$(var.ProductVersion)" Manufacturer="FOo">
<Package Id="0d246bb4-8823-4753-bc15-c6a7e2f0dea8" Description="Wec Web Service
Installer" Comments="This is used to automate the deployment."
Compressed="yes" />
<Upgrade Id='8a61000f-715b-4591-a985-1bafe03731a9'>
<UpgradeVersion Minimum ='$(var.ProductVersion)' OnlyDetect='yes'
Property='NEWERVERSIONDETECTED' />
<UpgradeVersion Minimum ='1.0.0.0' IncludeMinimum='yes' OnlyDetect='yes'
Maximum="$(var.ProductVersion)" IncludeMaximum ="no"
Property='OLDERVERSIONBEINGUPGRADED' />
</Upgrade>
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
<!-- Variables -->
<?define BinDir = "bin" ?>
<?define ToolsDir = "tools" ?>
<!-- Variables for web service -->
<?define ApplicationName = "foo" ?>
<?define WebServiceVirtualDir = "foo" ?>
<?define WebServiceName = "foo" ?>
<?define WebServicePoolName = "foo" ?>
<Property Id="W3SVCMAJORVERSION">
<RegistrySearch Id="W3SVCMAJORVERSION" Type="raw" Root="HKLM"
Key="System\CurrentControlSet\Services\W3SVC\Parameters"
Name="MajorVersion" />
</Property>
<Property Id="SQLSERVERNAME" Value="default"/>
<Property Id="DATABASENAME" Value="default"/>
<Condition Message='[ProductName] requires the .NET Framework 2.0 or
higher.'>
<![CDATA[MsiNetAssemblySupport >= "2.0.50727"]]>
</Condition>
<Condition Message="Windows Server 2003 is required.">
VersionNT = 502
</Condition>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="WindowsVolume">
<Directory Id="InetPub" Name="InetPub">
<Directory Id="wwwroot" Name="wwwroot" >
<Directory Id="HOME" Name= "." >
<Directory Id="WECINSTALLDIR"
Name="$(var.WebServiceVirtualDir)">
<Component Id="WCFComponent"
Guid="24c609bf-1964-49a9-9c56-70309715439f">
<Directory Id="WCFComponentBin" Name="bin" >
<Component Id="WCFBinComponent"
Guid="d8fecbb7-2cfe-4410-9a29-7ac515b8a0d2">
<File Id="SharedLibrary.dll" Name="WebShar.dll"
LongName="SharedLibrary.dll" DiskId="1" Source="SourceDir\SharedLibrary.dll"
Assembly="no" />
<File Id="WebService.dll" Name="WebWebS.dll"
LongName="WebService.dll" DiskId="1" Source="SourceDir\WebService.dll"
Assembly="no" />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
<Component Id="WebIIS6WebVirtualDirComponent"
Guid="420ab75e-c872-4ad7-a1b9-529f3b4b5938">
<Condition>W3SVCMAJORVERSION>"#5"</Condition>
<WebAppPool Id="WebIIS6WebApplicationPool"
Name="$(var.WebServicePoolName)" />
<WebVirtualDir Id="WebIIS6WebVirtualDir"
Alias="$(var.WebServiceVirtualDir)" Directory="INSTALLDIR"
WebSite="DefaultWebSite" DirProperties="WebDirProperties">
<WebApplication Id="WebIIS6WebApplication"
Name="$(var.WebServiceName)" WebAppPool="WebIIS6WebApplicationPool" />
</WebVirtualDir>
</Component>
</Directory>
<WebSite Id="DefaultWebSite" Description="Default Web Site">
<WebAddress Id="NonSecureAddress" Port="80" Secure="no" />
<WebAddress Id="SecureAddress" Port="443" Secure="yes" />
</WebSite>
<WebDirProperties Id="WebDirProperties" AnonymousAccess="yes"
IIsControlledPassword="yes" WindowsAuthentication="yes"
Execute="no" Script="yes" Read="yes" AccessSSL="no"
AccessSSL128="no" />
<Feature Id="Feature" Title="Feature" Level="1">
<ComponentRef Id="WCFComponent" />
<ComponentRef Id="WCFBinComponent" />
<ComponentRef Id="WecIIS6WebVirtualDirComponent" />
</Feature>
<!-- Register/unregister event source -->
<Binary Id="RegEventSource" src="RegEventSource.exe" />
<CustomAction Id="RegisterEventSource" BinaryKey="RegEventSource"
ExeCommand="-install"/>
<CustomAction Id="UnregisterEventSource" BinaryKey="RegEventSource"
ExeCommand="-uninstall" />
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallInitialize" />
<Custom Action="RegisterEventSource" After="InstallFiles">NOT
Installed</Custom>
<Custom Action="UnregisterEventSource"
After="RemoveFiles">Installed</Custom>
</InstallExecuteSequence>
</Product>
</Wix>
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users