Click here to Skip to main content
15,903,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I want to show the installed exe in Start->Programs->
Exa:Start->Programs->TeamViewer->TeamViewer5
UninstallTeamViewer5
means i want to run the exe as well as uninstall the exe From Start->Programs only.
I know how to add an Exe to start->Programs, but not uninstall.

Let me know the solution.
Here is code for uninstallation.

C#
private void Uninstall()
       {
           try
           {
               string[] arguments = Environment.GetCommandLineArgs();
               foreach (string argument in arguments)
               {
                   if (argument.Split('=')[0].ToLower() == "/u")
                   {
                       string guid = argument.Split('=')[1];
                       string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
                       ProcessStartInfo si = new ProcessStartInfo(path + "/msiexec.exe", "/x " + guid);
                       Process.Start(si);
                       Close();
                       Application.Exit();
                   }
               }
           }
           catch (Exception ex)
           {
               DataClass.LogError(ex);
           }
       }


but i am getting the below Exception.
DSIL has encountered a problem and needs to close. We are sorry for the inconvenience.


Regards,
Pawan.
Posted
Updated 4-Aug-10 18:31pm
v3

1 solution

Create a setup project in your solution and read the documentation.
 
Share this answer
 
Comments
Pawan Kiran 20-Oct-10 0:21am    
Hi,
Thanks to your post, Could u provide me a link or any sample document related to Uninstall process in a more Descriptive way..

i am very thankful to you.. if i get solution to my post.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900