Question

I want to check an installed msi product details like product key, code and others using msbuild target.

I want to uninstall the msi using the product code using the following syntax:

msiexec /x {PRODUCT-CODE-GUID-HERE}

Can anyone help me with sample code.

Thanks & Regards, Santosh Kumar Patro

Was it helpful?

Solution

After my analysis I found that there are two approaches available to resolve the issue as mentioned below:

a. Read the product code from Registry using C# and hook it up with a custom task and invoke it in Custom Build proj file.

In order to accomplish the above mentioned point the following links are useful: Get Product Code of installed Msi http://tech.pro/tutorial/934/creating-msbuild-tasks-in-csharp

b. Uninstall the installed MSI using Powershell script. Here I need to invoke the powershell script from the Custom Build proj file.

In order to accomplish the above mentioned point the following links are useful: http://www.asp.net/web-forms/tutorials/deployment/advanced-enterprise-web-deployment/running-windows-powershell-scripts-from-msbuild-project-files http://nzbart.blogspot.in/2012/11/correctly-executing-powershell-script.html http://thoughtsofmarcus.blogspot.in/2012/12/clever-uninstall-of-msi.html

Thanks & Regards, Santosh Kumar Patro

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top