Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno Setup Registry entry for custom URL protocol

I'm hoping someone can help me translate the following into a correctly formatted InnoSetup [Registry] entry to use in my InnoSetup Installer? The goal here is to create a new custom URL protocol on the user's machine.

HKEY_CLASSES_ROOT      
       ctp
          (Default) = "URL:Alert Protocol"
          URL Protocol = ""
          DefaultIcon
               (Default) = "myapp.exe"
          shell
               open
                    command
                         (Default) = "C:\Program Files\MyApp\myapp.exe"

I read through the InnoSetup Help doc but couldn't figure out how to translate the above into a proper InnoSetup Registry section:

[Registry]
Root: HKCR; Subkey: ".....etc.

The final result after the installer runs is that the user clicks on a link on a web site formatted as "ctp://myapp.exe" and that local app will launch on the user's machine. Am I approaching this correctly? Thanks very much for any responses.

like image 611
Tim Avatar asked Nov 26 '12 14:11

Tim


1 Answers

Try it this way:

[Registry]
Root: HKCR; Subkey: "ctp"; ValueType: "string"; ValueData: "URL:Custom Protocol"; Flags: uninsdeletekey
Root: HKCR; Subkey: "ctp"; ValueType: "string"; ValueName: "URL Protocol"; ValueData: ""
Root: HKCR; Subkey: "ctp\DefaultIcon"; ValueType: "string"; ValueData: "{app}\YourApp.exe,0"
Root: HKCR; Subkey: "ctp\shell\open\command"; ValueType: "string"; ValueData: """{app}\YourApp.exe"" ""%1"""
like image 167
TLama Avatar answered Sep 27 '22 19:09

TLama