/bundles/itninjaweb/img/Breadcrumb_cap_w.png
I would kindly appreciate it if anyone can help this scripting issue


I have this java app that needs a vb script to resolve a run time error


the script should read the registry key under hklm\ xxx\xxxx

then write the value and store in a variable

then install the java app with the /q:a /r:n arguments

then write the value in the variable back into the reg key to install the app

any leads would be higly appreciated
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
So what you want is a MSI package that installs the java app? And within this MSI package it records an existing registry key value, and then after installation it writes this registry key back again?

I don't mind helping you write the script, but can you elaborate on the requirements please?
Answered 04/06/2006 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment
0
1) read the registry value from [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Driver Signing]
"Policy"=hex:00,00 before install

2) store value in a variable then write the new value ( value change)

3) install the java.exe with the arguments /q:a ( space) /r:n

4) write the original value in the variable back into the reg key



yes thanks that is my problem. I would be grateful if you can possible help
are there any specific requirements I need to give
Answered 04/06/2006 by: cygan
Fifth Degree Brown Belt

Please log in to comment
0
This is depends on your actual requirements, but here is a vbscript that should be able to do what you want:


CONST HKEY_LOCAL_MACHINE = &H80000002
strKeyPath = "SOFTWARE\Microsoft\Driver Signing"
strValueName = "Policy"

'Read the regsitry key value into the intRegKeyOriginalValue variable.
Set objWMIReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
objWMIReg.GetBinaryValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, intRegKeyOriginalValue
Set objWMIReg = Nothing

'Write the new registry key value.
intRegKeyTemporaryValue = Array(&H00000000, &H00000001)
Set objWMIReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
objWMIReg.SetBinaryValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, intRegKeyTemporaryValue
set objWMIReg = Nothing

'Install the java application.
objShell.Run "C:\Windows\Temp\Java.exe /q:a /r:n", , TRUE

'Write the original registry key back.
Set objWMIReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
objWMIReg.SetBinaryValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, intRegKeyOriginalValue
set objWMIReg = Nothing
Answered 04/06/2006 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment
0
Whoops, forgot to tell you to change the following line to suit your needs:

intRegKeyTemporaryValue = Array(&H00000000, &H00000001)

eg: To set the binary registry key to 60:01:4a, the line would read:
intRegKeyTemporaryValue = Array(&H00000060, &H00000001, &H0000004A)


And this line objShell.Run "C:\Windows\Temp\Java.exe /q:a /r:n", , TRUE to run your Java app installation.
Answered 04/06/2006 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment
0
thanks will go through it
Answered 04/06/2006 by: cygan
Fifth Degree Brown Belt

Please log in to comment