Java: Distributing/Deploying the JRE using Windows Group Policies

Download the JRE you want to distribute from the Oracle Java SE Downloads page.

I used the Java SE Runtime Environment 6 Update 33.

Start the downloaded JRE installation package (in my case: jre-6u33-windows-x64.exe). When you see the following screen, the installer will have extracted the files we need to the file system:

The extracted files are stored in:

On Windows 7: C:\Users\<username>\AppData\LocalLow\Sun\JAVA\<version> e.g. C:\Users\benohead\AppData\LocalLow\Sun\JAVA\jre1.6.0_33_x64

Windows XP: C:\Documents and Settings\<username>\Local Settings\Application Data\Sun\Java\<version> e.g. C:\Documents and Settings\benohead\Local Settings\Application Data\Sun\Javajre1.6.0_33

Please copy the files there to your work directory e.g. c:\temp\staging

Note that the 32bit installer e.g. jre1.6.0_33 will not delete the files if you cancel the installation. But the 64bit installer will delete Data1.cab. So copy the files and only then cancel the installation.

If you need to update properties of the MSI package before distribution, you can use Orca database editor. It is part of the Microsoft Windows SDK (I used the Microsoft Windows SDK for Windows 7 and .NET Framework 4.

I’m not too sure to which part of the SDK Orca belongs to, so I’ve checked all packages during the installation of the SDK.

Then go to your SDK installation folder (in my case C:\Program Files\Microsoft SDKs\Windowsv7.1\Bin), you’ll find there Orca.msi:

Double-click on it to install it. Again I did a complete installation (disk space is cheap and my time too expensive to look for the exact components I really 100% need).

Start Orca now, Select “File | Open” in the menu. Select “Transform | New Transform” in the menu, so that all changes are tracked and visually indicated.

You’ll see a list of tables on the left, click there on Property (this is the table containing all the parameters you may want to change):

The following 3 changes will make sure that the check JRE updates is disabled. If the users have no admin rights, I guess the autoupdate makes no sense anyway.

AUTOUPDATECHECK 1 -> 0
JAVAUPDATE 1 -> 0
JU 1 -> 0

If you need to register the plugin as default JVM in IE and Firefox:

IEXPLORER 0 -> 1
MOZILLA 0 -> 1

(Note that the two properties above are deprecated as of Java 6U10)

To specify not to reboot the system after installation.

RebootYesNo Yes -> No

If you want to install for a single user and not for all users, remove the property ALLUSERS (which is set to 1 by default)

If you want to remove the Java coffee cup icon in the taskbar when applets run:

SYSTRAY 1 -> 0

All updated , deleted or inserted properties will be marked in green. You can then either save the transform with “Transform | Generate Transform…” in the menu. Or save an update MSI package with “File | Save Transformed As…”.

Then you need to copy your Installer (along with the CAB file to the share where it is accessible to all clients where the JRE should be installed).

Now go to your domain controller and open the Group Policy Management Editor:

Start | Run | gpmc.msc

Then navigate to:

Group Policy Management | Forests: xxxx | Domains | xxxx | Group Policy Object

There you can either use an existing policy or create a new one:

Let’s assume you want to create a new one. Click with the right mouse button in the area on the right and select New. Give it a name (e.g. “JRE Policy Object”)

Now select it in the list:

Right click and select Edit. This will open the Group Policy Management Editor.

There navigate to JRE Policy Object | Computer Configuration | Policies | Software Settings | Software installation:

In the area on the right, right click and select New | Package…

Then in the “Open” dialog, navigate to the share where the MSI package is stored, select it and click Open.

Choose Assigned as deployment method:

And there you have your new package in the group policy:

You can right click on it, choose Properties and go to the Security tab to manage who you want to distribute it to (it might be a good idea to first distribute it to your test users and then to everybody).

Leave a Reply

Your email address will not be published. Required fields are marked *