ClickOnce and Startup shortcut  
Author Message
BradVoy





PostPosted: ClickOnce and Setup & Deployment Projects, ClickOnce and Startup shortcut Top

I am deploying my application via ClickOnce. In some cases this application needs to put a shortcut to itself into the Start Menu's Startup folder so it will be started automatically when the user logs in. I implemented this with code that makes a copy of the ClickOnce .appref-ms file and puts the copy in the Startup folder. This works fine until my application is uninstalled. The .appref-ms file in Startup doesn't get uninstalled, so it gets activated the next time the user logs in, which causes the application to download and re-install itself. If the user just uninstalled the application then this is clearly not the behavior he wants. Is there a better way to handle this

Windows Forms18  
 
 
Samsagaz





PostPosted: ClickOnce and Setup & Deployment Projects, ClickOnce and Startup shortcut Top

Hi, i think you would use a custom installer and more properly custom actions. On customs actions you have an action "Uninstall" where you may drop the icon.

See the web http://www.installsite.org for more information.

I hope this help you.

See you.


 
 
BradVoy





PostPosted: ClickOnce and Setup & Deployment Projects, ClickOnce and Startup shortcut Top

By "custom installer" I presume you mean throwing out ClickOnce and using a standard install program. If I do that, how do I get the automatic updating functionality of ClickOnce
 
 
David Guyer MS





PostPosted: ClickOnce and Setup & Deployment Projects, ClickOnce and Startup shortcut Top

Unfortunately, ClickOnce really doesn't support this scenario.

You've stepped outside ClickOnce by writing custom code that creates the shortcut. That works fine, but the downside is that there's nothing to hook into to trigger code that will uninstall the shortcut.

I'm sorry I don't have a better answer.