MainPackage (應用程式安裝程式架構)

MainPackage 元素會指定封裝的相關資訊,其中包括名稱、發行者、版本和 uri。 ProcessorArchitecture 和 ResourceId 是 MainPackage 的選擇性屬性。

元素階層

<AppInstaller>
**MainPackage**

語法

<MainPackage 
    Name        = A string between 3 and 50 characters in length that consists of alpha-numeric, period, and dash characters.
    Publisher   = A string between 1 and 8192 characters in length that fits the regular expression of a distinguished name: "(CN|L|O|OU|E|C|S|STREET|T|G|I|SN|DC|SERIALNUMBER|(OID\.(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))+))=(([^,+="<>#;])+|".*")(, ((CN|L|O|OU|E|C|S|STREET|T|G|I|SN|DC|SERIALNUMBER|(OID\.(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))+))=(([^,+="<>#;])+|".*")))*". Further, semantic validation ensures that the string is compliant with CertNameToStr Windows API implementation of X.500 rules.
    Version     = A version string in quad notation, "Major.Minor.Build.Revision".
    ProcessorArchitecture  = "x86" | "x64" | "arm" | "neutral"
    Uri         = Uri to the app package location 
    ResourceId? = An ASCII string between 1 and 30 characters in length. />

屬性和項目

屬性

屬性 描述 資料類型 必要
Name 組合資訊清單中 identity 元素所指定的名稱。 Name 屬性不區分大小寫。 長度介於3到50個字元之間的字串,由英數位元、句號和虛線字元所組成。 Yes
Publisher Publisher,如套件組合資訊清單中的 identity 元素所指定。 介於1到8192個字元之間的字串,長度符合辨別名稱的正則運算式。 此外,語意驗證可確保字串符合 CertNameToStr Windows API 實作為500規則的規範。 Yes
版本 套件組合資訊清單中 identity 元素所指定的版本。 四個標記法中的版本字串: Yes
ProcessorArchitecture 描述封裝所包含之程式碼的架構。 包含可執行程式碼的封裝必須包含這個屬性。 "x86" 或 "x64" 或 "arm" 或 "中性" Yes
Uri 應用程式套件位置的 Uri URI,以介於1到2084個字元之間的字串長度。 Yes
ResourceId 描述封裝中包含的 UI 資源類型。 ResourceId 是發行者指定的字串。 這個字串不能以句號結尾,而且不可以是下列其中一個字串: "CON"、"PRN"、"AUX"、"NUL"、"COM1"、"COM2"、"COM3"、"COM4"、"COM5"、"COM6"、"COM7"、"COM8"、"COM9"、"LPT1"、"LPT2"、"LPT3"、"LPT4"、"LPT5"、"LPT6"、"LPT7"、"LPT8" 和 "LPT9"。 長度介於1到30個字元之間的 ASCII 字串。 No

父項目

父項目 描述
AppInstaller Appinstaller 檔的根項目。

備註

只有其中一個 <MainPackage><MainBundle> 可以在專案中 <AppInstaller> 宣告。

<MainPackage>元素應該僅用於 ( .appx) 的應用程式套件。

注意

Name、Publisher、Version、ProcessorArchitecture 和 ResourceId必須符合應用程式封裝 Uri 中所指定 AppxManifest.xml 檔案中的值。

需求

Namespace http://schemas.microsoft.com/appx/appinstaller/2017