private void linkAppId_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     this.linkAppId.LinkVisited = true;
     UserInterface.LaunchUrlInBrowser(e.Link.LinkData.ToString());
 }
 private void ActivateDeploymentWorker(object state)
 {
     string subscrioptionUrl = null;
     string textualSubId = null;
     string deploymentProviderUrlFromExtension = null;
     try
     {
         CodeMarker_Singleton.Instance.CodeMarker(CodeMarkerEvent.perfNewApptBegin);
         object[] args = (object[]) state;
         subscrioptionUrl = (string) args[0];
         Logger.StartCurrentThreadLogging();
         Logger.SetSubscriptionUrl(subscrioptionUrl);
         Logger.AddInternalState("Activation through dfsvc.exe started.");
         Logger.AddMethodCall("ActivateDeploymentWorker({0},{1},{2},{3},{4}) called.", args);
         bool isShortcut = (bool) args[1];
         if (args[2] != null)
         {
             textualSubId = (string) args[2];
         }
         if (args[3] != null)
         {
             deploymentProviderUrlFromExtension = (string) args[3];
         }
         BrowserSettings browserSettings = null;
         if (args[4] != null)
         {
             browserSettings = (BrowserSettings) args[4];
         }
         Uri uri = null;
         string errorPageUrl = null;
         try
         {
             int num = this.CheckActivationInProgress(subscrioptionUrl);
             this._ui = new UserInterface(false);
             if (!PolicyKeys.SuppressLimitOnNumberOfActivations() && (num > 8))
             {
                 throw new DeploymentException(ExceptionTypes.ActivationLimitExceeded, Resources.GetString("Ex_TooManyLiveActivation"));
             }
             if (subscrioptionUrl.Length > 0x4000)
             {
                 throw new DeploymentException(ExceptionTypes.Activation, Resources.GetString("Ex_UrlTooLong"));
             }
             uri = new Uri(subscrioptionUrl);
             try
             {
                 UriHelper.ValidateSupportedSchemeInArgument(uri, "activationUrl");
             }
             catch (ArgumentException exception)
             {
                 throw new InvalidDeploymentException(ExceptionTypes.UriSchemeNotSupported, Resources.GetString("Ex_NotSupportedUriScheme"), exception);
             }
             Logger.AddPhaseInformation(Resources.GetString("PhaseLog_StartOfActivation"), new object[] { subscrioptionUrl });
             this.PerformDeploymentActivation(uri, isShortcut, textualSubId, deploymentProviderUrlFromExtension, browserSettings, ref errorPageUrl);
             Logger.AddPhaseInformation(Resources.GetString("ActivateManifestSucceeded"), new object[] { subscrioptionUrl });
         }
         catch (DependentPlatformMissingException exception2)
         {
             Logger.AddErrorInformation(exception2, Resources.GetString("ActivateManifestException"), new object[] { subscrioptionUrl });
             if (this._ui == null)
             {
                 this._ui = new UserInterface();
             }
             if (!this._ui.SplashCancelled())
             {
                 this.DisplayPlatformDetectionFailureUI(exception2);
             }
         }
         catch (DownloadCancelledException exception3)
         {
             Logger.AddErrorInformation(exception3, Resources.GetString("ActivateManifestException"), new object[] { subscrioptionUrl });
         }
         catch (TrustNotGrantedException exception4)
         {
             Logger.AddErrorInformation(exception4, Resources.GetString("ActivateManifestException"), new object[] { subscrioptionUrl });
         }
         catch (DeploymentException exception5)
         {
             Logger.AddErrorInformation(exception5, Resources.GetString("ActivateManifestException"), new object[] { subscrioptionUrl });
             if (exception5.SubType != ExceptionTypes.ActivationInProgress)
             {
                 if (this._ui == null)
                 {
                     this._ui = new UserInterface();
                 }
                 if (!this._ui.SplashCancelled())
                 {
                     if (exception5.SubType == ExceptionTypes.ActivationLimitExceeded)
                     {
                         if (Interlocked.CompareExchange(ref _liveActivationLimitUIStatus, 1, 0) == 0)
                         {
                             this.DisplayActivationFailureReason(exception5, errorPageUrl);
                             Interlocked.CompareExchange(ref _liveActivationLimitUIStatus, 0, 1);
                         }
                     }
                     else
                     {
                         this.DisplayActivationFailureReason(exception5, errorPageUrl);
                     }
                 }
             }
         }
         catch (Exception exception6)
         {
             if ((exception6 is AccessViolationException) || (exception6 is OutOfMemoryException))
             {
                 throw;
             }
             if (PolicyKeys.DisableGenericExceptionHandler())
             {
                 throw;
             }
             Logger.AddErrorInformation(exception6, Resources.GetString("ActivateManifestException"), new object[] { subscrioptionUrl });
             if (this._ui == null)
             {
                 this._ui = new UserInterface();
             }
             if (!this._ui.SplashCancelled())
             {
                 this.DisplayActivationFailureReason(exception6, errorPageUrl);
             }
         }
     }
     finally
     {
         this.RemoveActivationInProgressEntry(subscrioptionUrl);
         if (this._ui != null)
         {
             this._ui.Dispose();
             this._ui = null;
         }
         CodeMarker_Singleton.Instance.CodeMarker(CodeMarkerEvent.perfNewApptEnd);
         Logger.EndCurrentThreadLogging();
         LifetimeManager.EndOperation();
     }
 }
 private void InitializeContent()
 {
     this.pictureDesktop.Image = Resources.GetImage("setup.bmp");
     this.lblSubHeader.Text    = string.Format(CultureInfo.CurrentUICulture, Resources.GetString("UI_UpdateSubHeader"), new object[] { UserInterface.LimitDisplayTextLength(this._info.productName) });
     this.linkAppId.Text       = this._info.productName;
     this.linkAppId.Links.Clear();
     if (UserInterface.IsValidHttpUrl(this._info.supportUrl))
     {
         this.linkAppId.Links.Add(0, this._info.productName.Length, this._info.supportUrl);
     }
     this.lblFromId.Text = this._info.sourceSite;
 }
 private void MaintainSubscriptionInternal(string textualSubId)
 {
     bool flag = false;
     string[] strArray = new string[] { "Maintain_Exception", "Maintain_Completed", "Maintain_Failed", "Maintain_FailedMsg" };
     bool flag2 = false;
     Exception exception = null;
     bool flag3 = false;
     bool flag4 = false;
     string linkUrlMessage = Resources.GetString("ErrorMessage_GenericLinkUrlMessage");
     string linkUrl = null;
     string errorReportUrl = null;
     Logger.StartCurrentThreadLogging();
     Logger.SetTextualSubscriptionIdentity(textualSubId);
     using (UserInterface interface2 = new UserInterface())
     {
         MaintenanceInfo maintenanceInfo = new MaintenanceInfo();
         try
         {
             UserInterfaceInfo info = new UserInterfaceInfo();
             Logger.AddPhaseInformation(Resources.GetString("PhaseLog_StoreQueryForMaintenanceInfo"));
             SubscriptionState subscriptionState = this.GetSubscriptionState(textualSubId);
             try
             {
                 subscriptionState.SubscriptionStore.CheckInstalledAndShellVisible(subscriptionState);
                 if (subscriptionState.RollbackDeployment == null)
                 {
                     maintenanceInfo.maintenanceFlags |= MaintenanceFlags.RemoveSelected;
                 }
                 else
                 {
                     maintenanceInfo.maintenanceFlags |= MaintenanceFlags.RestorationPossible;
                     maintenanceInfo.maintenanceFlags |= MaintenanceFlags.RestoreSelected;
                 }
                 AssemblyManifest currentDeploymentManifest = subscriptionState.CurrentDeploymentManifest;
                 if ((currentDeploymentManifest != null) && (currentDeploymentManifest.Description != null))
                 {
                     errorReportUrl = currentDeploymentManifest.Description.ErrorReportUrl;
                 }
                 Description effectiveDescription = subscriptionState.EffectiveDescription;
                 info.productName = effectiveDescription.Product;
                 info.supportUrl = effectiveDescription.SupportUrl;
                 info.formTitle = string.Format(CultureInfo.CurrentUICulture, Resources.GetString("UI_MaintenanceTitle"), new object[] { info.productName });
                 flag3 = true;
             }
             catch (DeploymentException exception2)
             {
                 flag3 = false;
                 Logger.AddErrorInformation(Resources.GetString("MaintainLogMsg_FailedStoreLookup"), exception2);
                 maintenanceInfo.maintenanceFlags |= MaintenanceFlags.RemoveSelected;
             }
             catch (FormatException exception3)
             {
                 flag3 = false;
                 Logger.AddErrorInformation(Resources.GetString("MaintainLogMsg_FailedStoreLookup"), exception3);
                 maintenanceInfo.maintenanceFlags |= MaintenanceFlags.RemoveSelected;
             }
             bool flag5 = false;
             if (flag3)
             {
                 if (interface2.ShowMaintenance(info, maintenanceInfo) == UserInterfaceModalResult.Ok)
                 {
                     flag5 = true;
                 }
             }
             else
             {
                 maintenanceInfo.maintenanceFlags = MaintenanceFlags.RemoveSelected;
                 flag5 = true;
             }
             if (flag5)
             {
                 flag2 = true;
                 if ((maintenanceInfo.maintenanceFlags & MaintenanceFlags.RestoreSelected) != MaintenanceFlags.ClearFlag)
                 {
                     strArray = new string[] { "Rollback_Exception", "Rollback_Completed", "Rollback_Failed", "Rollback_FailedMsg" };
                     subscriptionState.SubscriptionStore.RollbackSubscription(subscriptionState);
                     flag2 = false;
                     interface2.ShowMessage(Resources.GetString("UI_RollbackCompletedMsg"), Resources.GetString("UI_RollbackCompletedTitle"));
                 }
                 else if ((maintenanceInfo.maintenanceFlags & MaintenanceFlags.RemoveSelected) != MaintenanceFlags.ClearFlag)
                 {
                     strArray = new string[] { "Uninstall_Exception", "Uninstall_Completed", "Uninstall_Failed", "Uninstall_FailedMsg" };
                     try
                     {
                         subscriptionState.SubscriptionStore.UninstallSubscription(subscriptionState);
                         flag2 = false;
                     }
                     catch (DeploymentException exception4)
                     {
                         Logger.AddErrorInformation(Resources.GetString("MaintainLogMsg_UninstallFailed"), exception4);
                         flag4 = true;
                         ShellExposure.RemoveSubscriptionShellExposure(subscriptionState);
                         flag4 = false;
                     }
                 }
                 flag = true;
             }
         }
         catch (DeploymentException exception5)
         {
             Logger.AddErrorInformation(exception5, Resources.GetString(strArray[0]), new object[] { textualSubId });
             exception = exception5;
         }
         finally
         {
             Logger.AddPhaseInformation(Resources.GetString(flag ? strArray[1] : strArray[2]), new object[] { textualSubId });
             if ((((maintenanceInfo.maintenanceFlags & MaintenanceFlags.RestoreSelected) != MaintenanceFlags.ClearFlag) && flag2) || ((((maintenanceInfo.maintenanceFlags & MaintenanceFlags.RemoveSelected) != MaintenanceFlags.ClearFlag) && flag4) && flag2))
             {
                 string logFilePath = Logger.GetLogFilePath();
                 if (!Logger.FlushCurrentThreadLogs())
                 {
                     logFilePath = null;
                 }
                 if ((errorReportUrl != null) && (exception != null))
                 {
                     Exception innerMostException = this.GetInnerMostException(exception);
                     linkUrl = string.Format("{0}?outer={1}&&inner={2}&&msg={3}", new object[] { errorReportUrl, exception.GetType().ToString(), innerMostException.GetType().ToString(), innerMostException.Message });
                     if (linkUrl.Length > 0x800)
                     {
                         linkUrl = linkUrl.Substring(0, 0x800);
                     }
                 }
                 interface2.ShowError(Resources.GetString("UI_MaintenceErrorTitle"), Resources.GetString(strArray[3]), logFilePath, linkUrl, linkUrlMessage);
             }
             Logger.EndCurrentThreadLogging();
         }
     }
 }