In WiX you can register file types easily:
<ProgId Id="MyApp.File" Description="MyApp File" Icon="MyAppEXE" IconIndex="0">
<Extension Id="ext" ContentType="application/x-myapp-file">
<Verb Id="open" Command="&Open" TargetFile="MyAppEXE" Argument=""%1""/>
</Extension>
</ProgId>
What if I want to register an URL protocol, as specified here? Obviously, it has no extension so where would I put the Verb
tag? Or should I use another approach?
Thanks.
Just to add the code of the @Yan Sklyarenko's answer:
<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=""[INSTALLFOLDER]MyMainProgram.exe" "%1"" />
</RegistryKey>
</RegistryKey>
</Component>
MyMainProgram
is a reference to my main project in the wix setup projectprotocolname
is the name of the protocol used in the url: protocolname://
name of the protocol
is the formal name of the protocolI doubt there's an out-of-the-box feature for this in WiX (probably, in 3.6?), but as far as I can see by the link you provided, the process of registering a URL protocol is adding a bunch of entries to the system registry. Hence, you can add RegistryKey/RegistryValue elements manually to emulate this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With