Home > DeveloperSection > Forums > Uninstalling program using C#.
James Smith

Total Post:48

Points:336
Posted on    July-26-2011 4:38 AM

 C# C# 
Ratings:


 1 Reply(s)
 4822  View(s)
Rate this:
Hi everyone,
I have a small question. I want to uninstall programs using c#. Can any one tell me that how can I perform this task. Like suppose that vlc player is installed in my system. Now what I want using my program I want to uninstall that vlc player.

Thanks.


Awadhendra Tiwari

Total Post:126

Points:882
Posted on    July-26-2011 5:55 AM

There is many way to uninstall program in c#. Firstly you will have to find out GUID of that product then you have to use Process class of System.Diagonostic process to call msi.exe and pass it to start method of Process class.
Like following example will demonstarte
Process.Start("msiexec /x {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}");
where xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx represents GUID of that application that you want to uninstall.

Thanks.

Modified On Jul-26-2011 05:57:08 AM

Don't want to miss updates? Please click the below button!

Follow MindStick