JAVA Deployment.properties
Does anyone know if you can edit the deployment.properties file using javaw.exe
if you run the the control panel applet it gives out the commandline below in procexp I have tried adding values etc based on guesses but it doesn't modify the deployment.properites file
"C:\Program Files\Java\JRE\1.4.2\bin\javaw.exe" -classpath "C:\Program Files\Java\JRE\1.4.2"\lib\plugin.jar -Djavaplugin.version=1.4.2_07 -Djavaplugin.nodotversion=142_07 -Duser.home="c:\Documents and Settings\<username>" sun.plugin.panel.ControlPanel
am I barking up the wrong tree. I need to set three values without a straight overwrite/copy of the file
and without the user going into the control panel - I am trying to avoid parsing the file and re-writing in a custom action also - has anyone done this successfully?
Cheers
if you run the the control panel applet it gives out the commandline below in procexp I have tried adding values etc based on guesses but it doesn't modify the deployment.properites file
"C:\Program Files\Java\JRE\1.4.2\bin\javaw.exe" -classpath "C:\Program Files\Java\JRE\1.4.2"\lib\plugin.jar -Djavaplugin.version=1.4.2_07 -Djavaplugin.nodotversion=142_07 -Duser.home="c:\Documents and Settings\<username>" sun.plugin.panel.ControlPanel
am I barking up the wrong tree. I need to set three values without a straight overwrite/copy of the file
and without the user going into the control panel - I am trying to avoid parsing the file and re-writing in a custom action also - has anyone done this successfully?
Cheers
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
brenthunter2005
19 years ago
Posted by:
Lozza
19 years ago
Posted by:
brenthunter2005
19 years ago
OK, in the following example the corporation upgraded to a newer version of J2RE and needed to update the hardcoded proxy server entry in the 'deployment.properties' file. A stub path was written to the ActiveSetup registry keys so that upon user logon, the vbscript would run and silently modify the users local 'deployment.properties' file.
[8D] Remember that there are many many different ways to do this. In this example, the file already existed and all the script needed to do was to update the file with the new proxy server address.
In your environment, you need to discover if the file already exists or not and make the neccessary adjustments to the script etc.
On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
strPath = objShell.ExpandEnvironmentStrings("%APPDATA%") & "\Sun\Java\Deployment\deployment.properties" 'Complete Path & File Name
strFldr = objShell.ExpandEnvironmentStrings("%TEMP%") & "\temp_deployment.properties" 'Complete Path & File Name of Temporary File
Set file1 = objFSO.OpenTextFile(strPath)
Set file2 = objFSO.CreateTextFile(strFldr)
Do While Not file1.AtEndofStream
strLine = file1.ReadLine
If InStr(strLine,"javaplugin.proxy.settings") Then 'When this text is found, it is overwritten with the line below.
file2.WriteLine "javaplugin.proxy.settings=http\=proxyserver"
Else
file2.WriteLine strLine 'This just copies whatever was read in file1
End If
Loop
file1.close
Set file1 = nothing
file2.close
Set file2 = nothing
objFSO.DeleteFile strPath, True 'This deletes the original file
objFSO.MoveFile strFldr, strPath 'This moves and renames the temp file, replacing the original
[8D] Remember that there are many many different ways to do this. In this example, the file already existed and all the script needed to do was to update the file with the new proxy server address.
In your environment, you need to discover if the file already exists or not and make the neccessary adjustments to the script etc.
Posted by:
Lozza
19 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.