Windows – How to add Java Exception Site List for all users

javajava-appletjava-web-startSecuritywindows 7

I need to use an old Java applet for a certain website, but newer Java versions cannot run it, as it has a self-signed certificate. Reading on Oracle's Deployment Guide, I need to make my own deployment .JAR, with a proper certificate signing (not self signed), just to create the exception I need to run applets from a single domain.

I have found that there is a %userprofile%\appdata\LocalLow\Sun\Java\Deployment\security\exception.sites file, obviously one for each user. In there, one per line, is a list of domains I can set to exclude from NOT being executed. When I add the domain name, the user gets a single prompt, then it just allows that domain for that user. Great.

I know I could add this file to the Default user profile, for any new users being created. Unfortunately, I do not think that removing every user's profile from each of the systems is the right way to go. I can push commands to computers, but the commands run as my user – I can't use %USERPROFILE% for this. I do not want to put it in my login script, as I do not want the file getting large for users who constantly log in and off of systems. I also only want the single domain added to whatever is there, without wiping out the user's preferences that may already exist.

Because I do not want to wipe out their preferences, I thought of doing something along the lines of echo http://www.example.com >> %userprofile%\appdata\LocalLow\Sun\Java\Deployment\security\exception.sites, but that won't work, as it will keep adding to the file.

What can I do to add the list to the Exceptions rule, but only if the rule does not exist already?

Best Answer

Just add the following files to C:\Windows\Sun\Java\Deployment folder.

deployment.properties:

deployment.user.security.exception.sites=C:/Windows/Sun/Java/Deployment/exception.sites
deployment.system.config.mandatory=True

deployment.config:

deployment.system.config=file:///C:/Windows/Sun/Java/Deployment/deployment.properties
deployment.system.config.mandatory=True

exception.sites:

http://some.trusted.site/
https://another.trusted.site/

This would affect all users of this machine.

Via:

Related Question