I have a windows installer for my application. The application package also contains the Installer class, where some of the actions are performed, while others are executed in user actions.
The installer installs another application from the user actions during installation. I want to know if this application already exists in the same version. I do not want to install or provide Messagebox asknig to reinstall Y / N.
If my application is already installed, and I click the same installer again, I get the Repair and Uninstall options. But if the installer was recently built, I get a dialog box that says: "Another version is already installed ... uninstall using Add Remove Programs ..". Therefore, I cannot update the exisitng version without uninstalling it. How to upgrade an existing version?
Any help or guidance on these two queries is welcome. I looked at them, but could not get apropriae answers. If you can help me, that would be great.
THE CODE
prouct.xml
<?xml version="1.0" encoding="utf-8" ?> <Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="My.Bootstrapper.ABC"> <PackageFiles> <PackageFile Name="XYZ.exe"/> </PackageFiles> <InstallChecks> <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"> <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 installed on the PC. If the code is above, it is not installed as a prerequisite. In preliminary order, I select my application (along with the Windows 3.1 and .NET3.5 installer) and select "Download prereq from the same place as my application." In the assembly of the installation project, I get 3 folders in my Rel (for winIns, Net and my application, o is installed as preq, that is, XYZ). XYZ is not currently installed on my computer, so the key will not be found. When I install the installer, it installs the application, but not the prieq ie XYZ.exe application. Where am I going wrong?
Thanks.