I am writing a installer for an existing product, for which an earlier installer was written in NSIS (Nullsoft Scriptable Install System). I have to write an msi based installer for this product using WiX. I have certain question regarding this :-
- How to detect whether my application is installed or not on a target machine? The application may have been installed using NSIS (older versions) or MSI (now onwards).
- 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 are not working. Specifically I want to know which information (GUID, version etc.) needs to be changed in the installer code base on each release of the software.
- Three/four versions of our product are released 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 the newer installer is not able to replace the older one. When I double click the newer version of the installer it shows an 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 the 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"/>