public static void SnapshotBackupCode() { var i = 1; _areSavesAvaliable = Directory.GetFiles(CommonVariables.SaveLocation, "*.isgsf").Length > 0; if (!_areSavesAvaliable) { return; } if (Settings.Default.ArchiveBackups) { IoController.ArchiveCodec(false, SearchLocation, Settings.Default.AutoBackupLocation + "\\ImmortalSins-BackupSnapshot-" + DateTime.Now.ToString("yyyyMMddHHmm") + ".isarc2"); } else { if (!Directory.Exists(BackupFolder)) { IoController.DirectoryCopy(SearchLocation, BackupFolder, true); } else { var newBackupFolder = BackupFolder + "-" + i + "\\"; while (Directory.Exists(BackupFolder + "-" + i + "\\")) { i++; } IoController.DirectoryCopy(SearchLocation, newBackupFolder, true); } } }
public static void SingleBackupArchive() { if (!Directory.Exists(SingleBackupLocation)) { return; } IoController.ArchiveCodec(false, SingleBackupLocation, Settings.Default.AutoBackupLocation + "\\ImmortalSins-SingleBackup.isarc2"); Directory.Delete(SingleBackupLocation, true); }
private static void UnpackSingleBackupPackage() { if (Directory.Exists(SingleBackupLocation)) { Directory.Delete(SingleBackupLocation, true); } if (File.Exists(Settings.Default.AutoBackupLocation + "\\ImmortalSins-SingleBackup.isarc2")) { IoController.ArchiveCodec(true, Settings.Default.AutoBackupLocation + "\\ImmortalSins-SingleBackup.isarc2", SingleBackupLocation); } else { Directory.CreateDirectory(SingleBackupLocation); } }