public async void Install(bool update = false) { Progress <AppxProgress> progress = new Progress <AppxProgress>(p => { if (p.Percentage == 1000) { ErrorStatus = p.Result; } else if (p.Percentage == ProgressTotal) { // MP! todo: Resolve what happens on completion. ProgressCurrentPosition = (int)p.Percentage; } else { ProgressCurrentPosition = (int)p.Percentage; } }); IsRunning = true; ProgressTotal = 100; cancelTransfer = new CancellationTokenSource(); bool result = await AppxBundle.InstallAppx(BundleName, CertificateName, progress, cancelTransfer.Token, update); IsRunning = false; cancelTransfer = null; IsCurrentlyInstalled = result; ProductStatus = string.Format(installedmessage, IsCurrentlyInstalled ? "" : "NOT "); if (result) { CurrentActionName = "Success"; } }
public AssetSetup(string packageFamilyName, string productName, string productVersion, string bundleName, string certificateName) { ProductName = productName; ProductVersion = productVersion; BundleName = bundleName; CertificateName = certificateName; InstallDirectory = AppxBundle.GetAppxFolder(); IsCurrentlyInstalled = AppxBundle.IsPackageInstalled(packageFamilyName, productVersion, out FullPackageName); ProductStatus = string.Format(installedmessage, IsCurrentlyInstalled ? "" : "NOT "); }