Skip to content

Commit

Permalink
build(cpack/wix): fix protocol handler registration
Browse files Browse the repository at this point in the history
Fixes #923.
  • Loading branch information
trollixx committed Jul 22, 2024
1 parent d014f21 commit b9a25f2
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions pkg/wix/template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,35 @@
<?include "product_fragment.wxi"?>

<!-- Dash protocol handlers. -->
<Feature Id="Protocol" Title="Plugin Support" Level="1"
Description="Provides dash:// and dash-plugin:// protocol handlers.">
<Component Id="ProtocolHandlers" Directory="TARGETDIR">
<?foreach UrlScheme in dash;dash-plugin ?>
<RegistryKey Root="HKMU" Key="Software\Classes\$(var.UrlScheme)">
<RegistryValue Type="string" Value="URL: Dash Plugin Protocol (Zeal)" />
<RegistryValue Name="URL Protocol" Type="string" Value="" />

<RegistryKey Key="DefaultIcon">
<RegistryValue Type="string" Value="&quot;[CM_FP_zeal.exe],1&quot;" />
</RegistryKey>

<RegistryKey Key="shell\open\command">
<RegistryValue Type="string" Value="&quot;[CM_FP_zeal.exe]&quot; &quot;%1&quot;" />
</RegistryKey>
<Component Id="ProtocolHandlers" Directory="INSTALL_ROOT">
<?foreach UrlScheme in dash;dash-plugin ?>
<!-- Remove broken HKCU keys. -->
<RemoveRegistryKey Action="removeOnInstall" Root="HKCU" Key="Software\Classes\$(var.UrlScheme)" />

<RegistryKey Root="HKLM" Key="Software\Classes\$(var.UrlScheme)">
<RegistryValue Type="string" Value="URL:Dash Plugin Protocol (Zeal)" />
<RegistryValue Name="URL Protocol" Type="string" Value="" />

<RegistryKey Key="DefaultIcon">
<RegistryValue Type="string" Value="&quot;[#CM_FP_zeal.exe],1&quot;" />
</RegistryKey>

<RegistryKey Key="shell\open\command">
<RegistryValue Type="string" Value="&quot;[#CM_FP_zeal.exe]&quot; &quot;%1&quot;" />
</RegistryKey>
<?endforeach ?>
</Component>
</Feature>
</RegistryKey>
<?endforeach ?>
</Component>

<!-- Custom properties to control installation options -->
<Property Id="LAUNCHAPPONEXIT" Value="1" Secure="yes"/>

<!-- Set properties based on existing conditions, prevents changing state on upgrade. -->
<SetProperty Id="LicenseAccepted" After="AppSearch" Value="1">WIX_UPGRADE_DETECTED</SetProperty>

<FeatureRef Id="ProductFeature"/>
<FeatureRef Id="ProductFeature">
<ComponentRef Id="ProtocolHandlers" />
</FeatureRef>

<!-- Action to launch application after installer exits. -->
<Property Id="WixShellExecTarget" Value="[#CM_FP_zeal.exe]"/>
Expand Down

0 comments on commit b9a25f2

Please sign in to comment.