What's the use of the deployment.properties file when you install Java?
There is plenty of information regarding all the different options for deploying Java out there, I used to find myself very confused by it all too, as I wasn't sure which one to follow, I ended up compiling my own deployment package by following the guides found on the Java docs @ oracle.com, some links provided at the end of my comment.
The deployment.properties file is used to store and retrieve deployment configuration properties that can be seen in the Java Control Panel. It can also be used for customizing the runtime behavior for the Java Plug-in and Java Web Start.
The location which you are referring to (C:\Users\%user%AppData\LocalLow\Sun\Java\Deployment\) is used for a User-level configuration, and I believe this is non-configurable.
What I believe you need to look at is at the "System-level" configuration. For this, you first need to configure another file called "deployment.config", inside this file you can define the location of the system-level deployment.properties file.
This is what my current Java deployment configuration looks like, I have been using this for over a year now and have had to make very minor changes:
1. Create a folder called "config" and inside create 3 differente files:
- deployment.config - The contents of this file:
- deployment.properties - The contents of this file
# System Deployment Properties
# Created by David Zapata
# Updated on 28 November 2016
# Disable Sponsor offers like ASK Toolbar
# Mixed code (sandbox vs. trusted) security verification
# Security Level
# Security Execution Environment\Enable granting elevated access to signed apps
# aka. Allow user to grant permissions to signed content
# Enable Java content in the browser
# JNLP File/MIME Association
# Shortcut Creation
# Prompt: Your Java version is insecure. or Your Java version is out of date
# Exception sites file location
# Java Console - Options for show, disable or hide the Java Console
- exception.sites - You can add application URLS in this file to allow your users to Java enabled sites that would normally be blocked by security checks. Note that once you use this file, sites can no longer be added in the Java Control Panel, this gives you more control as you can manage this exclusively through the exception.sites file.
This is what my Config folder looks like:
2. Create another folder, you can call it Jre1.80_xx (I use whatever version of Java I'm deploying to keep some standard and also make it easy to identify. Inside this folder, place the config folder as well as the latest java exe available (at time of writing it is jre-8u131-windows-i586.exe). You are also going to create two more files inside this folder:
- java.settings.cfg - The contents of this file can vary, depending on your deployment needs, this are my settings:
- install.bat - This is your install script pulling everything together
@cd /d "%~dp0"
REM The below command will look for and uninstall any previous Java 7 or 8 from the target machine
wmic product where "name like 'Java 7%%' or name like 'Java 8%%'" call uninstall /nointeractive
REM The first command will copy the Java configuration file to the target machine
xcopy java.settings.cfg "C:\ProgramData\Oracle\Java\" /I /Q /R /Y > nul
REM The following line will install the java software to the target computer
Start /wait jre-8u131-windows-i586.exe /L C:\Drivers\jre-8u131.log
REM The next line will copy the Java deployment property files to the target computer
xcopy Config\*.* "C:\Windows\Sun\Java\Deployment\" /I /Q /R /Y > nul
NOTE: The way I use my batch script allows me to either deploy my software package from the K1000 by calling install.bat, or I can do a manual install on the target computer by simply right clicking on the batch file and run as admin, as long as all the contents stay inside the same folder the installation will work. I use this for all my software packaging actually, helps me to easily do manual installs on target machines where the agent may not be installed, or when users download the software package from the user portal, I instruct them to install the software by right clickin on the install.bat file.
This is what my software package looks like before I zip it and upload to my KBOX
Again, this has worked really well for me for about a year now and have had to make very little changes, you may need to make some customizations of your own, but I believe this should at least give you a guide.
More info regarding the deployment.properties file
More info regarding the Java configuration file
Hope it helps.