Starts installation of a package.
public:
static IAsyncOperationWithProgress<PackageInstallResult, PackageInstallProgress>^ InstallAsync(
String^ sourceUri
)
sourceUri
Type: String
URL to the package.
Type: IAsyncOperationWithProgress<PackageInstallResult, PackageInstallProgress>
Returns an IAsyncOperationWithProgress<TResult,TProgress> object that represents the state of the asynchronous operation. Completion of the asynchronous operation is signaled by using a handler that is passed to the IAsyncOperationWithProgress<TResult,TProgress>.Completed property. Progress of the asynchronous operation is signaled by using a handler that is passed to the IAsyncOperationWithProgress<TResult,TProgress>.Progress property When the asynchronous operation is complete, the result of the operation can be retrieved by using the IAsyncOperationWithProgress<TResult,TProgress>.GetResults method.
In Javascript the InstallAsync method is exposed as a Promise.
//Install our game
function handleInstallButtonInvoked() {
writeLog("Installing: " + installUrlForOurGame);
XtfPackageInstallManager.installAsync(installUrlForOurGame)
.done(
handleInstallCompleted,
handleInstallErrors,
handleInstallProgress
);
};
//Install Completed handler
function handleInstallCompleted(installResult) {
if (installResult.errorCode) {
writeLog("*** Error: " + installResult.packageFullName + " failed to install. Error Code: ", installResult.error);
} else {
writeLog("Installation of package " + installResult.packageFullName + " Completed!");
}
};
//Install Errors handler
function handleInstallErrors(installError) {
writeError("*** Failed to install your package. Error Code: ", installError);
}
//Install Progress handler
function handleInstallProgress(installProgress) {
writeLog("Installing " + installProgress.packageFullName + " " + installProgress.percentComplete + "% complete.");
};
Namespace: Microsoft.Xbox.Tools.ConsoleExtensions
Metadata: microsoft.xbox.tools.consoleextensions.winmd