• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 955
  • Last Modified:

Protocol for a desktop app (exe) not working for Internet Explorer

I have created a protocol that I want to use to open an EXE (created in Visual Studio using c#) via an html link in a webpage.

The expected result was that clicking on the link, the application would open. This does work for Firefox (and I can see the protocol listed in the Firefox protocol list) but does not work for Internet Explorer (and is not in the Windows protocol/associations list.

The registry keys are as follows:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CDL]
"URL Protocol"=""
@="URL:CDL Protocol"

[HKEY_CLASSES_ROOT\CDL\DefaultIcon]
@="\"Label Printer.exe,1\""

[HKEY_CLASSES_ROOT\CDL\shell]

[HKEY_CLASSES_ROOT\CDL\shell\open]

[HKEY_CLASSES_ROOT\CDL\shell\open\command]
@="\"C:\\Users\\user\\Documents\\Visual Studio 2010\\Projects\\Label Printer\\Label Printer\\bin\\Debug\\Label Printer.exe\" %1"

Open in new window


When I click on the HTML link (example below), in Firefox I get a popup message asking if I want to open the link in the specified application. On clicking OK, the application opens. Internet Explorer simply displays the "Cannot display the webpage" screen.

<a href="CDL:OPENFORM?data=Name|Address 1|Address 2|Town|AB12 3CD">Launch</a>

Open in new window


At the moment, I really can't see why this doesn't work - the lack of association in the Windows associations list is pretty key, but my registry key is not really any different from the Skype one I also have which does work in both IE and Firefox.

Thanks for the help!
0
emjx
Asked:
emjx
  • 5
1 Solution
 
David Johnson, CD, MVPOwnerCommented:
what is the html that you use?
0
 
emjxAuthor Commented:
The two links I have tried are as follows:

<a href="CDL:OPENFORM?data=My Name|My Address|Town|County|AB12 3CD">Launch</a><br />
<a href="CDL://OPENFORM?data=My Name|My Address|Town|County|AB12 3CD">Launch</a>

Open in new window


The first link works in Firefox and Safari, and the data parameter is passed to the application. The second link works in Firefox and Safari but the data parameter is not passed to the application.

[Edit - 20/08/12]
I have also tried:
<a href="CDL:OPENFORM">Launch</a>

Open in new window

i.e. no parameters.
0
 
emjxAuthor Commented:
Some further testing shows that the following entered in Windows Explorer also works. Looks like just IE and the associations list don't pay any attention to keys specified in HKEY_CLASSES_ROOT.

cdl:OPENFORM?data=hello world

Open in new window


Am guessing that there is also somewhere else in the registry that needs a entry. Any ideas? Anyone?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
emjxAuthor Commented:
A massive thanks to..................... me...

How did I fix this issue:

Simply added a new registry key to HKEY_CLASSES_ROOT that was 9 characters long. Apart from that, it was identical to the original CDL key. CDL was not a duplicate either (the fact that it works in Firefox kind of proves that).

Therefore, due to the lack of any info to say otherwise, I can only assume that when adding a new protocol handler, it needs to have a name that is greater than 3 characters in length (although have not tested to find that actual length).
0
 
emjxAuthor Commented:
Really good solution, explains the neccessary fix.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now