public override void Backup(string backupDirectory) { var fileName = PathTools.SanitizeFileName(FullRegKeyPath.TrimStart('\\')) + ".reg"; var path = Path.Combine(CreateBackupDirectory(backupDirectory), fileName); RegistryTools.ExportRegistry(path, new[] { FullRegKeyPath }); }
private void saveFileDialogBackupRegistry_FileOk(object sender, CancelEventArgs e) { try { var regPaths = SelectedJunk.OfType <RegistryJunkNode>().Select(x => x.FullName); RegistryTools.ExportRegistry(saveFileDialogBackupRegistry.FileName, regPaths); } catch (Exception ex) { if (MessageBoxes.BackupFailedQuestion(ex.Message) == MessageBoxes.PressedButton.Cancel) { e.Cancel = true; } } }
public override void CreateBackup(string backupPath) { var path = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\" + ProgramName; using (var key = RegistryTools.OpenRegistryKey(path)) { if (key == null) { throw new IOException(); } } var filename = PathTools.SanitizeFileName(FullLongName) + ".reg"; RegistryTools.ExportRegistry(Path.Combine(backupPath, filename), new[] { path }); }
public override void CreateBackup(string backupPath) { RegistryTools.ExportRegistry(Path.Combine(backupPath, $@"{Localisation.Startup_Shortname_BrowserHelper} - {ProgramName}.reg"), Path.Combine(GetRealParentPath(), EntryLongName)); }