<?xml version="1.0" encoding="utf-8"?>
<Package
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
  xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
  xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
  xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4"
  xmlns:desktop2="http://schemas.microsoft.com/appx/manifest/desktop/windows10/2"
  xmlns:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6"
  xmlns:virtualization="http://schemas.microsoft.com/appx/manifest/virtualization/windows10"
  IgnorableNamespaces="uap uap3 uap4 desktop2 desktop6 virtualization">
  <Identity
    Name="<%= identityName %>"
    ProcessorArchitecture="<%= architecture %>"
    Publisher="<%= publisher %>"
    Version="<%= appVersion %>" />

  <Properties>
    <DisplayName><%= displayName %></DisplayName>
    <PublisherDisplayName>Anthropic, PBC</PublisherDisplayName>
    <Logo>assets\icon.png</Logo>

    <desktop6:RegistryWriteVirtualization>disabled</desktop6:RegistryWriteVirtualization>
    <virtualization:RegistryWriteVirtualization>
      <virtualization:ExcludedKeys>
        <!-- Browser extension native messaging hosts -->
        <virtualization:ExcludedKey>HKEY_CURRENT_USER\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.anthropic.claude_browser_extension</virtualization:ExcludedKey>
        <virtualization:ExcludedKey>HKEY_CURRENT_USER\SOFTWARE\BraveSoftware\Brave-Browser\NativeMessagingHosts\com.anthropic.claude_browser_extension</virtualization:ExcludedKey>
        <virtualization:ExcludedKey>HKEY_CURRENT_USER\SOFTWARE\Microsoft\Edge\NativeMessagingHosts\com.anthropic.claude_browser_extension</virtualization:ExcludedKey>
        <virtualization:ExcludedKey>HKEY_CURRENT_USER\SOFTWARE\Chromium\NativeMessagingHosts\com.anthropic.claude_browser_extension</virtualization:ExcludedKey>
        <virtualization:ExcludedKey>HKEY_CURRENT_USER\SOFTWARE\ArcBrowser\Arc\NativeMessagingHosts\com.anthropic.claude_browser_extension</virtualization:ExcludedKey>
        <virtualization:ExcludedKey>HKEY_CURRENT_USER\SOFTWARE\Vivaldi\NativeMessagingHosts\com.anthropic.claude_browser_extension</virtualization:ExcludedKey>
        <virtualization:ExcludedKey>HKEY_CURRENT_USER\SOFTWARE\Opera Software\Opera Stable\NativeMessagingHosts\com.anthropic.claude_browser_extension</virtualization:ExcludedKey>
        <!-- Office add-in trusted catalog -->
        <virtualization:ExcludedKey>HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\WEF\TrustedCatalogs</virtualization:ExcludedKey>
      </virtualization:ExcludedKeys>
    </virtualization:RegistryWriteVirtualization>

    <!-- Filesystem writes to sideload Office add-in manifest -->
    <virtualization:FileSystemWriteVirtualization>
      <virtualization:ExcludedDirectories>
        <virtualization:ExcludedDirectory>$(KnownFolder:LocalAppData)\Microsoft\Office\16.0\WEF</virtualization:ExcludedDirectory>
        <!-- 3P userData lives in LocalAppData; exclude so devirtualizeMsixPath/showItemInFolder see the real path -->
        <virtualization:ExcludedDirectory>$(KnownFolder:LocalAppData)\Claude-3p</virtualization:ExcludedDirectory>
      </virtualization:ExcludedDirectories>
    </virtualization:FileSystemWriteVirtualization>
  </Properties>

  <Resources>
    <Resource Language="en-US" />
    <Resource Language="de-DE" />
    <Resource Language="es-ES" />
    <Resource Language="es-419" />
    <Resource Language="fr-FR" />
    <Resource Language="hi-IN" />
    <Resource Language="id-ID" />
    <Resource Language="it-IT" />
    <Resource Language="ja-JP" />
    <Resource Language="ko-KR" />
    <Resource Language="pt-BR" />
    <Resource uap:Scale="200" />
  </Resources>

  <Dependencies>
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.18362.0" MaxVersionTested="10.0.22621.0" />
  </Dependencies>

  <Capabilities>
    <rescap:Capability Name="runFullTrust" />
    <rescap:Capability Name="localSystemServices" />
    <rescap:Capability Name="packagedServices" />
    <rescap:Capability Name="unvirtualizedResources" />
    <Capability Name="internetClient" />
  </Capabilities>

  <Applications>
    <Application Id="Claude" Executable="app\Claude.exe" EntryPoint="Windows.FullTrustApplication">
      <uap:VisualElements
          DisplayName="<%= displayName %>"
          Description="Desktop application for Claude.ai"
          Square44x44Logo="Assets\Square44x44Logo.png"
          Square150x150Logo="Assets\Square150x150Logo.png"
          BackgroundColor="transparent">

        <uap:DefaultTile
          Wide310x150Logo="Assets\Wide310x150Logo.scale-200.png"
          Square71x71Logo="Assets\Square44x44Logo.targetsize-24_altform-unplated.png"
          Square310x310Logo="Assets\Square150x150Logo.png">
          <uap:ShowNameOnTiles>
            <uap:ShowOn Tile="square150x150Logo"/>
          </uap:ShowNameOnTiles>
        </uap:DefaultTile>
      </uap:VisualElements>

      <Extensions>
        <desktop:Extension
          Category="windows.startupTask"
          Executable="app\Claude.exe"
          EntryPoint="Windows.FullTrustApplication">
          <desktop:StartupTask TaskId="ClaudeStartup" Enabled="false" DisplayName="<%= displayName %>" />
        </desktop:Extension>
        <uap3:Extension Category="windows.protocol">
          <uap3:Protocol Name="claude" Parameters="&quot;%1&quot;" />
        </uap3:Extension>
        <desktop6:Extension
          Category="windows.service"
          Executable="app\resources\cowork-svc.exe"
          EntryPoint="Windows.FullTrustApplication">
          <desktop6:Service
            Name="<%= coworkServiceName %>"
            StartupType="auto"
            StartAccount="localSystem">
            <desktop6:TriggerEvents>
              <desktop6:TriggerCustom
                Action="ActionStart"
                Subtype="1f81d131-3e60-4c76-9860-37334e4ffce3">
                <desktop6:StringData>
                  <desktop6:DataItem Value="<%= coworkPipeTrigger %>" />
                </desktop6:StringData>
              </desktop6:TriggerCustom>
            </desktop6:TriggerEvents>
          </desktop6:Service>
        </desktop6:Extension>

      </Extensions>
    </Application>
  </Applications>
  <Extensions>
    <desktop2:Extension Category="windows.firewallRules">
      <desktop2:FirewallRules Executable="app\Claude.exe">
        <desktop2:Rule Direction="in" IPProtocol="TCP" Profile="all"/>
        <desktop2:Rule Direction="out" IPProtocol="TCP" Profile="all"/>
      </desktop2:FirewallRules>
    </desktop2:Extension>

    <desktop2:Extension Category="windows.firewallRules">
      <desktop2:FirewallRules Executable="app\resources\cowork-svc.exe">
        <desktop2:Rule Direction="in" IPProtocol="TCP" Profile="all"/>
        <desktop2:Rule Direction="out" IPProtocol="TCP" Profile="all"/>
      </desktop2:FirewallRules>
    </desktop2:Extension>
  </Extensions>
</Package>
