<?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 PowerRenameAssetsFiles=?>
  <?define PowerRenameAssetsFilesPath=$(var.BinDir)WinUI3Apps\Assets\PowerRename\?>

  <Fragment>
    <DirectoryRef Id="WinUI3AppsAssetsFolder">
      <Directory Id="PowerRenameAssetsFolder" Name="PowerRename" />
    </DirectoryRef>
    <DirectoryRef Id="PowerRenameAssetsFolder" FileSource="$(var.PowerRenameAssetsFilesPath)">
    <!-- Generated by generateFileComponents.ps1 -->
    <!--PowerRenameAssetsFiles_Component_Def-->
      <!-- !Warning! Make sure to change Component Guid if you update something here -->
      <Component Id="Module_PowerRename" Guid="40D43079-240E-402D-8CE8-571BFFA71175" Win64="yes">
        <RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\CLSID\{0440049F-D1DC-4E46-B27B-98393D79486B}">
          <RegistryValue Type="string" Value="PowerRename Shell Extension" />
          <RegistryValue Type="string" Name="ContextMenuOptIn" Value="" />
          <RegistryValue Type="string" Key="InprocServer32" Value="[WinUI3AppsInstallFolder]PowerToys.PowerRenameExt.dll" />
          <RegistryValue Type="string" Key="InprocServer32" Name="ThreadingModel" Value="Apartment" />
        </RegistryKey>
        <RegistryKey Root="$(var.RegistryScope)" Key="SOFTWARE\Classes\AllFileSystemObjects\ShellEx\ContextMenuHandlers\PowerRenameExt">
          <RegistryValue Type="string" Value="{0440049F-D1DC-4E46-B27B-98393D79486B}"/>
        </RegistryKey>
        <RegistryKey Root="$(var.RegistryScope)" Key="SOFTWARE\Classes\Directory\background\ShellEx\ContextMenuHandlers\PowerRenameExt">
          <RegistryValue Type="string" Value="{0440049F-D1DC-4E46-B27B-98393D79486B}"/>
        </RegistryKey>

      </Component>
    </DirectoryRef>

    <ComponentGroup Id="PowerRenameComponentGroup">
      <Component Id="RemovePowerRenameFolder" Guid="2028549B-02E3-4D80-BC3F-59AEA37AC73D" Directory="PowerRenameAssetsFolder" >
        <RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
          <RegistryValue Type="string" Name="RemovePowerRenameFolder" Value="" KeyPath="yes"/>
        </RegistryKey>
        <RemoveFolder Id="RemoveFolderPowerRenameAssetsFolder" Directory="PowerRenameAssetsFolder" On="uninstall"/>
      </Component>
      <ComponentRef Id="Module_PowerRename" />
    </ComponentGroup>

  </Fragment>
</Wix>
