I have an Windows Installer for my application. Application package also contains Installer class where some of the actions are performed other are performed in Custom Actions.
The Installer installs another application from Custom Actions during Install. I want to know if this application already exists of same version I don't want to install or provide a Messagebox asknig to Reinstall Y/N.
If my application is already installed, and I click the same installer again, I get "Repair" and "Remove" options. But if the installer is newly built, I get a dialog stating "Another version is already installed ... remove using Add Remove Programs..". So I can't update the exisitng version without uninstallng it. How can I update the existing version ?
Any help or guidance for these 2 queries are highly appreciated. I looked on net for these but couldn't get apropriae answers. If you can help me, that would be really great.
CODE
prouct.xml
<?xml version="1.0" encoding="utf-8" ?>
<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
ProductCode="My.Bootstrapper.ABC">
<!-- Create Package, Product Manifest http://msdn.microsoft.com/en-us/library/ee335702.aspx
Schema Reference : http://msdn.microsoft.com/en-us/library/ms229223.aspx
-->
<PackageFiles>
<PackageFile Name="XYZ.exe"/>
</PackageFiles>
<InstallChecks>
<!-- If its installed, it will be in Uninstall. DisplayName will be XYZ2.1_rc22
Can still get values of DisplayVersion (2.1_rc22) & UninstallString from this key
-->
<RegistryCheck
Property="IS_XYZ_INSTALLED"
Key="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\XYZ"
Value="DisplayName"/>
</InstallChecks>
<Commands>
<Command PackageFile="XYZ.exe" Arguments="/Install">
<InstallConditions>
<BypassIf Property="IS_XYZ_INSTALLED"
Compare="ValueEqualTo" Value="XYZ2.1_rc22"/> // tHIS IS THE DISPLAYNAME, THAT I SEE IN REGISTY
<FailIf Property="AdminUser"
Compare="ValueNotEqualTo" Value="True"
String="NotAnAdmin"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<ExitCode Value="1641" Result="SuccessReboot"/>
<ExitCode Value="3010" Result="SuccessReboot"/>
<DefaultExitCode Result="Fail" String="GeneralFailure"/>
</ExitCodes>
</Command>
</Commands>
</Product>
package.xml
<?xml version="1.0" encoding="utf-8" ?>
<Package xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
Name="DisplayName" Culture="Culture">
<!--Check for XYZversion 2.1_rc22 -->
<Strings>
<String Name="DisplayName">Install My XYZ</String>
<String Name="Culture">en</String>
<String Name="NotAnAdmin">Administrator permissions are required to install XYZ.Contact your
administrator.</String>
<String Name="GeneralFailure">A general error has occurred while installing this
package.</String>
</Strings>
</Package>
UPDATE : I want to install XYZ if it is not alerady installed on PC. With the Above code it doesn't install as Prerequisite. In Prerequisite I select my appication (along with Windows Installer 3.1 & .NET3.5) and have selected "Download prereq from same location as my appli". On Build of setup project, I get 3 folders in my Rel (for winIns, Net & my app o be installed as preq i.e. XYZ). Currently XYZ is not installed on my comp - so the key will not be found. When I install the installer, it installs the app but not the prereq i.e XYZ.exe application. Where am I going wrong ?
Thanks .