Skip to content

feat: build-launcher.ps1, a window to pick a branch and start run-gta… - #63

Merged
ShinniUwU merged 1 commit into
ProjectLeonidaL:mainfrom
MatCactus:feat/launcher
Nov 27, 2026
Merged

ShinniUwU merged 1 commit into
ProjectLeonidaL:mainfrom
MatCactus:feat/launcher

Conversation

@MatCactus

Copy link
Copy Markdown
Contributor

What changed

Adds build-launcher.ps1 at the root. It builds Leonida-Launcher.exe, a small window that lists the repository's branches, switches to the chosen one (git fetch + git checkout -f -B, after a warning if tracked files were changed) and starts run-gta6.ps1, with the game folder passed as -GameDir when one is set. No TODO row (closest: U-1). The README gets the one command to run.

The repository stays text only: the launcher's code lives in the script, the logo is downloaded at build time from the fixed-commit address the README already uses (a drawn logo is used without network), and the .exe and its icon are made in temporary files. Only Leonida-Launcher.exe is written to the repository, and .gitignore already ignores *.exe. This replaces my earlier PR that committed a prebuilt .exe.

How it was tested

  • Not run in game: tests only. Why: tooling only, no Rust code changed. Branch listing, the local-changes warning (declined and accepted), branch switching and the arguments passed to run-gta6.ps1 were checked on a test repository with a stubbed UI. Building the .exe and the window on Windows: built and started on Windows 11, window and icon OK.

Checks run on this branch:

  • cargo test --workspace --locked: no Rust change
  • cargo clippy --workspace --all-targets --locked -- -D warnings: no Rust change
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: no Rust change
  • cargo xtask policy: not run; the new file only uses an allowed extension, is 31 KB, and its longest alphanumeric run is 74 characters

AI

  • AI-assisted (Claude): the launcher, the build script and the README paragraph.

…6.ps1

build-launcher.ps1 builds Leonida-Launcher.exe, a Windows Forms window
that lists the repository's branches, switches to the chosen one
(fetch + checkout -f -B, after a warning if tracked files were changed)
and starts run-gta6.ps1, with the game folder passed as -GameDir when
one is set. Settings live in %APPDATA%\LeonidaLauncher\config.json.

The repository stays text only: the launcher's code is in the script,
and the project's logo is downloaded at build time (from a fixed
commit) into a temporary copy of that code; the .exe icon is made from
it in a temporary file. Without network a logo drawn by the code is
used. The .exe lands at the root, where git already ignores it.
@ShinniUwU

Copy link
Copy Markdown
Contributor

Thanks for turning this into a script. A few things worth fixing, here or in a follow-up:

  1. git checkout -f -B <branch> FETCH_HEAD resets a local branch of the same name to the remote one, so unpushed commits on it (a local main, say) are dropped and only the reflog keeps them. The warning dialog only counts uncommitted changes. It also runs git merge --abort and git rebase --abort without asking. Checking for local commits ahead of the remote (git rev-list --count FETCH_HEAD..<branch>) and asking first would cover it.
  2. It sets LEONIDA_GTA_DIR, LEONIDA_REPO_DIR and LEONIDA_BRANCH, which nothing reads. Since U-3: apply graphics profiles natively with TOML overrides #48, any LEONIDA_* variable that isn't a path or startup control counts as an explicit graphics override, so these show up as overrides in leonida config --graphics and in test reports. Dropping them, or using a prefix other than LEONIDA_, avoids that.
  3. The window text and the README's description of the buttons are in French; the rest of the repository is in English. Could the interface be in English?

Also worth a line in the README: the first build downloads the logo from a fork and installs ps2exe from the PowerShell Gallery.

@ShinniUwU
ShinniUwU merged commit cea51c2 into ProjectLeonidaL:main Nov 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants