Exemplo n.º 1
0
 public void UninstallCustomUXSubscription(SubscriptionState subState)
 {
     using (this.AcquireSubscriptionWriterLock(subState))
     {
         SubscriptionStore.CheckInstalled(subState);
         if (subState.appType != AppType.CustomUX)
         {
             throw new InvalidOperationException(Resources.GetString("Ex_CannotCallUninstallCustomUXApplication"));
         }
         if (subState.CurrentApplicationManifest != null)
         {
             string productName = (string)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);
         SubscriptionStore.OnDeploymentRemoved(subState);
     }
 }
Exemplo n.º 2
0
 public void SetLastCheckTimeToNow(SubscriptionState subState)
 {
     using (this.AcquireSubscriptionWriterLock(subState))
     {
         SubscriptionStore.CheckInstalled(subState);
         this._compStore.SetPendingDeployment(subState, (DefinitionIdentity)null, DateTime.UtcNow);
     }
 }
Exemplo n.º 3
0
 public void UninstallCustomHostSpecifiedSubscription(SubscriptionState subState)
 {
     using (this.AcquireSubscriptionWriterLock(subState))
     {
         SubscriptionStore.CheckInstalled(subState);
         if (subState.appType != AppType.CustomHostSpecified)
         {
             throw new InvalidOperationException(Resources.GetString("Ex_CannotCallUninstallCustomAddIn"));
         }
         this._compStore.RemoveSubscription(subState);
         SubscriptionStore.OnDeploymentRemoved(subState);
     }
 }
Exemplo n.º 4
0
 public void CommitApplication(ref SubscriptionState subState, CommitApplicationParams commitParams)
 {
     Logger.AddMethodCall("CommitApplication called.");
     using (this.AcquireSubscriptionWriterLock(subState))
     {
         if (commitParams.CommitDeploy)
         {
             Logger.AddInternalState("Commiting Deployment :  subscription metadata.");
             UriHelper.ValidateSupportedScheme(commitParams.DeploySourceUri);
             this.CheckDeploymentSubscriptionState(subState, commitParams.DeployManifest);
             this.ValidateFileAssoctiation(subState, commitParams);
             if (commitParams.IsUpdate && !commitParams.IsUpdateInPKTGroup)
             {
                 SubscriptionStore.CheckInstalled(subState);
             }
         }
         if (commitParams.CommitApp)
         {
             Logger.AddInternalState("Commiting Application:  application binaries.");
             UriHelper.ValidateSupportedScheme(commitParams.AppSourceUri);
             if (commitParams.AppGroup != null)
             {
                 SubscriptionStore.CheckInstalled(subState);
             }
             this.CheckApplicationPayload(commitParams);
         }
         bool      flag = false;
         bool      identityGroupFound       = false;
         bool      locationGroupFound       = false;
         string    identityGroupProductName = "";
         ArrayList arrayList = this._compStore.CollectCrossGroupApplications(commitParams.DeploySourceUri, commitParams.DeployManifest.Identity, ref identityGroupFound, ref locationGroupFound, ref identityGroupProductName);
         if (arrayList.Count > 0)
         {
             flag = true;
             Logger.AddInternalState("This installation is a Cross Group: identityGroupFound=" + identityGroupFound.ToString() + ",locationGroupFound=" + locationGroupFound.ToString());
         }
         if (subState.IsShellVisible & identityGroupFound & locationGroupFound)
         {
             throw new DeploymentException(ExceptionTypes.GroupMultipleMatch, string.Format((IFormatProvider)CultureInfo.CurrentUICulture, Resources.GetString("Ex_GroupMultipleMatch"), new object[1]
             {
                 (object)identityGroupProductName
             }));
         }
         subState = this.GetSubscriptionState(commitParams.DeployManifest);
         this._compStore.CommitApplication(subState, commitParams);
         if (flag)
         {
             Logger.AddInternalState("Performing cross group migration.");
             IActContext actContext = IsolationInterop.CreateActContext(subState.CurrentBind.ComPointer);
             actContext.PrepareForExecution(IntPtr.Zero, IntPtr.Zero);
             uint ulDisposition;
             actContext.SetApplicationRunningState(0U, 1U, out ulDisposition);
             actContext.SetApplicationRunningState(0U, 2U, out ulDisposition);
             Logger.AddInternalState("Uninstalling all cross groups.");
             foreach (ComponentStore.CrossGroupApplicationData groupApplicationData in arrayList)
             {
                 if (groupApplicationData.CrossGroupType == ComponentStore.CrossGroupApplicationData.GroupType.LocationGroup)
                 {
                     if (groupApplicationData.SubState.appType == AppType.CustomHostSpecified)
                     {
                         Logger.AddInternalState("UninstallCustomHostSpecifiedSubscription : " + (groupApplicationData.SubState.SubscriptionId != null ? groupApplicationData.SubState.SubscriptionId.ToString() : "null"));
                         this.UninstallCustomHostSpecifiedSubscription(groupApplicationData.SubState);
                     }
                     else if (groupApplicationData.SubState.appType == AppType.CustomUX)
                     {
                         Logger.AddInternalState("UninstallCustomUXSubscription : " + (groupApplicationData.SubState.SubscriptionId != null ? groupApplicationData.SubState.SubscriptionId.ToString() : "null"));
                         this.UninstallCustomUXSubscription(groupApplicationData.SubState);
                     }
                     else if (groupApplicationData.SubState.IsShellVisible)
                     {
                         Logger.AddInternalState("UninstallSubscription : " + (groupApplicationData.SubState.SubscriptionId != null ? groupApplicationData.SubState.SubscriptionId.ToString() : "null"));
                         this.UninstallSubscription(groupApplicationData.SubState);
                     }
                 }
                 else if (groupApplicationData.CrossGroupType == ComponentStore.CrossGroupApplicationData.GroupType.IdentityGroup)
                 {
                     Logger.AddInternalState("Not uninstalled :" + (groupApplicationData.SubState.SubscriptionId != null ? groupApplicationData.SubState.SubscriptionId.ToString() : "null") + ". It is in the identity group.");
                 }
             }
         }
         if (commitParams.IsConfirmed && subState.IsInstalled && (subState.IsShellVisible && commitParams.appType != AppType.CustomUX))
         {
             this.UpdateSubscriptionExposure(subState);
         }
         if (commitParams.appType == AppType.CustomUX)
         {
             ShellExposure.ShellExposureInformation exposureInformation = ShellExposure.ShellExposureInformation.CreateShellExposureInformation(subState.SubscriptionId);
             ShellExposure.UpdateShellExtensions(subState, ref exposureInformation);
         }
         SubscriptionStore.OnDeploymentAdded(subState);
     }
 }
Exemplo n.º 5
0
 public void CheckInstalledAndShellVisible(SubscriptionState subState)
 {
     SubscriptionStore.CheckInstalled(subState);
     SubscriptionStore.CheckShellVisible(subState);
 }