Re: Software Install script



Torgeir,
Thank you for your timely response. When I ran the script locally on
the workstation, it was successful. When I copied the script to the SERVER
and entered the location in a test user account profile (logon script field)
on the SERVER, rebooted the workstation and logged in, the script did not
run. Are there any issues regarding rights/permssions, etc. I should be
aware of that are preventing the script from running on the workstation? Any
information you can provide will greatly appreciated.
--
Chuck Durley
Network Analyst
--
Chuck Durley
Network Analyst


"Torgeir Bakken (MVP)" wrote:

> 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
>
.