UE-V (Windows 10) 的應用程式範本結構描述參考

使用者體驗虛擬化 (UE-V) 使用 XML 設定位置範本來定義由 UE-V 擷取並套用的傳統型應用程式設定和 Windows 設定。 UE-V 包含一組預設設定位置範本。 您也可以使用 UE-V 範本產生器來建立自訂設定位置範本。

進階使用者可以自訂設定位置範本的 XML 檔案。 此主題詳細說明 UE-V 設定位置範本的 XML 結構,並提供編輯這些檔案的指引。

UE-V 應用程式範本結構描述參考

本節詳細說明 UE-V 設定位置範本的 XML 結構,並提供編輯此檔案的指引。

本節內容

XML 宣告和編碼屬性

強制:True類型:字串

XML 宣告必須指定 XML 版本 1.0 屬性 (<?xml version=“1.0”>) 。 UE-V 範本產生器建立的設定位置範本會以 UTF-8 編碼儲存,但並未明確指定編碼。 建議您將 encoding=“UTF-8” 屬性加入此元素中,作為最佳作法。 產品隨附的所有範本都會指定此標籤, (請參閱 %ProgramFiles%\Microsoft 使用者體驗虛擬化\Templates 中的文件以供參考) 。 例如:

<?xml version="1.0" encoding="UTF-8"?>

命名空間和根元素

強制:True類型:字串

UE-V 會 https://schemas.microsoft.com/UserExperienceVirtualization/2012/SettingsLocationTemplate 針對所有應用程式使用命名空間。 SettingsLocationTemplate 是根元素,包含所有其他元素。 參考 SettingsLocationTemplate 在使用此標記的所有範本中:

<SettingsLocationTemplate xmlns='https://schemas.microsoft.com/UserExperienceVirtualization/2012/SettingsLocationTemplate'>

資料類型

這些資料類型是適用於 UE-V 應用程式範本結構描述的資料類型。

GUID GUID 以 “\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}” 的形式描述標準的全域唯一識別碼規則運算式。 此 GUID 用於 Filesetting\Root\KnownFolder 元素,以驗證已知資料夾的格式。

FilenameString FilenameString 是指要監控的進程的檔案名稱。 其值受到正則表達式 [^\\\?\*\|<>/:]+, (是不得包含反斜線字元、星號或問號萬用字元、直立線字元、大於或小於符號、正斜線或冒號字元) 。

IDString IDString 是指應用程式元素、SettingsLocationTemplate 和 Common 元素的識別碼值, (用來描述共用通用設定的應用程式套件) 。 它受到與 FilenameString ([^\\\?\*\|<>/:]+) 。

TemplateVersion TemplateVersion 是一個整數值,用來描述設定位置範本的修訂。 其值介於 0 到 2147483647 之間。

空白 空白表示 Null 值。 Process\ShellProcess 中使用這個資料類型,表示沒有要監視的程序。 此值不應用於任何應用程式範本。

作者 作者資料型別是一種複雜型別,可識別範本的作者。 它包含兩個子元素:Name 和 Email。 在 Author 資料型別中,Name 元素為必要元素,而 Email 元素則為選用。 在 SettingsLocationTemplate 元素下會有詳細說明。

範圍Range 定義由兩個子元素組成的整數類別:Minimum 和 Maximum。 此資料類型是在 ProcessVersion 資料類型中實作。 如果指定,則必須同時包含最小值和最大值。

ProcessVersion ProcessVersion 定義具有四個子元素的類型: Major、 Minor、 Build 和 Patch。 Process 元素使用此資料類型來填入其 ProductVersion 和 FileVersion 值。 此類型的資料是 [範圍] 值。 主要子元素為必要,其他則為選用。

架構 架構列舉兩個可能的值: Win32 和 Win64。 這些值可用來指定處理程序架構。

流程 [程序] 資料類型是用來描述 UE-V 要監視的程序的容器。 它包含六個子元素: Filename、 Architecture、 ProductName、 FileDescription、 ProductVersion 和 FileVersion。 下表詳細說明每個元素各自的資料類型:

元素 資料類型 Mandatory
檔名 FilenameString True
Architecture Architecture False
ProductName 字串 False
檔案描述 字串 False
ProductVersion ProcessVersion False
FileVersion ProcessVersion False

處理序 Processes 資料類型代表一或多個 Process 元素集合的容器。 處理序序列類型支援兩個子元素: Process 和 ShellProcess。 Process 是 Process 類型的元素,而 ShellProcess 的資料類型為 Empty。 此順序中至少必須識別一個項目。

路徑 RegistrySetting 和 FileSetting 會使用路徑來參照登錄和檔案路徑。 此元素支援兩個選用屬性: Recursive 和 DeleteIfNotFound。 這兩個值都設為 default=“False”。

遞迴表示檔案設定中包含路徑和所有子資料夾,或登錄設定包含所有子登錄機碼。 在這兩種情況下,目前層級的所有項目都會包含在擷取的資料中。 針對 FileSettings 物件,指定資料夾內的所有檔案都包含在 UE-V 所擷取的資料中,但資料夾則不包括在內。 針對登錄路徑,會擷取目前路徑中的所有值,但不會擷取子登錄機碼。 在這兩種情況下,都應注意避免捕獲大型數據集或大量項目。

DeleteIfNotFound 屬性會從使用者的設定儲存路徑資料移除設定。 如果從套件中移除這些設定會在設定儲存路徑檔案伺服器上節省大量磁碟空間,則此移除可能是可取的。

FileMask FileMask 僅針對由 Path 定義的資料夾指定特定檔案類型。 例如,Path 可以 C:\users\username\files 是,而 FileMask 可以 *.txt 是只包含文字檔。

RegistrySetting RegistrySetting 代表登錄機碼和值的容器,以及 UE-V 服務部分的相關聯所需行為。 此類型中定義了四個子元素: Path、 Name、 Exclude,以及 Path 和 Name 值的序列。

FileSetting FileSetting 包含與檔案和檔案路徑相關聯的參數。 定義了四個子元素: Root、 Path、 FileMask 和 Exclude。 Root 為必要,其他為選用。

設定 [設定] 是套用至特定範本之所有設定的容器。 它包含先前所述的登錄、檔案、SystemParameter 和 CustomAction 設定的執行個體。 此外,它也可以包含下列具有所述行為的子元素:

元素 描述
非同步 非同步設定套件會在不封鎖應用程式啟動的情況下套用,因此應用程式啟動會繼續進行,而設定仍在套用中。 此元素適用於可以非同步套用的設定,例如透過 API 取得/設定的設定,例如 SystemParameterSetting。
PreventOverlappingSynchronization 根據預設,UE-V 只有在使用範本的應用程式的最後一個執行個體關閉時,才會儲存應用程式的設定。 當此元素設為「false」時,即使應用程式的其他執行個體正在執行,UE-V 也會匯出設定。 UE-V 隨附的適合範本 - 包含 [通用元素] 區段的範本,會使用此旗標來啟用共用設定,一律在應用程式關閉時匯出,同時防止應用程式特定設定在最後一個執行個體關閉之前匯出。
AlwaysApplySettings 此參數會強制套用匯入的設定套件,即使套件與應用程式的目前狀態之間沒有差異。 此參數只能在特殊情況下使用,因為它會減慢設定匯入速度。

Name 元素

強制:True類型:字串

Name 會指定設定位置範本的唯一名稱。 此名稱用於在 WMI、PowerShell、事件檢視器和偵錯記錄檔中參照範本時的顯示目的。 一般而言,請避免參照版本資訊,因為可能會從 ProductVersion 元素遭到此參照。 例如,指定 <Name>My Application</Name> 而非 <Name>My Application 1.1</Name>。

注意

UE-V 不會參考外部 DTD,因此無法在設定位置範本中使用具名實體。 例如,請勿用®來指代註冊商標標誌®。 請改用標準編號參照來包含這些類型的特殊字元,例如字元的 ® ®。 此規則適用於本文件中的所有字串值。

請參閱 http://www.w3.org/TR/xhtml1/dtds.html 字元實體的完整清單。 UTF-8 編碼文件可以直接包含 Unicode 字元。 透過 UE-V 範本產生器儲存範本會自動將字元實體轉換為其 Unicode 表示法。

ID 元素

強制:True類型:字串

識別碼會填入特定範本的唯一識別碼。 此標籤會成為 UE-V 服務用來在執行階段參考範本的主要識別碼 (例如,請參閱 Get-UevTemplate 的輸出,Get-UevTemplateProgram PowerShell Cmdlet) 。 依照慣例,此標籤不應包含任何空格,這樣可以簡化指令碼編寫。 應在此元素中指定應用程式的版本號碼,以便於識別範本,例如 <ID>MicrosoftOffice2016Win64</ID>。

版本元素

強制:True類型:整數最小值:0最大值:2147483647

版本 識別設定位置範本的版本,以進行變更的系統管理追蹤。 UE-V 範本產生器會在每次儲存範本時自動將此數字遞增 1。 請注意,此欄位必須是整數整數;分數值,例如 <Version>2.5</Version> 不允許。

提示

您可以使用 XML 註解標籤 <!-- -->來儲存版本變更的相關附註,例如:

<!--
   Version History

   Version 1 Jul 05, 2012 Initial template created by Generator - Denise@Contoso.com
   Version 2 Jul 31, 2012 Added support for app.exe v2.1.3 - Mark@Contoso.com
   Version 3 Jan 01, 2013 Added font settings support - Mark@Contoso.com
   Version 4 Jan 31, 2013 Added support for plugin settings - Tony@Contoso.com
 -->
<Version>4</Version>

重要

系統會查詢此值,以判斷在下列執行個體中,新版範本是否應套用至現有範本:

  • 排定的範本自動更新工作執行時
  • 執行 Update-UevTemplate PowerShell Cmdlet 時
  • 透過 WMI 呼叫 microsoft\uev:SettingsLocationTemplate Update 方法時

作者元素

必要:False類型:字串

作者識別設定位置範本的建立者。 支援兩個選用子元素:Name 和 Email。 這兩個屬性都是選用的,但如果指定了 Email 子元素,則必須伴隨 Name 元素。 作者是指設定位置範本的連絡人全名,而電子郵件應是指作者的電子郵件地址。 建議您在公開發佈的範本中包含此資訊。

流程和流程元素

必要:True類型:元素

處理序至少包含一個 <Process> 元素,而該元素又包含下列子元素: Filename、 Architecture、 ProductName、 FileDescription、 ProductVersion 和 FileVersion。 Filename 子元素為必要,其他則為選用。 完整填入的元素包含類似這個範例的標籤:

<Process>
  <Filename>MyApplication.exe</Filename>
  <Architecture>Win64</Architecture>
  <ProductName> MyApplication </ProductName>
  <FileDescription>MyApplication.exe</FileDescription>
  <ProductVersion>
    <Major Minimum="2" Maximum="2" />
    <Minor Minimum="0" Maximum="0" />
    <Build Minimum="0" Maximum="0" />
    <Patch Minimum="5" Maximum="5" />
  </ProductVersion>
  <FileVersion>
    <Major Minimum="2" Maximum="2" />
    <Minor Minimum="0" Maximum="0" />
    <Build Minimum="0" Maximum="0" />
    <Patch Minimum="5" Maximum="5" />
  </FileVersion>
</Process>

檔名

強制:True類型:字串

檔案名稱是指可執行檔在檔案系統中顯示的實際檔案名稱。 此元素會指定 UE-V 用來評估範本是否適用於處理程序的主要準則。 此元素必須在設定位置範本 XML 中指定。

有效的檔案名稱不得與規則運算式 [^\\\?\*\|<>/:]+,也就是說,它們不得包含反斜線字元、星號或問號萬用字元、直線符號、大於或小於符號、正斜線或冒號 (\ ?* | <> / 或 : 字元.) 。

提示

若要針對此 RegEx 測試字串,請使用 PowerShell 命令視窗,並將您的可執行檔名稱取代為 YourFileName:

"YourFileName.exe" -match "[\\\?\*\|<>/:]+"

值為 True 時,表示字串包含不正確的字元。 以下是一些非法值的範例:

  • \\server\share\program.exe
  • 程式*.exe
  • 優點?ram.exe
  • 方案<1>.exe

注意

UE-V 範本產生器會分別編碼為 > 和 < 大於字元。

在極少數情況下,FileName 值不一定包含副檔名 .exe,但應指定為值的一部分。 例如, <Filename>MyApplication.exe</Filename> 應指定而非 <Filename>MyApplication</Filename>。 如果可執行檔的實際名稱為 “MyApplication.exe”,則第二個範例不會將範本套用至處理程序。

Architecture

強制:False類型:字串) (架構

架構是指編譯目標可執行檔的處理器架構。 32 位元應用程式的有效值為 Win32,64 位元應用程式的有效值為 Win64。 如果存在,此標籤會限制設定位置範本對特定應用程式架構的適用性。 如需此適用性限制的範例,請比較 UE-V 隨附的 %ProgramFiles%\Microsoft 使用者體驗虛擬化\templates\ MicrosoftOffice2016Win32.xml 和 MicrosoftOffice2016Win64.xml 檔案。 當不同版本的可執行檔之間的相對路徑變更,或在從一個處理器架構移至另一個處理器架構時已新增或移除設定時,此適用性限制便非常有用。

如果缺少此元素,則設定位置範本會忽略程式的架構,如果檔案名稱和其他屬性適用,則會同時套用至 32 位元和 64 位元程式。

注意

UE-V 在此版本中不支援 ARM 處理器。

ProductName

必要:False類型:字串

ProductName 是選用元素,用來識別產品以供系統管理用途或進行報告。 ProductName 與 Filename 的不同之處在於,其值沒有規則運算式的限制。 這種靈活性允許更容易理解對可執行檔名稱可能不明顯的流程進行描述。 例如:

<Process>
  <Filename>MyApplication.exe</Filename>
  <ProductName>My Application 6.x by Contoso.com</ProductName>
  <ProductVersion>
    <Major Minimum="6" Maximum="6" />
  </ProductVersion>
</Process>

檔案描述

必要:False類型:字串

FileDescription 是選用的標籤,可讓您對可執行檔進行系統管理描述。 此標籤為自由文字欄位,在需要識別可執行檔功能的軟體套件中,可區分多個可執行檔。

例如,在適合的應用程式中,提供兩個可執行檔 (MyApplication.exe 和 MyApplicationHelper.exe) 功能的提醒可能會很有用,如下所示:

<Processes>

   <Process>
      <Filename>MyApplication.exe</Filename>
      <FileDescription>My Application Main Engine</ FileDescription>
      <ProductVersion>
        <Major Minimum="6" Maximum="6" />
      </ProductVersion>
    </Process>
    <Process>
      <Filename>MyApplicationHelper.exe</Filename>
      <FileDescription>My Application Background Process Executable</FileDescription>
      <ProductVersion>
        <Major Minimum="6" Maximum="6" />
      </ProductVersion>
    </Process>
</Processes>

ProductVersion

必要:False類型:字串

ProductVersion 是指檔案的主要和次要產品版本,以及組建和修補程式層級。 ProductVersion 是選用元素,但如果指定,它至少必須包含主要子元素。 該值必須以下列格式表示範圍:Minimum=“X”,Maximum=“Y”,其中 X 和 Y 為整數。 最小值和最大值可以相同。

產品和檔案版本元素可能未指定。 這樣做會使範本「與版本無關」,這意味著該範本將應用於指定可執行檔的所有版本。

範例 1:

產品版本:UE-V 範本產生器中指定的 1.0 會產生下列 XML:

<ProductVersion>
  <Major Minimum="1" Maximum="1" />
  <Minor Minimum="0" Maximum="0" />
</ProductVersion>

範例 2:

UE-V 範本產生器中指定的檔案版本:5.0.2.1000 會產生下列 XML:

<FileVersion>
  <Major Minimum="5" Maximum="5" />
  <Minor Minimum="0" Maximum="0" />
  <Build Minimum="2" Maximum="2" />
  <Patch Minimum="1000" Maximum="1000" />
</FileVersion>

不正確的範例 1 - 不完整的範圍:

只有 Minimum 屬性存在。 最大值也必須包含在範圍中。

<ProductVersion>
  <Major Minimum="2" />
</ProductVersion>

不正確的範例 2 - 指定的次要項目但沒有主要元素:

只有次要元素存在。 也必須包括主要。

<ProductVersion>
  <Minor Minimum="0" Maximum="0" />
</ProductVersion>

FileVersion

必要:False類型:字串

FileVersion 區分已發佈應用程式的發行版本與元件可執行檔的內部組建詳細資料。 對於大多數商業應用程式,這些數字是相同的。 如果它們不同,則檔案的產品版本會指出檔案的一般版本識別碼,而檔案版本則會指出檔案的特定組建 (如 Hotfix 或更新) 的範例所示。 此檔案版本唯一識別檔案,而不會中斷偵測邏輯。

若要判斷特定可執行檔的產品版本和檔案版本,請以滑鼠右鍵按一下 Windows 檔案總管中的檔案,選取 [內容],然後按一下 [詳細資料] 索引標籤。

包含應用程式的 FileVersion 元素可讓您進行更細微的微調偵測邏輯,但這對大部分的應用程式而言並非必要。 先檢查 ProductVersion 元素設定,然後再檢查 FileVersion。 將會套用更嚴格的設定。

FileVersion 的子元素和語法規則與 ProductVersion 的元素和規則相同。

<Process>
  <Filename>MSACCESS.EXE</Filename>
  <Architecture>Win32</Architecture>
  <ProductVersion>
    <Major Minimum="14" Maximum="14" />
    <Minor Minimum="0" Maximum="0" />
  </ProductVersion>
  <FileVersion>
    <Major Minimum="14" Maximum="14" />
    <Minor Minimum="0" Maximum="0" />
  </FileVersion>
</Process>

應用程式元素

應用程式是套用至特定應用程式之設定的容器。 這是下列欄位/類型的集合。

欄位/類型 描述
Name 指定設定位置範本的唯一名稱。 此名稱用於在 WMI、PowerShell、事件檢視器和偵錯記錄檔中參照範本時的顯示目的。 如需詳細資訊,請參閱 名稱。
識別碼 填入特定範本的唯一識別碼。 此標籤會成為 UE-V 服務在執行階段用來參考範本的主要識別碼。 如需詳細資訊,請參閱 ID。
描述 範本的選擇性描述。
LocalizedNames 顯示在 UI 中的選用名稱,依語言地區設定當地語系化。
LocalizedDescriptions 依語言地區設定當地語系化的選用範本描述。
版本 識別設定位置範本的版本,以進行變更的系統管理追蹤。 如需詳細資訊,請參閱 版本。
DeferToMSAccount 控制是否要與 Microsoft 帳戶一起啟用此範本。 如果電腦上的使用者已啟用 MSA 同步處理,則會自動停用此範本。
DeferToOffice365 類似於 MSA,此類型會控制是否要與 Office361 一起啟用此範本。 如果 Office 365 用於同步設定,此範本將會自動停用。
FixedProfile 指定此範本只能與此元素中指定的設定檔相關聯,而且無法透過 WMI 或 PowerShell 變更。
處理程序 一或多個程序元素集合的容器。 如需詳細資訊,請參閱 處理程序。
設定 適用於特定範本的所有設定的容器。 它包含登錄、檔案、SystemParameter 和 CustomAction 設定的執行個體。 如需詳細資訊,請參閱「資料類型」中的設定。

共同元素

[常見] 與 Application 元素類似,但它一律與兩個或多個 Application 元素相關聯。 [共同] 區段代表在這些應用程式實例之間共用的設定集。 這是下列欄位/類型的集合。

欄位/類型 描述
Name 指定設定位置範本的唯一名稱。 此名稱用於在 WMI、PowerShell、事件檢視器和偵錯記錄檔中參照範本時的顯示目的。 如需詳細資訊,請參閱 名稱。
識別碼 填入特定範本的唯一識別碼。 此標籤會成為 UE-V 服務在執行階段用來參考範本的主要識別碼。 如需詳細資訊,請參閱 ID。
描述 範本的選擇性描述。
LocalizedNames 顯示在 UI 中的選用名稱,依語言地區設定當地語系化。
LocalizedDescriptions 依語言地區設定當地語系化的選用範本描述。
版本 識別設定位置範本的版本,以進行變更的系統管理追蹤。 如需詳細資訊,請參閱 版本。
DeferToMSAccount 控制是否要與 Microsoft 帳戶一起啟用此範本。 如果電腦上的使用者已啟用 MSA 同步處理,則會自動停用此範本。
DeferToOffice365 類似於 MSA,此類型會控制是否要與 Office361 一起啟用此範本。 如果 Office 365 用於同步設定,此範本將會自動停用。
FixedProfile 指定此範本只能與此元素中指定的設定檔相關聯,而且無法透過 WMI 或 PowerShell 變更。
設定 適用於特定範本的所有設定的容器。 它包含登錄、檔案、SystemParameter 和 CustomAction 設定的執行個體。 如需詳細資訊,請參閱 [資料類型] 中的 [設定]。

SettingsLocationTemplate 元素

此元素會定義單一應用程式或一套應用程式的設定。

欄位/類型 描述
Name 指定設定位置範本的唯一名稱。 此類型用於在 WMI、PowerShell、事件檢視器和偵錯記錄檔中參考範本時的顯示目的。 如需詳細資訊,請參閱 名稱。
識別碼 填入特定範本的唯一識別碼。 此標籤會成為 UE-V 服務在執行階段用來參考範本的主要識別碼。 如需詳細資訊,請參閱 ID。
描述 範本的選擇性描述。
LocalizedNames 顯示在 UI 中的選用名稱,依語言地區設定當地語系化。
LocalizedDescriptions 依語言地區設定當地語系化的選用範本描述。

附錄:SettingsLocationTemplate.xsd

以下是 SettingsLocationTemplate.xsd 檔案,顯示其元素、子元素、屬性和參數:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="UevSettingsLocationTemplate"
  targetNamespace="https://schemas.microsoft.com/UserExperienceVirtualization/2013A/SettingsLocationTemplate"
  elementFormDefault="qualified"
  xmlns="https://schemas.microsoft.com/UserExperienceVirtualization/2013A/SettingsLocationTemplate"
  xmlns:mstns="https://schemas.microsoft.com/UserExperienceVirtualization/2013A/SettingsLocationTemplate"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:simpleType name="Guid">
        <xs:restriction base="xs:string">
            <xs:pattern value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="FilenameString">
        <xs:restriction base="xs:string">
            <xs:pattern value="[^\\\?\*\|&lt;&gt;/:]+" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="IDString">
        <xs:restriction base="xs:string">
            <xs:pattern value="[^\\\?\*\|&lt;&gt;/:.]+" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="CompositeIDString">
        <xs:restriction base="xs:string">
            <xs:pattern value="[^\\\?\*\|&lt;&gt;/:.]+([.][^\\\?\*\|&lt;&gt;/:.]+)?" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="TemplateVersion">
        <xs:restriction base="xs:integer">
            <xs:minInclusive value="0" />
            <xs:maxInclusive value="2147483647" />
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="Empty">
        <xs:sequence/>
    </xs:complexType>

    <xs:complexType name="LocalizedString">
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="Locale" type="xs:string" use="required"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>

    <xs:complexType name="LocalizedName">
        <xs:sequence>
            <xs:element name="Name" type="LocalizedString" minOccurs="1" maxOccurs="unbounded" />
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="LocalizedDescription">
        <xs:sequence>
            <xs:element name="Description" type="LocalizedString" minOccurs="1" maxOccurs="unbounded" />
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="ReplacedTemplates">
      <xs:sequence>
        <xs:element name="ID" type="CompositeIDString" minOccurs="1" maxOccurs="unbounded" />
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Author">
        <xs:all>
            <xs:element name="Name" type="xs:string" minOccurs="1" />
            <xs:element name="Email" type="xs:string" minOccurs="0" />
        </xs:all>
    </xs:complexType>

    <xs:complexType name="Range">
        <xs:attribute name="Minimum" type="xs:integer" use="required"/>
        <xs:attribute name="Maximum" type="xs:integer" use="required"/>
    </xs:complexType>

    <xs:complexType name="ProcessVersion">
        <xs:sequence>
            <xs:element name="Major" type="Range" minOccurs="1" />
            <xs:element name="Minor" type="Range" minOccurs="0" />
            <xs:element name="Build" type="Range" minOccurs="0" />
            <xs:element name="Patch" type="Range" minOccurs="0" />
        </xs:sequence>
    </xs:complexType>

    <xs:simpleType name="Architecture">
        <xs:restriction base="xs:string">
            <xs:enumeration value="Win32"/>
            <xs:enumeration value="Win64"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="Process">
        <xs:sequence>
            <xs:element name="Filename" type="FilenameString" minOccurs="1" />
            <xs:element name="Architecture" type="Architecture" minOccurs="0" />
            <xs:element name="ProductName" type="xs:string" minOccurs="0" />
            <xs:element name="FileDescription" type="xs:string" minOccurs="0" />
            <xs:element name="ProductVersion" type="ProcessVersion" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="FileVersion" type="ProcessVersion" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Processes">
        <xs:sequence>
            <xs:choice minOccurs="1">
                <xs:element name="Process" type="Process" />
                <xs:element name="ShellProcess" type="Empty" />
            </xs:choice>
            <xs:element name="Process" type="Process" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Path">
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="Recursive" type="xs:boolean" default="false"/>
                <xs:attribute name="DeleteIfNotFound" type="xs:boolean" default="false"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>

    <xs:complexType name="RegistrySetting">
        <xs:sequence>
            <xs:element name="Path" type="Path" />
            <xs:element name="Name" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="Exclude" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="Path" type="Path" minOccurs="0" />
                        <xs:element name="Name" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="FileSetting">
        <xs:sequence>

            <xs:element name="Root">
                <xs:complexType>
                    <xs:choice>
                        <xs:element name="KnownFolder" type="Guid" />
                        <xs:element name="RegistryEntry" type="xs:string" />
                        <xs:element name="EnvironmentVariable" type="xs:string" />
                    </xs:choice>
                </xs:complexType>
            </xs:element>

            <xs:element name="Path" minOccurs="0" type="Path" />
            <xs:element name="FileMask" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>

            <xs:element name="Exclude" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="Path" type="Path" minOccurs="0" />
                        <xs:element name="FileMask" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>

        </xs:sequence>
    </xs:complexType>

    <xs:simpleType name="CustomActionSetting">
        <xs:restriction base="xs:anyURI"/>
    </xs:simpleType>

    <xs:simpleType name="SystemParameterSetting">
        <xs:restriction base="xs:string">

            <!-- Accessibility parameters -->
            <xs:enumeration value="AccessTimeout"/>
            <xs:enumeration value="AudioDescription"/>
            <xs:enumeration value="ClientAreaAnimation"/>
            <xs:enumeration value="DisableOverlappedContent"/>
            <xs:enumeration value="FilterKeys"/>
            <xs:enumeration value="FocusBorderHeight"/>
            <xs:enumeration value="FocusBorderWidth"/>
            <xs:enumeration value="HighContrast"/>
            <xs:enumeration value="MessageDuration"/>
            <xs:enumeration value="MouseClickLock"/>
            <xs:enumeration value="MouseClickLockTime"/>
            <xs:enumeration value="MouseKeys"/>
            <xs:enumeration value="MouseSonar"/>
            <xs:enumeration value="MouseVanish"/>
            <xs:enumeration value="ScreenReader"/>
            <xs:enumeration value="ShowSounds"/>
            <xs:enumeration value="SoundSentry"/>
            <xs:enumeration value="StickyKeys"/>
            <xs:enumeration value="ToggleKeys"/>

            <!-- Input parameters -->
            <xs:enumeration value="Beep"/>
            <xs:enumeration value="BlockSendInputResets"/>
            <xs:enumeration value="DefaultInputLang"/>
            <xs:enumeration value="DoubleClickTime"/>
            <xs:enumeration value="DoubleClkHeight"/>
            <xs:enumeration value="DoubleClkWidth"/>
            <xs:enumeration value="KeyboardCues"/>
            <xs:enumeration value="KeyboardDelay"/>
            <xs:enumeration value="KeyboardPref"/>
            <xs:enumeration value="KeyboardSpeed"/>
            <xs:enumeration value="Mouse"/>
            <xs:enumeration value="MouseButtonSwap"/>
            <xs:enumeration value="MouseHoverHeight"/>
            <xs:enumeration value="MouseHoverTime"/>
            <xs:enumeration value="MouseHoverWidth"/>
            <xs:enumeration value="MouseSpeed"/>
            <xs:enumeration value="MouseTrails"/>
            <xs:enumeration value="SnapToDefButton"/>
            <xs:enumeration value="WheelScrollChars"/>
            <xs:enumeration value="WheelScrollLines"/>

            <!-- Desktop parameters (limited subset) -->
            <xs:enumeration value="DeskWallpaper"/>
            <xs:enumeration value="DesktopColor"/>

        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="Settings">
        <xs:sequence>
            <xs:element name="Asynchronous" type="xs:boolean" minOccurs="0" />
            <xs:element name="PreventOverlappingSynchronization" type="xs:boolean" minOccurs="0" />
            <xs:element name="AlwaysApplySettings" type="xs:boolean" minOccurs="0" />
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="Registry" type="RegistrySetting" />
                <xs:element name="File" type="FileSetting" />
                <xs:element name="SystemParameter" type="SystemParameterSetting" />
                <xs:element name="CustomAction" type="CustomActionSetting" />
            </xs:choice>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Common">
        <xs:sequence>
            <xs:element name="Name" type="xs:string" />
            <xs:element name="ID" type="IDString" />
            <xs:element name="ReplacedTemplates" type="ReplacedTemplates" minOccurs="0" />
            <xs:element name="Description" type="xs:string" minOccurs="0" />
            <xs:element name="LocalizedNames" type="LocalizedName" minOccurs="0" />
            <xs:element name="LocalizedDescriptions" type="LocalizedDescription" minOccurs="0" />
            <xs:element name="Version" type="xs:integer" />
            <xs:element name="DeferToMSAccount" type="Empty"  minOccurs="0" />
            <xs:element name="DeferToOffice365" type="Empty" minOccurs="0" />
            <xs:element name="Settings" type="Settings" />
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Application">
        <xs:sequence>
            <xs:element name="Name" type="xs:string" />
            <xs:element name="ID" type="IDString" />
            <xs:element name="ReplacedTemplates" type="ReplacedTemplates" minOccurs="0" />
            <xs:element name="Description" type="xs:string" minOccurs="0" />
            <xs:element name="LocalizedNames" type="LocalizedName" minOccurs="0" />
            <xs:element name="LocalizedDescriptions" type="LocalizedDescription" minOccurs="0" />
            <xs:element name="Version" type="xs:integer" />
            <xs:element name="DeferToMSAccount" type="Empty"  minOccurs="0" />
            <xs:element name="DeferToOffice365" type="Empty" minOccurs="0" />
            <xs:element name="Processes" type="Processes" />
            <xs:element name="Settings" type="Settings" />
        </xs:sequence>
    </xs:complexType>

    <xs:element name="SettingsLocationTemplate">
        <xs:complexType>
            <xs:sequence>

                <xs:element name="Name" type="xs:string" />
                <xs:element name="ID" type="IDString" />
                <xs:element name="Description" type="xs:string" minOccurs="0" />
                <xs:element name="LocalizedNames" type="LocalizedName" minOccurs="0" />
                <xs:element name="LocalizedDescriptions" type="LocalizedDescription" minOccurs="0" />

                <xs:choice>

                    <!-- Single application -->
                    <xs:sequence>
                        <xs:element name="ReplacedTemplates" type="ReplacedTemplates" minOccurs="0" />
                        <xs:element name="Version" type="TemplateVersion" />
                        <xs:element name="Author" type="Author" minOccurs="0" />
                        <xs:element name="FixedProfile" type="xs:string"  minOccurs="0" />
                        <xs:element name="DeferToMSAccount" type="Empty"  minOccurs="0" />
                        <xs:element name="DeferToOffice365" type="Empty" minOccurs="0" />
                        <xs:element name="Processes" type="Processes" />
                        <xs:element name="Settings" type="Settings" />
                    </xs:sequence>

                    <!-- Suite of applications -->
                    <xs:sequence>
                        <xs:element name="ManageSuiteOnly" type="xs:boolean" minOccurs="0" />
                        <xs:element name="Author" type="Author" minOccurs="0" />
                        <xs:element name="FixedProfile" type="xs:string"  minOccurs="0" />
                        <xs:element name="Common" type="Common" />
                        <xs:element name="Application" type="Application" minOccurs="2" maxOccurs="unbounded" />
                    </xs:sequence>

                </xs:choice>

            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- SettingsLocationTemplate -->

</xs:schema>

使用自訂 UE-V 範本與 UE-V 範本產生器UE-V 技術參考