private void UpdateProc() { try { if (_monitor.CancelRequested) { _monitor.ReportCancelled(); return; } _monitor.Stage = "Closing running app instances..."; Utility.KillAllGitterProcesses(_target); _monitor.CurrentProgress = 3; if (_monitor.CancelRequested) { _monitor.ReportCancelled(); return; } _monitor.CanCancel = false; _monitor.Stage = "Installing application..."; Utility.CopyDirectoryContent(_source, _target); _monitor.CurrentProgress = _monitor.MaximumProgress; _monitor.ReportSuccess(); } catch (Exception exc) { _monitor.ReportFailure("Unexpected error:\n" + exc.Message); } }
private void UpdateProc() { try { if (_monitor.CancelRequested) { _monitor.ReportCancelled(); return; } if (!_skipVersionCheck) { _monitor.Stage = "Checking for new version..."; var ver = GetRemoteMasterVersion(); if (ver == null) { _monitor.ReportFailure("Failed to check for new version"); return; } else if (ver <= _currentVersion) { _monitor.Stage = "Your version is up to date"; _monitor.CurrentProgress = _monitor.MaximumProgress; _monitor.ReportSuccess(); return; } if (_monitor.CancelRequested) { _monitor.ReportCancelled(); return; } } _monitor.Stage = "Downloading source code from " + _repoUrl + "..."; _monitor.CurrentProgress = 1; if (DownloadSourceCode()) { if (_monitor.CancelRequested) { _monitor.ReportCancelled(); return; } _monitor.Stage = "Compiling program..."; _monitor.CurrentProgress = 4; if (BuildSourceCode()) { if (_monitor.CancelRequested) { _monitor.ReportCancelled(); return; } _monitor.Stage = "Installing program..."; _monitor.CurrentProgress = 8; KillAllGitterProcesses(); if (_monitor.CancelRequested) { _monitor.ReportCancelled(); return; } _monitor.CanCancel = false; if (DeployBuildResults()) { _monitor.Stage = "Cleaning up temporary files..."; _monitor.CurrentProgress = 9; CleanUp(); _monitor.CurrentProgress = 10; _monitor.Stage = "Launching program..."; StartApplication(); _monitor.ReportSuccess(); } else { _monitor.ReportFailure("Failed to deploy build results."); } } else { _monitor.ReportFailure("Failed to build source code."); } } else { _monitor.ReportFailure("Failed to download source code."); } } catch (Exception exc) { if (_monitor.CancelRequested) { _monitor.ReportCancelled(); } else { _monitor.ReportFailure("Unexpected error:\n" + exc.Message); } } finally { CleanUp(); } }