Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent: Help deployment script 2

Status
Not open for further replies.

pnutz

Programmer
May 21, 2003
10
0
0
US
Hey there,

Does anyone know how to write an deployment script from vb,
What i need to do is, this is in the client server environment

1)when i deploy the installation package from the active directory through the network to all of the network users i would need to check for these two things..

a) read from the registry if the there is an existing software if there is check for the version and compare it to the one that i'm abt to deploy

How do i go abt doing this?
Thanks!
 
Hello markdmac,

If not thanks to your inquisition to make thing clearer, I would not have answered the question!

regards - tsuji

ps Also to correct a mistake, a momentary slip of attention, all postings of mine up there with this line is obviously wrong:
for i=0 to Installed(nn) '[red]_wrong_[/red]
It should be read as
for i=0 to nn
Just to put the record straight.
 
Hey there,

Thank you ever so much for you kind help..i think its a really good deployment script reference. I was wondering if i could use the code below to subsitute for the script to install the software? Is it possible...

Code:
Option Explicit
On Error Resume Next
Dim Return, programpath, programname, windowspath, startmenupath, fso, WshShell, WshNetwork
programname = "Adobe Acrobat Reader 6.0 Full"
set fso = CreateObject("scripting.filesystemobject")
Set WshShell=WScript.CreateObject("Wscript.Shell")
Set WshNetwork = WScript.CreateObject("Wscript.Network")
programpath = left(WScript.ScriptFullName,len(wscript.scriptfullname) - Len(WScript.scriptName)) 

' 2. run setup program
WshShell.Popup "Starting installation of " & programname & "...",3,programname
Return = WshShell.Run("msiexec /qb- /i """ & programpath & "Adobe Reader 6.0.1.msi""",1,True)
'
' 3. perform after-installation configuration
'
WshShell.regdelete "HKCU\Software\Adobe\Acrobat Reader\6.0\AdobeViewer\EULA"
WshShell.regdelete "HKLM\Software\Adobe\Acrobat Reader\6.0\AdobeViewer\EULA"
WshShell.regwrite "HKCU\Software\Adobe\Acrobat Reader\6.0\AdobeViewer\EULA","1","REG_DWORD"
WshShell.regwrite "HKLM\Software\Adobe\Acrobat Reader\6.0\AdobeViewer\EULA","1","REG_DWORD"
If fso.folderexists("c:\documents and settings\all users") Then
fso.deletefolder "c:\documents and settings\all users\start menu\programs\PrintMe Internet Printing", True 
End If
If fso.folderexists("c:\winnt\profiles\all users") Then
fso.deletefolder "c:\winnt\profiles\all users\start menu\programs\PrintMe Internet Printing", True 

End If 
If fso.folderexists("c:\windows\profiles\all users") Then
fso.deletefolder "c:\windows\profiles\all users\start menu\programs\PrintMe Internet Printing", True 
End If 

WshShell.Popup "Completed installation of " & programname & "...",3,programname

Thanks!
 
Do you have nothing but XP workstations?

If you also have Win2k you should probably change things a little.

For instance change areas like this:

If fso.folderexists("c:\windows\profiles\all users") Then
fso.deletefolder "c:\windows\profiles\all users\start menu\programs\PrintMe Internet Printing", True
End If

To this:

If fso.folderexists("c:\windows") Then
windir = "c:\windows"
ElseIf fso.folderexists("c:\winnt") Then
windir = "c:\winnt"
End If


If fso.folderexists(windir & "\profiles\all users") Then
fso.deletefolder windir & "\profiles\all users\start menu\programs\PrintMe Internet Printing", True
End If



End If


I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
pnutz,

Nothing big to add. Just one small note. If fso instantiated already, the programpath can be extracted by:
programpath = fso.GetParentFolderName(WScript.ScriptFullName) & "\"

- tsuji

ps Correction to my prev posting where the run line should be read as:
oShell.run [COLOR=red yellow]"[/color]setup.exe[COLOR=red yellow]"[/color]

 
To get the all users programs folder, you may consider this:
WshShell.SpecialFolders("AllUsersPrograms")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
hey there,

Thanks for all you suggestion.. but i have a slight problem everytime i try to run the script below the msi file would terminate halfway..which means it would just run the initialization process and it would not go through the setup process.. any idea why it happens

Code:
Dim Return, programpath, programname, windowspath, startmenupath, fso, WshShell, WshNetwork
    programname = "SClient"
	set fso = CreateObject("scripting.filesystemobject")
	
	Set WshShell=WScript.CreateObject("Wscript.Shell")
	Set WshNetwork = WScript.CreateObject("Wscript.Network")
	
	programpath = left(WScript.ScriptFullName,len(wscript.scriptfullname) - Len(WScript.scriptName)) 

	'run setup program
	WshShell.Popup "Starting installation of " & programname & "...",3,programname
	Return = WshShell.Run("msiexec /qb- /i """ & programpath & "SClient.msi""",1,True)
	
	
	 WshShell.Popup "Completed installation of " & programname & "...",3,programname

Have anice day!
 
pnutz,

What happens to, say, this run?
Return = WshShell.Run("msiexec /i """ & programpath & "SClient.msi"" /qb",1,True)

- tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top