private static PackageMetadata LoadPackage(string packagePath, RegistryKey packageKey, PackageState state) { string[] files = Directory.GetFiles(packagePath, "*.nuspec").ToArray(); if (files.Length != 1) throw new PackageUpdateException(Labels.CouldNotFindNuSpecManifest); var nuSpec = Serialization.Deserialize<NuSpec>(files[0]); var metadata = nuSpec.Metadata; metadata.GalleryDetailsUrl = (string)packageKey.GetValue("GalleryDetailsUrl"); metadata.NuGetSite = (string)packageKey.GetValue("NuGetSite"); metadata.Version = (string)packageKey.GetValue("Version"); metadata.PendingVersion = (string)packageKey.GetValue("PendingVersion"); metadata.State = state; return metadata; }
/// <summary> /// Creates a new instance of the <see cref="DetectMsiFeatureEventArgs"/> class. /// </summary> /// <param name="packageId">Detected package identifier.</param> /// <param name="productCode">Detected product code.</param> /// <param name="state">Package state detected.</param> public DetectTargetMsiPackageEventArgs(string packageId, string productCode, PackageState state) { this.packageId = packageId; this.productCode = productCode; this.state = state; }
void IBootstrapperApplication.OnPlanPackageComplete(string wzPackageId, int hrStatus, PackageState state, RequestState requested, ActionState execute, ActionState rollback) { this.OnPlanPackageComplete(new PlanPackageCompleteEventArgs(wzPackageId, hrStatus, state, requested, execute, rollback)); }
/// <summary> /// Initializes a new instance of the ApplicationPackage class with /// required arguments. /// </summary> public ApplicationPackage(PackageState state) : this() { this.State = state; }
void IBootstrapperApplication.OnDetectPackageComplete(string wzPackageId, int hrStatus, PackageState state) { this.OnDetectPackageComplete(new DetectPackageCompleteEventArgs(wzPackageId, hrStatus, state)); }
Result IBootstrapperApplication.OnDetectTargetMsiPackage(string wzPackageId, string wzProductCode, PackageState patchState) { DetectTargetMsiPackageEventArgs args = new DetectTargetMsiPackageEventArgs(wzPackageId, wzProductCode, patchState); this.OnDetectTargetMsiPackage(args); return args.Result; }
public Task SetState(IPackage p, PackageState state) { return Task.Factory.StartNew(() => { var a = CreateActivity(p, ActivityType.SetState); Activities.Add(a); var task = CoApp.SetState(p.CanonicalName, state); task.Wait(); a.State = task.Exception != null ? State.Failed : State.Finished; //task.RethrowWhenFaulted(); }); }
public string GetTooltipByState(PackageState state) { return(string.Format(k_TooltipsByState[(int)state], package.GetDescriptor())); }
private async Task <bool> ProcessPackage(UserInfo userInfo, string feedName, PackageName packageName, PackageState packageState, PackageState damagedPackageState, Func <IPackageStorageItem, Task <IPackageStorageItem> > tryWithPackageItemBefore, Func <IPackageStorageItem, ZipPackage, Task> tryWithPackage, Func <IPackageStorageItem, Task> tryWithPackageItemAfter) { var feed = storage.GetFeed(feedName); var packageItem = feed.GetPackage(null, packageState, packageName); var traceName = packageItem.ToString(); try { packageItem = await tryWithPackageItemBefore(packageItem); if (packageItem == null) { throw new Exception(string.Format("Missing package {0}", traceName)); } using (var packageStream = await packageItem.Get()) { if (packageStream == null) { throw new Exception(string.Format("Missing package data {0}", traceName)); } var package = new ZipPackage(packageStream); await tryWithPackage(packageItem, package); } await tryWithPackageItemAfter(packageItem); return(true); } catch (Exception e) { support.TrackException(e, new { packageName }); Trace.TraceError("Unexpected error while processing package {0}:\n{1}", traceName, e); notifier.Damaged(userInfo, packageName).Wait(); if (packageItem != null) { packageItem.Move(damagedPackageState, packageName).Wait(); } return(false); } }
public static string GetIconStateId(PackageState state) { return(state.ToString().ToLower()); }
public AzureBlob GetBlobReference(PackageState packageState, string userName, PackageName packageName) { var path = GetPath(packageState, userName, packageName); return(new AzureBlob(container.GetBlockBlobReference(path))); }
private static string GetPath(PackageState packageState, string userName, PackageName packageName) { return(string.Format("{0}/{1}", GetDirectoryPath(packageState, userName), GetPackagePath(packageName))); }
private static string GetDirectoryPath(PackageState packageState, string userName) { return(string.Format("pkg/{0}/{1}", packageState.ToString().ToLower(), userName)); }
/// <summary> /// Creates a new instance of the <see cref="DetectPackageCompleteEventArgs"/> class. /// </summary> /// <param name="packageId">The identity of the package detected.</param> /// <param name="status">The return code of the operation.</param> /// <param name="state">The state of the specified package.</param> public DetectPackageCompleteEventArgs(string packageId, int status, PackageState state) : base(status) { this.packageId = packageId; this.state = state; }
public Task SetState(CanonicalName packageName, PackageState state) { return EPM.SetGeneralPackageInformation(50, packageName, "state", state.ToString()); }
/// <summary> /// Creates a new instance of the <see cref="PlanPackageCompleteEventArgs"/> class. /// </summary> /// <param name="packageId">The identity of the package planned for.</param> /// <param name="status">The return code of the operation.</param> /// <param name="state">The current state of the package.</param> /// <param name="requested">The requested state for the package</param> /// <param name="execute">The execution action to take.</param> /// <param name="rollback">The rollback action to take.</param> public PlanPackageCompleteEventArgs(string packageId, int status, PackageState state, RequestState requested, ActionState execute, ActionState rollback) : base(status) { this.packageId = packageId; this.state = state; this.requested = requested; this.execute = execute; this.rollback = rollback; }
public static string GetTooltipByState(PackageState state) { return(ApplicationUtil.instance.GetTranslationForText(k_TooltipsByState[(int)state])); }