WiX: How to check if JRE is installed on install only

Checking JRE can be done with below code. I found this on the net, but it failed for me with WixUI_FeatureTree and WixUI_Mondo setup interfaces. The problem was that the condition has not checked only on install. Therefore I got the message also if I tried to modify features and this prevented my from changing them. The added Installed OR makes sure this condition is only checked on the very first install and no more later. It would otherwise cause serious issues for the user if the application should be removed after the JRE has been uninstalled.

<!-- Check some requirements ONLY on "install", but not on modify or uninstall. -->
<Property Id="JAVA_CURRENT_VERSION">
  <RegistrySearch Id="JRE_CURRENT_VERSION_REGSEARCH" Root="HKLM" Key="SOFTWARE\JavaSoft\Java Runtime Environment" Name="CurrentVersion" Type="raw" Win64="no" />
</Property>
<Condition Message="Java Runtime Environment (32 Bit) is not installed. Please install Oracle JRE."><![CDATA[(Installed OR JAVA_CURRENT_VERSION)]]></Condition>

Or if you require a Java version 1.6 or later.

<!-- Check some requirements ONLY on "install", but not on modify or uninstall. -->
<Property Id="JAVA_CURRENT_VERSION">
  <RegistrySearch Id="JRE_CURRENT_VERSION_REGSEARCH" Root="HKLM" Key="SOFTWARE\JavaSoft\Java Runtime Environment" Name="CurrentVersion" Type="raw" Win64="no" />
</Property>
<Condition Message="Java Runtime Environment (32 Bit) is not installed or outdated. Please install Oracle JRE 1.6 or later."><![CDATA[Installed OR (JAVA_CURRENT_VERSION >= "1.6")]]></Condition>
Bewertung: 
Noch keine Bewertungen vorhanden