InstallationManager InstallationManager InstallationManager Class

Manages the application installations for a phone.

Syntax

Declaration

public static class InstallationManagerpublic static class InstallationManagerPublic Static Class InstallationManager

Remarks

Use this class to find applications from a particular app publisher, install apps and get pending app installs.

Methods summary

Starts the installation process for the app specified by the app title and location URI.

This API is not intended to be used directly from your code.

Retrieves information about all packages installed across all users.

Finds all installed packages with the specified name and publisher.

Returns all the app packages with the same publisher ID as the app calling this method.

Returns all of the app installations currently in progress.

Registers a package (the main package) and its dependency packages for the current user.

Removes a package for the current user asynchronously and receives progress and status messages on the removal operation. Dependency packages are also removed for the user if no other packages installed for the user depend on them.

Methods

  • AddPackageAsync(System.String,Windows.Foundation.Uri)
    AddPackageAsync(System.String,Windows.Foundation.Uri)
    AddPackageAsync(System.String,Windows.Foundation.Uri)
    AddPackageAsync(System.String,Windows.Foundation.Uri)

    Starts the installation process for the app specified by the app title and location URI.

    public static IAsyncOperationWithProgress<PackageInstallResult, uint> AddPackageAsync(System.String,Windows.Foundation.Uri)public static IAsyncOperationWithProgress<PackageInstallResult, uint> AddPackageAsync(System.String,Windows.Foundation.Uri)Public Static Function AddPackageAsync(System.String,Windows.Foundation.Uri) As IAsyncOperationWithProgress( Of PackageInstallResult, uint )

    Parameters

    • title
      System.String
      System.String
      System.String

      The name of the app to install.

    • sourceLocation

      The URI location of the app to install.

    Returns

    • The asynchronous operation that represents the installation process.

    Remarks

    Examples

    void InstallMyCoolApp()
    {
        Uri uri = new Uri(@"https://PlaceHolderServerName/XAP/MyCoolApp.xap");
        string appTitle = "Cool App";
    
        Windows.Foundation.IAsyncOperationWithProgress<PackageInstallResult, uint> result;
    
        // Queue up an installation request.
        result = InstallationManager.AddPackageAsync(appTitle, uri);
    
        // Note: You could save "result" as a member variable to enable 
        // the installation to be cancelled later.
    }
    
  • AddPackageAsync(System.String,Windows.Foundation.Uri,System.String,System.String,Windows.Foundation.Uri)
    AddPackageAsync(System.String,Windows.Foundation.Uri,System.String,System.String,Windows.Foundation.Uri)
    AddPackageAsync(System.String,Windows.Foundation.Uri,System.String,System.String,Windows.Foundation.Uri)
    AddPackageAsync(System.String,Windows.Foundation.Uri,System.String,System.String,Windows.Foundation.Uri)

    This API is not intended to be used directly from your code.

    public static IAsyncOperationWithProgress<PackageInstallResult, uint> AddPackageAsync(System.String,Windows.Foundation.Uri,System.String,System.String,Windows.Foundation.Uri)public static IAsyncOperationWithProgress<PackageInstallResult, uint> AddPackageAsync(System.String,Windows.Foundation.Uri,System.String,System.String,Windows.Foundation.Uri)Public Static Function AddPackageAsync(System.String,Windows.Foundation.Uri,System.String,System.String,Windows.Foundation.Uri) As IAsyncOperationWithProgress( Of PackageInstallResult, uint )

    Parameters

    • title
      System.String
      System.String
      System.String

      This API is not intended to be used directly from your code.

    • sourceLocation

      This API is not intended to be used directly from your code.

    • instanceId
      System.String
      System.String
      System.String

      This API is not intended to be used directly from your code.

    • offerId
      System.String
      System.String
      System.String

      This API is not intended to be used directly from your code.

    • license

      This API is not intended to be used directly from your code.

    Returns

    • This API is not intended to be used directly from your code.

  • FindPackages()
    FindPackages()
    FindPackages()
    FindPackages()

    Retrieves information about all packages installed across all users.

    public static IIterable<Package> FindPackages()public static IIterable<Package> FindPackages()Public Static Function FindPackages() As IIterable( Of Package )

    Returns

    • If the method succeeds, an enumerable collection of package objects is returned. Each Package object in this collection contains information about the package, including but not limited to its name, publisher, version, and install location.

    Remarks

    This method requires the ID_CAP_OEM_DEPLOYMENT capability and is not intended to be used directly from your code.

  • FindPackages(System.String,System.String)
    FindPackages(System.String,System.String)
    FindPackages(System.String,System.String)
    FindPackages(System.String,System.String)

    Finds all installed packages with the specified name and publisher.

    public static IIterable<Package> FindPackages(System.String,System.String)public static IIterable<Package> FindPackages(System.String,System.String)Public Static Function FindPackages(System.String,System.String) As IIterable( Of Package )

    Parameters

    • packageName
      System.String
      System.String
      System.String

      The package name. This parameter cannot be null.

    • packagePublisher
      System.String
      System.String
      System.String

      The package publisher. This parameter cannot be null.

    Returns

    • If the method succeeds, an enumerable collection of package objects with the same package name and publisher name is returned. Each Package object in this collection contains information about the package, including but not limited to its name, publisher, version, and install location. If no packages with the specified name and publisher are found, this method returns an empty list.

  • FindPackagesForCurrentPublisher()
    FindPackagesForCurrentPublisher()
    FindPackagesForCurrentPublisher()
    FindPackagesForCurrentPublisher()

    Returns all the app packages with the same publisher ID as the app calling this method.

    public static IIterable<Package> FindPackagesForCurrentPublisher()public static IIterable<Package> FindPackagesForCurrentPublisher()Public Static Function FindPackagesForCurrentPublisher() As IIterable( Of Package )

    Returns

    • A list of app packages with the same publisher ID as the app calling this method.

    Remarks

    This method returns all applications associated with the publisher ID of the calling app. This includes:

    • Apps preloaded on the phone.
    • Apps installed by the user.
    • Apps currently stored on the phone's SD card.
    • Enterprise apps.

    Examples

    using Windows.ApplicationModel;
    using Windows.Phone.Management.Deployment;
    
    void DisplayApplicationInfo(string ProductId)
    {
    
        IEnumerable<Package> packages = InstallationManager.FindPackagesForCurrentPublisher();
    
        // Loop over all installed applications looking for the specified ProductId 
        // (not the most efficient way to search, but a simple way to show how to use   
        // the functionality. 
        foreach (Package package in packages)
        {
            if (package.Id.ProductId.ToString().ToLower()== ProductId.ToLower())
            {
                // Dislay the title info in the ApplicationTitle textlock.
                ApplicationTitle.Text = package.Id.Name;
    
                // Retrieve the icon image by getting its DSS Token.
                string token = package.GetThumbnailToken();
    
                // Do something with image token.
    
            }
        }
    }
    

    You can also use this method to see if other apps from your publisher ID are installed on a phone. If they’re installed, you can launch them. To demonstrate, the following example enumerates all apps for the current publisher ID and launches the first app in the enumeration (unless that app happens to be the current app).

    IEnumerable<Package> apps = Windows.Phone.Management.Deployment.InstallationManager.FindPackagesForCurrentPublisher();
    apps.First().Launch(string.Empty);
    
  • GetPendingPackageInstalls()
    GetPendingPackageInstalls()
    GetPendingPackageInstalls()
    GetPendingPackageInstalls()

    Returns all of the app installations currently in progress.

    public static IIterable<PackageInstallResult, uint>> GetPendingPackageInstalls()public static IIterable<PackageInstallResult, uint>> GetPendingPackageInstalls()Public Static Function GetPendingPackageInstalls() As IIterable( Of PackageInstallResult, uint )

    Returns

  • RegisterPackageAsync(Windows.Foundation.Uri,Windows.Foundation.Collections.IIterable{Windows.Foundation.Uri},Windows.Management.Deployment.DeploymentOptions)
    RegisterPackageAsync(Windows.Foundation.Uri,Windows.Foundation.Collections.IIterable{Windows.Foundation.Uri},Windows.Management.Deployment.DeploymentOptions)
    RegisterPackageAsync(Windows.Foundation.Uri,Windows.Foundation.Collections.IIterable{Windows.Foundation.Uri},Windows.Management.Deployment.DeploymentOptions)
    RegisterPackageAsync(Windows.Foundation.Uri,Windows.Foundation.Collections.IIterable{Windows.Foundation.Uri},Windows.Management.Deployment.DeploymentOptions)

    Registers a package (the main package) and its dependency packages for the current user.

    public static IAsyncOperationWithProgress<PackageInstallResult, uint> RegisterPackageAsync(Windows.Foundation.Uri,Windows.Foundation.Collections.IIterable{Windows.Foundation.Uri},Windows.Management.Deployment.DeploymentOptions)public static IAsyncOperationWithProgress<PackageInstallResult, uint> RegisterPackageAsync(Windows.Foundation.Uri,Windows.Foundation.Collections.IIterable{Windows.Foundation.Uri},Windows.Management.Deployment.DeploymentOptions)Public Static Function RegisterPackageAsync(Windows.Foundation.Uri,Windows.Foundation.Collections.IIterable{Windows.Foundation.Uri},Windows.Management.Deployment.DeploymentOptions) As IAsyncOperationWithProgress( Of PackageInstallResult, uint )

    Parameters

    • manifestUri

      The path to the package manifest of the main package.

    • dependencyPackageUris

      The paths to the dependency packages. If there are no dependency packages or if the dependency packages are already registered, this parameter can be null. When DeploymentOptions is set to DevelopmentMode, leave this parameter null.

    • deploymentOptions

      Options that modify the deployment operation.

    Returns

    • An object that represents the asynchronous deployment operation and includes progress updates.

  • RemovePackageAsync(System.String,Windows.Management.Deployment.RemovalOptions)
    RemovePackageAsync(System.String,Windows.Management.Deployment.RemovalOptions)
    RemovePackageAsync(System.String,Windows.Management.Deployment.RemovalOptions)
    RemovePackageAsync(System.String,Windows.Management.Deployment.RemovalOptions)

    Removes a package for the current user asynchronously and receives progress and status messages on the removal operation. Dependency packages are also removed for the user if no other packages installed for the user depend on them.

    public static IAsyncOperationWithProgress<PackageInstallResult, uint> RemovePackageAsync(System.String,Windows.Management.Deployment.RemovalOptions)public static IAsyncOperationWithProgress<PackageInstallResult, uint> RemovePackageAsync(System.String,Windows.Management.Deployment.RemovalOptions)Public Static Function RemovePackageAsync(System.String,Windows.Management.Deployment.RemovalOptions) As IAsyncOperationWithProgress( Of PackageInstallResult, uint )

    Parameters

    • packageFullName
      System.String
      System.String
      System.String

      A string representation of the package identity to identify the package to be removed.

    • removalOptions

      Options that modify the removal operation.

    Returns

    • An object that represents the asynchronous removal operation and includes progress updates.

Device family

Windows Mobile Extension SDK (introduced v10.0.10240.0)

API contract

Windows.Phone.PhoneContract (introduced v1)

Attributes

Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Phone.Management.Deployment.dll