Scanload / loadstate USMT 使用我创建的自定义 XML 给出错误 26 应该保存额外的数据,错误说元素内容丢失

Scanload / loadstate USMT Gives out Error 26 with the custom XML I created that should save additional data, error says element content missing

我正在进行似乎会产生问题的迁移。我想将所有用户数据与所有内容一起迁移并使用 USMT。默认情况下,大多数用户都已备份,并且也可以正常工作。因为我还想为用户保存一些其他信息,所以我开始创建自定义 XML.

我得到的错误在输出日志中:

2015-02-02 13:57:18, Error [0x08055d] MXE Agent: Migration XML C:\WKSBackup\myfile.xml is not properly formatted. Message: element should have some content.

我现在正在研究这个问题已经超过 4 个小时了,但我不明白为什么会这样。我的意思是我正在遍历每个元素,看不到一个是空的。任何帮助或建议都会有所帮助

附件是XML文件的内容

<?xml version="1.0" encoding="UTF-8" ?>
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/wallpaper">

    <!--This component migrates wallpaper settings-->
    <component type="System" context="User">
        <displayName>Wallpapers</displayName>
        <role role="Settings">
            <rules>
                <include>
                    <objectSet>
                        <pattern type="Registry">HKCU\Control Panel\Desktop [Pattern]</pattern>
                        <pattern type="Registry">HKCU\Control Panel\Desktop [PatternUpgrade]</pattern>
                        <pattern type="Registry">HKCU\Control Panel\Desktop [TileWallpaper]</pattern>
                        <pattern type="Registry">HKCU\Control Panel\Desktop [WallPaper]</pattern>
                        <pattern type="Registry">HKCU\Control Panel\Desktop [WallpaperStyle]</pattern>
                        <pattern type="Registry">HKCU\Software\Microsoft\Windows\CurrentVersion\Themes [SetupVersion]</pattern>
                        <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [BackupWallpaper]</pattern>
                        <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [TileWallpaper]</pattern>
                        <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [Wallpaper]</pattern>
                        <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [WallpaperFileTime]</pattern>
                        <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [WallpaperLocalFileTime]</pattern>
                        <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [WallpaperStyle]</pattern>
                        <content filter="MigXmlHelper.ExtractSingleFile(NULL, NULL)">
                            <objectSet>
                                <pattern type="Registry">HKCU\Control Panel\Desktop [WallPaper]</pattern>
                                <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [BackupWallpaper]</pattern>
                                <pattern type="Registry">HKCU\Software\Microsoft\Internet Explorer\Desktop\General [Wallpaper]</pattern>
                            </objectSet>
                        </content>
                    </objectSet>
                </include>
            </rules>
        </role>
    </component>

    <!--This component migrates wallpaper files-->
    <component type="Documents" context="System">
        <displayName>Move JPG and BMP</displayName>
        <role role="Data">
            <rules>
                <include>
                    <objectSet>
                        <pattern type="File"> %windir% [*.bmp]</pattern>
                        <pattern type="File"> %windir%\web\wallpaper [*.jpg]</pattern>
                        <pattern type="File"> %windir%\web\wallpaper [*.bmp]</pattern>
                    </objectSet>
                </include>
            </rules>
        </role>
    </component>

    <!-- This component migrates appdata local office-->
    <component context="UserAndSystem" type="Application">
        <displayName>Copy AppData roaming</displayName>
        <role role="Data">
            <rules>
                <include>
                    <objectSet>
                        <pattern type="File"> %APPDATA%\Office</pattern>
                        <pattern type="File"> %APPDATA%\Excel</pattern>
                        <pattern type="File"> %APPDATA%\Powerpoint</pattern>
                        <pattern type="File"> %APPDATA%\Access</pattern>
                        <pattern type="File"> %APPDATA%\Outlook</pattern>
                        <pattern type="File"> %APPDATA%\OneNote</pattern>
                        <pattern type="File"> %APPDATA%\Signatures</pattern>
                        <pattern type="File"> %APPDATA%\Templates</pattern>
                        <pattern type="File"> %APPDATA%\UProof</pattern>
                        <pattern type="File"> %APPDATA%\Visio</pattern>
                        <pattern type="File"> %APPDATA%\Forms</pattern>
                    </objectSet>
                </include>
            </rules>
        </role>
    </component>

    <!--This component migrates appdata local office-->
    <component context="UserAndSystem" type="Application">
        <displayName>Copy AppData local</displayName>
        <role role="Data">
            <rules>
                <include>
                    <objectSet>
                        <pattern type="File"> %LOCALAPPDATA%\Office</pattern>
                        <pattern type="File"> %LOCALAPPDATA%\Excel</pattern>
                        <pattern type="File"> %LOCALAPPDATA%\Powerpoint</pattern>
                        <pattern type="File"> %LOCALAPPDATA%\Access</pattern>
                        <pattern type="File"> %LOCALAPPDATA%\Outlook</pattern>
                        <pattern type="File"> %LOCALAPPDATA%\OneNote</pattern>
                        <pattern type="File"> %LOCALAPPDATA%\Signatures</pattern>
                        <pattern type="File"> %LOCALAPPDATA%\Templates</pattern>
                        <pattern type="File"> %LOCALAPPDATA%\UProof</pattern>
                        <pattern type="File"> %LOCALAPPDATA%\Visio</pattern>
                        <pattern type="File"> %LOCALAPPDATA%\Forms</pattern>
                    </objectSet>
                </include>
            </rules>
        </role>
    </component>

    <!--This component migrates DesktopData-->
    <component context="UserAndSystem" type="Application">
        <displayName>Copy DesktopData</displayName>
        <role role="Data">
            <rules>
                <include>
                    <objectSet>
                        <pattern type="File"> %USERPROFILE%\Desktop</pattern>
                    </objectSet>
                </include>
            </rules>
        </role>
    </component>

    <!-- Mozilla Firefox - Modified for any version to migapp-->
    <component context="UserAndSystem" type="Application">
        <displayName _locID="migapp.firefox3">Mozilla Firefox</displayName>
        <environment name="GlobalEnv" />
        <environment name="GlobalEnvX64" />
        <role role="Settings">
            <detection>
                <conditions>
                    <condition>MigXmlHelper.DoesObjectExist("Registry","%HklmWowSoftware%\Mozilla\Mozilla Firefox *.*\bin [PathToExe]")</condition>
                </conditions>
            </detection>
            <rules context="User">
                <destinationCleanup>
                    <objectSet>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\*\Cache\* [*]</pattern>
                    </objectSet>
                </destinationCleanup>
                <include>
                    <objectSet>
                        <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\* [*]</pattern>
                    </objectSet>
                </include>
                <exclude>
                    <objectSet>
                        <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\Crash Reports\* [*]</pattern>
                        <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\Profiles\*\ [pluginreg.dat]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\*\Cache\* [*]</pattern>
                    </objectSet>
                </exclude>
                <merge script="MigXmlHelper.SourcePriority()">
                    <objectSet>
                        <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\* [*]</pattern>
                    </objectSet>
                </merge>
            </rules>
        </role>
    </component>

    <!-- Google Chrome to migapp-->
    <component context="UserAndSystem" type="Application">
        <displayName _locID="migapp.chrome1">Google Chrome</displayName>
        <environment name="GlobalEnv" />
        <environment name="GlobalEnvX64" />
        <role role="Settings">
            <destinationCleanup>
                <objectSet>
                    <pattern type="File">%CSIDL_LOCAL_APPDATA%\Google\Chrome\User Data\*\Cache\* [*]</pattern>
                </objectSet>
            </destinationCleanup>
            <detection>
                <conditions>
                    <condition>MigXmlHelper.DoesObjectExist("Registry","%HklmWowSoftware%\Google\Chrome\")</condition>
                </conditions>
            </detection>
            <rules context="User">
                <include>
                    <objectSet>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Google\Chrome\User Data\* [*]</pattern>
                    </objectSet>
                </include>
                <exclude>
                    <objectSet>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Google\Chrome\User Data\*\Cache\* [*]</pattern>
                    </objectSet>
                </exclude>
                <merge script="MigXmlHelper.SourcePriority()">
                    <objectSet>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Google\Chrome\User Data\* [*]</pattern>
                    </objectSet>
                </merge>
            </rules>
        </role>
    </component>

     <component type="System" context="user">
        <displayName _locID="miguser.User_Exclusions">User Exclusions</displayName>
        <role role="Data">
            <rules>
                <unconditionalExclude>
                     <objectSet>
                        <pattern type="File">%CSIDL_DESKTOP%\* [*.msi]</pattern>
                        <pattern type="File">%CSIDL_DESKTOP%\* [*.exe]</pattern>
                        <pattern type="File">%CSIDL_DESKTOP%\* [*.lnk]</pattern>
                        <pattern type="File">%CSIDL_DESKTOP%\* [*.lnk2]</pattern>
                        <pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.msi]</pattern>
                        <pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.exe]</pattern>
                        <pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.lnk]</pattern>
                        <pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.lnk2]</pattern>
                        <pattern type="File">%CSIDL_DEFAULT_DESKTOP%\* [*.msi]</pattern>
                        <pattern type="File">%CSIDL_DEFAULT_DESKTOP%\* [*.exe]</pattern>
                        <pattern type="File">%CSIDL_DEFAULT_DESKTOP%\* [*.lnk]</pattern>
                        <pattern type="File">%CSIDL_DEFAULT_DESKTOP%\* [*.lnk2]</pattern>
                        <pattern type="File">%CSIDL_DEFAULT_PROGRAMS%\* [*]</pattern>
                        <pattern type="File">%CSIDL_DEFAULT_STARTMENU%\* [*]</pattern>
                        <pattern type="File">%CSIDL_DEFAULT_STARTUP%\* [*]</pattern>
                        <pattern type="File">%CSIDL_PROGRAMS%\* [*]</pattern>
                        <pattern type="File">%CSIDL_STARTMENU%\* [*]</pattern>
                        <pattern type="File">%CSIDL_STARTUP%\* [*]</pattern>
                    </objectSet>
                </unconditionalExclude>
            </rules>
        </role>
    </component>

    <!-- This component EXCLUDES the following shared User specific stuff-->
    <component type="System" context="System">
        <displayName _locID="miguser.Shared_User_Exclusions">Shared User Exclusions</displayName>
        <role role="Data">
            <rules>
                <unconditionalExclude>
                    <objectSet>
                        <pattern type="File">%CSIDL_COMMON_DESKTOPDIRECTORY%\* [*.msi]</pattern>
                        <pattern type="File">%CSIDL_COMMON_DESKTOPDIRECTORY%\* [*.exe]</pattern>
                        <pattern type="File">%CSIDL_COMMON_DESKTOPDIRECTORY%\* [*.lnk]</pattern>
                        <pattern type="File">%CSIDL_COMMON_DESKTOPDIRECTORY%\* [*.lnk2]</pattern>
                        <pattern type="File">%CSIDL_COMMON_PROGRAMS%\* [*]</pattern>
                        <pattern type="File">%CSIDL_COMMON_STARTMENU%\* [*]</pattern>
                        <pattern type="File">%CSIDL_COMMON_STARTUP%\* [*]</pattern>
                        <pattern type="File">%CSIDL_PROGRAMS%\* [*]</pattern>
                        <pattern type="File">%CSIDL_STARTMENU%\* [*]</pattern>
                        <pattern type="File">%CSIDL_STARTUP%\* [*]</pattern>
                    </objectSet>
                </unconditionalExclude>
            </rules>
        </role>
    </component>

</migration>

问题是微软不支持单个元素...

<environment name="GlobalEnv" />

需要转换...希望这对以后的人有所帮助

您需要在 XML:

的顶部
   <_locDefinition>
      <_locDefault _loc="locNone"/>
      <_locTag _loc="locData">displayName</_locTag>
   </_locDefinition>

   <namedElements>
      <!-- Global -->
      <environment name="GlobalEnvX64">
         <conditions>
            <condition>MigXmlHelper.IsNative64Bit()</condition>
         </conditions>
         <variable name="HklmWowSoftware">
            <text>HKLM\SOFTWARE\Wow6432Node</text>
         </variable>
         <variable name="ProgramFiles32bit">
            <text>%ProgramFiles(x86)%</text>
         </variable>
         <variable name="CommonProgramFiles32bit">
            <text>%CommonProgramFiles(x86)%</text>
         </variable>
      </environment>
      <environment name="GlobalEnv">
         <conditions>
            <condition negation="Yes">MigXmlHelper.IsNative64Bit()</condition>
         </conditions>
         <variable name="HklmWowSoftware">
            <text>HKLM\Software</text>
         </variable>
         <variable name="ProgramFiles32bit">
            <text>%ProgramFiles%</text>
         </variable>
         <variable name="CommonProgramFiles32bit">
            <text>%CommonProgramFiles%</text>
         </variable>
      </environment>

      <!-- Global USER -->
      <environment context="USER" name="GlobalEnvX64User">
         <conditions>
            <condition>MigXmlHelper.IsNative64Bit()</condition>
         </conditions>
         <variable name="VirtualStore_ProgramFiles32bit">
            <text>%CSIDL_VIRTUALSTORE_PROGRAMFILES(X86)%</text>
         </variable>
         <variable name="VirtualStore_CommonProgramFiles32bit">
            <text>%CSIDL_VIRTUALSTORE_COMMONPROGRAMFILES(X86)%</text>
         </variable>
      </environment>
      <environment context="USER" name="GlobalEnvUser">
         <conditions>
            <condition negation="Yes">MigXmlHelper.IsNative64Bit()</condition>
         </conditions>
         <variable name="VirtualStore_ProgramFiles32bit">
            <text>%CSIDL_VIRTUALSTORE_PROGRAMFILES%</text>
         </variable>
         <variable name="VirtualStore_CommonProgramFiles32bit">
            <text>%CSIDL_VIRTUALSTORE_COMMONPROGRAMFILES%</text>
         </variable>
      </environment>
   </namedElements>