Esempio n. 1
0
        private void BackupPart2(Group backupGroup, List <String> progidsToDelete, List <String> extsToDelete, List <String> iconFilesToDelete)
        {
            if (backupGroup == null)
            {
                return;
            }

            foreach (String progId in progidsToDelete)
            {
                if (String.IsNullOrEmpty(progId))
                {
                    continue;                                                  // just in case
                }
                ProgramOperation pop = ProgramOperation.CreateRegistryOperation(backupGroup, "DELETE", @"HKEY_CLASSES_ROOT\" + progId);
                backupGroup.Operations.Add(pop);
            }

            foreach (String ext in extsToDelete)
            {
                if (String.IsNullOrEmpty(ext))
                {
                    continue;                                               // just in case
                }
                ProgramOperation pop = ProgramOperation.CreateRegistryOperation(backupGroup, "DELETE", @"HKEY_CLASSES_ROOT\" + ext);
                backupGroup.Operations.Add(pop);
            }

            foreach (String fileName in iconFilesToDelete)
            {
                FileOperation fop = new FileOperation(backupGroup, fileName);
                backupGroup.Operations.Add(fop);
            }
        }
Esempio n. 2
0
        private void Backup(Group backupGroup, String regKeyPath)
        {
            if (backupGroup == null)
            {
                return;
            }

            // basically, run reg.exe such that it deletes the uninstallation registry key

            ProgramOperation op = ProgramOperation.CreateRegistryOperation(backupGroup, "DELETE", regKeyPath);

            backupGroup.Operations.Add(op);
        }