Script to modify registry settings after install of application
So here is my problem I wrote the script below (which works if you just run it) to modify the Update options for Java (which they removed from the installer) but K1000 box will not let me have one app with two configs. So the script calls the installer once finished it checks to see if OS is 64 or 32 then modifies the java registry settings but IT WILL NOT WORK when pushed from the k1000 box
HELP!
Thanks
--------------------------------------------
Option Explicit
Dim objWshShell, objFSO, intReturn
Dim strSystemType
Dim FileLocation
Set objWshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'On Error Resume Next
'----------Script--------------'
FileLocation = objWshShell.ExpandEnvironmentStrings("%WINDIR%\SysWOW64\REG.EXE")
If objFSO.FileExists(FileLocation) Then
strSystemType = "x64"
Else
strSystemType = "x86"
End If
intReturn = objWshShell.Run ("jre-6u30-windows-i586-s.exe /s /v""/qn IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 AUTOUPDATECHECK=0 REBOOT=Suppress EULA=0", 0, True)
'objWshShell.Popup "Finished Installing"
if strSystemType = "x64" then
objWshShell.RegWrite "HKLM\Software\Wow6432Node\JavaSoft\Java Update\Policy\EnableAutoUpdateCheck", "0","REG_DWORD"
objWshShell.RegWrite "HKLM\Software\Wow6432Node\JavaSoft\Java Update\Policy\EnableJavaUpdate", "0","REG_DWORD"
Else
objWshShell.RegWrite "HKLM\Software\JavaSoft\Java Update\Policy\EnableAutoUpdateCheck", "0","REG_DWORD"
objWshShell.RegWrite "HKLM\Software\JavaSoft\Java Update\Policy\EnableJavaUpdate", "0","REG_DWORD"
End If
'objWshShell.Popup "Finished Configuring" & " " & strSystemType
Wscript.Quit
------------------------------
HELP!
Thanks
--------------------------------------------
Option Explicit
Dim objWshShell, objFSO, intReturn
Dim strSystemType
Dim FileLocation
Set objWshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'On Error Resume Next
'----------Script--------------'
FileLocation = objWshShell.ExpandEnvironmentStrings("%WINDIR%\SysWOW64\REG.EXE")
If objFSO.FileExists(FileLocation) Then
strSystemType = "x64"
Else
strSystemType = "x86"
End If
intReturn = objWshShell.Run ("jre-6u30-windows-i586-s.exe /s /v""/qn IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 AUTOUPDATECHECK=0 REBOOT=Suppress EULA=0", 0, True)
'objWshShell.Popup "Finished Installing"
if strSystemType = "x64" then
objWshShell.RegWrite "HKLM\Software\Wow6432Node\JavaSoft\Java Update\Policy\EnableAutoUpdateCheck", "0","REG_DWORD"
objWshShell.RegWrite "HKLM\Software\Wow6432Node\JavaSoft\Java Update\Policy\EnableJavaUpdate", "0","REG_DWORD"
Else
objWshShell.RegWrite "HKLM\Software\JavaSoft\Java Update\Policy\EnableAutoUpdateCheck", "0","REG_DWORD"
objWshShell.RegWrite "HKLM\Software\JavaSoft\Java Update\Policy\EnableJavaUpdate", "0","REG_DWORD"
End If
'objWshShell.Popup "Finished Configuring" & " " & strSystemType
Wscript.Quit
------------------------------
0 Comments
[ + ] Show comments
Answers (18)
Please log in to answer
Posted by:
GillySpy
12 years ago
Posted by:
d_firlotte
12 years ago
Details:
Using K1000 box
Using Managed Installs
Installing Java 6 u 30 - 32bit version
In the current issue I am installing Java on 32 and 64 bit systems but the install differs by the registry settings. Kace will not allow me to have one software package (ie: java 6 u 30 32bit) with two types of installs (ie: 32bit systems and 64 bit systems) so the above script is how I configure the install for OS version.
The script I used runs from the desktop works, but when Kace runs it... nothing happens. I saw a couple of posts that show a vbs script (with WSH) needs to be call from a batch file first... again met with failure.
Another example of one software two packages is:
Adobe Acrobat Standard for two departments that have two different keys and settings but they are the exact same version of Acrobat.
Thanks
Using K1000 box
Using Managed Installs
Installing Java 6 u 30 - 32bit version
In the current issue I am installing Java on 32 and 64 bit systems but the install differs by the registry settings. Kace will not allow me to have one software package (ie: java 6 u 30 32bit) with two types of installs (ie: 32bit systems and 64 bit systems) so the above script is how I configure the install for OS version.
The script I used runs from the desktop works, but when Kace runs it... nothing happens. I saw a couple of posts that show a vbs script (with WSH) needs to be call from a batch file first... again met with failure.
Another example of one software two packages is:
Adobe Acrobat Standard for two departments that have two different keys and settings but they are the exact same version of Acrobat.
Thanks
Posted by:
GillySpy
12 years ago
Ok I see now.
In these cases you make a custom inventory rule to tell the system about some other difference OTHER than the defaults of name and version. Then you'll have two software entries and two MIs -- one on each. I wish I could give you a simple custom inventory rule that proves 32-bit but I do not know one. I can tell 64-bit easy but not 32-bit. The good news is that you CAN have a label that detects architecture and target your two MIs to different labels. I have asked for an enhancement that should make it possible to verify 32-bit. Any other method that comes across my desk I find a flaw with it. One common one is the existence of one of the core OS files. I can't remember which one but I find cases of upgraded machines with the old files anyway.
What is the command you are running? An MI runs with local system access. In your tests have you tried to run as local system access?
If you need other types of access a kbox "script" (scripting tab) can be used to do that.
In these cases you make a custom inventory rule to tell the system about some other difference OTHER than the defaults of name and version. Then you'll have two software entries and two MIs -- one on each. I wish I could give you a simple custom inventory rule that proves 32-bit but I do not know one. I can tell 64-bit easy but not 32-bit. The good news is that you CAN have a label that detects architecture and target your two MIs to different labels. I have asked for an enhancement that should make it possible to verify 32-bit. Any other method that comes across my desk I find a flaw with it. One common one is the existence of one of the core OS files. I can't remember which one but I find cases of upgraded machines with the old files anyway.
What is the command you are running? An MI runs with local system access. In your tests have you tried to run as local system access?
If you need other types of access a kbox "script" (scripting tab) can be used to do that.
Posted by:
dchristian
12 years ago
Posted by:
rmeyer
12 years ago
Posted by:
d_firlotte
12 years ago
Thanks for all the replies.
So the zip file is contains two files the java executable and a vbs script that handles calls the installs then based on the OS version installs the appropriate registrey keys.
The problem is that the install of java never occurs. The only thing that is selected is configure manually (installjava.vbs) and a pre and post message.
I have also tried to use a batch file that I found online but modified it to fit my needs:
_________________________________________________
@ECHO OFF
ECHO Sun J2SE Runtime Environment 6 Update 30..
START /WAIT jre-6u30-windows-i586-s.exe /s /v"/qn IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 AUTOUPDATECHECK=0 REBOOT=Suppress EULA=0"
REM Configure on x86 systems
IF NOT EXIST %SYSTEMROOT%\SysWOW64\REG.EXE (
REG.EXE ADD "HKLM\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /t REG_DWORD /d 0 /f
REG.EXE ADD "HKLM\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableAutoUpdateCheck /t REG_DWORD /d 0 /f
)
REM Configure on x64 systems
IF EXIST %SYSTEMROOT%\SysWOW64\REG.EXE (
%SYSTEMROOT%\SysWOW64\REG.EXE ADD "HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /t REG_DWORD /d 0 /f
%SYSTEMROOT%\SysWOW64\REG.EXE ADD "HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy" /v EnableAutoUpdateCheck /t REG_DWORD /d 0 /f
)
_________________________________________________
Still no joy.
So the zip file is contains two files the java executable and a vbs script that handles calls the installs then based on the OS version installs the appropriate registrey keys.
The problem is that the install of java never occurs. The only thing that is selected is configure manually (installjava.vbs) and a pre and post message.
I have also tried to use a batch file that I found online but modified it to fit my needs:
_________________________________________________
@ECHO OFF
ECHO Sun J2SE Runtime Environment 6 Update 30..
START /WAIT jre-6u30-windows-i586-s.exe /s /v"/qn IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 AUTOUPDATECHECK=0 REBOOT=Suppress EULA=0"
REM Configure on x86 systems
IF NOT EXIST %SYSTEMROOT%\SysWOW64\REG.EXE (
REG.EXE ADD "HKLM\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /t REG_DWORD /d 0 /f
REG.EXE ADD "HKLM\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableAutoUpdateCheck /t REG_DWORD /d 0 /f
)
REM Configure on x64 systems
IF EXIST %SYSTEMROOT%\SysWOW64\REG.EXE (
%SYSTEMROOT%\SysWOW64\REG.EXE ADD "HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /t REG_DWORD /d 0 /f
%SYSTEMROOT%\SysWOW64\REG.EXE ADD "HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy" /v EnableAutoUpdateCheck /t REG_DWORD /d 0 /f
)
_________________________________________________
Still no joy.
Posted by:
dchristian
12 years ago
Posted by:
dchristian
12 years ago
Posted by:
tpr
12 years ago
Posted by:
d_firlotte
12 years ago
Problem is Java will not install... forget the registry settings we can deal with that part as we get to it. But calling the java from a batch file or vbs script it will not run.
the only options that set are:
Installation Command: install.bat (which is the batch file from the previous post)
Don't Prepend MSIEXEC.exe is checked
Delete Downloaded Files is checked
Managed Action: Execute anytime
Limit deployment to {test system}
Deploy order 10
Max Attempts 3
Open windows 0 - 24
Custom Pre-Install Message is checked
Pre message - Installin Java
Pre Timeout 5
Pre Timeout action install now
Post Install Message - Java Installation Complete
Post Message Time out 5 mins.
STILL WILL NOT INSTALL. My next step is to remove kace agent and reinstall. I'll let you know.
the only options that set are:
Installation Command: install.bat (which is the batch file from the previous post)
Don't Prepend MSIEXEC.exe is checked
Delete Downloaded Files is checked
Managed Action: Execute anytime
Limit deployment to {test system}
Deploy order 10
Max Attempts 3
Open windows 0 - 24
Custom Pre-Install Message is checked
Pre message - Installin Java
Pre Timeout 5
Pre Timeout action install now
Post Install Message - Java Installation Complete
Post Message Time out 5 mins.
STILL WILL NOT INSTALL. My next step is to remove kace agent and reinstall. I'll let you know.
Posted by:
d_firlotte
12 years ago
Reinstalling the agent did nothing new
Running the script works fine... running the script from kace does nothing...
Now the installer I am calling is a EXE file and in the Windows Event logs I see two events that show Beginning and Ending of jre1.6.0_30.msi with the exact same time stamp on it. Could that mean a security issue? Under what context does the install from k1000 run? Local System (I would assume)?
Running the script works fine... running the script from kace does nothing...
Now the installer I am calling is a EXE file and in the Windows Event logs I see two events that show Beginning and Ending of jre1.6.0_30.msi with the exact same time stamp on it. Could that mean a security issue? Under what context does the install from k1000 run? Local System (I would assume)?
Posted by:
d_firlotte
12 years ago
Posted by:
dchristian
12 years ago
Posted by:
d_firlotte
12 years ago
Uploading the zip file with both scripts .vbs and .bat changing the call of the executable to just "jre-6u31-windows-i586-s.exe /s MOZILLA=1 IEXPLORER=1" still doesn't work. I then called jre-6u31-windows-i586-s.exe /s MOZILLA=1 IEXPLORER=1 instead of the batch files and it still will not install. I have even disabled UAC on the computers and still will not install.
Thanks
Thanks
Posted by:
d_firlotte
12 years ago
Posted by:
tpr
12 years ago
DF, under the "Managed Software Installation : Edit Detail", what does the "Install using ..." say? I'm having a similar problem where I'm uploading a zip file and using Configure Manually for the installation command. The MI is completely ignoring the installation command I put in, so under my Edit Detail, it says "Install using file.zip". In other words, it always wants to use my uploaded file name rather than the command I tell it. If I upload a single exe or batch file, then no problem because that is the default install command.
I don't mean to pile on, but I'm having some concerns about kbox, too. The 5.1 agent has given me mixed results for MIs, but when I upgraded to the latest 2 versions of the 5.3 agent, none of my MIs worked so I reverted back to 5.1. Now the 5.3 version of the appliance is ignoring my manual install commands, so I'm afraid I may have to backrev that, too.
I don't mean to pile on, but I'm having some concerns about kbox, too. The 5.1 agent has given me mixed results for MIs, but when I upgraded to the latest 2 versions of the 5.3 agent, none of my MIs worked so I reverted back to 5.1. Now the 5.3 version of the appliance is ignoring my manual install commands, so I'm afraid I may have to backrev that, too.
Posted by:
d_firlotte
12 years ago
My coworker tried to setup a new managed install (msi file) to push out a new software package. During testing the software gets pushed and the log files shows it is working but the software does not get installed (even though Kace shows that it is). He had to manually remove registry entries to clean up the system before he could try again.
Seems Dell has broked the K1000 unit. All mi's before upgrade work fine all new ones... not so much.
Seems Dell has broked the K1000 unit. All mi's before upgrade work fine all new ones... not so much.
Posted by:
d_firlotte
12 years ago
So I discovered my issue. Java does not like to be installed from the local system account. Once we figured that out (with the help of Dell Kace Support) I found two articles that got me through it.
http://www.scriptingsimon.com/2010/10/installing-java-silently/
http://www.scriptingsimon.com/2010/08/editing-msi-files-with-microsoft-orca-2/
Now from the instructions I deviated slightly buy renaming the {custom}.mst to the original name of the mst (so I don't have to use TRANSFORMS=...) Also this method avoids the scripted workaround which was suggested. Personally I am not a big fan of using scripted installs when it should be under Managed Installs (I know there will be scenarios where I will have to). I consider scripted installs a work around not a fix.
Hopefully this helps someone else
Thanks for your help.
http://www.scriptingsimon.com/2010/10/installing-java-silently/
http://www.scriptingsimon.com/2010/08/editing-msi-files-with-microsoft-orca-2/
Now from the instructions I deviated slightly buy renaming the {custom}.mst to the original name of the mst (so I don't have to use TRANSFORMS=...) Also this method avoids the scripted workaround which was suggested. Personally I am not a big fan of using scripted installs when it should be under Managed Installs (I know there will be scenarios where I will have to). I consider scripted installs a work around not a fix.
Hopefully this helps someone else
Thanks for your help.
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.