Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


ClickOnce Install

Posted on 2016-08-16
Medium Priority
Last Modified: 2016-09-06
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?
Question by:HLRosenberger
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 40

Expert Comment

by:Vadim Rapp
ID: 41758727
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."

Author Comment

ID: 41759379
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?
LVL 40

Expert Comment

by:Vadim Rapp
ID: 41759599
Find the executable by name on your computer (usually under %userprofile%\AppData\Local\Apps\2.0), and create the shortcut as usual.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 41759947
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.
LVL 40

Expert Comment

by:Vadim Rapp
ID: 41760506
Please post the code that creates the shortcut.

Accepted Solution

HLRosenberger earned 2000 total points (awarded by participants)
ID: 41761164
Dim Target As String

        Target = "c:\users\" & Environment.UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Precision Solutions, Inc\Gravity\Precision Gravity Office.appref-ms"

        Dim WshShell = New WshShell

        Dim MyShortcut As IWshRuntimeLibrary.IWshShortcut

        Dim DesktopFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)

        MyShortcut = DirectCast(WshShell.CreateShortcut(DesktopFolder & "\Precision Gravity Office.lnk"), IWshRuntimeLibrary.IWshShortcut)

        MyShortcut.TargetPath = Target
        MyShortcut.Description = "My Shortcut"
        MyShortcut.Hotkey = "Ctrl+Alt+G"
        MyShortcut.IconLocation = "\\PSISERVER1\SetupFiles\PSI\Precision Gravity\Install\gravity-office.ico"
LVL 40

Expert Comment

by:Vadim Rapp
ID: 41785788
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

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question