en-UShe-IL
You are here:  Blog

Awared MVP 

Microsoft® Community Contributor 


Microsoft® Community Contributor


Blog Archive:

הגדל
* Can be used in order to search for older blogs Entries

Search in blogs


Blog Categories:

הגדל
* Can be used in order to search for blogs Entries by Categories

Blog Tags:

הגדל
* Can be used in order to search for blogs by keywords

TNWikiSummit


הגדל מה בעמוד?

יונ23

Written by: ronen ariely
23/06/2016 23:25 RssIcon

Background

In one of my previous blogs I wrote about how to install Microsoft SQL Server 2016 Book-online for offline use. I mentioned a bug regarding starting the help viewer:

! Quote: In the current SSMS version (April 2016 preview), when we click on F1 or if we select "Help" -> "View Help" in order to get help, instead of opening the Help Viewer, SSMS opens the download page in the browser, even if the Help Viewer already installed! It seems like a bug.

If we installed the Book-Online for local use, then the Help viewer should open the local content. Unfortunately, this is not working as expected. The current version is "SSMS June 2016 generally available release", which mean that this version theoretically ready for production. Yet, the bug is still there. it is time to focus a bit more on what seems to behave wrong and how we can workaround these issues.

Starting the Help viewer using F1 does not work

Most of Microsoft apps uses the same basic Keyboard Shortcuts. One of the most common used Keyboard shortcuts is F1, which should open the helper for the app. There should be nothing new under the sun with SSMS 2016, and according to the documentation F1 should open the help viewer version 2.2. In fact it does not do so.

Expected behavior: In older versions of SSMS (for example SSMS 2014), when we first use F1 in order to open the Help Viewer, an alert massage raise with the option to choose if we want to view online Help content on the internet, or local Help content that stored on our machine.

There are two behaviors that people reports about: (1) Instead of getting the new Help Viewer version 2.2, which came with the SSMS 2016, the old version 1.1 is opened(2) Instead of getting any help viewer, the browser opened and redirects us to the Book-Online.

* The behavior does not directly points us to the issue or to the solution.

Workaround 01: Use direct command

In my previous blog (you can read more there), I gave a simple workaround to open the Help Viewer, using a simple direct command:

"C:\Program Files (x86)\Microsoft Help Viewer\v2.2\HlpViewer.exe" /catalogName SSMS16

SSMS gives us the option to add Keyboard Shortcuts, which execute Stored Procedure (SP). We can create new system SP, which everyone can use. In the SP we can spawns a Windows command shell, which open the SSMS help viewer. Another option, which personally was my solution is to simply create a desktop shortcut, which open the SSMS help viewer (using the same command as above).

Starting the Help viewer from the properties window

After I published my previous blog, which mentioned the above workaround, people still raised in the forums other needs, which are not covered by using direct command. For example:

Issue 1: We want to use the built-in option to start the Help Viewer from the properties window using the button.
Issue 2: The direct command opens the viewer in the main page, but if we want to open the help viewer in specific Object, we need a dynamic solution that get input as parameter(s).

Let's examine the issue first

Open SSMS -> go to the "Object Explorer" -> right click on database or any other element -> choose "Properties" -> In the properties windows click the button "Help"

Almost the same as using F1, there are two options that people reports about: (1) Instead of getting the new Help Viewer version 2.2, which came with the SSMS 2016, the old version 1.1 is opened(2) An error raised with the message "no app are installed to open this type of link (ms-xhelp)".

Well, the error massage in the second option actually points to the basic issue. This massage tell us that there isn't any associate application to the protocol ms-xhelp.

It is a good time to thanks Microsoft Corp, which provided me a free account to the Azure. I have research the issue on several Virtual Machines that I created with different configuration and installation. I tested on Windows 2012r2 and Windows Server 2016 Technical Preview 5, with and without other versions of SSMS and/or Visual studio. It seems that each time I had previous version of Microsoft Help Viewer the previous version opened, and if no previous version was installed the error raised with the message "no app are installed to open this type of link (ms-xhelp)".

My conclusion was that the basic reason to issues in starting the Microsoft Help Viewer, is that SSMS 2016 does not associates the app to the protocol. When we execute Microsoft Help Viewer throw SQL Server Management Studio properties Windows, it executes Uniform Resource Identifier (URI), using the protocol "MS-XHelp". People that installed older version of SSMS got that version associate the the protocol during installation, but people that do not have older versions have no app associate to that protocol.

no app are installed to open this type of link

Most operating system (including Windows) associates specific app as default for each common file extension. For example, double click on file with the extension ".html", should execute the default browser, since the extension html is associated to this app.

Less known is that the operating system also associates default app to specific protocols. For example the protocol "http" associated with the default browser. You can try to execute from the command line something that starts with "http://" like "https://ArielyTest".

We can fix this, by manually add several keys to the registry key.

Associating app as default for specific protocol

I assume that anyone who read this blog familiar with the option to associate a file type with specific program. There are several options to do that using the windows API, for example we can open control panel -> Click on "Programs" -> and click on "Default Programs". This will open a windows like bellow image:

Clicking on "associate a file type or protocol with a program" open a list of current protocols and file's extensions which associated to specific app. In this windows we can change the app associate with a specific file extension or protocol, but we cannot add a new file extension or protocol to the list.

There is a simple option to add new file extensions to the list by clicking a file with that extension and using the wizard, but I did not find any simple option to add new protocol using a GUI API. The only option that I found was to add keys to the registry keys.

Warning!Anything that I write here should NOT be done on production! This is unofficial workaround and not a solution. we should wait for the official Microsoft solution. Anything that you do is on your own risk! The registry is the core of the system and any mistake can lead to issues in the operating system level. In any case, if you changes the registry, make sure that you have full backup of your machine, and backup the registry as well.

All the protocol<->app associations are located in the HKEY_CLASSES_ROOT. If you have no key [HKEY_CLASSES_ROOT\MS-XHelp\shell\open\command] then you probably did not install older version of SSMS and you got the massage "no app are installed to open this type of link (ms-xhelp)". If you see that registry key then you probably installed an older version and the registry key value include the command to execute your older version of the Help viewer. This is the issue!

Now that we understand the issue we can simply fix it by adding the right keys :-)

Example of keys that fit SSMS 2016 - without parameters

If you decided (against my recommendation) to fix the issue yourself by edit the registry, then This is the most simple registry keys sample that I tested, which associates the Help Viewer v2.20 to the protocol MS-XHelp.

* It can be applied by saving this to a text file with the extension ".reg" for example "ArielyFix_MS-XHELP v2.2.reg", and double click the file as Administrator.

Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\MS-XHelp]
"URL Protocol"=""
@="URL:MS-XHelp Protocol"
 
[HKEY_CLASSES_ROOT\MS-XHelp\shell]
 
[HKEY_CLASSES_ROOT\MS-XHelp\shell\open]
 
[HKEY_CLASSES_ROOT\MS-XHelp\shell\open\command]
@="\"C:\\Program Files (x86)\\Microsoft Help Viewer\\v2.2\\HlpViewer.exe\" /catalogName SSMS16"

* Keep reading for adding dynamic parameters, as this example will open the new Help Viewer but always in the main page.

Example of related registry keys for older versions of Help Viewer

This is the related registry keys for v1.10 including the way it pass and uses the parameters.

Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\MS-XHelp]
"URL Protocol"=""
@="URL:MS-XHelp Protocol"
 
[HKEY_CLASSES_ROOT\MS-XHelp\shell]
 
[HKEY_CLASSES_ROOT\MS-XHelp\shell\open]
 
[HKEY_CLASSES_ROOT\MS-XHelp\shell\open\command]
@="\"C:\\Program Files\\Microsoft Help Viewer\\v1.0\\HelpLibAgent.exe\" %1"
 
[HKEY_CLASSES_ROOT\MS-XHelp\shell\open\ddeexec]
@="\"%1\""
 
[HKEY_CLASSES_ROOT\MS-XHelp\shell\open\ddeexec\Application]
@="HelpLibAgent"
 
[HKEY_CLASSES_ROOT\MS-XHelp\shell\open\ddeexec\ifexec]
@="\"%1\""
 
[HKEY_CLASSES_ROOT\MS-XHelp\shell\open\ddeexec\Topic]
@="OpenTopic"

As you can see in my above code the registry key [HKEY_CLASSES_ROOT\MS-XHelp\shell\open\command] include the value:
@="\"C:\\Program Files\\Microsoft Help Viewer\\v1.0\\HelpLibAgent.exe\" %1"

The above value is the command that execute while we are using the MS-XHelp protocol. The command get input which is parse in the keys under [HKEY_CLASSES_ROOT\MS-XHelp\shell\open\ddeexec] (there are 3 keys: Application, ifexec, Topic).

The HlpViewer has several optional parameters, which you can use in the direct link. For example you can use /helpQuery  in order to executes a query to display specific content. You can add these options to as keys in order to dynamically points to spesific place in the SQL Server Book-Online for example.

You can read more about adding dynamic parameters to a key in this link: Associate Verbs with DDE Commands.

Conclusions

Most operating system (including Windows) associates specific app as default for each common file extension. For example double click on file with the extension ".html", will execute the default browser, since the extension html is associated to this app. Less known is that the operating system also associates default app to specific protocols. For example the protocol http associated with the default browser. You can try to execute from the command line something that starts with "http://" like "https://ArielyTest".

When we execute Microsoft Help Viewer throw SQL Server Management Studio, it executed using the protocol MS-XHelp. The basic reason to issues in starting the Microsoft Help Viewer, is that SSMS 2016 does not associates the app to the protocol. We can fix this by manually add several keys to the registry key. In addition we can create shortcut to execute the Help Viewer directly.

Resources and more information

Tags: SQL , sql server , SSMS , bug
Categories: SQL , Other...
Location: Blogs Parent Separator Public blog