/build/static/layout/Breadcrumb_cap_w.png

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

0 Comments   [ + ] Show comments

Answers (5)

Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
To edit the deployment.properties file I have used VBScript in a custom action in the MSI or used ActiveSetup to modify the file.
Posted by: Lozza 19 years ago
Senior Yellow Belt
0
didn't want to go down the vbscript route if could help it but it seems that its is my only option other than writing a custom exe to parse the file and my code is not good enough to for that any chance you would be willing to post the vbscript code?

Thanks in advance
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
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.
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 18 years ago
Senior Yellow Belt
0
I know its been a while but just wanted to say cheers - After a lot of modification and your script suggestion it worked great thanks
Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
Glad to hear that you got it working. [:)]
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ