Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 private Version?GetLastPreparedUpdate() => _updateManager.GetPreparedUpdates().Max();