Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issues regarding Installing an Application via Windows Installer

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 .

like image 257
Tvd Avatar asked Jun 06 '11 08:06

Tvd


People also ask

How do you fix there is a problem with this Windows Installer package a program run as part of the setup did not finish as expected?

Go to Settings > Update & Security and run the Program Compatibility Troubleshooter and Windows Store Apps Troubleshooter. Both scan and provide solutions for any app problems that cause this error message to occur. Repair the app.

Why Windows Installer is not working?

You may see the message Windows Installer Service could not be accessed. This usually happens if the Windows Installer Engine is corrupted, installed incorrectly, or disabled. You will need to fix either the corruption or fix the configuration or enable it.

Why can't I install apps from Windows Store?

If updates for Windows were recently installed, you'll need to restart your PC before you can install apps from Microsoft Store. Your PC isn't authorized to use Microsoft Store apps. You'll need to sign into the app with your Microsoft account.


1 Answers

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.

Instead of a custom action you should use a prerequisite. If you are using a Visual Studio setup project, perhaps this will help: Adding Custom prerequsites to visual studio setup project

If you are using another setup authoring tool, you should find out if it supports prerequisites or not.

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 ?

This happens because you modified the package without increasing the ProductVersion and modifying the ProductCode. If you want an automatic upgrade you need to modify them.

However, if you are just testing and you don't want to increase the ProductVersion, you need to manually uninstall the old package before installing the new one. This is how Windows Installer upgrades work.

like image 53
rmrrm Avatar answered Oct 22 '22 09:10

rmrrm