Archive

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

VB Script to Install msi and mst

– I feel that VB scripting is very important for all system admins, Application Packageres and SCCM Admins so I am writing this model script to help our community

Example 1

Install MSI with MST


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)

Thanks,

Sri

 

Sven Aelterman

Educating and Consulting in IT

Steve Thompson [MVP]

The automation specialist

Marc Westerink's blog

Cloud and related stuff...

System Center ConfigMgr

"Things should be made as simple as possible, but not any simpler." – Albert Einstein

Coretech Blog

All About: Software Application Packaging & SCCM Administration & VMWare Administration

ConfigMgrFTW!

Configuration Manager For The Win!

SCCMentor - Paul Winstanley

SCCM Tips. Fixes and Guides

SavillTech's Blog

Just another WordPress.com site

IT And Management by Abheek

Microsoft certified Trainer -Abheek

System Center In A Kilt

System Center Demystified. In a kilt.

Boerlowie's Blog

Blog about VMware, PowerShell, PowerCLI, Active Directory, Exchange, SQL, ...

Another computer blog

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Catapult Systems

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Catapult Systems

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Catapult Systems

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Amelia Willson

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Catapult Systems

All About: Software Application Packaging & SCCM Administration & VMWare Administration

21st Century Project Management

All About: Software Application Packaging & SCCM Administration & VMWare Administration

IT Consultant Everyday Notes

Just some problems/solutions storage

System Center Solutions

All About: Software Application Packaging & SCCM Administration & VMWare Administration

SCCM Packager

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Srikanth Boddupalli

The greatest WordPress.com site in all the land!

Tao Yang's System Center Blog

My thoughts on System Center, PowerShell and more...

Kirx' Blog - kirxblog.wordpress.com

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

PackageDeploy.com

All About: Software Application Packaging & SCCM Administration & VMWare Administration

just another windows noob ?

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

MSIwisdom

All About: Software Application Packaging & SCCM Administration & VMWare Administration

video technet

All About: Software Application Packaging & SCCM Administration & VMWare Administration

TechNet Blogs

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Hey, Scripting Guy! Blog

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

TechNet Blogs

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Aaron Parker

on application delivery and end user computing

Felipe Binotto's Blog

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Anoops

SCCM ConfigMgr A blog about Infrastructure Management and Troubleshooting Tips about

Puskar on Tech

Just another WordPress.com site

Eswar Koneti's Blog

Blog about Configmgr and its Connected Objects