<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" >

  <?include $(sys.CURRENTDIR)\Common.wxi?>

  <?define FileLocksmithAssetsFiles=?>
  <?define FileLocksmithAssetsFilesPath=$(var.BinDir)WinUI3Apps\Assets\FileLocksmith\?>

  <Fragment>
    <DirectoryRef Id="WinUI3AppsAssetsFolder">
      <Directory Id="FileLocksmithAssetsInstallFolder" Name="FileLocksmith" />
    </DirectoryRef>
    <DirectoryRef Id="FileLocksmithAssetsInstallFolder" FileSource="$(var.FileLocksmithAssetsFilesPath)">
    <!-- Generated by generateFileComponents.ps1 -->
    <!--FileLocksmithAssetsFiles_Component_Def-->
      <!-- !Warning! Make sure to change Component Guid if you update something here -->
      <Component Id="Module_FileLocksmith" Guid="108D3EC1-E6E0-4E81-88EF-25966133CB41" Win64="yes">
        <RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\CLSID\{84D68575-E186-46AD-B0CB-BAEB45EE29C0}">
          <RegistryValue Type="string" Value="File Locksmith Shell Extension" />
          <RegistryValue Type="string" Name="ContextMenuOptIn" Value="" />
          <RegistryValue Type="string" Key="InprocServer32" Value="[WinUI3AppsInstallFolder]PowerToys.FileLocksmithExt.dll" />
          <RegistryValue Type="string" Key="InprocServer32" Name="ThreadingModel" Value="Apartment" />
        </RegistryKey>
        <RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\AllFileSystemObjects\ShellEx\ContextMenuHandlers\FileLocksmithExt">
          <RegistryValue Type="string" Value="{84D68575-E186-46AD-B0CB-BAEB45EE29C0}"/>
        </RegistryKey>
        <RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\Drive\ShellEx\ContextMenuHandlers\FileLocksmithExt">
          <RegistryValue Type="string" Value="{84D68575-E186-46AD-B0CB-BAEB45EE29C0}"/>
        </RegistryKey>
      </Component>
    </DirectoryRef>

    <ComponentGroup Id="FileLocksmithComponentGroup">
      <Component Id="RemoveFileLocksmithFolder" Guid="1DAC9A3F-D89C-4730-BF57-1778E011709B" Directory="FileLocksmithAssetsInstallFolder" >
        <RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
          <RegistryValue Type="string" Name="RemoveFileLocksmithFolder" Value="" KeyPath="yes"/>
        </RegistryKey>
        <RemoveFolder Id="RemoveFolderFileLocksmithAssetsFolder" Directory="FileLocksmithAssetsInstallFolder" On="uninstall"/>
      </Component>
      <ComponentRef Id="Module_FileLocksmith" />
    </ComponentGroup>

  </Fragment>
</Wix>
