Re: Software Install script
Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance
Chuck Durley wrote:
To reply to your response:
1. All users are in a domain
2. The setup.exe will use the setup.exe -r -f1 (for a response file and
silent install)
3. Yes I would like to check the registry to determine whether or not the
application was previously installed.
Any help you can provide will be greatly appreciated.
Hi,
Ok, the users are in a domain, but are they in the local
Administrators group on the computers? The user needs to have local
admin rights to be able to install software in the logon script. If
they are not local admins, you could do it in a computer startup script
(with a GPO) that runs as part of the boot up process (before the user
logs in). It runs under the system context and has admin rights.
I assume you mean -s and not -r (at least for InstallShield
installation, -r is for uninstallation).
Something like this should work:
'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
' Check on a registry value that disappears if you uninstall the program
sRegValue = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion" _
& "\Uninstall\QuickTime\DisplayName")
If sRegValue = "" Then
' Registry value was empty, install the program
MsgBox "About to install program something, this might take some Time." _
& vbCrLf & vbCrLf _
& "Press OK to start the installation...", _
vbSystemModal+vbInformation, "Logon script"
' Added -SMS to order InstallShield to wait for the worker
' process to finish before exiting
oShell.Run "\\server\share\mysw\setup.exe -SMS -s" _
& " -f1\\server\share\mysw\setup.iss", 1, True
MsgBox "Finished installing program something." _
& vbCrLf & vbCrLf _
& "Press OK to continue...", _
vbSystemModal+vbInformation, "Logon script"
End If
Function RegRead(sRegValue)
Set oShell = CreateObject("WScript.Shell")
On Error Resume Next
RegRead = oShell.RegRead(sRegValue)
' If the value does not exist, error is raised
If Err Then
RegRead = ""
Err.clear
End If
' If a value is present but uninitialized the RegRead method
' returns the input value in Win2k.
If VarType(RegRead) < vbArray Then
If RegRead = sRegValue Then
RegRead = ""
End If
End If
On Error Goto 0
End Function
'--------------------8<----------------------
WSH 5.6 documentation (local help file) can be downloaded from here
if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
.
Relevant Pages
- Re: RegRead
... I assume you are talking about checking/reading a registry value ... In that case, I suggest you use the RegRead function I use, below ... we can install the app ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ... (microsoft.public.scripting.vbscript) - Re: scripting patch installation
... what i want is for it to just install the ... > patch if that registry value is non existant. ... If you want a script that also can handle different OS version and Service pack ... Below is an updated version of your script that uses the function RegRead to ... (microsoft.public.windowsxp.security_admin) - Re: Set registry value with .vbs
... >> and then this path put into bellow registry with variable. ... > ' If a value is present but uninitialized the RegRead method ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ... (microsoft.public.scripting.wsh) - Re: How can I kill IE?!?!?!!?
... Every "install" tracking program I've tried was disappointing to start with ... MS's backup program - and it's "system state" option. ... I've found to reliably backup and restore XP's registry. ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ... (microsoft.public.windowsxp.general) - Re: MS Update keeps pestering me to install the MSXML 4.0 security Update......
... the same results...MS Update still wants me to install the patch. ... I have no problem editing the registry but>> I'm not expert in the nomenclature. ... > Microsoft MVP Scripting and WMI, Porsgrunn Norway> Administration scripting examples and an ONLINE version of the 1328 page> Scripting Guide: http://www.microsoft.com/technet/scriptcenter> ... (microsoft.public.security) |
|