diff --git a/MsiZapEx/Program.cs b/MsiZapEx/Program.cs index 60088f9..86f03ce 100644 --- a/MsiZapEx/Program.cs +++ b/MsiZapEx/Program.cs @@ -141,9 +141,16 @@ static void Main(string[] args) { List orphan = ProductInfo.GetOrphanProducts(); Console.WriteLine($"{orphan.Count} orphan product(s) detected"); - foreach (ProductInfo pi in orphan) + using (RegistryModifier modifier = new RegistryModifier()) { - pi.PrintState(); + foreach (ProductInfo pi in orphan) + { + pi.PrintState(); + if (Settings.Instance.ForceCleanAllRelated) + { + pi.Prune(modifier); + } + } } } } diff --git a/MsiZapEx/Settings.cs b/MsiZapEx/Settings.cs index 054aa8e..be57b75 100644 --- a/MsiZapEx/Settings.cs +++ b/MsiZapEx/Settings.cs @@ -27,7 +27,7 @@ public class Settings [Option("delete", Required = false, HelpText = "Forcibly remove product's Windows Installer entries from the registry")] public bool ForceClean { get; set; } - [Option("delete-all-related", Required = false, HelpText = "When used with --upgrade-code or --bundle-upgrade-code, deletes Windows Installer and WiX entries for all related products")] + [Option("delete-all-related", Required = false, HelpText = "When used with --upgrade-code or --bundle-upgrade-code, deletes Windows Installer and WiX entries for all related products. When used with --detect-orphan-products, deletes registration for all orphan products")] public bool ForceCleanAllRelated { get; set; } [Option("dry-run", Required = false, HelpText = "Do not delete Windows Installer entries. Instead, print anything that would have been deleted")] diff --git a/TidyBuild.custom.props b/TidyBuild.custom.props index 77a787b..7f5de75 100644 --- a/TidyBuild.custom.props +++ b/TidyBuild.custom.props @@ -2,7 +2,7 @@ - 0.0.9 + 0.0.10 FullVersion=$(FullVersion);$(DefineConstants) \ No newline at end of file