<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
    xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension">
    <Product
        Id="*"
        Name="$(var.MyProductName) $(var.MyProductVersion)"
        Manufacturer="$(var.MyCompanyName)"
        Version="$(var.MyVersion)"
        Language="1033"
        UpgradeCode="82F812D9-4083-4EF1-8BC8-0F1EDA05B46B">

        <Package
            Description="$(var.MyProductName) - $(var.MyDescription)"
            InstallerVersion="200"
            Compressed="yes"
            InstallScope="perMachine" />
        <MajorUpgrade
            Disallow="yes"
            AllowDowngrades="no"
            AllowSameVersionUpgrades="no"
            DisallowUpgradeErrorMessage="An older version of $(var.MyProductName) is already installed. You must uninstall it before you can install this version."
            DowngradeErrorMessage="A newer version of $(var.MyProductName) is already installed." />
        <Media Id="1" Cabinet="WinFsp.cab" EmbedCab="yes" />

        <Property Id="P.LauncherName">$(var.MyProductName).Launcher</Property>
        <Property Id="P.LauncherRegistryKey">Software\$(var.MyProductName)\Services</Property>
        <Property Id="P.RegistryKey">Software\$(var.MyProductName)</Property>
        <Property Id="INSTALLDIR">
            <RegistrySearch
                Id="R.INSTALLDIR"
                Root="HKLM"
                Key="[P.RegistryKey]"
                Name="InstallDir"
                Type="raw" />
        </Property>

        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLDIR" Name="WinFsp">
                    <Directory Id="BINDIR" Name="bin" />
                    <Directory Id="INCDIR" Name="inc" />
                    <Directory Id="LIBDIR" Name="lib" />
                    <Directory Id="OPTDIR" Name="opt" />
                    <Directory Id="SMPDIR" Name="samples" />
                    <Directory Id="SYMDIR" Name="sym" />
                </Directory>
            </Directory>
        </Directory>

        <DirectoryRef Id="INSTALLDIR">
            <Component Id="C.INSTALLDIR" Guid="{F876F26E-5016-4AC6-93B3-653C0312A6CE}">
                <RegistryValue
                    Root="HKLM"
                    Key="[P.RegistryKey]"
                    Name="InstallDir"
                    Type="string"
                    Value="[INSTALLDIR]" />
                <dep:Provides Key="WinFsp" />
            </Component>
            <Component Id="C.License.txt">
                <File Name="License.txt" Source="..\..\..\License.txt" KeyPath="yes" />
            </Component>
        </DirectoryRef>
        <DirectoryRef Id="BINDIR" FileSource="..\build\$(var.Configuration)">
            <Component Id="C.winfsp_x64.sys">
                <File Name="winfsp-x64.sys" KeyPath="yes" />
            </Component>
            <Component Id="C.winfsp_x86.sys">
                <File Name="winfsp-x86.sys" KeyPath="yes" />
            </Component>

            <!-- On Win64 register winfsp-x64.dll -->
            <Component Id="C.winfsp_x64.dll.selfreg" Guid="F0A67746-1A9C-4976-8EC0-882E9407FA6D">
                <File Id="FILE.winfsp_x64.dll.selfreg" Name="winfsp-x64.dll" KeyPath="yes" SelfRegCost="1" />
                <Condition>VersionNT64</Condition>
            </Component>
            <Component Id="C.winfsp_x86.dll" Guid="950492FB-12F7-4E27-9124-8325A2BC9927">
                <File Name="winfsp-x86.dll" KeyPath="yes" />
                <Condition>VersionNT64</Condition>
            </Component>

            <!-- On Win32 register winfsp-x86.dll -->
            <Component Id="C.winfsp_x64.dll" Guid="4D6E7A8E-0CA6-49BE-B312-1EDADE725756">
                <File Name="winfsp-x64.dll" KeyPath="yes" />
                <Condition>NOT VersionNT64</Condition>
            </Component>
            <Component Id="C.winfsp_x86.dll.selfreg" Guid="F0DEF7A6-AF55-419F-A58A-DF4018C6FA73">
                <File Id="FILE.winfsp_x86.dll.selfreg" Name="winfsp-x86.dll" KeyPath="yes" SelfRegCost="1" />
                <Condition>NOT VersionNT64</Condition>
            </Component>

            <!-- install assembly -->
            <Component Id="C.winfsp_msil.dll" Guid="0D8BA6AE-9F87-402B-AE1A-95B0AE3BE179">
                <File Id="FILE.winfsp_msil.dll" Name="winfsp-msil.dll" KeyPath="yes" />
            </Component>
            <Component Id="C.winfsp_msil.xml" Guid="1657F707-C112-454C-91AE-0FDEBBF454AB">
                <File Id="FILE.winfsp_msil.xml" Name="winfsp-msil.xml" KeyPath="yes" />
            </Component>
            <!--
            <Component Id="C.winfsp_msil.dll.GAC" Guid="6469467D-8C90-4889-8138-4028F9DA6E85">
                <File Id="FILE.winfsp_msil.dll.GAC" Name="winfsp-msil.dll" KeyPath="yes" Assembly=".net" />
            </Component>
            <Component Id="C.policy.winfsp_msil.dll.GAC">
                <File Name="policy.1.0.winfsp-msil.dll" KeyPath="yes" Assembly=".net" />
                <File Name="policy.1.0.winfsp-msil.config" KeyPath="no" />
            </Component>
            -->

            <!-- On Win64 ServiceInstall launcher-x64.exe -->
            <Component Id="C.launcher_x64.exe.svcinst">
                <File Id="launcher_x64.exe.svcinst" Name="launcher-x64.exe" KeyPath="yes" />
                <ServiceInstall
                    Id="launcher_x64.exe.svcinst"
                    Name="[P.LauncherName]"
                    Description="$(var.MyDescription)"
                    Type="ownProcess"
                    Start="auto"
                    ErrorControl="ignore" />
                <ServiceControl
                    Id="launcher_x64.exe.svcinst"
                    Name="[P.LauncherName]"
                    Start="install"
                    Stop="both"
                    Remove="uninstall" />
                <Condition>VersionNT64</Condition>
            </Component>
            <Component Id="C.launcher_x86.exe">
                <File Name="launcher-x86.exe" KeyPath="yes" />
                <Condition>VersionNT64</Condition>
            </Component>

            <!-- On Win32 ServiceInstall launcher-x86.exe -->
            <Component Id="C.launcher_x64.exe" Guid="88CDBE92-8B67-485A-838F-FA4AD37F306F">
                <File Name="launcher-x64.exe" KeyPath="yes" />
                <Condition>NOT VersionNT64</Condition>
            </Component>
            <Component Id="C.launcher_x86.exe.svcinst" Guid="E995D906-0273-4758-9B26-99A3A8CD143A">
                <File Id="launcher_x86.exe.svcinst" Name="launcher-x86.exe" KeyPath="yes" />
                <ServiceInstall
                    Id="launcher_x86.exe.svcinst"
                    Name="[P.LauncherName]"
                    Description="$(var.MyDescription)"
                    Type="ownProcess"
                    Start="auto"
                    ErrorControl="ignore" />
                <ServiceControl
                    Id="launcher_x86.exe.svcinst"
                    Name="[P.LauncherName]"
                    Start="install"
                    Stop="both"
                    Remove="uninstall" />
                <Condition>NOT VersionNT64</Condition>
            </Component>

            <Component Id="C.launchctl_x64.exe" Guid="2753623B-66F1-4514-B9C7-F879178DFF49">
                <File Name="launchctl-x64.exe" KeyPath="yes" />
            </Component>
            <Component Id="C.launchctl_x86.exe" Guid="EBDEC4FB-07BB-47CA-BFFF-EB854CA2D22D">
                <File Name="launchctl-x86.exe" KeyPath="yes" />
            </Component>

            <Component Id="C.fsptool_x64.exe" Guid="013FE508-097D-4433-9C60-717F5446E7F4">
                <File Name="fsptool-x64.exe" KeyPath="yes" />
            </Component>
            <Component Id="C.fsptool_x86.exe" Guid="6C16DC2C-E12F-49FB-A665-3AF0475487AD">
                <File Name="fsptool-x86.exe" KeyPath="yes" />
            </Component>

            <Component Id="C.diag.bat">
                <File Name="diag.bat" Source="..\..\..\tools\diag.bat" KeyPath="yes" />
            </Component>
            <Component Id="C.fsreg.bat">
                <File Name="fsreg.bat" Source="..\..\..\tools\fsreg.bat" KeyPath="yes" />
            </Component>

            <Component Id="C.memfs_x64.exe">
                <File Name="memfs-x64.exe" KeyPath="yes" />
                <RegistryKey
                    Root="HKLM"
                    Key="[P.LauncherRegistryKey]">
                    <RegistryKey
                        Key="memfs64">
                        <RegistryValue
                            Type="string"
                            Name="Executable"
                            Value="[BINDIR]memfs-x64.exe" />
                        <RegistryValue
                            Type="string"
                            Name="CommandLine"
                            Value="-i -F NTFS -n 65536 -s 67108864 -u %1 -m %2" />
                        <RegistryValue
                            Type="string"
                            Name="Security"
                            Value="D:P(A;;RPWPLC;;;WD)" />
                        <RegistryValue
                            Type="integer"
                            Name="JobControl"
                            Value="1" />
                    </RegistryKey>
                </RegistryKey>
            </Component>
            <Component Id="C.memfs_x86.exe">
                <File Name="memfs-x86.exe" KeyPath="yes" />
                <RegistryKey
                    Root="HKLM"
                    Key="[P.LauncherRegistryKey]">
                    <RegistryKey
                        Key="memfs32">
                        <RegistryValue
                            Type="string"
                            Name="Executable"
                            Value="[BINDIR]memfs-x86.exe" />
                        <RegistryValue
                            Type="string"
                            Name="CommandLine"
                            Value="-i -F NTFS -n 65536 -s 67108864 -u %1 -m %2" />
                        <RegistryValue
                            Type="string"
                            Name="Security"
                            Value="D:P(A;;RPWPLC;;;WD)" />
                        <RegistryValue
                            Type="integer"
                            Name="JobControl"
                            Value="1" />
                    </RegistryKey>
                </RegistryKey>
            </Component>
            <Component Id="C.memfs_dotnet_msil.exe">
                <File Name="memfs-dotnet-msil.exe" KeyPath="yes" />
                <RegistryKey
                    Root="HKLM"
                    Key="[P.LauncherRegistryKey]">
                    <RegistryKey
                        Key="memfs-dotnet">
                        <RegistryValue
                            Type="string"
                            Name="Executable"
                            Value="[BINDIR]memfs-dotnet-msil.exe" />
                        <RegistryValue
                            Type="string"
                            Name="CommandLine"
                            Value="-i -F NTFS -n 65536 -s 67108864 -u %1 -m %2" />
                        <RegistryValue
                            Type="string"
                            Name="Security"
                            Value="D:P(A;;RPWPLC;;;WD)" />
                        <RegistryValue
                            Type="integer"
                            Name="JobControl"
                            Value="1" />
                    </RegistryKey>
                </RegistryKey>
            </Component>
        </DirectoryRef>
        <DirectoryRef Id="INCDIR" FileSource="..\..\..\inc">
            <Directory Id="INCDIR.winfsp" Name="winfsp">
                <Component Id="C.fsctl.h">
                    <File Name="fsctl.h" KeyPath="yes" />
                </Component>
                <Component Id="C.winfsp.h">
                    <File Name="winfsp.h" KeyPath="yes" />
                </Component>
                <Component Id="C.launch.h">
                    <File Name="launch.h" KeyPath="yes" />
                </Component>
                <!--Component Id="C.winfsp.hpp">
                    <File Name="winfsp.hpp" KeyPath="yes" />
                </Component-->
            </Directory>
            <Directory Id="INCDIR.fuse" Name="fuse">
                <Component Id="C.fuse.h">
                    <File Name="fuse.h" KeyPath="yes" />
                </Component>
                <Component Id="C.fuse_common.h">
                    <File Name="fuse_common.h" KeyPath="yes" />
                </Component>
                <Component Id="C.fuse_opt.h">
                    <File Name="fuse_opt.h" KeyPath="yes" />
                </Component>
                <Component Id="C.winfsp_fuse.h">
                    <File Name="winfsp_fuse.h" KeyPath="yes" />
                </Component>
            </Directory>
            <Directory Id="INCDIR.fuse3" Name="fuse3">
                <Component Id="C.fuse3.h">
                    <File Id="fuse3.h" Name="fuse.h" KeyPath="yes" />
                </Component>
                <Component Id="C.fuse3_common.h">
                    <File Id="fuse3_common.h" Name="fuse_common.h" KeyPath="yes" />
                </Component>
                <Component Id="C.fuse3_opt.h">
                    <File Id="fuse3_opt.h" Name="fuse_opt.h" KeyPath="yes" />
                </Component>
                <Component Id="C.winfsp_fuse3.h">
                    <File Id="winfsp_fuse3.h" Name="winfsp_fuse.h" KeyPath="yes" />
                </Component>
            </Directory>
        </DirectoryRef>
        <DirectoryRef Id="LIBDIR" FileSource="..\build\$(var.Configuration)">
            <Component Id="C.winfsp_x64.lib">
                <File Name="winfsp-x64.lib" KeyPath="yes" />
            </Component>
            <Component Id="C.winfsp_x86.lib">
                <File Name="winfsp-x86.lib" KeyPath="yes" />
            </Component>

            <!-- On Win64 copy fuse-x64.pc -->
            <Component Id="C.fuse_x64.pc" Guid="407395D2-D076-411E-B1D0-D97E21E11A3C">
                <File
                    Id="FILE.fuse_x64.pc"
                    Name="fuse.pc"
                    Source="..\build\$(var.Configuration)\fuse-x64.pc"
                    KeyPath="yes" />
                <Condition>VersionNT64</Condition>
            </Component>

            <!-- On Win32 copy fuse-x86.pc -->
            <Component Id="C.fuse_x86.pc" Guid="0568EBCB-782E-4C17-9B64-BAFCC43F64ED">
                <File
                    Id="FILE.fuse_x86.pc"
                    Name="fuse.pc"
                    Source="..\build\$(var.Configuration)\fuse-x86.pc"
                    KeyPath="yes" />
                <Condition>NOT VersionNT64</Condition>
            </Component>

            <!-- On Win64 copy fuse3-x64.pc -->
            <Component Id="C.fuse3_x64.pc" Guid="FE59E3BA-E5EA-4822-80B1-19A1DE6B62C7">
                <File
                    Id="FILE.fuse3_x64.pc"
                    Name="fuse3.pc"
                    Source="..\build\$(var.Configuration)\fuse3-x64.pc"
                    KeyPath="yes" />
                <Condition>VersionNT64</Condition>
            </Component>

            <!-- On Win32 copy fuse3-x86.pc -->
            <Component Id="C.fuse3_x86.pc" Guid="176205D0-07EA-4DFC-947F-18E89ABDAFAB">
                <File
                    Id="FILE.fuse3_x86.pc"
                    Name="fuse3.pc"
                    Source="..\build\$(var.Configuration)\fuse3-x86.pc"
                    KeyPath="yes" />
                <Condition>NOT VersionNT64</Condition>
            </Component>
        </DirectoryRef>
        <DirectoryRef Id="OPTDIR">
            <Directory Id="OPTDIR.cygfuse" Name="cygfuse" FileSource="..\..\..\opt\cygfuse\dist">
                <Directory Id="OPTDIR.cygfuse.x64" Name="x64">
                    <Component Id="C.fuse.tar.xz.x64">
                        <File Id="FILE.fuse.tar.xz.x64" Name="fuse-2.8-10.tar.xz" KeyPath="yes" />
                    </Component>
                    <Component Id="C.fuse3.tar.xz.x64">
                        <File Id="FILE.fuse3.tar.xz.x64" Name="fuse3-3.2-2.tar.xz" KeyPath="yes" />
                    </Component>
                </Directory>
                <Directory Id="OPTDIR.cygfuse.x86" Name="x86">
                    <Component Id="C.fuse.tar.xz.x86">
                        <File Id="FILE.fuse.tar.xz.x86" Name="fuse-2.8-10.tar.xz" KeyPath="yes" />
                    </Component>
                    <Component Id="C.fuse3.tar.xz.x86">
                        <File Id="FILE.fuse3.tar.xz.x86" Name="fuse3-3.2-2.tar.xz" KeyPath="yes" />
                    </Component>
                </Directory>
                <Component Id="C.fuse.install.sh">
                    <File Name="install.sh" KeyPath="yes" />
                </Component>
                <Component Id="C.fuse.uninstall.sh">
                    <File Name="uninstall.sh" KeyPath="yes" />
                </Component>
            </Directory>
        </DirectoryRef>
        <DirectoryRef Id="SMPDIR" FileSource="..\..\..\tst">
            <Directory Id="SMPDIR.memfs" Name="memfs">
                <Component Id="C.memfs.h">
                    <File Name="memfs.h" KeyPath="yes" />
                </Component>
                <Component Id="C.memfs.cpp">
                    <File Name="memfs.cpp" KeyPath="yes" />
                </Component>
                <Component Id="C.memfs_main.c">
                    <File Name="memfs-main.c" KeyPath="yes" />
                </Component>
            </Directory>
            <Directory Id="SMPDIR.memfs_dotnet" Name="memfs-dotnet">
                <Component Id="C.memfs_dotnet.Program.cs">
                    <File Id="FILE.memfs_dotnet.Program.cs" Name="Program.cs" KeyPath="yes" />
                </Component>
            </Directory>
            <Directory Id="SMPDIR.airfs" Name="airfs">
                <Component Id="C.airfs.cpp">
                    <File Name="airfs.cpp" KeyPath="yes" />
                </Component>
                <Component Id="C.airfs.sln">
                    <File Name="airfs.sln" KeyPath="yes" />
                </Component>
                <Component Id="C.airfs.vcxproj">
                    <File Name="airfs.vcxproj" KeyPath="yes" />
                </Component>
                <Component Id="C.airfs.vcxproj.filters">
                    <File Name="airfs.vcxproj.filters" KeyPath="yes" />
                </Component>
            </Directory>
            <Directory Id="SMPDIR.passthrough" Name="passthrough">
                <Component Id="C.passthrough.c">
                    <File Name="passthrough.c" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough.sln">
                    <File Name="passthrough.sln" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough.vcxproj">
                    <File Name="passthrough.vcxproj" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough.vcxproj.filters">
                    <File Name="passthrough.vcxproj.filters" KeyPath="yes" />
                </Component>
            </Directory>
            <!--Directory Id="SMPDIR.passthrough_cpp" Name="passthrough-cpp">
                <Component Id="C.passthrough_cpp.cpp">
                    <File Name="passthrough-cpp.cpp" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_cpp.sln">
                    <File Name="passthrough-cpp.sln" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_cpp.vcxproj">
                    <File Name="passthrough-cpp.vcxproj" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_cpp.vcxproj.filters">
                    <File Name="passthrough-cpp.vcxproj.filters" KeyPath="yes" />
                </Component>
            </Directory-->
            <Directory Id="SMPDIR.passthrough_fuse" Name="passthrough-fuse">
                <Component Id="C.passthrough_fuse.c">
                    <File Name="passthrough-fuse.c" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse.winposix.c">
                    <File Name="winposix.c" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse.winposix.h">
                    <File Name="winposix.h" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse.sln">
                    <File Name="passthrough-fuse.sln" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse.vcxproj">
                    <File Name="passthrough-fuse.vcxproj" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse.vcxproj.filters">
                    <File Name="passthrough-fuse.vcxproj.filters" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse.Makefile">
                    <File Name="Makefile" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse.README.md">
                    <File Name="README.md" KeyPath="yes" />
                </Component>
            </Directory>
            <Directory Id="SMPDIR.passthrough_fuse3" Name="passthrough-fuse3">
                <Component Id="C.passthrough_fuse3.c">
                    <File Name="passthrough-fuse3.c" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse3.winposix.c">
                    <File Id="F.passthrough_fuse3.winposix.c" Name="winposix.c" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse3.winposix.h">
                    <File Id="F.passthrough_fuse3.winposix.h" Name="winposix.h" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse3.sln">
                    <File Name="passthrough-fuse3.sln" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse3.vcxproj">
                    <File Name="passthrough-fuse3.vcxproj" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse3.vcxproj.filters">
                    <File Name="passthrough-fuse3.vcxproj.filters" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse3.Makefile">
                    <File Id="F.passthrough_fuse3.Makefile" Name="Makefile" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_fuse3.README.md">
                    <File Id="F.passthrough_fuse3.README.md" Name="README.md" KeyPath="yes" />
                </Component>
            </Directory>
            <Directory Id="SMPDIR.passthrough_dotnet" Name="passthrough-dotnet">
                <Component Id="C.passthrough_dotnet.Program.cs">
                    <File Id="FILE.passthrough_dotnet.Program.cs" Name="Program.cs" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_dotnet.sln">
                    <File Name="passthrough-dotnet.sln" KeyPath="yes" />
                </Component>
                <Component Id="C.passthrough_dotnet.csproj">
                    <File Name="passthrough-dotnet.csproj" KeyPath="yes" />
                </Component>
            </Directory>
        </DirectoryRef>
        <DirectoryRef Id="SYMDIR">
            <Component Id="C.winfsp_x64.sys.pdb">
                <File Name="winfsp-x64.sys.pdb" Source="..\build\$(var.Configuration)\winfsp-x64.sys.public.pdb" KeyPath="yes" />
            </Component>
            <Component Id="C.winfsp_x86.sys.pdb">
                <File Name="winfsp-x86.sys.pdb" Source="..\build\$(var.Configuration)\winfsp-x86.sys.public.pdb" KeyPath="yes" />
            </Component>
            <Component Id="C.winfsp_x64.dll.pdb">
                <File Name="winfsp-x64.dll.pdb" Source="..\build\$(var.Configuration)\winfsp-x64.dll.public.pdb" KeyPath="yes" />
            </Component>
            <Component Id="C.winfsp_x86.dll.pdb">
                <File Name="winfsp-x86.dll.pdb" Source="..\build\$(var.Configuration)\winfsp-x86.dll.public.pdb" KeyPath="yes" />
            </Component>
            <Component Id="C.launcher_x64.pdb">
                <File Name="launcher-x64.pdb" Source="..\build\$(var.Configuration)\launcher-x64.public.pdb" KeyPath="yes" />
            </Component>
            <Component Id="C.launcher_x86.pdb">
                <File Name="launcher-x86.pdb" Source="..\build\$(var.Configuration)\launcher-x86.public.pdb" KeyPath="yes" />
            </Component>
            <Component Id="C.launchctl_x64.pdb">
                <File Name="launchctl-x64.pdb" Source="..\build\$(var.Configuration)\launchctl-x64.public.pdb" KeyPath="yes" />
            </Component>
            <Component Id="C.launchctl_x86.pdb">
                <File Name="launchctl-x86.pdb" Source="..\build\$(var.Configuration)\launchctl-x86.public.pdb" KeyPath="yes" />
            </Component>
            <Component Id="C.fsptool_x64.pdb">
                <File Name="fsptool-x64.pdb" Source="..\build\$(var.Configuration)\fsptool-x64.public.pdb" KeyPath="yes" />
            </Component>
            <Component Id="C.fsptool_x86.pdb">
                <File Name="fsptool-x86.pdb" Source="..\build\$(var.Configuration)\fsptool-x86.public.pdb" KeyPath="yes" />
            </Component>
            <Component Id="C.memfs_x64.pdb">
                <File Name="memfs-x64.pdb" Source="..\build\$(var.Configuration)\memfs-x64.public.pdb" KeyPath="yes" />
            </Component>
            <Component Id="C.memfs_x86.pdb">
                <File Name="memfs-x86.pdb" Source="..\build\$(var.Configuration)\memfs-x86.public.pdb" KeyPath="yes" />
            </Component>
        </DirectoryRef>

        <ComponentGroup Id="C.WinFsp.bin">
            <ComponentRef Id="C.winfsp_x64.sys" />
            <ComponentRef Id="C.winfsp_x86.sys" />
            <ComponentRef Id="C.winfsp_x64.dll.selfreg" />
            <ComponentRef Id="C.winfsp_x86.dll" />
            <ComponentRef Id="C.winfsp_x64.dll" />
            <ComponentRef Id="C.winfsp_x86.dll.selfreg" />
            <ComponentRef Id="C.launcher_x64.exe.svcinst" />
            <ComponentRef Id="C.launcher_x86.exe" />
            <ComponentRef Id="C.launcher_x64.exe" />
            <ComponentRef Id="C.launcher_x86.exe.svcinst" />
            <ComponentRef Id="C.launchctl_x64.exe" />
            <ComponentRef Id="C.launchctl_x86.exe" />
            <ComponentRef Id="C.fsptool_x64.exe" />
            <ComponentRef Id="C.fsptool_x86.exe" />
            <ComponentRef Id="C.diag.bat" />
            <ComponentRef Id="C.fsreg.bat" />
        </ComponentGroup>
        <ComponentGroup Id="C.WinFsp.inc">
            <ComponentRef Id="C.fsctl.h" />
            <ComponentRef Id="C.winfsp.h" />
            <ComponentRef Id="C.launch.h" />
            <!--ComponentRef Id="C.winfsp.hpp" /-->
            <ComponentRef Id="C.fuse.h" />
            <ComponentRef Id="C.fuse_common.h" />
            <ComponentRef Id="C.fuse_opt.h" />
            <ComponentRef Id="C.winfsp_fuse.h" />
            <ComponentRef Id="C.fuse3.h" />
            <ComponentRef Id="C.fuse3_common.h" />
            <ComponentRef Id="C.fuse3_opt.h" />
            <ComponentRef Id="C.winfsp_fuse3.h" />
        </ComponentGroup>
        <ComponentGroup Id="C.WinFsp.lib">
            <ComponentRef Id="C.winfsp_x64.lib" />
            <ComponentRef Id="C.winfsp_x86.lib" />
            <ComponentRef Id="C.fuse_x64.pc" />
            <ComponentRef Id="C.fuse_x86.pc" />
            <ComponentRef Id="C.fuse3_x64.pc" />
            <ComponentRef Id="C.fuse3_x86.pc" />
        </ComponentGroup>
        <ComponentGroup Id="C.WinFsp.opt.fuse">
            <ComponentRef Id="C.fuse.tar.xz.x64" />
            <ComponentRef Id="C.fuse.tar.xz.x86" />
            <ComponentRef Id="C.fuse3.tar.xz.x64" />
            <ComponentRef Id="C.fuse3.tar.xz.x86" />
            <ComponentRef Id="C.fuse.install.sh" />
            <ComponentRef Id="C.fuse.uninstall.sh" />
        </ComponentGroup>
        <ComponentGroup Id="C.WinFsp.smp">
            <ComponentRef Id="C.memfs_x64.exe" />
            <ComponentRef Id="C.memfs_x86.exe" />
            <ComponentRef Id="C.memfs.h" />
            <ComponentRef Id="C.memfs.cpp" />
            <ComponentRef Id="C.memfs_main.c" />
            <ComponentRef Id="C.airfs.cpp" />
            <ComponentRef Id="C.airfs.sln" />
            <ComponentRef Id="C.airfs.vcxproj" />
            <ComponentRef Id="C.airfs.vcxproj.filters" />
            <ComponentRef Id="C.passthrough.c" />
            <ComponentRef Id="C.passthrough.sln" />
            <ComponentRef Id="C.passthrough.vcxproj" />
            <ComponentRef Id="C.passthrough.vcxproj.filters" />
            <!--ComponentRef Id="C.passthrough_cpp.cpp" /-->
            <!--ComponentRef Id="C.passthrough_cpp.sln" /-->
            <!--ComponentRef Id="C.passthrough_cpp.vcxproj" /-->
            <!--ComponentRef Id="C.passthrough_cpp.vcxproj.filters" /-->
            <ComponentRef Id="C.passthrough_fuse.c" />
            <ComponentRef Id="C.passthrough_fuse.winposix.c" />
            <ComponentRef Id="C.passthrough_fuse.winposix.h" />
            <ComponentRef Id="C.passthrough_fuse.sln" />
            <ComponentRef Id="C.passthrough_fuse.vcxproj" />
            <ComponentRef Id="C.passthrough_fuse.vcxproj.filters" />
            <ComponentRef Id="C.passthrough_fuse.Makefile" />
            <ComponentRef Id="C.passthrough_fuse.README.md" />
            <ComponentRef Id="C.passthrough_fuse3.c" />
            <ComponentRef Id="C.passthrough_fuse3.winposix.c" />
            <ComponentRef Id="C.passthrough_fuse3.winposix.h" />
            <ComponentRef Id="C.passthrough_fuse3.sln" />
            <ComponentRef Id="C.passthrough_fuse3.vcxproj" />
            <ComponentRef Id="C.passthrough_fuse3.vcxproj.filters" />
            <ComponentRef Id="C.passthrough_fuse3.Makefile" />
            <ComponentRef Id="C.passthrough_fuse3.README.md" />
        </ComponentGroup>
        <ComponentGroup Id="C.WinFsp.sym">
            <ComponentRef Id="C.winfsp_x64.sys.pdb" />
            <ComponentRef Id="C.winfsp_x86.sys.pdb" />
            <ComponentRef Id="C.winfsp_x86.dll.pdb" />
            <ComponentRef Id="C.winfsp_x64.dll.pdb" />
            <ComponentRef Id="C.launcher_x86.pdb" />
            <ComponentRef Id="C.launcher_x64.pdb" />
            <ComponentRef Id="C.launchctl_x64.pdb" />
            <ComponentRef Id="C.launchctl_x86.pdb" />
            <ComponentRef Id="C.fsptool_x64.pdb" />
            <ComponentRef Id="C.fsptool_x86.pdb" />
            <ComponentRef Id="C.memfs_x64.pdb" />
            <ComponentRef Id="C.memfs_x86.pdb" />
        </ComponentGroup>
        <ComponentGroup Id="C.WinFsp.net">
            <ComponentRef Id="C.winfsp_msil.dll" />
            <ComponentRef Id="C.winfsp_msil.xml" />
            <!--
            <ComponentRef Id="C.winfsp_msil.dll.GAC" />
            <ComponentRef Id="C.policy.winfsp_msil.dll.GAC" />
            -->
        </ComponentGroup>
        <ComponentGroup Id="C.WinFsp.smp.net">
            <ComponentRef Id="C.memfs_dotnet_msil.exe" />
            <ComponentRef Id="C.memfs_dotnet.Program.cs" />
            <ComponentRef Id="C.passthrough_dotnet.Program.cs" />
            <ComponentRef Id="C.passthrough_dotnet.sln" />
            <ComponentRef Id="C.passthrough_dotnet.csproj" />
        </ComponentGroup>

        <Feature
            Id="F.Main"
            Level="1"
            Title="$(var.MyProductName) $(var.MyProductVersion)"
            Description="$(var.MyDescription)"
            Display="expand"
            ConfigurableDirectory="INSTALLDIR"
            AllowAdvertise="no"
            InstallDefault="local"
            Absent="disallow">
            <ComponentRef Id="C.INSTALLDIR" />
            <ComponentRef Id="C.License.txt" />
            <Feature
                Id="F.User"
                Level="1"
                Title="Core"
                Description="The core $(var.MyProductName) files."
                AllowAdvertise="no"
                InstallDefault="local"
                Absent="disallow">
                <ComponentGroupRef Id="C.WinFsp.bin" />
                <ComponentGroupRef Id="C.WinFsp.net" />
            </Feature>
            <!--
            <Feature
                Id="F.Net"
                Level="10"
                Title=".NET"
                Description="The managed $(var.MyProductName) files."
                AllowAdvertise="no"
                InstallDefault="local"
                Absent="allow">
                <ComponentGroupRef Id="C.WinFsp.net" />
            </Feature>
            -->
            <Feature
                Id="F.Developer"
                Level="1000"
                Title="Developer"
                Description="Additional files needed for development."
                AllowAdvertise="no"
                InstallDefault="local"
                Absent="allow">
                <ComponentGroupRef Id="C.WinFsp.inc" />
                <ComponentGroupRef Id="C.WinFsp.lib" />
                <ComponentGroupRef Id="C.WinFsp.smp" />
                <ComponentGroupRef Id="C.WinFsp.smp.net" />
                <ComponentGroupRef Id="C.WinFsp.sym" />
            </Feature>
            <Feature
                Id="F.Cygfuse"
                Level="1000"
                Title="FUSE for Cygwin"
                Description="From a Cygwin prompt change to &lt;InstallDir&gt;/opt/cygfuse and run install.sh."
                AllowAdvertise="no"
                InstallDefault="local"
                Absent="allow">
                <ComponentGroupRef Id="C.WinFsp.opt.fuse" />
            </Feature>
        </Feature>

        <WixVariable Id="WixUIBannerBmp" Value="wixbanner.bmp" />
        <WixVariable Id="WixUIDialogBmp" Value="wixdialog-$(var.MyProductStage).bmp" />
        <UI Id="FeatureTree">
            <UIRef Id="WixUI_FeatureTree" />
            <!-- skip the license agreement dialog; higher Order takes priority (weird) -->
            <Publish
                Dialog="WelcomeDlg"
                Control="Next"
                Event="NewDialog"
                Value="CustomizeDlg"
                Order="10">NOT Installed</Publish>
            <Publish
                Dialog="CustomizeDlg"
                Control="Back"
                Event="NewDialog"
                Value="WelcomeDlg"
                Order="10">NOT Installed</Publish>
        </UI>

        <Binary Id="CustomActions" SourceFile="..\build\$(var.Configuration)\CustomActions.dll" />
        <CustomAction
            Id="Params.ServiceRunning"
            Property="ServiceRunning"
            Value="$(var.MyProductName)" />
        <CustomAction
            Id="Action.ServiceRunning"
            BinaryKey="CustomActions"
            DllEntry="ServiceRunning"
            Execute="immediate"
            Return="ignore" />
        <CustomAction
            Id="Action.ServiceRunning.Error"
            Error="The $(var.MyProductName) service appears to be running. If you just uninstalled $(var.MyProductName) please restart your computer. If you are running a development version of $(var.MyProductName) please remove it before proceeding." />
        <InstallExecuteSequence>
            <Custom Action="Params.ServiceRunning" Before="Action.ServiceRunning" />
            <Custom Action="Action.ServiceRunning" Before="LaunchConditions" />
            <Custom Action="Action.ServiceRunning.Error" After="Action.ServiceRunning">
                <![CDATA[NOT Installed AND (0 <> ServiceRunning)]]>
            </Custom>
            <ScheduleReboot After="RemoveFiles">
                <![CDATA[(REMOVE ~= "ALL") AND (0 <> ServiceRunning)]]>
            </ScheduleReboot>
        </InstallExecuteSequence>
    </Product>
</Wix>