Deleting the cached msi and mst
Hi All,
Can any please gimmeVB script.I want to delete the cached copy of msi and mst from c:\Windows\Installer.
Product code of the application is {18D6DCEF-5BB6-4994-BC38-C34534137245}.
Thanks in advance.
Can any please gimmeVB script.I want to delete the cached copy of msi and mst from c:\Windows\Installer.
Product code of the application is {18D6DCEF-5BB6-4994-BC38-C34534137245}.
Thanks in advance.
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
jmcfadyen
15 years ago
Posted by:
AngelD
15 years ago
I don't know why you would want this but here is a vbscript to fetch the cached location, you have to add the deletion code your-self.
Option Explicit
On Error Resume Next
Const ProductCode = "{18D6DCEF-5BB6-4994-BC38-C34534137245}"
Dim Installer : Set Installer = Nothing
Set Installer = CreateObject("WindowsInstaller.Installer")
If Not IsProductInstalled(ProductCode) Then Wscript.Quit
Dim InstallSource : InstallSource = Installer.ProductInfo(ProductCode, "LocalPackage")
Dim Transforms : Transforms = Installer.ProductInfo(ProductCode, "Transforms")
WScript.Echo "Cached package: " & InstallSource
WScript.Echo "Cached Transforms: " & Transforms
Set Installer = Nothing
Wscript.Quit(0)
'// check if designated product is installed
Function IsProductInstalled(ProductCode)
IsProductInstalled = False
Dim ProductState : ProductState = Installer.ProductState(ProductCode)
If ProductState <> 5 Then
Wscript.Echo "Product not installed (ProductState return: " & ProductState & ")"
Wscript.Echo "Please check the ProductCode"
Exit Function
End If
IsProductInstalled = True
End Function
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.