Question

I would like to create an installer for a Java application using Visual Studio 2008 Installer

I have followed the instructions for creating a prerequisite using the tool Bootstrapper Manifest Generator.
How to: Create a Product Manifest

I want to create a prerequisite that will install Java if not present on the machine.

To do so, I check the registry Key: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion

And I test if the CurrentVersion is >= 1.7.

The product.xml generated is the following:

<?xml version="1.0" encoding="utf-8"?>
<Product ProductCode="Java1.7" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
  <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="jre-7u45-windows-x64.exe" />
  </PackageFiles>
  <InstallChecks>
    <RegistryCheck Property="Java_Version" Key="HKLM\Software\JavaSoft\Java Runtime Environment" Value="CurrentVersion" />
  </InstallChecks>
  <Commands Reboot="Defer">
    <Command PackageFile="jre-7u45-windows-x64.exe">
      <InstallConditions>
        <BypassIf Property="Java_Version" Compare="VersionGreaterThanOrEqualTo" Value="1.7" />
      </InstallConditions>
      <ExitCodes>
        <ExitCode Value="0" Result="Success" />
        <ExitCode Value="3010" Result="Success" />
        <DefaultExitCode Result="Fail" String="Anunexpectedexitcodewasr" FormatMessageFromSystem="true" />
      </ExitCodes>
    </Command>
  </Commands>
</Product>

I generate the installer using this prerequisite (VS 2008), but if I run the installer on a Machine with the Java already installed, the installer asks me to install Java!

The ByPassIf instructions is ignored for some reasons. I have checked whether the registry key does exist obviously ...

Any Idea?

No correct solution

OTHER TIPS

http://archive.msdn.microsoft.com/bmg/Thread/View.aspx?ThreadId=6765 Please check the install log, for the following error: "Unable to read registry value error"

Quoting from the above post: "32 bit machine works fine , issue is seen only on 64 bit machines that too SP2 ( Server version throws error) . Windows 7 Professional edition works fine."

Please check what happens on 32 Bit machines. It worked for me on 32 bit machines but not 64 bit machines

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top