# vencord/installer architecture

> Architecture diagram of the GitHub repository vencord/installer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vencord/installer
- Repository: https://github.com/vencord/installer

## Overview

#### Purpose and build entry points
This Go repository builds the cross-platform Vencord Installer: a desktop GUI by default and a terminal CLI with the `cli` build tag. It locates an installed Discord client, obtains required Vencord/OpenAsar assets, patches Discord’s application archive layout, and can update itself. Main entry selection is split between `gui.go`, `cli.go`, and platform-specific CLI files such as `cli_windows.go`.

#### Application modes and UI boundary
The default build is a graphical installer; the CLI is an alternate compile-time frontend rather than a separate service. UI-specific build selection is represented by `buildinfo/ui_type.go`, `buildinfo/ui_type_gui.go`, and `buildinfo/ui_type_cli.go`. Linux GUI builds require native SDL/OpenGL/X11 or Wayland dependencies, while Windows and macOS carry platform packaging resources in `winres/winres.json` and `macos/Info.plist`.

#### Discord discovery
Platform-specific discovery isolates filesystem and installation-layout differences for the target Discord desktop installation:
- `find_discord_windows.go`
- `find_discord_darwin.go`
- `find_discord_linux.go`

This boundary supplies the Discord location to the installer/patcher rather than embedding one universal path convention.

#### Installation and patching pipeline
The core mutation path is centered on `patcher.go`, with archive/application handling in `app_asar.go` and OpenAsar-specific work in `openasar.go`. These components likely manage Discord’s `app.asar`-based resource structure and perform the installation or replacement steps needed for Vencord. Shared operational constants and utilities are kept in `constants.go` and `util.go`; logging is centralized in `log.go`.

#### Remote artifact and release integration
Network-facing update/download responsibilities are separated from patching:
- `github_downloader.go` retrieves release assets from GitHub.
- `self_updater.go` updates the installer binary itself.
- `buildinfo/git_data.go` exposes source/revision metadata for builds.

This keeps external GitHub release retrieval and installer self-maintenance distinct from local Discord modification.

#### Distribution and runtime infrastructure
The project is compiled with Go and native GUI dependencies; Linux requires SDL2, OpenGL, and either X11 or Wayland development libraries. User-facing bootstrap scripts are `install.sh` and `install.ps1`. Release automation and Windows package publication are defined in `.github/workflows/release.yml` and `.github/workflows/winget-submission.yml`, indicating GitHub Actions is the release pipeline and WinGet is a downstream distribution channel.

Main entry points: [`patcher.go`](https://github.com/vencord/installer/blob/main/patcher.go) (Installer patcher), [`cli.go`](https://github.com/vencord/installer/blob/main/cli.go) (CLI entry), [`gui.go`](https://github.com/vencord/installer/blob/main/gui.go) (GUI entry), [`github_downloader.go`](https://github.com/vencord/installer/blob/main/github_downloader.go) (GitHub downloader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["Installer Frontends"]
  node_gui["GUI entry<br/>Go entrypoint<br/>[gui.go]"]
  node_cli["CLI entry<br/>Go entrypoint<br/>[cli.go]"]
  node_cli_windows["Windows CLI<br/>platform CLI<br/>[cli_windows.go]"]
  node_ui_selection["UI build selection<br/>build metadata<br/>[ui_type.go]"]
end

subgraph group_core["Discovery &amp; Patching"]
  node_patcher["Installer patcher<br/>core pipeline<br/>[patcher.go]"]
  node_discord_windows["Windows discovery<br/>platform discovery"]
  node_discord_macos["macOS discovery<br/>platform discovery"]
  node_discord_linux["Linux discovery<br/>platform discovery"]
  node_app_asar["Discord app archive<br/>archive handling<br/>[app_asar.go]"]
  node_openasar["OpenAsar handling<br/>patch component<br/>[openasar.go]"]
  node_runtime_support["Shared runtime support<br/>utilities &amp; logging<br/>[constants.go]"]
end

subgraph group_remote["Artifacts &amp; Updates"]
  node_github_downloader["GitHub downloader<br/>release client"]
  node_self_updater["Self updater<br/>binary updater<br/>[self_updater.go]"]
  node_git_data["Build revision data<br/>build metadata<br/>[git_data.go]"]
  node_github_releases[("GitHub releases<br/>external artifact source")]
end

subgraph group_distribution["Distribution"]
  node_bootstrap["Bootstrap scripts<br/>user installation<br/>[install.sh]"]
  node_release_workflow["Release workflow<br/>GitHub Actions<br/>[release.yml]"]
  node_winget_workflow["WinGet submission<br/>GitHub Actions"]
  node_winget[("WinGet<br/>package channel")]
end

node_gui -.->|"build identity"| node_ui_selection
node_cli -.->|"build identity"| node_ui_selection
node_cli_windows -.->|"Windows implementation"| node_cli
node_gui -->|"starts install"| node_patcher
node_cli -->|"starts install"| node_patcher
node_discord_windows -->|"Discord location"| node_patcher
node_discord_macos -->|"Discord location"| node_patcher
node_discord_linux -->|"Discord location"| node_patcher
node_patcher -->|"modifies"| node_app_asar
node_patcher -->|"installs or replaces"| node_openasar
node_patcher -->|"uses"| node_runtime_support
node_github_downloader -->|"downloads assets"| node_github_releases
node_github_downloader -->|"provides artifacts"| node_patcher
node_self_updater -->|"checks releases"| node_github_releases
node_git_data -->|"version metadata"| node_self_updater
node_bootstrap -->|"installs release"| node_github_releases
node_release_workflow -->|"publishes"| node_github_releases
node_release_workflow -.->|"triggers downstream release"| node_winget_workflow
node_winget_workflow -->|"submits package"| node_winget

click node_gui "https://github.com/vencord/installer/blob/main/gui.go"
click node_cli "https://github.com/vencord/installer/blob/main/cli.go"
click node_cli_windows "https://github.com/vencord/installer/blob/main/cli_windows.go"
click node_ui_selection "https://github.com/vencord/installer/blob/main/buildinfo/ui_type.go"
click node_patcher "https://github.com/vencord/installer/blob/main/patcher.go"
click node_discord_windows "https://github.com/vencord/installer/blob/main/find_discord_windows.go"
click node_discord_macos "https://github.com/vencord/installer/blob/main/find_discord_darwin.go"
click node_discord_linux "https://github.com/vencord/installer/blob/main/find_discord_linux.go"
click node_app_asar "https://github.com/vencord/installer/blob/main/app_asar.go"
click node_openasar "https://github.com/vencord/installer/blob/main/openasar.go"
click node_runtime_support "https://github.com/vencord/installer/blob/main/constants.go"
click node_github_downloader "https://github.com/vencord/installer/blob/main/github_downloader.go"
click node_self_updater "https://github.com/vencord/installer/blob/main/self_updater.go"
click node_git_data "https://github.com/vencord/installer/blob/main/buildinfo/git_data.go"
click node_bootstrap "https://github.com/vencord/installer/blob/main/install.sh"
click node_release_workflow "https://github.com/vencord/installer/blob/main/.github/workflows/release.yml"
click node_winget_workflow "https://github.com/vencord/installer/blob/main/.github/workflows/winget-submission.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gui,node_cli,node_cli_windows,node_ui_selection toneBlue
class node_patcher,node_discord_windows,node_discord_macos,node_discord_linux,node_app_asar,node_openasar,node_runtime_support toneAmber
class node_github_downloader,node_self_updater,node_git_data,node_github_releases toneMint
class node_bootstrap,node_release_workflow,node_winget_workflow,node_winget toneRose
```

## Components

### Installer Frontends

Compile-time GUI or CLI entry selection.

- [GUI entry](https://github.com/vencord/installer/blob/main/gui.go): Go entrypoint · Default desktop installer frontend. · `gui.go`
- [CLI entry](https://github.com/vencord/installer/blob/main/cli.go): Go entrypoint · Alternate build selected with the cli tag. · `cli.go`
- [Windows CLI](https://github.com/vencord/installer/blob/main/cli_windows.go): platform CLI · `cli_windows.go`
- [UI build selection](https://github.com/vencord/installer/blob/main/buildinfo/ui_type.go): build metadata · Selects GUI or CLI UI identity at build time. · `buildinfo/ui_type.go`

### Discovery & Patching

Local Discord discovery and archive mutation.

- [Installer patcher](https://github.com/vencord/installer/blob/main/patcher.go): core pipeline · Coordinates Discord modification. · `patcher.go`
- [Windows discovery](https://github.com/vencord/installer/blob/main/find_discord_windows.go): platform discovery · `find_discord_windows.go`
- [macOS discovery](https://github.com/vencord/installer/blob/main/find_discord_darwin.go): platform discovery · `find_discord_darwin.go`
- [Linux discovery](https://github.com/vencord/installer/blob/main/find_discord_linux.go): platform discovery · `find_discord_linux.go`
- [Discord app archive](https://github.com/vencord/installer/blob/main/app_asar.go): archive handling · Handles app.asar application layout. · `app_asar.go`
- [OpenAsar handling](https://github.com/vencord/installer/blob/main/openasar.go): patch component · `openasar.go`
- [Shared runtime support](https://github.com/vencord/installer/blob/main/constants.go): utilities & logging · Operational constants, utilities, and centralized logging. · `constants.go`

### Artifacts & Updates

GitHub release retrieval and installer maintenance.

- [GitHub downloader](https://github.com/vencord/installer/blob/main/github_downloader.go): release client · Retrieves Vencord and related release assets. · `github_downloader.go`
- [Self updater](https://github.com/vencord/installer/blob/main/self_updater.go): binary updater · Updates the installer executable. · `self_updater.go`
- [Build revision data](https://github.com/vencord/installer/blob/main/buildinfo/git_data.go): build metadata · `buildinfo/git_data.go`
- **GitHub releases**: external artifact source · Source of downloadable assets and releases.

### Distribution

Bootstrap and release publishing.

- [Bootstrap scripts](https://github.com/vencord/installer/blob/main/install.sh): user installation · Shell and PowerShell install entry points. · `install.sh`
- [Release workflow](https://github.com/vencord/installer/blob/main/.github/workflows/release.yml): GitHub Actions · Builds and publishes installer releases. · `.github/workflows/release.yml`
- [WinGet submission](https://github.com/vencord/installer/blob/main/.github/workflows/winget-submission.yml): GitHub Actions · Publishes the Windows package downstream. · `.github/workflows/winget-submission.yml`
- **WinGet**: package channel · Downstream Windows distribution channel.

## Connections

- GUI entry → UI build selection: build identity
- CLI entry → UI build selection: build identity
- Windows CLI → CLI entry: Windows implementation
- GUI entry → Installer patcher: starts install
- CLI entry → Installer patcher: starts install
- Windows discovery → Installer patcher: Discord location
- macOS discovery → Installer patcher: Discord location
- Linux discovery → Installer patcher: Discord location
- Installer patcher → Discord app archive: modifies
- Installer patcher → OpenAsar handling: installs or replaces
- Installer patcher → Shared runtime support: uses
- GitHub downloader → GitHub releases: downloads assets
- GitHub downloader → Installer patcher: provides artifacts
- Self updater → GitHub releases: checks releases
- Build revision data → Self updater: version metadata
- Bootstrap scripts → GitHub releases: installs release
- Release workflow → GitHub releases: publishes
- Release workflow → WinGet submission: triggers downstream release
- WinGet submission → WinGet: submits package
