如何使用它的产品编号在C#中卸载MSI [英] How to uninstall MSI using its Product Code in c#
问题描述
我知道我们可以通过传递命令参数使用其MSI卸载Windows应用程序如下,
I know We can uninstall a windows application using its MSI by passing command arguments as follows,
Process p = new Process();
p.StartInfo.FileName = "msiexec.exe";
p.StartInfo.Arguments = "/x \"C:\\MyApplication.msi\"/qn";
p.Start();
但我想知道的是,我们如何可以卸载不使用MSI应用程序?在上述情况下,我应该有微星的具体位置卸载该应用程序,如果我能unstaill使用的产品代码,然后我不需要有微星在目标机器。
But what i want to know is how can we uninstall the application without using MSI ? In the above scenario I should have the MSI in the specific location to uninstall this application, If i could unstaill using product code then I dont need to have the MSI in the target machine.
推荐答案
据的 MSDN ,您可以使用产品代码卸载它:
According to MSDN, You can uninstall it using the product code:
msiexec.exe /x {your-product-code-guid}
当您使用的产品代码,它使用缓存的MSI从 C:\WINDOWS\Installer
When you use the product code, it uses the cached MSI from C:\WINDOWS\Installer
.
这篇关于如何使用它的产品编号在C#中卸载MSI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!