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?