# klocman/bulk-crap-uninstaller architecture

> Architecture diagram of the GitHub repository klocman/bulk-crap-uninstaller, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/klocman/bulk-crap-uninstaller
- Repository: https://github.com/klocman/bulk-crap-uninstaller

## Overview

##### Main Components
- Core Application – The main Bulk Crap Uninstaller executable (found under source/BulkCrapUninstaller) that implements the uninstallation logic.
- UI Layer – A Windows Forms-based presentation layer providing forms and dialogs (see Forms directories and numerous Designer files).
- Uninstallation Engine – Modules that scan the system, interact with the registry, execute uninstallation commands, and manage orphaned/leftover files.
- Helper Libraries and Utilities – Several subprojects (for example, KlocTools, NetSettingBinder, ObjectListView, PortableSettingsProvider, etc.) that provide reusable functions, controls, settings management, and supporting infrastructure.
- Installer – An installer composition based on Inno Setup scripts (stored in the installer directory) that packages and deploys the application.
- Test Suites – Directories such as BulkCrapUninstallerTests that validate core functionalities.
- External Modules – Components like NBug (for error reporting) and integration code for third-party systems (e.g., support for NSIS, InnoSetup, Msiexec, Steam, and Windows Store apps).

##### Establish Relationships and Interactions
- The UI layer interacts with the core uninstallation engine, displaying information, receiving user inputs, and triggering functions.
- The Uninstallation Engine uses various helper libraries (for registry scanning, file and process operations, and language localization) to perform its functions.
- The Installer (separate Inno Setup scripts and additional language and product configuration files) packages the core application and its dependencies.
- There is bidirectional data flow: from the UI to core logic and then feedback (including logging and error reports via NBug) that is then displayed.
- Test projects are linked to core libraries to validate functionality but are not part of production deployment.

##### Architectural Patterns and Design Principles
- Modular design: The application is split into distinct modules – core, UI, utilities, and installers – which interact via well-defined interfaces.
- Abstraction and reusability: Many common functionalities (file manipulation, registry interaction, control rendering, language localization) are encapsulated within dedicated libraries.
- Separation of concerns: The installer, business logic, UI, and testing suites are clearly segregated.
- Extensibility: The presence of many plug-in style “factories” and “adders” (see the InfoAdders in UninstallTools/Factory) indicates an architecture favoring modular extensions.

##### Relevant Technologies, Frameworks, or Libraries
- Visual Studio and .NET (C# and C++ projects indicate mixed-language components).
- Windows Forms for the UI.
- Inno Setup for the installer.
- Custom libraries such as KlocTools, ObjectListView, and NetSettingBinder.
- NBug for error reporting.
- Built-in support for integration with other uninstallation systems (MSI, NSIS, etc.).

##### Detail Level
You detail every functional layer:
– Start with the external installer that deploys the application.
– Follow with the Core Application which acts as the central controller.
– Break the Core into subcomponents: the UI, the uninstallation/screen scraping mechanisms, and the underlying helper libraries.
– Optionally, include a layer for error reporting and logging (NBug) and testing modules.

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Installation"
        INS("Installer/Setup Module"):::installer
    end

    subgraph "Core Application Layer"
        CA("Core Application"):::core
        UI("UI Layer (Windows Forms)"):::ui
        UE("Uninstallation Engine"):::engine
        CA -->|"invokes"| UI
        CA -->|"triggers"| UE
    end

    subgraph "Helper Libraries & Utilities"
        KL("KlocTools"):::helper
        NS("NetSettingBinder"):::helper
        OV("ObjectListView"):::helper
        PS("PortableSettingsProvider"):::helper
    end

    subgraph "External & Testing"
        NB("Error Reporting (NBug)"):::external
        TS("Test Suites"):::test
    end

    INS -->|"packages"| CA
    UI -->|"commands"| UE
    UE -->|"utilizes"| KL
    UE -->|"utilizes"| NS
    UE -->|"utilizes"| OV
    UE -->|"utilizes"| PS
    UE -->|"sendsErrors"| NB
    CA -->|"testedBy"| TS

    click CA "https://github.com/klocman/bulk-crap-uninstaller/tree/master/source/BulkCrapUninstaller"
    click UI "https://github.com/klocman/bulk-crap-uninstaller/tree/master/source/BulkCrapUninstaller/Forms"
    click UE "https://github.com/klocman/bulk-crap-uninstaller/tree/master/source/UninstallTools"
    click KL "https://github.com/klocman/bulk-crap-uninstaller/tree/master/source/KlocTools"
    click NS "https://github.com/klocman/bulk-crap-uninstaller/tree/master/source/NetSettingBinder"
    click OV "https://github.com/klocman/bulk-crap-uninstaller/tree/master/source/ObjectListView"
    click PS "https://github.com/klocman/bulk-crap-uninstaller/tree/master/source/PortableSettingsProvider"
    click INS "https://github.com/klocman/bulk-crap-uninstaller/tree/master/installer"
    click TS "https://github.com/klocman/bulk-crap-uninstaller/tree/master/source/BulkCrapUninstallerTests"
    click NB "https://github.com/klocman/bulk-crap-uninstaller/tree/master/source/NBug_custom"

    classDef installer fill:#f2d7d5,stroke:#c0392b,stroke-width:2px;
    classDef core fill:#d5f5e3,stroke:#27ae60,stroke-width:2px;
    classDef ui fill:#fcf3cf,stroke:#f1c40f,stroke-width:2px;
    classDef engine fill:#d6eaf8,stroke:#3498db,stroke-width:2px;
    classDef helper fill:#ebdef0,stroke:#8e44ad,stroke-width:2px;
    classDef external fill:#f9e79f,stroke:#f39c12,stroke-width:2px;
    classDef test fill:#fadbd8,stroke:#e74c3c,stroke-width:2px;
```
