MSIEXEC command to install and repair?
Any assistance is appreciated.
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
Your best option is to use a script, in which you can test for the product's installed state using the WindowsInstaller.Installer object. If it's installed, do a repair. If not, install. The object model is fully documented on MSDN.
BTW, one of the big advantages of using the WI engine is that applications can self-heal, if the installation package is properly constructed.
BTW, one of the big advantages of using the WI engine is that applications can self-heal, if the installation package is properly constructed.
Posted by:
timmsie
14 years ago
this script will help you, we use it as a pre-req sometimes in sms to determine whether an app is installed or advertised and then uninstall it.
you'll have to change it a bit for your scenario but it's a start
you'll have to change it a bit for your scenario but it's a start
Option Explicit
Const productCode = "{xxxx-xxx-xxxx-xxxxxxx}"
Const productFeat = "Complete"
Const msiProdAdvertised = 1
Const msiProdInstCurrUser = 5
Const msiInstallStateAdvertised = 1
Const msiInstallStateLocal = 3
Const msiInstallAllFeatures = 65535
Dim msiObject : Set msiObject = CreateObject("WindowsInstaller.Installer")
Dim objShell : Set objShell = CreateObject("WScript.Shell")
' Check existing product state
If (msiObject.ProductState(productCode) <> msiProdAdvertised) And (msiObject.ProductState(productCode) <> msiProdInstCurrUser) Then
' Package is neither advertised or installed so exit the script with error code 0 to satify SMS pre-requisite
WScript.Quit(0)
Else
On Error Resume Next
' If main product feature is either advertised or installed, call uninstall routine via msiexec command line
If (msiObject.FeatureState(productCode, productFeat) = msiInstallStateAdvertised) Or _
(msiObject.FeatureState(productCode, productFeat) = msiInstallStateLocal) Then
objShell.Run("msiexec.exe /x {xxxxx-xxxxx-xxxx-xxxx} /qb!"),1,True
End If
End If
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.