PackageInstallManager.IsInstalled Method

Checks whether a package is installed.

Syntax

public:
static bool IsInstalled(
         String^ packageFullName
)  

Parameters

packageFullName
Type: String 

 The package to check.

Return value

Type: bool 

 Returns true if the given package is installed.

Remarks

If an install is abruptly terminated, IsInstalled can return true even if a package has been un-installed. This can happen in debugging sessions if you call InstallAsync, then hit Shift-F5, and then call Uninstall.

If you encounter this problem, you can workaround it by setting your console back to a good known state by calling xbcleanup /F or by catching exceptions and looking for the “Package not found” error, as follows:

try { if (PackageInstallManager.isInstalled(pfnForOurGame)) { ApplicationManager.uninstall(pfnForOurGame); } catch (e) { if (e.number != -2147009295) { // Package not found this._writeError("Failed to uninstall.", e); } }  

Requirements

Namespace: Microsoft.Xbox.Tools.ConsoleExtensions

Metadata: microsoft.xbox.tools.consoleextensions.winmd

See also

Reference

PackageInstallManager Class

PackageInstallManager Members

Microsoft.Xbox.Tools.ConsoleExtensions Namespace