[Bug] Background crash in MsiTools.InitLookups on shared MSI components
Author: SecretLULCreated Aug 24, 2026Updated Sep 7, 2026
Description
When multiple MSI products reference the same component ID (shared MSI components), \MsiTools.InitLookups()\ crashes with a \System.ArgumentException: An item with the same key has already been added\ when calling .ToDictionary(x => x.component, x => x.product).
Additionally, in \GetInstalledComponentPathRaw(), storing \ComponentPathLookup[component] = null\ throws \ArgumentNullException\ because .NET's \ConcurrentDictionary<TKey, TValue>\ does not allow null values.
Expected Behavior
- Shared MSI components should be handled gracefully (e.g. by grouping by component).
- Missing component paths should use a non-null sentinel in \ConcurrentDictionary.
Source: BCUninstaller/Bulk-Crap-Uninstaller