<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<assembly
    xmlns="urn:schemas-microsoft-com:asm.v3"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    manifestVersion="1.0"
    >
  <assemblyIdentity
      language="neutral"
      name="Microsoft-Windows-IE-AdminKitBranding"
      processorArchitecture="*"
      publicKeyToken=""
      version="0.0.0.0"
      versionScope="nonSxS"
      />
  <migration
      scope="Upgrade"
      settingsVersion="0"
      replacementSettingsVersionRange="0"
      replacementVersionRange="7.0-8.0.7118"
      alwaysProcess="yes"
      >
    <migXml xmlns="">
      <environment>
        <variable name="IEAK.BrandGUID">
          <script>MigXmlHelper.GetStringContent("Registry","HKLM\SOFTWARE\Microsoft\Internet Explorer [BrandGUID]")</script>
        </variable>
      </environment>
      <rules context="User">
        <include>
          <objectSet>
            <!-- On upgrades, include the user OEM branding active setup stub so we won't re-apply branding.
                 If we've previously applied OEM branding (via unattend and SIGNUP\install.ins) we don't want to
                 re-apply when the user is doing an OS upgrade because it will stomp user customizations.
                 See iedkcs32!BrandIEActiveSetup (brandll/exports.cpp) for the condition that allows non-default branding to be applied. -->
            <pattern type="Registry">HKCU\SOFTWARE\Microsoft\Active Setup\Installed Components\&gt;{60B49E34-C7CC-11D0-8953-00A0C90347FF}\* [*]</pattern>
            <!-- On a 64-bit OS for 32-bit stubs, Active Setup writes to HKCU\Software\Wow6432Node\Microsoft\Active Setup\Installed Components
                 when a component stub has finished running. Since this isn't actually a redirected key, we'll have to copy
                 it as well, if it exists, to prevent the 32-bit stub from applying the ins file, similar to above -->
            <pattern type="Registry">HKCU\SOFTWARE\Wow6432Node\Microsoft\Active Setup\Installed Components\&gt;{60B49E34-C7CC-11D0-8953-00A0C90347FF}\* [*]</pattern>
          </objectSet>
        </include>
      </rules>
      <rules context="User">
        <detects>
          <detect>
            <condition>MigXmlHelper.DoesObjectExist("Registry", "HKLM\SOFTWARE\Microsoft\Internet Explorer [BrandGUID]")</condition>
          </detect>
        </detects>
        <include>
          <objectSet>
            <!-- On upgrades, include the USER branding active setup stub so we won't re-run branding
                 If we've previously applied IEAK branding (via {CUSTOM,SIGNUP}\install.ins) we don't want to
                 re-apply when the user is doing an OS upgrade because it will stomp user customizations.
                 Since the Active Setup stubs that IEAK uses to apply branding have no version,
                 copying this key will cause the stub to not be re-run -->
            <pattern type="Registry">HKCU\SOFTWARE\Microsoft\Active Setup\Installed Components\%IEAK.BrandGUID%\* [*]</pattern>
            <!-- On a 64-bit OS for 32-bit stubs, Active Setup writes to HKCU\Software\Wow6432Node\Microsoft\Active Setup\Installed Components
                 when a component stub has finished running. Since this isn't actually a redirected key, we'll have to copy
                 it as well, if it exists, to prevent the 32-bit stub from applying the ins file, similar to above -->
            <pattern type="Registry">HKCU\SOFTWARE\Wow6432Node\Microsoft\Active Setup\Installed Components\%IEAK.BrandGUID%\* [*]</pattern>
          </objectSet>
        </include>
      </rules>
      <rules context="System">
        <include>
          <objectSet>
            <pattern type="File">%CSIDL_PROGRAM_FILES%\Internet Explorer\SIGNUP\* [*]</pattern>
            <pattern type="File">%CSIDL_PROGRAM_FILESX86%\Internet Explorer\SIGNUP\* [*]</pattern>
          </objectSet>
        </include>
        <merge script="MigXmlHelper.SourcePriority()">
          <objectSet>
            <pattern type="File">%CSIDL_PROGRAM_FILES%\Internet Explorer\SIGNUP\* [*]</pattern>
            <pattern type="File">%CSIDL_PROGRAM_FILESX86%\Internet Explorer\SIGNUP\* [*]</pattern>
          </objectSet>
        </merge>
      </rules>
      <rules context="System">
        <detects>
          <detect>
            <condition>MigXmlHelper.DoesObjectExist("Registry", "HKLM\SOFTWARE\Microsoft\Internet Explorer [BrandGUID]")</condition>
          </detect>
          <detect>
            <condition>MigXmlHelper.DoesObjectExist("Registry", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\%IEAK.BrandGUID%")</condition>
          </detect>
        </detects>
        <include>
          <objectSet>
            <pattern type="File">%CSIDL_PROGRAM_FILES%\Internet Explorer\CUSTOM\* [*]</pattern>
            <pattern type="File">%CSIDL_PROGRAM_FILESX86%\Internet Explorer\CUSTOM\* [*]</pattern>
          </objectSet>
        </include>
        <merge script="MigXmlHelper.SourcePriority()">
          <objectSet>
            <pattern type="File">%CSIDL_PROGRAM_FILES%\Internet Explorer\CUSTOM\* [*]</pattern>
            <pattern type="File">%CSIDL_PROGRAM_FILESX86%\Internet Explorer\CUSTOM\* [*]</pattern>
          </objectSet>
        </merge>
    </rules>
    </migXml>
    <supportedComponents>
      <supportedComponent>
        <supportedComponentIdentity
            language="*"
            name="Microsoft-Windows-IE-AdminKitBranding"
            processorArchitecture="*"
            settingsVersionRange="0"
            />
            <migXml  xmlns="">
              <rules context="System">
                <merge script="MigXmlHelper.SourcePriority()">
                    <objectSet>
                    <pattern type="File">%CSIDL_PROGRAM_FILES%\Internet Explorer\SIGNUP\* [*]</pattern>
                    <pattern type="File">%CSIDL_PROGRAM_FILESX86%\Internet Explorer\SIGNUP\* [*]</pattern>
                    <pattern type="File">%CSIDL_PROGRAM_FILES%\Internet Explorer\CUSTOM\* [*]</pattern>
                    <pattern type="File">%CSIDL_PROGRAM_FILESX86%\Internet Explorer\CUSTOM\* [*]</pattern>
                    </objectSet>
                </merge>
              </rules>
            </migXml>
      </supportedComponent>
    </supportedComponents>    
  </migration>
</assembly>
