I also tried, but it did not work for Java Runtime.
Assigning a registry search result to a property.
<Property Id="JAVACURRENTVERSION"> <RegistrySearch Id="JRE_KEY" Root="HKLM" Key="SOFTWARE\JavaSoft\Java Runtime Environment" Name="CurrentVersion" Type="raw" /> </Property>
And then, using this property to conditionally show a warning,
<UI> <Dialog Id="JavaWarningDlg" Width="284" Height="73" Title="Java Runtime" NoMinimize="yes"> <Control Id="Text" Type="Text" X="38" Y="8" Width="240" Height="40" TabSkip="no"> <Text>JRE version 1.6 or higher is required for some components to function correctly. You may proceed with installation, but be sure to install JRE if you will be using any of those components.</Text> </Control> <Control Id="OK" Type="PushButton" X="114" Y="52" Width="56" Height="17" Default="yes" Cancel="yes" Text="OK"> <Publish Event="EndDialog" Value="Return">1</Publish> </Control> </Dialog> <InstallUISequence> <Show Dialog="JavaWarningDlg" Before="ResumeDlg"> <![CDATA[NOT Installed AND JAVACURRENTVERSION < "1.6"]]> </Show> </InstallUISequence> </UI>
This did not work in all cases, so I examined it with a detailed log and found that "PrepareDlg" was called earlier than the property assignment, so I switched the Before = " PrepareDlg " register to Before = " ResumeDlg ".
Now it works fine.
source share