Link to home
Start Free TrialLog in
Avatar of HLRosenberger
HLRosenbergerFlag for United States of America

asked on

ClickOnce Install

I'm creating a ClickOnce install using Publish.   First time I have done this.  The desktop icon that it's creates does not have a shortcut tab.  I want to be able to map a keyboard shortcut to this icon.  How can I do it?  What is the shortcut tab missing?
Avatar of Vadim Rapp
Vadim Rapp
Flag of United States of America image

This is special shortcut, it does not directly reference the target file, but installs, upgrades, or repairs if necessary; it's target is the product information in the system. For that reason, Microsoft has removed Target tab. Unfortunately, since keyboard hotkey had a misfortune to be on the same tab, it got removed as well.

The good news is that if this installation is for yourself, you can create your own regular shortcut to the file, and assign the hotkey. If this is for others, I never once saw a user who knew about this feature. In fact, it seems to me that it never worked anyways, i.e. assigned hotkey did not survive computer restart (not 100% sure about that).

If you really want this feature, you have to create regular installation.

Note that Windows SDK has this to say about specifying hotkeys for shortcuts in the installations:

"Authors of installation packages are generally recommended not to set this option, because the setting of this option can add duplicate hotkeys to a user's desktop. In addition, the practice of assigning hotkeys to shortcuts can be problematic for users using hotkeys for accessibility."
Avatar of HLRosenberger

ASKER

When you say "The good news is that if this installation is for yourself, you can create your own regular shortcut to the file, and assign the hotkey.",  how do I do this?
Find the executable by name on your computer (usually under %userprofile%\AppData\Local\Apps\2.0), and create the shortcut as usual.
I can't point to the EXE, or that defeats the one ClickOnce mechanism, right?

 I found a way around it.  if I create the desktop shortcut in code, it has the Shortcut tab in properties.
Please post the code that creates the shortcut.
ASKER CERTIFIED SOLUTION
Avatar of HLRosenberger
HLRosenberger
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's good find to create the shortcut to appref-ms, although you probably might have created the same shortcut manually - unclear why you had to write the code