0 Replies Latest reply on Jul 18, 2011 6:09 PM by 876257

    Deploying bundled JRE with a solution using the Active-X bridge


      I have been using the Active-X bridge technology for a number of years and have now decided to streamline the installation of my code by including the JRE. I am doing this for two reasons, the first to avoid having to run the JRE installer as a number of the machines I deploy to require specific versions of the JRE, and the second to make it easier to control the location of the java.policy file as I need to grant certain privilages for my code.

      I have managed to get an installer working so the user can choose the installation folder, my active-x dlls and jar file get copied in and registered and I now include a java/jre6 sub directory with the contents of the 1.6.0_26 runtime.
      My dlls are registered to point to my axbridge.dll under the java/jre6/bin sub folder and after some trial and error I was able to work out that my axbridge.dll reads the java home location from the HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Plug-in\1.6.0_26\Java Home key. This isnt ideal as I could now be pointing the users 1.6 plugin back to my installation as well but the axbridge.dll seems hardcoded to read its version from the plugin registry entry and not use any current version flag etc. I could get around this though by using a version that isnt going to conflict with a JRE installed on a users machine.

      The problem I have now though is that if the user already has a JRE installed and runs the java plug-in from the windows control panel the deployment.properties file is created under the users folder. For Windows 7 its C:\Users\<userslogin>\AppData\LocalLow\Sun\Java\Deployment. Within this file is a path to the javaw.exe and this causes the java home to be reset to the installed JRE path which in turn uses the java.policy file in that location. If I amend the path to point to my installation it works fine and my java.policy file is invoked, if I delete the deployment.properties file it works fine and again my jvm.dll and policy file are invoked.

      I have tried creating the deployment.config file under windows\sun\Java\deployment and pointing it back to a deployment.properties file under my installation but the deployment.config is not read atleast I cant see the file being accessed in processmonitor.

      Has anyone managed to bundle a JRE with an Active-X bridge solution?