473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

C# Uninstall Shortcut and Command Line Arguments

30
I am trying to add an uninstall shortcut to the user's program directory upon installation of my application. I utilized the following website:

Adding Uninstall Shortcut

And then conformed the code to C# in this manner:

Expand|Select|Wrap|Line Numbers
  1.         static void CheckUninstall()
  2.         {
  3.             string[] arguments = System.Environment.GetCommandLineArgs();
  4.             char[] delimiter = new char['='];
  5.             foreach(string argument in arguments)
  6.             {
  7.                 MessageBox.Show(argument.Split(delimiter,0).ToString().ToLower());
  8.                 if(argument.Split(delimiter,0).ToString().ToLower() == @"/u")
  9.                 {
  10.                     string guid = argument.Split(delimiter,1)[0];
  11.                     string path = Environment.GetFolderPath(
  12.                                             Environment.SpecialFolder.System);
  13.                     ProcessStartInfo si =  new ProcessStartInfo(path +
  14.                                 @"\msiExec.exe", "/x " + guid);
  15.  
  16.                     Process.Start(si);
  17.                     Application.Exit();
  18.  
  19.                 }
  20.             }//end foreach
  21.  
  22.  
  23.         }
But it seems that while this is executes when I click the uninstall shortcut, it can't find the parameters. When I look at the properties of the shortcut, there are no parameters listed, even though I set the shortcut's parameters in the installer solution to /u=[ProductCode]. Any ideas on why this isn't working?
Sep 28 '07 #1
0 2111

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dave A | last post by:
How do I add an Uninstall icon off the start menu using Visual Studio .Net Deployment project? You can add a folder, project output, file or assembly or create a shortcut. None of these seem to...
16
by: MLH | last post by:
I have created an A97 runtime distribution for the first time in my life this morning. I had precious little time to do it and was unable to create the distributable installation fileset with the...
9
by: VJ | last post by:
I am deploying a Package having applications developed using VB.NET and VS.NET 2003. I am using the Packaging feature provided with the VisualStudio. I can use the package to creates shortcuts for...
1
by: Paulers | last post by:
I have been searching for example code that will create a shortcut link to a file and place it on the desktop. I have searched google and found a couple examples using the windows scripting object...
5
by: Screaming Eagles 101 | last post by:
Hi , not much trouble in making a setup project, but I'd like also an icon in All Programs to uninstall the application. I can't find a good explanation on the net so far... -- Filip...
0
by: Gasnic | last post by:
I have created a MSI project for my project, after I run the MSI, I want to see the command and the arguments I passed in in a shortcut (start menu), but when I see the property of the shortcut, it...
2
by: Ilya | last post by:
Hi, all! Some weird thing happens... I'm trying to create a shortcut programmatically in C#. I need to create a shortcut with the "target" parameter using slash. Actually I'm creating a...
2
by: Sirius | last post by:
When creating a deployment project in Microsoft Visual Studio 2005, there seems to be no option to create an uninstall link. How can this be achieved? To be specific, I want an 'Uninstall' shortcut...
4
by: RvGrah | last post by:
If I add "string args" to the Program.cs file so that there can be arguments passed when the program launches, how do I add those to a fixed desktop shortcut on my users' machines? And If I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.