File: WinShellExt.wxs.in

package info (click to toggle)
nextcloud-desktop 4.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,404 kB
  • sloc: cpp: 118,401; objc: 752; python: 606; sh: 395; ansic: 391; ruby: 174; makefile: 44; javascript: 32; xml: 6
file content (83 lines) | stat: -rw-r--r-- 5,250 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?xml version="1.0" encoding="utf-8"?>
<!--
  - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  - SPDX-License-Identifier: GPL-2.0-or-later
-->
<?include $(sys.CURRENTDIR)Platform.wxi?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>

        <!--
            IMPORTANT: Keep these constants in sync with WinShellExtConstants.h.in
        -->

        <!-- Context Menu -->
        <?define ContextMenuGuid        = "@WIN_SHELLEXT_CONTEXT_MENU_GUID@" ?>
        <?define ContextMenuRegKeyName  = "@APPLICATION_SHORTNAME@ContextMenuHandler" ?>

        <?define ContextMenuDescription = "@APPLICATION_SHORTNAME@ context menu handler" ?>

        <!-- Overlays -->
        <?define OverlayGuidError       = "@WIN_SHELLEXT_OVERLAY_GUID_ERROR@" ?>
        <?define OverlayGuidOK          = "@WIN_SHELLEXT_OVERLAY_GUID_OK@" ?>
        <?define OverlayGuidOKShared    = "@WIN_SHELLEXT_OVERLAY_GUID_OK_SHARED@" ?>
        <?define OverlayGuidSync        = "@WIN_SHELLEXT_OVERLAY_GUID_SYNC@" ?>
        <?define OverlayGuidWarning     = "@WIN_SHELLEXT_OVERLAY_GUID_WARNING@" ?>

        <!--
            Preceding spaces are intended, two spaces to put us ahead of the competition :/

            There is a limit in Windows (oh wonder^^) so that only the first 15 extensions get invoked, this is why to use that dirty little trick to get ahead ;)
            See: https://docs.microsoft.com/en-us/windows/win32/shell/context-menu-handlers?redirectedfrom=MSDN#employing-the-verb-selection-model
        -->
        <?define OverlayNameError       = "                @APPLICATION_SHORTNAME@Error" ?>
        <?define OverlayNameOK          = "                @APPLICATION_SHORTNAME@OK" ?>
        <?define OverlayNameOKShared    = "                @APPLICATION_SHORTNAME@OKShared" ?>
        <?define OverlayNameSync        = "                @APPLICATION_SHORTNAME@Sync" ?>
        <?define OverlayNameWarning     = "                @APPLICATION_SHORTNAME@Warning" ?>

        <?define OverlayDescription     = "@APPLICATION_SHORTNAME@ overlay handler" ?>

        <!--
            Integration for Windows Explorer

            Avoid SelfReg by the DLLs, see:
            https://stackoverflow.com/questions/364187/how-do-you-register-a-win32-com-dll-file-in-wix-3#364210
            https://docs.microsoft.com/en-us/windows/win32/msi/selfreg-table#remarks
        -->

        <DirectoryRef Id="ShellExtDir">
            <Component Id="NCContextMenu" Guid="*" Win64="$(var.PlatformWin64)">
                <File Id="NCContextMenu.dll" KeyPath="yes" Source="$(var.HarvestAppDir)\NCContextMenu.dll">
                    <Class Id="$(var.ContextMenuGuid)" Context="InprocServer32" Description="$(var.ContextMenuDescription)" ThreadingModel="apartment" />
                </File>
                <RegistryValue Root="HKCR" Key="CLSID\$(var.ContextMenuGuid)" Name="ContextMenuOptIn" Value="" Type="string" Action="write" />
                <RegistryValue Root="HKCR" Key="AllFileSystemObjects\shellex\ContextMenuHandlers\$(var.ContextMenuRegKeyName)" Value="$(var.ContextMenuGuid)" Type="string" Action="write" />
            </Component>

            <Component Id="NCOverlays" Guid="*" Win64="$(var.PlatformWin64)">
                <File Id="NCOverlays.dll" KeyPath="yes" Source="$(var.HarvestAppDir)\NCOverlays.dll">
                    <Class Id="$(var.OverlayGuidError)" Context="InprocServer32" Description="$(var.OverlayDescription)" ThreadingModel="apartment" Version="1.0" />
                    <Class Id="$(var.OverlayGuidOK)" Context="InprocServer32" Description="$(var.OverlayDescription)" ThreadingModel="apartment" Version="1.0" />
                    <Class Id="$(var.OverlayGuidOKShared)" Context="InprocServer32" Description="$(var.OverlayDescription)" ThreadingModel="apartment" Version="1.0" />
                    <Class Id="$(var.OverlayGuidSync)" Context="InprocServer32" Description="$(var.OverlayDescription)" ThreadingModel="apartment" Version="1.0" />
                    <Class Id="$(var.OverlayGuidWarning)" Context="InprocServer32" Description="$(var.OverlayDescription)" ThreadingModel="apartment" Version="1.0" />
                </File>
                <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers">
                    <RegistryValue Key="$(var.OverlayNameError)" Value="$(var.OverlayGuidError)" Type="string" Action="write" />
                    <RegistryValue Key="$(var.OverlayNameOK)" Value="$(var.OverlayGuidOK)" Type="string" Action="write" />
                    <RegistryValue Key="$(var.OverlayNameOKShared)" Value="$(var.OverlayGuidOKShared)" Type="string" Action="write" />
                    <RegistryValue Key="$(var.OverlayNameSync)" Value="$(var.OverlayGuidSync)" Type="string" Action="write" />
                    <RegistryValue Key="$(var.OverlayNameWarning)" Value="$(var.OverlayGuidWarning)" Type="string" Action="write" />
                </RegistryKey>
            </Component>
        </DirectoryRef>

        <ComponentGroup Id="ShellExtensions">
            <ComponentRef Id="NCContextMenu" />
            <ComponentRef Id="NCOverlays" />
        </ComponentGroup>

    </Fragment>
</Wix>