Search code examples
windowsregistry7zip

7-zip SFX executable doesn't have the full registry


I have a batch file that reads a registry entry:

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment" /v Java7FamilyVersion

When I run this batch file, it's able to detect the Java installation. However, when I package the batch into a 7-zip SFX executable and run it, JavaSoft is missing from the SOFTWARE path.

I have a feeling that the JavaSoft path is in a different hive, and that particular hive isn't being loaded when 7-zip auto-executes the extracted batch. Does anyone know how to fix this problem?


Solution

  • Ben Voigt was right, there's a 32-bit vs 64-bit problem going on. I managed to access the Java registry with this:

    reg query "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment" /reg:64