0

I have written an installer using wix. I try to check if JRE is installed on computer. Mostly works fine but some cases (some user machines) does not work properly and installation cannot complete successfully because wix cannot find JRE.

JRE search and condition code:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
.....
<Product ...... >
.....
<Property Id="JREINSTALLED">
<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[(JREINSTALLED)]]></Condition>
......
</Product>
</Wix>

MSI Log Releated to "JREINSTALLED":

.....
AppSearch: Property: JREINSTALLED, Signature: JREINSTALLED_REGSEARCH
.....
PROPERTY CHANGE: Adding JREINSTALLED property. Its value is '1.8'.
.....
Switching to server: JREINSTALLED="1.8" INSTALLDIR="C:\Program Files (x86)\MyProgram\" TARGETDIR="D:\" PREVIOUSVERSIONSINSTALLED="{08636CF5-D7C4-42FD-85D8-ED21227632AE}" ALLUSERS="1" CURRENTDIRECTORY="C:\Users\dreamcatcher" CLIENTUILEVEL="0" CLIENTPROCESSID="3968" PRODUCTLANGUAGE="1055" USERNAME="menemine.cart" COMPANYNAME="SCCM06S01" SOURCEDIR="C:\Windows\ccmcache\d\" EXECUTEACTION="INSTALL" ACTION="INSTALL" ROOTDRIVE="D:\" INSTALLLEVEL="1" SECONDSEQUENCE="1"  ADDLOCAL=DefaultFeature  
.....
Command Line: JREINSTALLED=1.8 INSTALLDIR=C:\Program Files (x86)\MyProgram\ TARGETDIR=D:\ PREVIOUSVERSIONSINSTALLED={08636CF5-D7C4-42FD-85D8-ED21227632AE} ALLUSERS=1 CURRENTDIRECTORY=C:\Users\dreamcatcher CLIENTUILEVEL=0 CLIENTPROCESSID=3968 PRODUCTLANGUAGE=1055 USERNAME=dreamcatcher COMPANYNAME=SCCM06S01 SOURCEDIR=C:\Windows\ccmcache\d\ EXECUTEACTION=INSTALL ACTION=INSTALL ROOTDRIVE=D:\ INSTALLLEVEL=1 SECONDSEQUENCE=1 ADDLOCAL=DefaultFeature ACTION=INSTALL 
.....
Ignoring disallowed property JREINSTALLED
.....
Property(C): JREINSTALLED = 1.8

Also I check Registry records (HKLM\SOFTWARE\JavaSoft\Java Runtime Environment) and looks right. I cannot find any reason for cannot determine JRE.

What am i missing?

Dreamcatcher
  • 798
  • 13
  • 31
  • I don't use Wix, but have you checked the examples here?: https://www.hass.de/content/wix-how-check-if-jre-installed-install-only – Captain_Planet May 24 '18 at 08:52
  • yes I have checked that example. but I think my problem not directly releated JRE check condition because as you can see below log "CurrentVersion" registry record found successfully. however somehow cannot pass jre check condition. – Dreamcatcher May 24 '18 at 08:57
  • Could i be similar to this?: https://stackoverflow.com/questions/22443237/ignoring-disallowed-property-iismajorversion-and-enableusercontrol and have you marked your property as secure? http://wixtoolset.org/documentation/manual/v3/xsd/wix/property.html If it works on some machines but not other then the environments must be different (possibly some of the Windows Installer policies, application architecture, OS architecture etc) – Captain_Planet May 24 '18 at 13:34
  • When you say it "does not work properly" - do you get the message "Java Runtime Environment (32 Bit) is not installed." during the install? And one more thing, is the above registry search log from a machine on which it didnt work? – Isaiah4110 May 24 '18 at 16:16
  • You should add a 64-bit registry search as well: a 64-bit JRE will add 32 and 64-bit support, but maybe not the 32-bit registry entry. If the systems where it fails are server OS there is no 32-bit subsystem anyway. – PhilDW May 24 '18 at 18:02
  • I agree with @Captain_Planet, property must be secure. Condition should be (Installed OR JREINSTALLED). This will make sure uninstallation does not check for JRE and stop uninstallation. – Ashish Kamat Jun 01 '18 at 11:21

0 Answers0