private void ToggleInstallationLabel(InstallStatus install) { try { installStatus = install; switch (install) { case InstallStatus.Installed: txtLabelInstalled.Foreground = new SolidColorBrush(Colors.LawnGreen); txtLabelInstalled.Text = "Installed"; uStatusUpdate("Found installed Panacea executable"); PanaceaReadyToStart(); break; case InstallStatus.NotInstalled: txtLabelInstalled.Foreground = new SolidColorBrush(Colors.Red); txtLabelInstalled.Text = "Not Installed"; uStatusUpdate("Couldn't find Panacea executable, not installed"); ToggleFixMeButton(FixMeStatus.NotInstalled); PanaceaStartDisable(); break; default: uDebugLogAdd("Unknown state triggered for install status", DebugType.FAILURE); uStatusUpdate("Unknown state triggered for install status, please let the developer know"); break; } } catch (Exception ex) { LogException(ex); } }
static void Main(string[] args) { InstallStatus status = Reinstaller.CheckForUpdates(false); if (ApplicationDeployment.IsNetworkDeployed) { Console.WriteLine("\t" + ApplicationDeployment.CurrentDeployment.CurrentVersion); } if (status == InstallStatus.NoUpdates) { Console.WriteLine("We've successfully executed the check for an update, but there was no update."); } else if (status == InstallStatus.FailedUninstall) { Console.WriteLine("Couldn't Uninstall the application. New installation never executed."); } else if (status == InstallStatus.FailedReinstall) { Console.WriteLine("The application was uninstalled. However, the installation of the new version failed."); } else if (status == InstallStatus.Success) { Console.WriteLine("Success! You have uninstalled and reinstalled the application. Here is where you can put " + "any clean up code because you didn't ask the Reinstaller to exit the application."); } Console.ReadKey(); }
public VersionCheckerResponce(InstallStatus status, string version, string message, string versionPath) { this.InstallStatus = status; this.Message = message; this.Version = version; this.VersionPath = versionPath; }
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { Visibility result = Visibility.Hidden; InstallStatus s1 = (InstallStatus)parameter; foreach (object val in values) { if (val != null && (InstallStatus)val == s1) { result = Visibility.Visible; } } if (values != null && values[0] != null && values[1] != null) { InstallStatus s2 = (InstallStatus)values[0]; InstallStatus s3 = (InstallStatus)values[1]; if (s2 == s3) { result = Visibility.Visible; } } return(result); }
public override InstallStatus GetInstallStatus() { if (_configuration == null || _localConfig == null) { return(new InstallStatus(InstallStatusType.RequiresConfiguration)); } var installStatus = new InstallStatus(InstallStatusType.Pending); //now, let check if we've actually been installed try { var isValid = ValidateSchema(_configuration); if (isValid) { installStatus = new InstallStatus(InstallStatusType.Completed); } } catch (Exception ex) { //if an exception is thrown other than an HibernateException then its probably attempted an install and failed //such as invalid connection details installStatus = new InstallStatus(InstallStatusType.TriedAndFailed, ex); } return(installStatus); }
private async void CheckInstall() { installStatus = InstallStatus.Unknown; var checkTask = await ShellUtility.ExecuteCommandAsync("npm version"); installStatus = !checkTask ? InstallStatus.NotFound : InstallStatus.Installed; }
/// <summary> /// Return the symbol to use to represent a mod's StatusSymbol. /// This can't be static because the user's installation plans are part of the object. /// </summary> /// <param name="st">Install status of a mod</param> /// <returns> /// String containing symbol to use /// </returns> public static string StatusSymbol(InstallStatus st) { switch (st) { case InstallStatus.Unavailable: return(unavailable); case InstallStatus.Removing: return(removing); case InstallStatus.Upgrading: return(upgrading); case InstallStatus.Upgradeable: return(upgradable); case InstallStatus.Installed: return(installed); case InstallStatus.AutoInstalled: return(autoInstalled); case InstallStatus.Installing: return(installing); case InstallStatus.NotInstalled: return(notinstalled); case InstallStatus.AutoDetected: return(autodetected); case InstallStatus.Replaceable: return(replaceable); case InstallStatus.Replacing: return(replacing); default: return(""); } }
private void updateStatus(int rowIndex, InstallStatus status) { if (status == InstallStatus.Failed) { throw new NotSupportedException("Failed status expects error parameter."); } updateStatus(rowIndex, status, null); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { InstallStatus s1 = (InstallStatus)value; InstallStatus s2 = (InstallStatus)parameter; return(s1 == s2 ? Visibility.Visible : Visibility.Collapsed); }
public void BuildAll(InstallStatus status, string mainBuildFolder, string optBuildFolder, string saveFolder) { Log.Dual("Building FOMODs..."); Log.Display("This can take some time."); Build(status, mainBuildFolder, Path.Combine(saveFolder, Paths.MainFOMOD)); Build(status, optBuildFolder, Path.Combine(saveFolder, Paths.OptFOMOD)); Log.File("\tDone."); Log.Display("\tFOMODs built."); }
public InstallAbstract(string fileName, InstallStatus installStatus) { if (!IsValidMSI(fileName)) { throw new IOException("Invalid extension. The selected file must be an .msi"); } _installStatus = installStatus; }
private static void SetInstallStatus(InstallStatus status) // Writes value 'status' to 'rootRegKeyName\InstallStatus' // For backwards compatibility with 3rd party applications, // the same value is also written under the 'XenToolsInstaller' // registry keys (both x64/x86) { const string SOFTWARE = @"SOFTWARE\"; const string XTINSTALLER = @"XCP-ng\XenToolsInstaller"; const string INSTALLSTATUS = "InstallStatus"; string xenToolsKey; Trace.WriteLine( "Setting \'" + INSTALLSTATUS + "\': \'" + status + "\'" ); installStatus = status; using (RegistryKey rootRK = Registry.LocalMachine.CreateSubKey(rootRegKeyName)) { rootRK.SetValue( INSTALLSTATUS, status, RegistryValueKind.String ); } xenToolsKey = SOFTWARE + XTINSTALLER; using (RegistryKey rk = Registry.LocalMachine.CreateSubKey(xenToolsKey)) { rk.SetValue( INSTALLSTATUS, status, RegistryValueKind.String ); } if (!WinVersion.Is64BitOS()) { return; } xenToolsKey = SOFTWARE + @"Wow6432Node\" + XTINSTALLER; using (RegistryKey rk = Registry.LocalMachine.CreateSubKey(xenToolsKey)) { rk.SetValue( INSTALLSTATUS, status, RegistryValueKind.String ); } }
/// <summary>Snippet for GetInstallStatus</summary> public void GetInstallStatus() { // Snippet: GetInstallStatus(string, CallSettings) // Create client GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.Create(); // Initialize request argument(s) string name = "projects/[PROJECT]/deployments/[DEPLOYMENT]/installStatus"; // Make the request InstallStatus response = gSuiteAddOnsClient.GetInstallStatus(name); // End snippet }
/// <summary>Snippet for GetInstallStatus</summary> public void GetInstallStatusResourceNames() { // Snippet: GetInstallStatus(InstallStatusName, CallSettings) // Create client GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.Create(); // Initialize request argument(s) InstallStatusName name = InstallStatusName.FromProjectDeployment("[PROJECT]", "[DEPLOYMENT]"); // Make the request InstallStatus response = gSuiteAddOnsClient.GetInstallStatus(name); // End snippet }
/// <summary> /// 更新安装进度 /// </summary> /// <param name="type">类型标识:安装/卸载</param> /// <param name="progressState">进度状态</param> public override void OnProgressUpdated(AMS_OPERATION_TYPE type, InstallStatus progressState) { string res = String.Format("\"progress\":\"{0}\",\"type\":\"{1}\"", ((int)progressState).ToString(), ((int)type).ToString()); res = "{" + res + "}"; xFaceLib.Log.XLog.WriteInfo("-------------------AMS OnProgressUpdated result: " + res); //TODO: ams install progress PluginResult result = new PluginResult(PluginResult.Status.OK, res); result.KeepCallback = true; DispatchPluginResult(this, result); }
/// <summary>Snippet for GetInstallStatus</summary> public void GetInstallStatusRequestObject() { // Snippet: GetInstallStatus(GetInstallStatusRequest, CallSettings) // Create client GSuiteAddOnsClient gSuiteAddOnsClient = GSuiteAddOnsClient.Create(); // Initialize request argument(s) GetInstallStatusRequest request = new GetInstallStatusRequest { InstallStatusName = InstallStatusName.FromProjectDeployment("[PROJECT]", "[DEPLOYMENT]"), }; // Make the request InstallStatus response = gSuiteAddOnsClient.GetInstallStatus(request); // End snippet }
/// <summary>Snippet for GetInstallStatusAsync</summary> public async Task GetInstallStatusResourceNamesAsync() { // Snippet: GetInstallStatusAsync(InstallStatusName, CallSettings) // Additional: GetInstallStatusAsync(InstallStatusName, CancellationToken) // Create client GSuiteAddOnsClient gSuiteAddOnsClient = await GSuiteAddOnsClient.CreateAsync(); // Initialize request argument(s) InstallStatusName name = InstallStatusName.FromProjectDeployment("[PROJECT]", "[DEPLOYMENT]"); // Make the request InstallStatus response = await gSuiteAddOnsClient.GetInstallStatusAsync(name); // End snippet }
/// <summary>Snippet for GetInstallStatusAsync</summary> public async Task GetInstallStatusAsync() { // Snippet: GetInstallStatusAsync(string, CallSettings) // Additional: GetInstallStatusAsync(string, CancellationToken) // Create client GSuiteAddOnsClient gSuiteAddOnsClient = await GSuiteAddOnsClient.CreateAsync(); // Initialize request argument(s) string name = "projects/[PROJECT]/deployments/[DEPLOYMENT]/installStatus"; // Make the request InstallStatus response = await gSuiteAddOnsClient.GetInstallStatusAsync(name); // End snippet }
protected InstallStatus GetInstallStatusByListCheck(IEnumerable <RMPackObject> list, bool dualMode = false) { InstallStatus retVal = InstallStatus.NotApplicable; if (list != null && list.Count() > 0) { foreach (RMPackObject obj in list) { if (dualMode) { if (retVal == InstallStatus.NotApplicable) { retVal = obj.InstallationStatus; } else if (obj.InstallationStatus == InstallStatus.Installed && retVal == InstallStatus.NotInstalled) { return(InstallStatus.Partial); } else if (obj.InstallationStatus == InstallStatus.NotInstalled && retVal == InstallStatus.Installed) { return(InstallStatus.Partial); } } else { if (retVal == InstallStatus.NotApplicable) { retVal = obj.InstallationStatus; } else if (retVal == InstallStatus.NotInstalled) { if (obj.InstallationStatus == InstallStatus.Installed || obj.InstallationStatus == InstallStatus.Partial) { return(InstallStatus.Partial); } } else if (retVal == InstallStatus.Installed) { if (obj.InstallationStatus == InstallStatus.NotInstalled || obj.InstallationStatus == InstallStatus.Partial) { return(InstallStatus.Partial); } } } } } return(retVal); }
public bool?Run(IInstallStatusUpdate status, CancellationToken token) { if (!_prompts.BuildFOMODsPrompt()) { return(false); } //+1 (opt) status.ItemsTotal++; status.CurrentOperation = "Building FOMODs"; var fomodStatus = new InstallStatus(_installer.ProgressMinorOperation, _installer.Token); _fomod.BuildAll(fomodStatus, _installer.DirTTWMain, _installer.DirTTWOptional, _prompts.TTWSavePath); return(true); }
public void RenameFiles(BSA bsa, IDictionary<string, string> renameDict) { const string opPrefix = "Renaming BSA files"; var opRename = new InstallStatus(Progress, Token) { CurrentOperation = opPrefix }; var renameFixes = CreateRenameQuery(bsa, renameDict); opRename.ItemsTotal = renameDict.Count; #if PARALLEL Parallel.ForEach(renameFixes, a => #else foreach (var a in renameFixes) #endif { renameDict.Remove(a.Item3); opRename.CurrentOperation = opPrefix + ": " + a.Item1 + " -> " + a.Item2; opRename.Step(); }
public static void Build(InstallStatus status, string path, string fomod) { var compressor = new SevenZipCompressor { ArchiveFormat = OutArchiveFormat.SevenZip, CompressionLevel = CompressionLevel.Fast, CompressionMethod = CompressionMethod.Lzma2, CompressionMode = CompressionMode.Create, }; compressor.CustomParameters.Add("mt", "on"); //enable multithreading compressor.FilesFound += (sender, e) => status.ItemsTotal = e.Value; compressor.Compressing += (sender, e) => e.Cancel = status.Token.IsCancellationRequested; compressor.CompressionFinished += (sender, e) => status.Finish(); compressor.FileCompressionStarted += (sender, e) => status.CurrentOperation = "Compressing " + e.FileName; compressor.FileCompressionFinished += (sender, e) => status.Step(); compressor.CompressDirectory(path, fomod, true); }
/// <summary> /// Detect if the user is on the right page, if not, return the proper action for moving them at the right place /// </summary> /// <param name="detectedStatus">The current installation status</param> /// <param name="currentPageStatus">The current page related installation status</param> /// <returns>nothing if currentPageStatus and detected status are equal, else where, an redirect action to the proper page</returns> protected ActionResult RedirectToRightInstallAction(InstallStatus detectedStatus, InstallStatus currentPageStatus) { ActionResult result = null; //Currently good page if (detectedStatus == currentPageStatus) { return null; } //Get the right result action for the status switch (detectedStatus) { case InstallStatus.ReadyToInstall: //Move to the Install page result = this.RedirectToAction("Index", "Install", new { area = "Install" }); break; case InstallStatus.UpdateNeeded: //Move to the update process, its already installed result = this.RedirectToAction("Index", "Update", new { area = "Install" }); break; case InstallStatus.UpToDate: //Move to no up to date, its already installed and up to date result = this.RedirectToAction("UpToDate", "Update", new { area = "Install" }); break; case InstallStatus.Unknown: //An error occured on the detection, stop process result = this.RedirectToAction("UnknowStatus", "Install", new { area = "Install" }); break; case InstallStatus.Error: //One provider has thow an exception. result = this.RedirectToAction("Error", "Install", new { area = "Install" }); break; case InstallStatus.Downgrade: //A downgrade is requested (Currently not supported) result = this.RedirectToAction("Downgrade", "Update", new { area = "Install" }); break; } return result; }
public static AppInstallStatus GetInstallStatus(ConnectInfo connectInfo) { using (var client = new TimeoutWebClient()) { client.Credentials = new NetworkCredential(connectInfo.User, connectInfo.Password); string query = string.Format(kAPI_InstallStatusQuery, connectInfo.IP); string statusJSON = client.DownloadString(query); InstallStatus status = JsonUtility.FromJson <InstallStatus>(statusJSON); if (status == null) { return(AppInstallStatus.Installing); } else if (status.Success == false) { Debug.LogError(status.Reason + "(" + status.CodeText + ")"); return(AppInstallStatus.InstallFail); } return(AppInstallStatus.InstallSuccess); } }
private bool PatchMasters(InstallStatus opProg) { foreach (var esm in Game.CheckedESMs) { try { opProg.CurrentOperation = "Patching " + esm; if (Token.IsCancellationRequested || !PatchMaster(esm)) { return(false); } } finally { opProg.Step(); } } return(true); }
private async Task InstallComponentsAsync() { CreateServicePath.Run(InstallationPath); foreach (var item in InstallQueue) { try { InstallStatus.Add(@"..\Resources\installer-arrow.png"); await item.Invoke(); InstallStatus.Remove(@"..\Resources\installer-arrow.png"); InstallStatus.Add(@"..\Resources\installer-ok.png"); } catch (Exception ex) { InstallationResult = "Houveram um ou mais erros durante a instalação! A operação não foi bem sucedida."; InstallStatus.Remove(@"..\Resources\installer-arrow.png"); InstallStatus.Add(@"..\Resources\installer-error.png"); System.Windows.MessageBox.Show(ex.Message, "Erro!", MessageBoxButton.OK, MessageBoxImage.Error); } } }
public override InstallStatus TryInstall() { switch (_localConfig.Driver) { case SupportedNHDrivers.MsSqlCe4: using (new WriteLockDisposable(SchemaValidationLocker)) { using (var sqlCeEngine = new SqlCeEngine(_configuration.Properties[Environment.ConnectionString])) { if (!sqlCeEngine.Verify()) { sqlCeEngine.CreateDatabase(); } } } break; } InstallStatus installStatus; try { var schemaAlreadyValid = ValidateSchema(_configuration); if (schemaAlreadyValid) { return(new InstallStatus(InstallStatusType.Completed)); } UpdateSchema(_configuration); installStatus = new InstallStatus(InstallStatusType.Completed); } catch (Exception ex) { installStatus = new InstallStatus(InstallStatusType.TriedAndFailed, ex); } return(installStatus); }
private void updateStatus(int rowIndex, InstallStatus status, string error) { switch (status) { case InstallStatus.InProgress: installDataGridView.Rows[rowIndex].Cells[0].Value = Resources.InProgress; installDataGridView.Rows[rowIndex].Cells[2].Value = "In Progress"; installDataGridView.Rows[rowIndex].Cells[3].Value = null; break; case InstallStatus.Success: installDataGridView.Rows[rowIndex].Cells[0].Value = Resources.Success; installDataGridView.Rows[rowIndex].Cells[2].Value = "Success"; installDataGridView.Rows[rowIndex].Cells[3].Value = null; break; case InstallStatus.Failed: installDataGridView.Rows[rowIndex].Cells[0].Value = Resources.Failure; installDataGridView.Rows[rowIndex].Cells[2].Value = "Failed"; installDataGridView.Rows[rowIndex].Cells[3].Value = error; failuresOccured = true; break; } }
void RunCancelInstall() { ABORT = true; if (bgInstall.IsBusy) bgInstall.CancelAsync(); CancelOperation(); InstallFinishTitle = String.Format("{0} " + WPFLocalizeExtensionHelpers.GetUIString("DriversInstalled"), DriverIndex + 1); Status = InstallStatus.NotStarted; InstallStatusTitle = InstallFinishTitle; InstallStatusText = string.Empty; Progress = 0; }
public static bool IsEmpty(this InstallStatus status) => !status.Install.Any() && !status.Uninstall.Any() && !status.Update.Any();
/// <summary> /// Initializes a new instance of the <see cref="ProviderBootstrapper"/> class if insufficient configuration information is yet available. /// </summary> /// <param name="installStatus">The install status.</param> /// <remarks></remarks> public ProviderBootstrapper(InstallStatus installStatus) { _installStatus = installStatus; }
/// <summary>- /// receives the progress of driver scan /// </summary> /// <param name="progressType"></param> /// <param name="data"></param> /// <param name="currentItemPos"></param> /// <param name="nTotalDriversToScan"></param> /// <param name="progress"></param> /// <returns></returns> public bool progressCallback(DUSDKHandler.PROGRESS_TYPE progressType, IntPtr data, int currentItemPos, int nTotalDriversToScan, int progress) { // here we will get the progress of driver scan. DriverData? dd = null; string category = string.Empty; if (data != IntPtr.Zero) { dd = (DriverData)Marshal.PtrToStructure( (IntPtr)(data.ToInt64() + currentItemPos * Marshal.SizeOf(typeof(DriverData))), typeof(DriverData) ); } switch (progressType) { case DUSDKHandler.PROGRESS_TYPE.PROGRESS_UPDATE_STARTED_FOR_SINGLE: { if (data != IntPtr.Zero && dd.HasValue) { if (CurrentDispatcher.Thread != null) { CurrentDispatcher.BeginInvoke((Action)(() => { // DownloadedDrivers.Add(new DownloadingDriverModel(WPFLocalizeExtensionHelpers.GetUIString("InstallingDriver"), devicesForUpdate[currentItemPos])); //ScanStatusTitle = WPFLocalizeExtensionHelpers.GetUIString("InstallingDriver"); // ScanStatusText = devicesForUpdate[currentItemPos].DeviceName; })); } } } break; case DUSDKHandler.PROGRESS_TYPE.PROGRESS_UPDATE_END_FOR_SINGLE: { if (data != IntPtr.Zero && dd.HasValue) { if (CurrentDispatcher.Thread != null) { CurrentDispatcher.BeginInvoke((Action)(() => { InstallFinishTitle = String.Format("{0} " + WPFLocalizeExtensionHelpers.GetUIString("DriversInstalled"), driversToInstall.Count()); Status = InstallStatus.Finished; InstallStatusTitle = InstallFinishTitle; InstallStatusText = ""; DriverIndex = 0; })); } } } break; case DUSDKHandler.PROGRESS_TYPE.PROGRESS_UPDATE_SUCCESSFUL: { } break; case DUSDKHandler.PROGRESS_TYPE.PROGRESS_UPDATE_FAILED: { if (data != IntPtr.Zero && dd.HasValue) { string driverName = ((DriverData)dd).driverName; if (driverName.Length > 37) driverName = driverName.Substring(0, 34) + "..."; if (CurrentDispatcher.Thread != null) { CurrentDispatcher.BeginInvoke((Action)(() => { // ScanStatusTitle = WPFLocalizeExtensionHelpers.GetUIString("UpdateFailed") + " " + driverName; // ScanStatusText = string.Empty; })); } } } break; case DUSDKHandler.PROGRESS_TYPE.PROGRESS_UPDATE_END_FOR_ALL: if (CurrentDispatcher.Thread != null) { CurrentDispatcher.BeginInvoke((Action)(() => { CurrentDispatcher.BeginInvoke((Action)(() => { //ScanFinishTitle = String.Format("{0} " + WPFLocalizeExtensionHelpers.GetUIString("DriversDownloaded"), DevicesForDestinationOS.Count()); //Status = ScanStatus.DownloadFinished; //driverDownloading = false; //ScanStatusTitle = ScanFinishTitle; //ScanStatusText = string.Empty; //driverIndex = 0; Progress = 0; })); })); } break; case DUSDKHandler.PROGRESS_TYPE.PROGRESS_DOWNLOAD_END_FOR_SINGLE_INET_ERROR: { // download failed because of Internet Error } break; case DUSDKHandler.PROGRESS_TYPE.PROGRESS_OSMT_RST_FAILED_OS_NOTMATCHED: //OS aren't match if (CurrentDispatcher.Thread != null) { CurrentDispatcher.BeginInvoke((Action)(() => { CurrentDispatcher.BeginInvoke((Action)(() => { string OSInfo = GetOSInfo(); string OSName = OsList[allDrivers.OS].Key.ToString();//((DU_SUPPORTED_OS_NAMES)allDrivers.OS).ToString(); WPFMessageBox.Show( String.Format(WPFLocalizeExtensionHelpers.GetUIString("OSMismatchText"), OSName, OSInfo), WPFLocalizeExtensionHelpers.GetUIString("OSMismatch"), WPFMessageBoxButton.OK, MessageBoxImage.Error ); Close(); })); })); } break; default: break; } if (progress > 0) { if (CurrentDispatcher.Thread != null) { CurrentDispatcher.BeginInvoke((Action)(() => { Progress = progress; })); } } return true; }
public MySQLInstaller(string fileName, InstallStatus installStatus = null) : base(fileName, installStatus) { _path = $@"{ Directory.GetCurrentDirectory() }\mysql"; _fileName = fileName; }
/// <summary> /// 更新安装进度 /// </summary> /// <param name="type">类型标识:安装/卸载</param> /// <param name="progressState">进度状态</param> public abstract void OnProgressUpdated(AMS_OPERATION_TYPE type, InstallStatus progressState);
private void UpdateProgressBar(InstallStatus opProg, TextProgressBar bar) { bar.Maximum = opProg.ItemsTotal; bar.Value = opProg.ItemsDone; bar.CustomText = opProg.CurrentOperation; }
void RunInstall() { driversToInstall = allDrivers.DownloadedDestinationOSDrivers.Where(d => d.SelectedForInstall).ToList(); if (driversToInstall.Count == 0) { WPFMessageBox.Show(WPFLocalizeExtensionHelpers.GetUIString("SelectAtLeastOneDriver"), WPFLocalizeExtensionHelpers.GetUIString("SelectDrivers"), WPFMessageBoxButton.OK, MessageBoxImage.Exclamation); return; } Progress = 0; InstallStatusTitle = WPFLocalizeExtensionHelpers.GetUIString("InstallingDrivers"); InstallStatusText = string.Empty; PanelScanHeader = WPFLocalizeExtensionHelpers.GetUIString("InstallingDrivers"); Status = InstallStatus.Started; DriverIndex = 0; if (ABORT) { ABORT = false; return; } bgInstall = new BackgroundWorker(); bgInstall.DoWork += DriverInstall; bgInstall.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgInstall_RunWorkerCompleted); bgInstall.WorkerSupportsCancellation = true; bgInstall.RunWorkerAsync(); }
void bgInstall_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (!ABORT) { if (CurrentDispatcher.Thread != null) { CurrentDispatcher.BeginInvoke((Action)(() => { InstallFinishTitle = String.Format("{0} " + WPFLocalizeExtensionHelpers.GetUIString("DriversInstalled"), driversToInstall.Count()); Status = InstallStatus.Finished; InstallStatusTitle = InstallFinishTitle; InstallStatusText = ""; DriverIndex = 0; })); } } }