> ## Documentation Index
> Fetch the complete documentation index at: https://ej3mplo.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Build ejGames

> Environment, commands, useful variables, and how a version is published.

## Requirements

* Windows 10/11 with WebView2.
* Node 20+ and pnpm.
* Stable Rust with the MSVC toolchain (and the Visual Studio Build Tools).

## Commands

```bash theme={null}
pnpm install          # also copies hls.js and the theme fonts (scripts/vendor.mjs)
pnpm tauri dev        # app with hot reload
pnpm tauri build      # NSIS installer in target/release/bundle/nsis
cd src-tauri && cargo test --lib
```

> [!WARNING]
>
> **Disk space:** Rust's `target` folder takes several GB. If the project drive is tight, build somewhere else:
> `set CARGO_TARGET_DIR=D:\build\ejgames-target` (or `$env:CARGO_TARGET_DIR=…` in PowerShell).

## Useful variables

| Variable | Effect |
| - | - |
| `EJGAMES_DATA_DIR` | Stores data in another folder and runs as a separate instance, even while the installed app is open (for testing). |
| `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=9222` | Debug the UI and themes with DevTools (`scripts/cdp.mjs`). |
| `RUST_LOG=ejgames_lib=debug` | Detailed logs from the core. |
| `EJGAMES_INSTALL_VERB=open` | (Development only) Opens a repack's installer without asking for administrator, for testing. |
| `EJGAMES_UPDATE_REPO=owner/repo` | (Development only) Looks for updates in another repository. |

## Publish a version

**1. Write down the changes**

Add a `## <version>` section to `CHANGELOG.md`. Those notes become the release notes.

**2. Build**

`pnpm release patch` (or `minor`, `major`, `x.y.z`) bumps the version in `package.json`, `tauri.conf.json`,
`Cargo.toml` and `Cargo.lock`, builds the NSIS installer, then the custom installer (`installer-app/`), which
carries the NSIS one inside. It leaves `installer/ejGames_<version>_Setup.exe` and never overwrites an older one.

**3. Publish**

`pnpm publish-release` creates the `v<version>` release on GitHub with that installer. Installed copies offer it
the next time they open. It needs the GitHub CLI signed in (`gh auth login`).

The published installer is a separate Tauri app: it draws its own window and silently runs Tauri's NSIS installer,
which is embedded in it. When the updater opens it with `/P /R /UPDATE`, it updates without asking and opens ejGames
again. If the PC is missing WebView2, it opens the NSIS installer as-is, with the same arguments.

## Documentation

This site is generated with [Mintlify](https://mintlify.com) from the `docs/` folder of the repository. To see it
locally:

```bash theme={null}
npx mint dev          # from docs/
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.