Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > VS uninstall does not remove shortcut.
 

VS uninstall does not remove shortcut.

I have a Install shield setup up we are replacing with a VS install program. If I manually remove the application using the control panel add / remove programms the
programs shortcut is removed. I have bumped the version number and used the same upgrade code on the VS install. The VS uninstalls the old program except for the
old programs short cut. How do I remove this shortcut.
BarberColman  Wednesday, July 29, 2009 4:05 PM
Thanks for all the suggestions. The shortcuts being bound to a file was new and helped me from making a couple of new errors.

The root problem with the two shortcuts was a nameing issue. The shortcutname did not exactly match so two shortcuts were created. When the new and old shortcut name are the same the old shortcut is deletd or replaced.
  • Marked As Answer byBarberColman Thursday, August 06, 2009 11:57 AM
  •  
BarberColman  Thursday, August 06, 2009 11:56 AM
Hello BarberColman,

How did you create shortcut in VS? Did you use the following way?
1. Select "User's Programs Menu" node in the File System window.
2. Right click the blank area at the right side, choose "Create new shortcut".
3. Point it to the Primary output in the "Application Folder".

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Friday, July 31, 2009 3:00 AM
Sorry. I did not specify this is a shortcut on the users desktop. Any help on this?
BarberColman  Monday, August 03, 2009 6:34 PM

Not without more information.
Do you have the same desktop shortcut in your Visual Studio setup project? If you have, then did you create it as Kira asked or in some other way (a custom action).

Without more information it's impossible to say if this is even an issue. Forget InstallShield (it's just building an MSI file like Visual Studio), and so if my old install had a desktop shortcut and my new install has a desktop shortcut this is what I'd expect - it would stay.An uninstall of the old product will remove it, but an upgrade will preserve it.


Phil Wilson
PhilWilson  Monday, August 03, 2009 8:02 PM

This is the first time I have had to do a Windows install so I do not know what information isneeded.

I created it as Kira asked except that I used the "User's Desktop".


I want the user to be able to control the creation of the shortcut on the desktop so I added the Checkboxes (A) to the UI editor andmadethe CheckBox2PropertySTORCUT_ON_DESKTOP. In the file system editor I added "SHORTCUT_ON_DESKTOP=CHECKED" in the condition filed of the "User's Destip" properties. If there is a better way of doing this I will change.

Does the fact that using the uninstall from the add/remove programs deletes the shortcut and that unistall as part of the new install not delete the shortcut mean anything?

BarberColman  Tuesday, August 04, 2009 11:25 AM

I think tou're saying that the issue is nothing to do with the upgrade, it's just that your shortcut isn't being installed, correct?

1) This won't work. Shortcuts are bound to the file being installed. If the file is installed then the shortcut is installed.
2) The condition is incorrect. The conditions with checkboxes work as here:
http://msdn.microsoft.com/en-us/library/025bcetc(VS.80).aspx

The only way I know to do this without writing code in a custom action is this: Add the file twice. One will have a shortcut and the other will not. Condition each file install on the checkbox, ine with CHECKBOXA1=1 (or whatever you call it) and the other withCHECKBOXA1<>1.

If you want to use custom action code instead, there are articles like this:
http://www.codeproject.com/KB/install/shortcut_installer.aspx


Phil Wilson
PhilWilson  Tuesday, August 04, 2009 8:09 PM
Hi BarberColman,

You want to create shortcut based on the condition selection? Unfortunately it doesn't support that. You can only use condition to the project components and files, but you cannot use this for shortcut creation. Once you have created the shortcut, it always put onto the user desktop regardless user selection.

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Wednesday, August 05, 2009 1:43 AM
Hi
The add the file twice works for corrently adding the new shortcut but nothing I have tried has deleated the old shortcut during a new install. The only way I have been able to delete the old shortcut was using add/remove programs.

Very strange!
BarberColman  Wednesday, August 05, 2009 2:25 PM
Thanks for all the suggestions. The shortcuts being bound to a file was new and helped me from making a couple of new errors.

The root problem with the two shortcuts was a nameing issue. The shortcutname did not exactly match so two shortcuts were created. When the new and old shortcut name are the same the old shortcut is deletd or replaced.
  • Marked As Answer byBarberColman Thursday, August 06, 2009 11:57 AM
  •  
BarberColman  Thursday, August 06, 2009 11:56 AM

You can use google to search for other answers

Custom Search

More Threads

• How to copy files before display of msi GUI
• Calling a windows app during installation
• Try my weather program!
• Search Bar Resizing on Toolbar
• ClickOnce SQL Express issues
• VS2005 Setup Project - Launch Conditions - Registry Problem On X64 Operating Systems
• Desktop shortcut not working w/ WPF App & Vista
• GAC Assembly not present until after reboot
• Setup project and NHibernate
• Does my executable have to be copied to the target system??