<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/oobeupgrade">

  <component type="System" context="User">
    <displayName>oobeUpgrade</displayName>
    <paths>
      <path type="File">%WINDIR%\oobeUpgrade</path>
    </paths>
    <role role="Settings">

      <rules>
        <detects>
          <detect>
            <condition negation="Yes">MigXmlHelper.IsOSLaterThan("NT","6.0.0.0")</condition>
          </detect>
        </detects>
        <rules>
          <detects>
            <detect>
              <condition negation="Yes">MigXmlHelper.DoesObjectExist("Registry","HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My Music]")</condition>
            </detect>
            <detect>
              <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_PERSONAL")</condition>
            </detect>
          </detects>
          <addObjects>
            <object>
              <location type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My Music]</location>
              <attributes>ExpandString</attributes>
              <bytes string="Yes" expand="Yes">%CSIDL_MYMUSIC%</bytes>
            </object>
          </addObjects>
        </rules>
        <rules>
          <detects>
            <detect>
              <condition negation="Yes">MigXmlHelper.DoesObjectExist("Registry","HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My Pictures]")</condition>
            </detect>
            <detect>
              <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_PERSONAL")</condition>
            </detect>
          </detects>
          <addObjects>
            <object>
              <location type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My Pictures]</location>
              <attributes>ExpandString</attributes>
              <bytes string="Yes" expand="Yes">%CSIDL_MYPICTURES%</bytes>
            </object>
          </addObjects>
        </rules>
        <rules>
          <detects>
            <detect>
              <condition negation="Yes">MigXmlHelper.DoesObjectExist("Registry","HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My Video]")</condition>
            </detect>
            <detect>
              <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_PERSONAL")</condition>
            </detect>
          </detects>
          <addObjects>
            <object>
              <location type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My Video]</location>
              <attributes>ExpandString</attributes>
              <bytes string="Yes" expand="Yes">%CSIDL_MYVIDEO%</bytes>
            </object>
          </addObjects>
        </rules>
      </rules>

      <rules>

        <include>
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_PERSONAL")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [Personal]</pattern>
          </objectSet>
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_MYMUSIC")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My Music]</pattern>
          </objectSet>
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_MYPICTURES")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My Pictures]</pattern>
          </objectSet>
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_MYVIDEO")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My Video]</pattern>
          </objectSet>
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_STARTMENU")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [Start Menu]</pattern>
          </objectSet>
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_PROGRAMS")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [Programs]</pattern>
          </objectSet>
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_STARTUP")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [Startup]</pattern>
          </objectSet>
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_RECENT")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [Recent]</pattern>
          </objectSet>
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_DESKTOP")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [Desktop]</pattern>
          </objectSet>
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_FAVORITES")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [Favorites]</pattern>
          </objectSet>
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("CSIDL_INTERNET_CACHE")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [Cache]</pattern>
          </objectSet>

        <!-- FOLDERID_LocalAppDataLow {A520A1A4-1780-4FF6-BD18-167343C5AF16} -->
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("FOLDERID_LocalAppDataLow")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [{A520A1A4-1780-4FF6-BD18-167343C5AF16}]</pattern>
          </objectSet>

        <!-- FOLDERID_Playlists {DE92C1C7-837F-4F69-A3BB-86E631204A23} -->
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("FOLDERID_Playlists")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [{DE92C1C7-837F-4F69-A3BB-86E631204A23}]</pattern>
          </objectSet>

        <!-- FOLDERID_PhotoAlbums {69D2CF90-FC33-4FB7-9A0C-EBB0F0FCB43C} -->
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("FOLDERID_PhotoAlbums")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [{69D2CF90-FC33-4FB7-9A0C-EBB0F0FCB43C}]</pattern>
          </objectSet>

        <!-- FOLDERID_Downloads {374DE290-123F-4565-9164-39C4925E467B} -->
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("FOLDERID_Downloads")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [{374DE290-123F-4565-9164-39C4925E467B}]</pattern>
          </objectSet>

        <!-- FOLDERID_SavedSearches {7d1d3a04-debb-4115-95cf-2f29da2920da} -->
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("FOLDERID_SavedSearches")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [{7d1d3a04-debb-4115-95cf-2f29da2920da}]</pattern>
          </objectSet>

        <!-- FOLDERID_Contacts {56784854-C6CB-462b-8169-88E350ACB882} -->
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("FOLDERID_Contacts")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [{56784854-C6CB-462b-8169-88E350ACB882}]</pattern>
          </objectSet>

        <!-- FOLDERID_GameTasks {054FAE61-4DD8-4787-80B6-090220C4B700} -->
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("FOLDERID_GameTasks")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [{054FAE61-4DD8-4787-80B6-090220C4B700}]</pattern>
          </objectSet>

        <!-- FOLDERID_SavedGames {4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4} -->
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("FOLDERID_SavedGames")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [{4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4}]</pattern>
          </objectSet>

        <!-- FOLDERID_Games {CAC52C1A-B53D-4edc-92D7-6B2E8AC19434} -->
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("FOLDERID_Games")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [{CAC52C1A-B53D-4edc-92D7-6B2E8AC19434}]</pattern>
          </objectSet>

        <!-- FOLDERID_RecordedTV {bd85e001-112e-431e-983b-7b15ac09fff1} -->
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("FOLDERID_RecordedTV")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [{bd85e001-112e-431e-983b-7b15ac09fff1}]</pattern>
          </objectSet>
          
        <!-- FOLDERID_Links {bfb9d5e0-c6a9-404c-b2b2-ae6db6af4968} -->
          <objectSet>
            <condition negation="Yes">MigXmlHelper.IsDefaultShellFolderPath("FOLDERID_Links")</condition>
            <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [{bfb9d5e0-c6a9-404c-b2b2-ae6db6af4968}]</pattern>
          </objectSet>
          
        </include>

        <processing when="apply-success">
          <script>MigXmlHelper.RemapShellFolderPaths('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [*]')</script>
        </processing>

      </rules>

    </role>
  </component>

</migration>
