Skip to main content
BCU uses a multi-source detection architecture to discover installed applications from various locations and installation methods. This comprehensive approach ensures maximum coverage while minimizing duplicates.

Detection Architecture

BCU employs multiple factory classes that scan different sources concurrently:

Registry Factory

Scans Windows registry for standard uninstaller entries

Store App Factory

Detects Windows Store and UWP applications

Steam Factory

Discovers Steam games and applications

Chocolatey Factory

Finds applications installed via Chocolatey

Scoop Factory

Detects Scoop-installed applications

Windows Feature Factory

Identifies Windows optional features

Windows Update Factory

Lists installed Windows updates

Oculus Factory

Finds Oculus VR applications

Directory Factory

Scans Program Files for orphaned apps

Script Factory

Loads predefined uninstall scripts

Registry Detection

The most common detection method scans Windows registry locations where uninstallers are registered.

Registry Paths Scanned

Registry Locations
// 64-bit uninstallers
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

// 32-bit uninstallers on 64-bit Windows
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

// Per-user installations
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

// MSI product codes
HKEY_CLASSES_ROOT\Installer\Products
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData

Registry Key Analysis

BCU looks for these essential registry values:
  • DisplayName - Application name
  • UninstallString - Command to uninstall
  • DisplayIcon - Application icon path
  • Publisher - Software publisher/vendor
  • DisplayVersion - Version number
  • InstallLocation - Installation directory
  • InstallDate - Installation timestamp
  • EstimatedSize - Disk space used (in KB)
  • QuietUninstallString - Silent uninstall command
Additional metadata BCU extracts:
  • URLInfoAbout - Product website
  • HelpLink - Support URL
  • InstallSource - Original installer location
  • ModifyPath - Command to modify installation
  • SystemComponent - Hidden system component flag
  • WindowsInstaller - Indicates MSI installation
  • ParentKeyName - Parent application reference

Filtering Logic

RegistryFactory.cs
public static bool IsValidUninstallerKey(RegistryKey key)
{
    // Must have DisplayName or use registry key name
    string displayName = key.GetValue("DisplayName") as string;
    if (string.IsNullOrEmpty(displayName))
        return false;
    
    // Must have UninstallString unless it's an MSI with ProductCode
    string uninstallString = key.GetValue("UninstallString") as string;
    bool isMsi = key.GetValue("WindowsInstaller") as int? == 1;
    if (string.IsNullOrEmpty(uninstallString) && !isMsi)
        return false;
    
    // Skip system components by default
    int systemComponent = key.GetValue("SystemComponent") as int? ?? 0;
    if (systemComponent == 1)
        return false;
    
    return true;
}

Windows Store App Detection

BCU uses PowerShell to query installed Windows Store applications.
Get-AppxPackage Query
Get-AppxPackage -AllUsers | Select-Object Name, PackageFullName, InstallLocation, Publisher
  1. Execute PowerShell Get-AppxPackage cmdlet
  2. Parse XML or JSON output
  3. Extract package metadata (name, publisher, version)
  4. Determine installation scope (user vs. all-users)
  5. Identify protected/non-removable packages
  6. Create ApplicationUninstallerEntry objects
Some Windows Store apps are protected and cannot be uninstalled. BCU marks these appropriately.

Steam Application Detection

Steam games are detected by parsing Steam library manifests.
SteamFactory.cs
// Steam library locations
C:\Program Files (x86)\Steam\steamapps\
<SteamLibrary>\steamapps\

// Manifest files
appmanifest_<AppID>.acf
1

Locate Steam Installation

Read Steam installation path from registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Valve\Steam\InstallPath
2

Find Library Folders

Parse libraryfolders.vdf to discover all Steam library locations
3

Read Manifests

Parse .acf manifest files for each game:
  • App ID
  • Game name
  • Install directory
  • Size on disk
  • Last update timestamp
4

Generate Uninstall Command

Create Steam protocol uninstall URL:
steam://uninstall/<AppID>

Chocolatey Detection

Chocolatey packages are detected from the Chocolatey package database.
Chocolatey Query
choco list --local-only
For each package, BCU extracts:
  • Package name and version
  • Install location
  • Package metadata (description, author)
  • Dependencies
  • Uninstall command: choco uninstall <package> -y

Scoop Detection

Scoop applications are detected by scanning Scoop’s installation directory.
Scoop Locations
~\scoop\apps\              # Default user installation
C:\ProgramData\scoop\apps\  # Global installation
1

Find Scoop Root

Check environment variable SCOOP or default location ~\scoop
2

Enumerate Apps

List directories in apps folder
3

Read Manifests

Parse JSON manifest files for metadata
4

Generate Uninstall

Create command: scoop uninstall <app>

Windows Features Detection

Query Windows Features
Get-WindowsOptionalFeature -Online | Where-Object {$_.State -eq "Enabled"}
Windows Features are system components and require administrator privileges to modify.

Program Files Orphan Detection

BCU scans Program Files directories to find applications without registry entries.
DirectoryFactory.cs
// Scanned directories
C:\Program Files\
C:\Program Files (x86)\
  1. Enumerate all subdirectories in Program Files
  2. Look for common uninstaller executables:
    • uninstall.exe
    • unins*.exe (Inno Setup)
    • uninst.exe
    • helper.exe --uninstall
  3. Check if directory has corresponding registry entry
  4. If no registry entry found, mark as orphan
  5. Attempt to identify installer type from executables
  6. Generate potential uninstall command
Orphaned applications may not uninstall cleanly. Use caution and review before removal.

Concurrent Detection

All factories run concurrently for fast detection:
ApplicationUninstallerFactory.cs
public static List<ApplicationUninstallerEntry> GetUninstallerEntries(
    ListGenerationProgress progressCallback)
{
    var factories = new List<IUninstallerFactory>
    {
        new RegistryFactory(),
        new StoreAppFactory(),
        new SteamFactory(),
        new ChocolateyFactory(),
        // ... other factories
    };
    
    // Run all factories in parallel
    var tasks = factories.Select(f => 
        Task.Run(() => f.GetUninstallerEntries(progressCallback))
    ).ToArray();
    
    Task.WaitAll(tasks);
    
    // Combine and deduplicate results
    return CombineAndDeduplicate(tasks.Select(t => t.Result));
}

Deduplication

Multiple sources may report the same application. BCU uses intelligent deduplication:
Applications are considered duplicates if they match on:
  1. Exact ProductCode (MSI GUID)
  2. Display Name + Publisher (fuzzy match)
  3. Install Location (same directory)
  4. Uninstall String (same command)
When duplicates are found:
  • Prefer MSI entries over registry entries
  • Prefer entries with ProductCode
  • Merge metadata from all sources
  • Use most complete information available
  • Keep QuietUninstallString if available from any source

Performance Optimization

Parallel Execution

All factory classes run concurrently using Task-based parallelism

Caching

Results are cached to avoid repeated expensive operations

Lazy Loading

Additional metadata loaded on-demand, not during initial scan

Registry Batching

Registry reads are batched to minimize I/O operations

Configuration Options

Users can enable/disable specific detection sources:
Settings
- EnableRegistryScanning
- EnableStoreApps
- EnableSteamDetection
- EnableChocolateyDetection
- EnableScoopDetection
- EnableWindowsFeatures
- EnableWindowsUpdates
- EnableOculusDetection
- EnableOrphanedProgramsSearch

Uninstaller Types

Learn about different installer systems BCU supports

Helper Tools

Understand the helper applications used for detection

Build docs developers (and LLMs) love