To make a complete upgrade, the Product Id="*" Pacakage="*" UpgradeCode=<Some constant GUID>
In the first time of the release set the upgradecode to some guid and set Version. >From next release onwards keep increasing the version. <?xml version="1.0" encoding="utf-8"?> <?define ApplicationName="APPName" ?> <?define Version="0.0.0.1" ?> <?define Upgradecode="DBC7AC16-5BD8-4b67-9DC0-9F2A9C111D2D" ?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="$(var.ApplicationName)" Language="1033" Version="$(var.Version)" Manufacturer="Manufacturar" UpgradeCode="$(var.Upgradecode)" Codepage="$(var.codepage)"> <Package Id="*" Keywords="WLL" Description="My Installer" InstallPrivileges="elevated" Comments="Installs driver and product" Manufacturer="Manufacturar" InstallerVersion="300" Languages="1033" Compressed="yes" SummaryCodepage="$(var.codepage)" /> <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" /> .................... .................... <Upgrade Id="$(var.Upgradecode)"> <!-- Detect any newer version of this product --> <UpgradeVersion Minimum="$(var.Version)" IncludeMinimum="no" OnlyDetect="yes" Language="1033" Property="NEWPRODUCTFOUND" /> <!-- Detect and remove any older version of this product --> <UpgradeVersion Maximum="$(var.Version)" IncludeMaximum="yes" OnlyDetect="no" Language="1033" Property="OLDPRODUCTFOUND" /> </Upgrade> ................... ..................... <CustomAction Id="PREVENTDOWNGRADE" Error="Newer version already installed" /> <InstallExecuteSequence> .............. ........... <Custom Action="PREVENTDOWNGRADE" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom> <RemoveExistingProducts After="InstallFinalize" /> </InstallExecuteSequence> ................ .................... ----- Original Message ----- From: "Sanjay Rao" <[email protected]> To: <[email protected]> Sent: Thursday, December 03, 2009 7:37 PM Subject: [WiX-devs] writing upgradeable msi packages using WIX > Hi, > > I am writing first time on this list. I am writing a installer for > a existing product, for which earlier installer was written in > NSIS(nullsoft script able installer system). I have to write a msi based > installer for this product using WIX. I have certain question regarding > this :- > 1. How to detect whether my application is installed or not on a target > machine. application may have been installed using NSIS(older versions) > or MSI(now onwards). > 2. How to write a WIX installer which can upgrade if there is older/same > version of product installed on target machine. I found this topic on > several sites but all those is not working. Specifically I want to know > which information (GUID, version etc.) needs to be changed in installer > code base on each release of the software. > 3. Three/four version of our product releases each year. what kind of > installer will be best suitable for me ? > > Please note that if I just change version of the product element in Wix > code, then newer installer is not able to replace older one. when I > double click the newer version of installer is shows a error dialog > saying:-"another version of this product is already installed . > Installation of this version cannot continue.To configure or remove the > existing version of this product, use add/remove Programs on control > panel". > > sample code > > <?xml version='1.0' encoding='windows-1252'?> > <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" > xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" > > <Product Name='Baton' Id='41B8F929-B6CF-41BE-9E40-C96D9BD6D672' > UpgradeCode='E1F03FA4-D470-4FA6-86BA-F5CDD3007C1D' > Language='1033' Codepage='1252' Version='1.0.0' > Manufacturer='Company Name.'> > > <Package Id='*' Keywords='Installer' Description="product > Installer" > Comments='product comments' > InstallerVersion='100' Languages='1033' Compressed='yes' > SummaryCodepage='1252' /> > > <Upgrade Id='E1F03FA4-D470-4FA6-86BA-F5CDD3007C1D'> > <UpgradeVersion OnlyDetect='no' Property='PREVIOUSFOUND' > Minimum='1.0.0' IncludeMinimum='yes' Maximum='1.1.0' IncludeMaximum='yes' > /> > </Upgrade> > > <!-- ***Install execution sequence*** --> > <InstallExecuteSequence> > <RemoveExistingProducts After="InstallInitialize"/> > ......................................... > > > Regards, > Sanjay Rao > > > > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > _______________________________________________ > WiX-devs mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/wix-devs > > ------------------------------------------------------------------------------ Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev _______________________________________________ WiX-devs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wix-devs
