private async void Install() { if (_state == DriverInstallerState.Start) { // 드라이버 초기화. _driver = new DriverUtility(); _tempPath = Path.GetTempFileName(); Reports.Instance.AddReportWithDispatcher(ReportType.Information, "드라이버 설치를 시작합니다."); _state = DriverInstallerState.Check; Install(); } else if (_state == DriverInstallerState.Check) { await CheckAsync().ConfigureAwait(false); } else if (_state == DriverInstallerState.Download) { await DownloadAsync().ConfigureAwait(false); } else if (_state == DriverInstallerState.Decompress) { await DecompressAsync().ConfigureAwait(false); } else if (_state == DriverInstallerState.Complete) { ProgressCaption = "완료"; Reports.Instance.AddReportWithDispatcher(ReportType.Complete, "드라이버 설치가 완료되었습니다."); Settings.Instance.DriverVersion = _selectedVersion; } else if (_state == DriverInstallerState.Error) { if (_retryCount >= 10) { return; } Reports.Instance.AddReportWithDispatcher(ReportType.Complete, $"드라이버 설치중 오류가 발생하였습니다. {++_retryCount}번째 재시도 중입니다."); Install(); } }
public void Init() { driver = DriverUtility.CreateWebDriver(); }