public void RollbackSubscription(SubscriptionState subState)
 {
     using (this.AcquireSubscriptionWriterLock(subState))
     {
         this.CheckInstalledAndShellVisible(subState);
         if (subState.RollbackDeployment == null)
         {
             throw new DeploymentException(ExceptionTypes.SubscriptionState, Resources.GetString("Ex_SubNoRollbackDeployment"));
         }
         if (subState.CurrentApplicationManifest != null)
         {
             string productName = null;
             if ((subState.CurrentDeploymentManifest != null) && (subState.CurrentDeploymentManifest.Description != null))
             {
                 productName = subState.CurrentDeploymentManifest.Description.Product;
             }
             if (productName == null)
             {
                 productName = subState.SubscriptionId.Name;
             }
             ShellExposure.RemoveShellExtensions(subState.SubscriptionId, subState.CurrentApplicationManifest, productName);
         }
         this._compStore.RollbackSubscription(subState);
         this.UpdateSubscriptionExposure(subState);
         OnDeploymentRemoved(subState);
     }
 }
 public void UninstallCustomUXSubscription(SubscriptionState subState)
 {
     using (this.AcquireSubscriptionWriterLock(subState))
     {
         CheckInstalled(subState);
         if (subState.appType != AppType.CustomUX)
         {
             throw new InvalidOperationException(Resources.GetString("Ex_CannotCallUninstallCustomUXApplication"));
         }
         if (subState.CurrentApplicationManifest != null)
         {
             string productName = null;
             if ((subState.CurrentDeploymentManifest != null) && (subState.CurrentDeploymentManifest.Description != null))
             {
                 productName = subState.CurrentDeploymentManifest.Description.Product;
             }
             if (productName == null)
             {
                 productName = subState.SubscriptionId.Name;
             }
             ShellExposure.RemoveShellExtensions(subState.SubscriptionId, subState.CurrentApplicationManifest, productName);
         }
         this._compStore.RemoveSubscription(subState);
         OnDeploymentRemoved(subState);
     }
 }
Ejemplo n.º 3
0
        public static void UpdateShellExtensions(SubscriptionState subState, ref ShellExposure.ShellExposureInformation shellExposureInformation)
        {
            string productName = (string)null;

            if (shellExposureInformation != null)
            {
                productName = shellExposureInformation.AppProduct;
            }
            if (productName == null)
            {
                productName = subState.SubscriptionId.Name;
            }
            if (subState.PreviousBind != null)
            {
                Logger.AddInternalState("Removing file associations if existed for the previous version.");
                ShellExposure.RemoveShellExtensions(subState.SubscriptionId, subState.PreviousApplicationManifest, productName);
            }
            Logger.AddInternalState("Registering file associations if there is any in the manifest for the new version. ");
            ShellExposure.AddShellExtensions(subState.SubscriptionId, subState.DeploymentProviderUri, subState.CurrentApplicationManifest);
            NativeMethods.SHChangeNotify(134217728, 0U, IntPtr.Zero, IntPtr.Zero);
        }
 public void UninstallSubscription(SubscriptionState subState)
 {
     using (this.AcquireSubscriptionWriterLock(subState))
     {
         this.CheckInstalledAndShellVisible(subState);
         if (subState.CurrentApplicationManifest != null)
         {
             string productName = null;
             if ((subState.CurrentDeploymentManifest != null) && (subState.CurrentDeploymentManifest.Description != null))
             {
                 productName = subState.CurrentDeploymentManifest.Description.Product;
             }
             if (productName == null)
             {
                 productName = subState.SubscriptionId.Name;
             }
             ShellExposure.RemoveShellExtensions(subState.SubscriptionId, subState.CurrentApplicationManifest, productName);
             ShellExposure.RemovePins(subState);
         }
         this._compStore.RemoveSubscription(subState);
         RemoveSubscriptionExposure(subState);
         OnDeploymentRemoved(subState);
     }
 }