Checks whether a package is installed.
public:
static bool IsInstalled(
String^ packageFullName
)
packageFullName
Type: String
The package to check.
Type: bool
Returns true if the given package is installed.
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); } }
Namespace: Microsoft.Xbox.Tools.ConsoleExtensions
Metadata: microsoft.xbox.tools.consoleextensions.winmd