private void PreInstallPackage() { WIMAX_API_PACKAGE_INFO packageInfo = new WIMAX_API_PACKAGE_INFO(); if (CurrentUserSettings.ShowApdoFumoSimulator()) { packageInfo.mandatoryUpdate = true; packageInfo.warnUser = true; packageInfo.filePath = Environment.SystemDirectory; packageInfo.fileName = "mspaint.exe"; packageInfo.forceReboot = false; } else { int packageInformation = APDOHandler.Singleton.GetPackageInformation(ref packageInfo); if (packageInformation != 0) { ErrorHelper.ShowErrorDialog((Control) AppFramework.Dashboard, ErrorStringsHelper.GetString("General_GetPackageInformationFailed"), ErrorHelper.TranslateErrorCodeToMessage(packageInformation), (string) null, "GetPackageInformationFailed"); return; } } if (!packageInfo.mandatoryUpdate) { if (this.PromptUser(APDOEventHandler.PromptType.PackageInstall) != DialogResult.Yes) return; } else if (packageInfo.warnUser && !this._packageInstallCMB.Visible) { this._numOfSecondsBeforeInstallationBegins = 20; if (this._packageInstallCMBTimer == null) { this._packageInstallCMBTimer = new System.Windows.Forms.Timer(); this._packageInstallCMBTimer.Tick += new EventHandler(this.OnPackageInstallPopupTimer); this._packageInstallCMBTimer.Interval = TimerSettings.APDOEventHandler_PackageInstallCMBTimer_Interval; } this._packageInstallCMBTimer.Start(); this._packageInstallCMB = new CustomMessageBox(this.GetPackageInstallCMBText(), CustomMessageBoxStyle.Ok); this._packageInstallCMB.AccessibleName = "FUMOInstallMB"; this._packageInstallCMB.LocationOfMessageBox = CustomMessageBoxLocation.AlwaysInTaskTrayBottom; int num = (int) this._packageInstallCMB.CustomShowDialog((IWin32Window) AppFramework.Dashboard, true); if (this._packageInstallCMBTimer != null) this._packageInstallCMBTimer.Stop(); } this.InstallPackage(packageInfo); }
private void InstallPackage(WIMAX_API_PACKAGE_INFO packageInfo) { new SecurityPermission(SecurityPermissionFlag.AllFlags).Demand(); string path = string.Empty; if (!string.IsNullOrEmpty(packageInfo.filePath)) path = path + packageInfo.filePath + "\\"; if (!string.IsNullOrEmpty(packageInfo.fileName)) path = path + packageInfo.fileName; if (!string.IsNullOrEmpty(path) && File.Exists(path)) { Eventing.GenerateUIEvent("WiMAXSP.OnAPDO", (object) this, new object[1] { (object) APDOEventType.PackageInstallStarted }); ThreadPool.QueueUserWorkItem(new WaitCallback(APDOEventHandler.DoAsyncInstallPackage), (object) path); } else ErrorHelper.ShowErrorDialog((Control) AppFramework.Dashboard, ErrorStringsHelper.GetString("General_PackageInstallationFailed"), string.Format(ErrorStringsHelper.GetString("APDO_PACKAGE_INSTALLATION_FILE_DOES_NOT_EXIST"), (object) path), (string) null, "PackageInstallationFailedFileDoesNotExist"); }