Uninstall method question
Using this:
-----------------------------------------------------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product Where Name = 'Technesis PopUp'")
For Each objSoftware in colSoftware
objSoftware.Uninstall()
Next
----------------------------------------------------------------------
It uninstalls the program, however, there is a popup requesting the user to close all programs etc. Is there a way to suppress posups, or initiate a silent uninstall using the uninstall method?
Thanks
-----------------------------------------------------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product Where Name = 'Technesis PopUp'")
For Each objSoftware in colSoftware
objSoftware.Uninstall()
Next
----------------------------------------------------------------------
It uninstalls the program, however, there is a popup requesting the user to close all programs etc. Is there a way to suppress posups, or initiate a silent uninstall using the uninstall method?
Thanks
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
WiseUser
19 years ago
Create this VBScript, then drag and drop your MSI on it - it will return the Product code.
Const msiOpenDatabaseModeDirect = 2
Set oInst = CreateObject("WindowsInstaller.Installer")
sDBPath = Wscript.Arguments(0)
Set oDB = oInst.OpenDataBase(sDBPath, msiOpenDatabaseModeDirect)
sQuery = "SELECT `Value` FROM `Property` WHERE `Property` = 'ProductCode'"
Set oView = oDB.OpenView(sQuery)
oView.Execute
Set oRecord = oView.Fetch
InputBox "ProductCode is the following:", "PRODUCT CODE", oRecord.StringData(1)
Set oInst = Nothing
Set oInst = CreateObject("WindowsInstaller.Installer")
sDBPath = Wscript.Arguments(0)
Set oDB = oInst.OpenDataBase(sDBPath, msiOpenDatabaseModeDirect)
sQuery = "SELECT `Value` FROM `Property` WHERE `Property` = 'ProductCode'"
Set oView = oDB.OpenView(sQuery)
oView.Execute
Set oRecord = oView.Fetch
InputBox "ProductCode is the following:", "PRODUCT CODE", oRecord.StringData(1)
Set oInst = Nothing
Posted by:
Garrett
19 years ago
If you are executing the uninstall from the local computer it might be easier to use msiexec.exe /x. If you are executing the script from another then I don't know of a way to remove the prompt from the vbscript call you are making.
/qn will remove any user interaction.
Personally I prefer to use the GUID for uninstalls.
[link]http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/msiexec.mspx[/link]
To remove or uninstall a package, type:
Syntax
msiexec /x {package|ProductCode}
Top of page
Parameters
/x : uninstalls a product.
package : Name of the Windows Installer package file.
ProductCode : Globally unique identifier (GUID) of the Windows Installer package.
msiexec /x <pathToSource>\TechnesisPopUp.msi /qn
or
msiexec /x {GUID} /qn
/qn will remove any user interaction.
Personally I prefer to use the GUID for uninstalls.
[link]http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/msiexec.mspx[/link]
To remove or uninstall a package, type:
Syntax
msiexec /x {package|ProductCode}
Top of page
Parameters
/x : uninstalls a product.
package : Name of the Windows Installer package file.
ProductCode : Globally unique identifier (GUID) of the Windows Installer package.
Posted by:
ixoni
19 years ago
Thank you Garrett. The reason I went to the script is becasue msiexec is not working. I am getting the popup that indicates the package cannot be opened, verify that it is a valid package etc. I tried with the product name and the product GUID.
I got the GUID from the programs setup.ini file. That should be it, right?
I got the GUID from the programs setup.ini file. That should be it, right?
Posted by:
Garrett
19 years ago
Possibly, but its hard to be sure. You could test it out real quick by...
If you run that command and the uninstaller for that app launches then you have the correct GUID.
If it is the incorrect GUID you could try installing Masai and use it to locate the GUID.
- Installing the application
- Start -> Run
- msiexec /x {GUID} (include the braces in the command line)
Example: msiexec /x {123AB12A-1234-98E9-9213-A123456789E1}
If you run that command and the uninstaller for that app launches then you have the correct GUID.
If it is the incorrect GUID you could try installing Masai and use it to locate the GUID.
Posted by:
ixoni
19 years ago
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.