public bool InstallPendingUpdate(bool withRestart = true) { var lastPreparedVersion = _updateManager.GetPreparedUpdates().LastOrDefault(); if (lastPreparedVersion != null) { try { _updateManager.LaunchUpdater(lastPreparedVersion, withRestart); return(true); } catch (Exception e) when(e is UpdaterAlreadyLaunchedException || e is LockFileNotAcquiredException) { // Ignore race conditions } } return(false); }
private Version?GetLastPreparedUpdate() => _updateManager.GetPreparedUpdates().Max();