Link to home
Start Free TrialLog in
Avatar of emjx
emjxFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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!
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

what is the html that you use?
Avatar of emjx

ASKER

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.
Avatar of emjx

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of emjx
emjx
Flag of United Kingdom of Great Britain and Northern Ireland 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
Avatar of emjx

ASKER

Really good solution, explains the neccessary fix.