/build/static/layout/Breadcrumb_cap_w.png

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

------------------------------

0 Comments   [ + ] Show comments

Answers (18)

Posted by: GillySpy 12 years ago
7th Degree Black Belt
0
What is "one app with two configs"? meaning, how are you deploying this app via the kbox? an MI or a script can both run a batch file or a vbscript, etc
Posted by: d_firlotte 12 years ago
Orange Belt
0
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
Posted by: GillySpy 12 years ago
7th Degree Black Belt
0
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.
Posted by: dchristian 12 years ago
Red Belt
0
Hey D_firlotte,

How far does your script get?

Does it install java at all?

Did you zip up both files correctly?

Maybe a screenshot of your MI could help us figure out the issue.
Posted by: rmeyer 12 years ago
Second Degree Blue Belt
0
try to look if it sets the setting here insted:

"HKLM\Software\Wow6432Node\Wow6432Node\JavaSoft\Java Update\Policy"

Then it's because it see the script as a x86 application and automaticly add it to "Wow6432Node"

I've seen that happen before
Posted by: d_firlotte 12 years ago
Orange Belt
0
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.
Posted by: dchristian 12 years ago
Red Belt
0
Did you just zip the two files or a folder containing the files?

Also can you post a screen shot of your config?

That might help.
Posted by: dchristian 12 years ago
Red Belt
0
FWIW I just tested this and it works.

No modifications were made to your bat script....



I'm also on the 5.3.5 agent.
Posted by: tpr 12 years ago
2nd Degree Black Belt
0
DF, if you're still having trouble, why not try creating 2 different installers and use a label to let kbox determine the architecture?
Posted by: d_firlotte 12 years ago
Orange Belt
0
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.
Posted by: d_firlotte 12 years ago
Orange Belt
0
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)?
Posted by: d_firlotte 12 years ago
Orange Belt
0
Sorry clarify last post about the event logs. These show up after kace trys to run the managed install.
Posted by: dchristian 12 years ago
Red Belt
0
d_firlotte,

What if you upload java all by itself.

Does that install?
Posted by: d_firlotte 12 years ago
Orange Belt
0
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
Posted by: d_firlotte 12 years ago
Orange Belt
0
I uploaded just the exe and added /s left it on use default and it still will not install.
I choose configure manually and added {filename}.exe /s and it still will not install.

I am starting to have seconds thoughts about this product.
Posted by: tpr 12 years ago
2nd Degree Black Belt
0
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.
Posted by: d_firlotte 12 years ago
Orange Belt
0
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.
Posted by: d_firlotte 12 years ago
Orange Belt
0
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
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