WIX: How to register an application in the URL protocol?

In WiX, you can easily register file types:

<ProgId Id="MyApp.File" Description="MyApp File" Icon="MyAppEXE" IconIndex="0"> <Extension Id="ext" ContentType="application/x-myapp-file"> <Verb Id="open" Command="&amp;Open" TargetFile="MyAppEXE" Argument="&quot;%1&quot;"/> </Extension> </ProgId> 

What if I want to register the URL protocol as indicated here ? Obviously it has no extension, and where would I put the Verb tag? Or should I use a different approach?

Thanks.

+7
source share
2 answers

I doubt that WiX has the ability to use this feature (perhaps in version 3.6?), But, as I understand it, the link you provided indicates that the URL protocol registration process adds a bunch of entries to the system registry. Therefore, you can add RegistryKey / RegistryValue elements manually to emulate this.

+3
source

Just add the response code @Yan Sklyarenko:

 <Component Id="ProductComponent" Guid="{206C911C-56EF-44B8-9257-5FD214427965}"> <File Source="$(var.MyMainProgram.TargetPath)" /> <RegistryKey Root="HKCR" Key="protocolname" Action="createAndRemoveOnUninstall"> <RegistryValue Type="string" Name="URL Protocol" Value=""/> <RegistryValue Type="string" Value="URL:name of the protocol"/> <RegistryKey Key="DefaultIcon"> <RegistryValue Type="string" Value="MyMainProgram.exe" /> </RegistryKey> <RegistryKey Key="shell\open\command"> <RegistryValue Type="string" Value="&quot;[INSTALLFOLDER]MyMainProgram.exe&quot; &quot;%1&quot;" /> </RegistryKey> </RegistryKey> </Component> 
  • MyMainProgram - link to my main project in wix installation project
  • protocolname is the name of the protocol used in URL: protocolname://
  • name of the protocol is the formal name of the protocol
+8
source

All Articles