Archive

Archive for the ‘VB Script to Install msi and mst’ Category

VB Script to Install msi and mst

VB Script to Install msi and mst

- I feel VB scripting is very Important for Application Packageres and SCCM Admins so I am writing this model script to help our community

Example 1

Option Explicit
Dim objShell, objFSO, SystemDrive, Exitcode

Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set objShell = CreateObject(“WScript.shell”)

SystemDrive = objShell.ExpandEnvironmentStrings(“%SYSTEMDRIVE%”)

If objFSO.FolderExists(SystemDrive & “\Temp\Logs”) Then
‘Wscript.Echo “Folder does exist”
Else
objFSO.CreateFolder SystemDrive & “\Temp”
objFSO.CreateFolder SystemDrive & “\Temp\Logs”
End If

Exitcode = objShell.Run(“msiexec /i ” & Chr(34) & “WAAS.msi” & Chr(34) & ” TRANSFORMS=” & Chr(34) & “AcceleNet_3_5_4_3.mst” & Chr(34) & ” /quiet /passive /norestart /L*v ” & Chr(34) & SystemDrive & “\Temp\logs\AcceleNet_3_5_4_3.log” & Chr(34), 1, True)
Wscript.Quit(Exitcode)
Example 2 (MSI MST WITH PATCH)

Option Explicit

Dim objShell, objFSO, SystemDrive, Exitcode

Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set objShell = CreateObject(“WScript.shell”)

SystemDrive = objShell.ExpandEnvironmentStrings(“%SYSTEMDRIVE%”)

If objFSO.FolderExists(SystemDrive & “\Temp\Logs”) Then
‘Wscript.Echo “Folder does exist”
Else
objFSO.CreateFolder SystemDrive & “\Temp”
objFSO.CreateFolder SystemDrive & “\Temp\Logs”
End If

objShell.Run “msiexec /i ” & Chr(34) & “AdbeRdr1010_en_US.msi” & Chr(34) & ” TRANSFORMS=” & Chr(34) & “AdbeRdr1010_en_US.mst” & Chr(34) & ” /qB /L*v ” & Chr(34) & SystemDrive & “\Temp\logs\AdbeRdr1010_en_US.log” & Chr(34), 1, True

objShell.Run “msiexec /P ” & Chr(34) & “AdbeRdrUpd1014.msp” & Chr(34) & ” /qb REINSTALL=ALL REINSTALLMODE=VOMUS /L*v ” & Chr(34) & SystemDrive & “\install\logs\AdbeRdrUpd1014.log” & Chr(34), 1, True

objShell.Run “cmd.exe /c REGEDIT /S Policies.reg”, 0, True
objShell.Run “cmd.exe /c REGEDIT /S ARM.reg”, 0, True

Wscript.Quit(Exitcode)
Example 3 (PATCH ONLY .MSP FILE)

Option Explicit

Dim objShell, objFSO, SystemDrive, Exitcode, WshShell, OsType

Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set objShell = CreateObject(“WScript.shell”)
Set WshShell = CreateObject(“WScript.Shell”)

SystemDrive = objShell.ExpandEnvironmentStrings(“%SYSTEMDRIVE%”)
OsType = WshShell.RegRead(“HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE”)

If objFSO.FolderExists(SystemDrive & “\Temp\Logs”) Then
‘Wscript.Echo “Folder does exist”
Else
objFSO.CreateFolder SystemDrive & “\Temp”
objFSO.CreateFolder SystemDrive & “\Temp\Logs”
End If

If OsType = “x86″ then

objShell.Run “msiexec /P ” & Chr(34) & “AdbeRdrUpd1014.msp” & Chr(34) & ” /qb REINSTALL=ALL REINSTALLMODE=VOMUS REBOOT=ReallySuppress /L*v ” & Chr(34) & SystemDrive & “\Temp\logs\AdbeRdrUpd1014.log” & Chr(34), 1, True
Wscript.quit

elseif OsType = “AMD64″ then

objShell.Run “msiexec /P ” & Chr(34) & “AdbeRdrUpd1014.msp” & Chr(34) & ” /qb REINSTALL=ALL REINSTALLMODE=VOMUS REBOOT=ReallySuppress /L*v ” & Chr(34) & SystemDrive & “\Temp\logs\AdbeRdrUpd1014.log” & Chr(34), 1, True
Wscript.quit(Exitcode)

end if

Wscript.Quit(Exitcode)

A fine WordPress.com site

A fine WordPress.com site

Cameron Fuller

A fine WordPress.com site

A fine WordPress.com site

A fine WordPress.com site

A fine WordPress.com site

Adam Rafels

A fine WordPress.com site

A fine WordPress.com site

IT Consultant Everyday Notes

Just some problems/solutions storage

System Center Solutions

A fine WordPress.com site

SCCM Packager

A fine WordPress.com site

A fine WordPress.com site

Srikanth Boddupalli

The greatest WordPress.com site in all the land!

Tao Yang's System Management Blog

My thoughts on SCOM, SCCM, PowerShell and more...

Kirx' Blog

Kirx' Application Virtualization Blog

"MsiRevolution"

This site is completely related to the application packaging. In this site, you can find the information about the Windows Installer(MSI), Application Virtualisation and VB Scripting which will be useful for the application packagers. If any one faces the issues, please post in this site, we will try to get back to you with appropriate solutuion

A fine WordPress.com site

just another windows noob ?

A fine WordPress.com site

MSIwisdom

A fine WordPress.com site

Follow

Get every new post delivered to your Inbox.