適用于 Windows 8) 的應用程式 (套件架構

代表包含套件中所提供之部分或所有功能的應用程式。

元素階層

<套件>
<應用程式>
<應用>

語法

<Application Id          = An ASCII string between 1 and 64 characters in length. See the Attributes table for more information on character restrictions.
             Executable? = A string between 1 and 256 characters in length that must end with ".exe" and cannot contain these characters: <, >, :, %, ", |, ?, or *. It specifies the default executable for the extension. If not specified, the executable defined for the app is used.  If specified, the EntryPoint property is also used. If that EntryPoint property isn't specified, the EntryPoint defined for the app is used.
             EntryPoint? = A string between 1 and 256 characters in length, representing the task  handling the extension. This is normally the fully namespace-qualified name of a Windows Runtime type.
If EntryPoint is not specified, the EntryPoint defined for the app is used instead.

             StartPage?  = A string between 1 and 256 characters in length that cannot contain these characters: <, >, :, %, ", |, ?, or *. >

  <!-- Child elements -->
  ( VisualElements
  & ApplicationContentUriRules?
  & Extensions?
  )

</Application>

答案

? 選擇性 (零或一)

& 交錯連接器 (可能會以任何順序發生)

屬性和項目

屬性

屬性 描述 資料類型 必要 預設值
EntryPoint

啟動的類別識別碼,例如 "" Office。Winword 類別」。

若是桌面應用程式,這個值應該是可執行檔的實際進入點,例如 "main"、"WinMain" 或 "wWinMain"。

如果您指定這個屬性,您也必須指定 可執行 的屬性。 如果您指定這個屬性,就不能指定 StartPage 屬性。

長度介於1到256個字元之間的字串,代表處理延伸模組的工作。 這必須符合 Windows 執行階段類型的完整命名空間名稱。 如果未指定 EntryPoint,則會改用為應用程式定義的進入點。 No
可執行檔

應用程式的預設啟動可執行檔。 此檔案必須存在於封裝中。

如果您指定這個屬性,就必須指定 EntryPoint 屬性。 如果您指定這個屬性,就不能指定 StartPage 屬性。

介於1到256個字元之間的字串,其長度必須以 ".exe" 結尾,且不能包含下列字元: < 、 > 、:、%、"、|、?或 *。 它會指定擴充功能的預設可執行檔。 如果未指定,則會使用為應用程式定義的可執行檔。 如果指定的話,也會使用 EntryPoint 屬性。 如果未指定該 EntryPoint 屬性,則會使用為應用程式定義的進入點。 No
識別碼

封裝內應用程式的唯一識別碼。 此值有時稱為「套件相關應用程式識別碼 (PRAID)」。

識別碼在封裝內是唯一的,但不是全域的。 系統上可能有另一個套件使用相同的識別碼。 相同的識別碼無法在相同的封裝中使用一次以上。

此字串包含以英文句點分隔的英數欄位。 每個欄位的開頭必須為 ASCII 字母字元。 您無法使用這些值做為域值: "CON"、"PRN"、"AUX"、"NUL"、"COM1"、"COM2"、"COM3"、"COM4"、"COM5"、"COM6"、"COM7"、"COM8"、"COM9"、"LPT1"、"LPT2"、"LPT3"、"LPT4"、"LPT5"、"LPT6"、"LPT7"、"LPT8" 和 "LPT9"。

使用 Visual Studio 範本時,此屬性的預設值為 "App"。 開發人員應在資訊清單中手動變更此項。

應用程式在發佈至 Microsoft Store 之後,不應該變更應用程式的識別碼。這樣做會中斷磚在開始畫面上的位置。

長度介於1到64個字元之間的 ASCII 字串。 Yes
StartPage

應用程式的預設啟動 HTML 頁面。 此檔案必須存在於封裝中。

如果您指定這個屬性,就不能指定 EntryPoint 屬性或 可執行 的屬性。

長度介於1到256個字元之間的字串,不能包含下列字元: < 、 > 、:、%、"、|、?或 *。 No

 

子元素

子元素 描述
ApplicationContentUriRules

指定 web 內容中的哪些頁面可以存取系統的地理位置裝置 (如果應用程式有權存取此功能) 和存取剪貼簿。

延伸模組 (類型: CT_ApplicationExtensions)

定義應用程式的一個或多個擴充點。

VisualElements

描述 UWP 應用程式的視覺層面:其預設磚、標誌影像、文字和背景色彩、初始螢幕方向、啟動顯示畫面,以及鎖定畫面磚外觀。

 

父項目

Parent 項目 描述
應用程式

代表組成封裝的一或多個應用程式。

 

備註

應用程式元素包含適用于應用程式之擴充點的通用屬性。 其他擴充點會使用這項資訊來取得應用程式的相關資訊。 此外, 應用程式 屬性也可用於啟動和管理應用程式的實例。

如果指定了StartPage屬性,它就是使用 JavaScript 的 Windows 應用程式。 如果未指定StartPage ,則必須指定可執行檔EntryPoint屬性,它是使用 c # 或 VB 和 XAML 的 UWP 應用程式。

範例

下列範例取自其中一個 SDK 範例的套件資訊清單。

                    
<Applications>
  <Application Id="App" StartPage="default.html">

    <VisualElements DisplayName="Assocation launching sample" 
         Logo="images\squareTile-sdk.png" SmallLogo="images\smallTile-sdk.png" 
         Description="SDK sample" 
         ForegroundText="dark" BackgroundColor="#FFFFFF" ToastCapable="false">
      <DefaultTile ShowName="allLogos" />
      <SplashScreen BackgroundColor="white" Image="images\splash-sdk.png" />
    </VisualElements>

    <Extensions>
      <Extension Category="windows.fileTypeAssociation">
        <FileTypeAssociation Name=".alsdkjs">
          <SupportedFileTypes>
            <FileType>.alsdkjs</FileType>
          </SupportedFileTypes>
        </FileTypeAssociation>
      </Extension>

      <Extension Category="windows.protocol">
        <Protocol Name="alsdkjs" />
      </Extension>
    </Extensions>
  </Application>
</Applications>
                

需求

Namespace http://schemas.microsoft.com/appx/2010/manifest