public async Task <Version> CheckPrepareUpdateAsync()
        {
            // If auto-update is disabled - don't check for updates
            if (!_settingsService.IsAutoUpdateEnabled)
            {
                return(null);
            }

            // Cleanup leftover files
            _manager.Cleanup();

            // Check for updates
            var check = await _manager.CheckForUpdatesAsync();

            if (!check.CanUpdate)
            {
                return(null);
            }

            // Prepare the update
            if (!_manager.IsUpdatePrepared(check.LastVersion))
            {
                await _manager.PrepareUpdateAsync(check.LastVersion);
            }

            return(_updateVersion = check.LastVersion);
        }
예제 #2
0
        public async Task <Version> CheckPrepareUpdateAsync()
        {
            // Cleanup leftover files
            _updateManager.Cleanup();

            // Check for updates
            var check = await _updateManager.CheckForUpdatesAsync();

            if (!check.CanUpdate)
            {
                return(null);
            }

            // Prepare the update
            if (!_updateManager.IsUpdatePrepared(check.LastVersion))
            {
                await _updateManager.PrepareUpdateAsync(check.LastVersion);
            }

            return(_updateVersion = check.LastVersion);
        }