Installation​Manager Installation​Manager Installation​Manager Installation​Manager Class

Definition

Manages the application installations for a phone.

public : static class InstallationManagerpublic static class InstallationManagerPublic Static Class InstallationManager// This API is not available in Javascript.
Attributes
Windows 10 requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)

Remarks

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

Methods

AddPackageAsync(String, Uri) AddPackageAsync(String, Uri) AddPackageAsync(String, Uri) AddPackageAsync(String, Uri)

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

public : static IAsyncOperationWithProgress<PackageInstallResult, unsigned short> AddPackageAsync(PlatForm::String title, Uri sourceLocation)public static IAsyncOperationWithProgress<PackageInstallResult, uint> AddPackageAsync(String title, Uri sourceLocation)Public Static Function AddPackageAsync(title As String, sourceLocation As Uri) As IAsyncOperationWithProgress( Of PackageInstallResult, uint )// This API is not available in Javascript.
Parameters
title
PlatForm::String String String String

The name of the app to install.

sourceLocation
Uri Uri Uri Uri

The URI location of the app to install.

Returns

The asynchronous operation that represents the installation process.

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.
}
See Also

AddPackageAsync(String, Uri, String, String, Uri) AddPackageAsync(String, Uri, String, String, Uri) AddPackageAsync(String, Uri, String, String, Uri) AddPackageAsync(String, Uri, String, String, Uri)

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

public : static IAsyncOperationWithProgress<PackageInstallResult, unsigned short> AddPackageAsync(PlatForm::String title, Uri sourceLocation, PlatForm::String instanceId, PlatForm::String offerId, Uri license)public static IAsyncOperationWithProgress<PackageInstallResult, uint> AddPackageAsync(String title, Uri sourceLocation, String instanceId, String offerId, Uri license)Public Static Function AddPackageAsync(title As String, sourceLocation As Uri, instanceId As String, offerId As String, license As Uri) As IAsyncOperationWithProgress( Of PackageInstallResult, uint )// This API is not available in Javascript.
Parameters
title
PlatForm::String String String String

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

sourceLocation
Uri Uri Uri Uri

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

instanceId
PlatForm::String String String String

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

offerId
PlatForm::String String String String

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

license
Uri Uri Uri Uri

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.

See Also

FindPackages() FindPackages() FindPackages() FindPackages()

Retrieves information about all packages installed across all users.

public : static IIterable<Package> FindPackages()public static IEnumerable<Package> FindPackages()Public Static Function FindPackages() As IEnumerable( Of Package )// This API is not available in Javascript.
Returns
IIterable<Package> IEnumerable<Package> IEnumerable<Package> IEnumerable<Package>

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.

See Also

FindPackages(String, String) FindPackages(String, String) FindPackages(String, String) FindPackages(String, String)

Finds all installed packages with the specified name and publisher.

public : static IIterable<Package> FindPackages(PlatForm::String packageName, PlatForm::String packagePublisher)public static IEnumerable<Package> FindPackages(String packageName, String packagePublisher)Public Static Function FindPackages(packageName As String, packagePublisher As String) As IEnumerable( Of Package )// This API is not available in Javascript.
Parameters
packageName
PlatForm::String String String String

The package name. This parameter cannot be null.

packagePublisher
PlatForm::String String String String

The package publisher. This parameter cannot be null.

Returns
IIterable<Package> IEnumerable<Package> IEnumerable<Package> IEnumerable<Package>

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.

See Also

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 IEnumerable<Package> FindPackagesForCurrentPublisher()Public Static Function FindPackagesForCurrentPublisher() As IEnumerable( Of Package )// This API is not available in Javascript.
Returns
IIterable<Package> IEnumerable<Package> IEnumerable<Package> IEnumerable<Package>

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

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);

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.

GetPendingPackageInstalls() GetPendingPackageInstalls() GetPendingPackageInstalls() GetPendingPackageInstalls()

Returns all of the app installations currently in progress.

public : static IIterable<IAsyncOperationWithProgress<PackageInstallResult, unsigned short>> GetPendingPackageInstalls()public static IEnumerable<IAsyncOperationWithProgress> GetPendingPackageInstalls()Public Static Function GetPendingPackageInstalls() As IEnumerable( Of IAsyncOperationWithProgress )// This API is not available in Javascript.
Returns
IIterable<IAsyncOperationWithProgress<PackageInstallResult, unsigned short>> IEnumerable<IAsyncOperationWithProgress> IEnumerable<IAsyncOperationWithProgress> IEnumerable<IAsyncOperationWithProgress>

A list of the app installations currently in progress. The list contains the PackageInstallResult (pending) for each installation, which are wrapped by the async operation class (IAsyncOperationWithProgress ). See Asynchronous programming for more info on how to get progress info.

RegisterPackageAsync(Uri, IIterable<Uri>, DeploymentOptions) RegisterPackageAsync(Uri, IIterable<Uri>, DeploymentOptions) RegisterPackageAsync(Uri, IIterable<Uri>, DeploymentOptions) RegisterPackageAsync(Uri, IIterable<Uri>, DeploymentOptions)

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

public : static IAsyncOperationWithProgress<PackageInstallResult, unsigned short> RegisterPackageAsync(Uri manifestUri, IIterable<Uri> dependencyPackageUris, DeploymentOptions deploymentOptions)public static IAsyncOperationWithProgress<PackageInstallResult, uint> RegisterPackageAsync(Uri manifestUri, IEnumerable<Uri> dependencyPackageUris, DeploymentOptions deploymentOptions)Public Static Function RegisterPackageAsync(manifestUri As Uri, dependencyPackageUris As IEnumerable<Uri>, deploymentOptions As DeploymentOptions) As IAsyncOperationWithProgress( Of PackageInstallResult, uint )// This API is not available in Javascript.
Parameters
manifestUri
Uri Uri Uri Uri

The path to the package manifest of the main package.

dependencyPackageUris
IIterable<Uri> IEnumerable<Uri> IEnumerable<Uri> IEnumerable<Uri>

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
DeploymentOptions DeploymentOptions DeploymentOptions DeploymentOptions

Options that modify the deployment operation.

Returns

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

RemovePackageAsync(String, RemovalOptions) RemovePackageAsync(String, RemovalOptions) RemovePackageAsync(String, RemovalOptions) RemovePackageAsync(String, 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, unsigned short> RemovePackageAsync(PlatForm::String packageFullName, RemovalOptions removalOptions)public static IAsyncOperationWithProgress<PackageInstallResult, uint> RemovePackageAsync(String packageFullName, RemovalOptions removalOptions)Public Static Function RemovePackageAsync(packageFullName As String, removalOptions As RemovalOptions) As IAsyncOperationWithProgress( Of PackageInstallResult, uint )// This API is not available in Javascript.
Parameters
packageFullName
PlatForm::String String String String

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

removalOptions
RemovalOptions RemovalOptions RemovalOptions RemovalOptions

Options that modify the removal operation.

Returns

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