private async Task RestoreBackup(int backupVersion, string gameType) { if (MessageBox.Show("Restoring the backup will overwrite some of your GTA 5 files. Continue?", "Restore backup", MessageBoxButton.YesNoCancel) != MessageBoxResult.Yes) { return; } _logger.Write($"Started restoring game backup of version {backupVersion}"); var backupZipPath = GetBackupPathByVersion(backupVersion.ToString(), gameType); var backupExtractionPath = _gamePath; await ZipExtractor.ExtractToDirectoryAsync(backupZipPath, backupExtractionPath, true); _notificationService.ShowNotification("GTA 5 successfully downgraded."); }
private async Task <bool> ExtractUpdate(string updateFilePath) { var extractionPath = GetUpdateDownloadFolder(); _logger.Write($"Extracting launcher files {updateFilePath} to {extractionPath}"); try { await ZipExtractor.ExtractToDirectoryAsync(updateFilePath, extractionPath, true); return(true); } catch (Exception ex) { _logger.Write(ex); } return(false); }
private async Task <bool> ExtractUpdate(string updateFilePath) { var extractionPath = GetUpdateExtractionPath(); _logger.Write($"Extracting client files {updateFilePath} to {extractionPath}"); try { CleanupClientDirectory(extractionPath); await ZipExtractor.ExtractToDirectoryAsync(updateFilePath, extractionPath, true); Directory.Delete(GetUpdateDownloadFolder(), true); return(true); } catch (Exception ex) { _logger.Write(ex); _notificationService.ShowNotification("Failed to extract update.", true); } return(false); }