Поделиться через


DeviceCompanionApplications element

The DeviceCompanionApplications element specifies the Windows Store device app that will be downloaded when the device is installed to the system.

Usage

<DeviceCompanionApplications>
  child elements
</DeviceCompanionApplications>

Attributes

There are no attributes.

Child elements

Element

Package

Child element sequence

Package

Parent elements

Element

SoftwareInfo

XSD

<!-- Device Companion Applications Definition -->
<xs:complexType name="DeviceCompanionApplicationsType">
    <xs:sequence>
      <xs:element name="Package" type="tns:PackageType" maxOccurs="unbounded" />
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
</xs:complexType>

Remarks

The following points describe the use of the DeviceCompanionApplications element in a device metadata package:

  • When you specify the DeviceCompanionApplication element, the specified application will be downloaded when the user installs the device.
  • For some device categories, such as printer or webcam, the package identity and application ID will be used to launch an application or other user interface, such as the common printer dialog or the webcam-settings page.

The structure for the <package> element's <identity> and <applications> element correspond to the structure of those elements in an app manifest. Copy the Name and Publisher attributes from the application manifest's <identity> element after the app has been associated with the Windows Store, because the process of associating your app will update the app manifest. See Step 2: Create device metadata for your Windows Store device app for more information on associating the app with the store.

Here is an example of how the <Identity> element may look inside an app manifest. See the Examples section below for a complete app manifest example.

<Identity Name="64022FABRIKAM.FabrikamDeviceApp" Publisher="CN=05558413-FFF6-4AA5-8176-AD43036533FA" Version="1.0.0.0" />

Here is an example of how the <Applications> element may be structured inside an app manifest. See the Examples section below for a complete app manifest example.

 <Applications>
    <Application Id="DeviceAppForPrinters" Executable="$targetnametoken$.exe" 
        EntryPoint="DeviceAppForPrinters.App">
    </Application>
  </Applications>

You can see the Package name and publisher in Microsoft Visual Studio 2012 by following these steps:

  1. Open your app solution in Visual Studio 2012.
  2. If you have not done so already, associate your app with the Windows Store using the steps in Step 2: Create device metadata for your Windows Store device app.
  3. Double-click Package.appxmanifest in Solution Explorer to open the app manifest designer.
  4. In the manifest designer, click on the Packaging tab.
  5. In the Packaging tab, you can find the Package Name field and the Publisher field.

You can see the App ID in Visual Studio 2012 by following these steps:

  1. Open your app solution in Visual Studio 2012.
  2. Right-click Package.appxmanifest in Solution Explorer and choose View Code.
  3. You can see the Application element's Id attribute in the app manifest code.

You can specify only one package and one application ID in <DeviceCompanionApplications> for Windows 8. The second package or application ID will be ignored.

The UMDF Fx2 sample provides a sample metadata package that demonstrates the DeviceCompanionApplications element.

Examples

The following shows an example of an app manifest. The snippet that follows it shows the <DeviceCompanionApplications> element that can be derived from this manifest.

<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="https://schemas.microsoft.com/appx/2010/manifest">
  <Identity Name="64022FABRIKAM.FabrikamDeviceApp" Publisher="CN=05558413-FFF6-4AA5-8176-AD43036533FA" Version="1.0.0.0" />
  <Properties>
    <DisplayName>Fabrikam Device App</DisplayName>
    <PublisherDisplayName>Fabrikam</PublisherDisplayName>
    <Logo>Assets\storeLogo-sdk.png</Logo>
  </Properties>
  <Prerequisites>
    <OSMinVersion>6.2</OSMinVersion>
    <OSMaxVersionTested>6.2</OSMaxVersionTested>
  </Prerequisites>
  <Resources>
    <Resource Language="x-generate" />
  </Resources>
  <Applications>
    <Application Id="DeviceAppForPrinters" Executable="$targetnametoken$.exe" 
        EntryPoint="DeviceAppForPrinters.App">
      <VisualElements DisplayName="Fabrikam Device App" Logo="Assets\squareTile-sdk.png" 
         SmallLogo="Assets\smallTile-sdk.png" Description="DeviceAppForPrinters" ForegroundText="light" BackgroundColor="#00b2f0" ToastCapable="true">
        <DefaultTile ShowName="allLogos" ShortName="App4PrinterCS" WideLogo="Assets\tile-sdk.png" />
        <SplashScreen Image="Assets\splash-sdk.png" BackgroundColor="#00b2f0" />
      </VisualElements>
      <Extensions>
          <Extension Category="windows.backgroundTasks" 
             EntryPoint="Fabrikam.Printing.PrintApp.PrintNotificationHandler">
               <BackgroundTasks>
                 <Task Type="systemEvent" />
               </BackgroundTasks>
          </Extension>
          <Extension Category="windows.printTaskSettings" 
             Executable="$targetnametoken$.exe" EntryPoint="DeviceAppForPrinters.App" />
      </Extensions>
    </Application>
  </Applications>
</Package>

The following is an example of a <DeviceCompanionApplications> element derived from the app manifest.

<DeviceCompanionApplications>
    <Package>
        <Identity Name="64022FABRIKAM.FabrikamDeviceApp" 
    Publisher="CN=05558413-FFF6-4AA5-8176-AD43036533FA" />
        <Applications>
            <Application Id="DeviceAppForPrinters">
                  <DeviceNotificationHandlers>
          <DeviceNotificationHandler
            EventID="PrintNotificationHandler"
            EventAsset="Fabrikam.Printing.PrintApp.PrintNotificationHandler" />
      </DeviceNotificationHandlers>
            </Application>
  </Applications>
    </Package>
</DeviceCompanionApplications>

Element information

Minimum supported system

Windows 8
Can be empty No

See also

SoftwareInfo XML Example

SoftwareInfo

Package

 

 

Send comments about this topic to Microsoft