# hudrig0/windows-update-blocker architecture

> Architecture diagram of the GitHub repository hudrig0/windows-update-blocker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hudrig0/windows-update-blocker
- Repository: https://github.com/hudrig0/windows-update-blocker

## Overview

##### Project type and purpose
- This is a lightweight, portable Windows desktop utility (no installer) whose sole purpose is to disable or re-enable Windows Update services on demand.
- Key artifacts: two executables (32-bit `Wub.exe` and 64-bit `Wub_x64.exe`) and a configuration file (`Wub.ini`).

##### File structure
- Top-level files only:
- Wub.exe (32-bit GUI/CLI tool)
- Wub_x64.exe (64-bit GUI/CLI tool)
- Wub.ini (user‐editable settings)
- README.md (documentation)
- No separate frontend/backend or third-party libraries folders—this is a single‐executable utility.
- No installation scripts or services; everything runs in user context (with elevated privileges).

##### Extract additional insights from the README
- The tool uses standard Windows Service APIs to change service startup types and start/stop services.
- It enumerates a predefined list of services (defined in `Wub.ini` or hard-coded defaults).
- User interacts via a minimal GUI: chooses “Disable Updates” or “Enable Updates,” clicks “Apply.”
- Advanced mode: shows full service list and supports custom service selections via `Wub.ini`.

##### Main components
a. User Interface Layer
- 32-bit and 64-bit executables (single binary with embedded GUI)
- Menu logic to switch between normal mode and advanced mode
b. Configuration Store
- `Wub.ini` defines which services are targeted and any custom overrides
c. OS Interaction Layer
- Windows Service Control Manager (SCM)
- WinAPI calls: ChangeServiceConfig, StartService, StopService, QueryServiceStatus
d. Target Windows Services
- wuauserv (Windows Update)
- bits (Background Intelligent Transfer), wuauserv dependencies, etc.

##### Relationships and interactions
- User → (launches) UI (Wub.exe/Wub_x64.exe)
- UI → (reads/writes) `Wub.ini`
- UI → (invokes) Service Control Manager via WinAPI
- SCM → (manages) Target Windows services (stop, disable, enable, start)
- Services → (state changes) reported back to UI for display

##### Architectural patterns and design principles
- Single-responsibility: executable only handles UI, config parsing, and service control
- Portable/zero-install: no external dependencies, runs directly under elevated user context
- Configurability: `Wub.ini` allows extensibility without recompiling
- Minimal layers: Presentation → Config → OS Service API → Windows Services

##### Detail
- An “Advanced Mode” toggle to show how the tool switches to a detailed view.
- Elevation requirement (UAC prompt) as a side note on the UI component.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors
    User["User"]:::external

    %% Subgraphs
    subgraph "User Interface Layer"
        direction TB
        UI32["Wub.exe (32-bit)"]:::ui
        UI64["Wub_x64.exe (64-bit)"]:::ui
        Advanced["Advanced Mode Toggle"]:::ui
        UAC["UAC Prompt Required"]:::os
    end

    subgraph "Configuration Store"
        direction TB
        Config["Wub.ini"]:::config
    end

    subgraph "OS Interaction Layer"
        direction TB
        SCM["SCM (Windows Service Control Manager)"]:::os
    end

    subgraph "Target Services"
        direction TB
        S1["wuauserv"]:::svc
        S2["BITS"]:::svc
        S3["Other Dependencies"]:::svc
    end

    subgraph "Documentation"
        README["README.md"]:::doc
    end

    %% Connections
    User -->|"launch"| UI32
    User -->|"launch"| UI64
    User -.->|"elevate"| UAC
    UAC --> UI32
    UAC --> UI64

    UI32 -->|"Read/Write INI"| Config
    UI64 -->|"Read/Write INI"| Config

    UI32 -->|"WinAPI Calls<br>ChangeServiceConfig<br>StartService<br>StopService<br>QueryServiceStatus"| SCM
    UI64 -->|"WinAPI Calls<br>ChangeServiceConfig<br>StartService<br>StopService<br>QueryServiceStatus"| SCM

    SCM -->|"Stop/Disable<br>Start/Enable"| S1
    SCM -->|"Stop/Disable<br>Start/Enable"| S2
    SCM -->|"Stop/Disable<br>Start/Enable"| S3

    S1 -->|"Status Feedback"| SCM
    S2 -->|"Status Feedback"| SCM
    S3 -->|"Status Feedback"| SCM

    SCM -->|"QueryServiceStatus"| UI32
    SCM -->|"QueryServiceStatus"| UI64

    UI32 --> Advanced
    UI64 --> Advanced

    UI32 --> README
    UI64 --> README

    %% Click Events
    click UI32 "https://github.com/hudrig0/windows-update-blocker/blob/main/Wub.exe"
    click UI64 "https://github.com/hudrig0/windows-update-blocker/blob/main/Wub_x64.exe"
    click Config "https://github.com/hudrig0/windows-update-blocker/blob/main/Wub.ini"
    click README "https://github.com/hudrig0/windows-update-blocker/blob/main/README.md"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#3399ff,stroke-width:1px
    classDef config fill:#d4edda,stroke:#28a745,stroke-width:1px
    classDef os fill:#e2e3e5,stroke:#6c757d,stroke-width:1px
    classDef svc fill:#fff3cd,stroke:#ffcd39,stroke-width:1px
    classDef doc fill:#f8d7da,stroke:#dc3545,stroke-width:1px
    classDef external fill:#e2e3e5,stroke:#6c757d,stroke-width:1px,stroke-dasharray: 5 5
```
