예제 #1
0
        private SetupResult ProcessDeviceErrorCode(ProcessExecutionResult status)
        {
            if (IsHealthyAndRunning(status))
            {
                return(SetupResult.Success);
            }

            if (IsDriverUpdateRequired(status))
            {
                _tapInstallRunner.Update();
                return(SetupResult.Success);
            }

            if (IsDriverReinstallationRequired(status) && IsPcRestartRequired(status))
            {
                _logger.Log("TapAdapterInstaller: Driver is reinstalling and requesting restart.");
                _tapInstallRunner.Reinstall();

                return(SetupResult.RestartRequired);
            }

            if (IsDriverReinstallationRequired(status))
            {
                _logger.Log("TapAdapterInstaller: Driver is reinstalling.");
                _tapInstallRunner.Reinstall();

                return(SetupResult.Success);
            }

            _logger.Log($"TapAdapterInstaller: Installation failed. Status: {status}");
            return(SetupResult.Failure);
        }
예제 #2
0
        private SetupResult InstalOrUpdateTapAdapter()
        {
            var result = _tapInstallRunner.IsInstalled() ? _tapInstallRunner.Update() : _tapInstallRunner.Install();

            if (result.Success)
            {
                return(SetupResult.Success);
            }

            if (result.RestartRequired)
            {
                return(SetupResult.RestartRequired);
            }

            return(SetupResult.Failure);
        }