# LatiNova Client 1.00 source

This archive contains the WPF launcher, the MSIX bootstrap installer, packaging scripts, visual assets, the exact
release DLL required by the launcher, and the audited LatiNova DLL source archive.

`1.00` is the public product version. Windows package identities use a separate monotonically increasing technical
version so that App Installer can determine update order; the current source tree targets package build `1.1.6.33`.

## Build the launcher

Requirements:

- Windows 10 2004 or later, x64
- Visual Studio with .NET Framework 4.8 desktop development
- Windows 10/11 SDK (the current project uses 10.0.26100 metadata for the installer)
- Windows x64 MinGW GCC and `windres` for the MIT game-launch-helper

Run from a Visual Studio Developer PowerShell:

```powershell
msbuild .\LatiNovaClient.csproj /t:Rebuild /p:Configuration=Release /p:Platform=x64 /warnaserror
```

The launcher is written to `dist\LatiNovaClient.exe`.

## Version Manager

The current Version Manager is implemented in `VersionPackageService.cs` and
`MinecraftPackageDeploymentService.cs`. Supported GDK releases are downloaded
from allowlisted Microsoft Xbox Live CDN hosts into
`%LOCALAPPDATA%\LatiNova\VersionManager\Packages`. Downloads are resumable,
size-bounded, catalog-MD5 checked, and promoted atomically. After a download,
the exact cached `.msixvc` is passed to `PackageManager.StagePackageByUriAsync`
without changing the registered game. A version switch then uses
`AddPackageByUriAsync` with `ForceUpdateFromAnyVersion`. Windows reuses an exact
pre-staged package; the measured reuse path took about one second on the test
system. Windows performs staging, registration, and final signature validation. Gaming
Services and an existing Store-signed Minecraft package are required. Loose
and sideloaded registrations are rejected. Windows retains only a limited
number of versions from the same package family, so a saved version that is no
longer staged is automatically prepared again before it is selected.

Immediately before registered-package launch, `GameLaunchHelperService.cs`
places the embedded MIT `gamelaunchhelper.dll` beside the exact Store-signed
Minecraft package. The helper omits the PC Bootstrapper update flow and starts
`Minecraft.Windows.exe` inside the same package identity. The embedded bytes,
destination, existing-file conflicts, and post-write SHA-256 are checked. The
Minecraft executable, manifest, licenses, and user data are not modified.
All selected versions use Windows-managed package registration. LatiNova does
not create a loose game copy or launch a stored executable outside that
registration.

Minecraft files are not included in any LatiNova distribution. The launcher
does not decrypt or extract protected MSIXVC packages. If Minecraft is missing,
the Version Manager opens its official Microsoft Store product page.
The release list is refreshed at runtime from the public LiteLDev Minecraft
Windows GDK version database. Catalog responses are size-bounded and validated
for schema, release version, MD5 syntax, `.msixvc` paths, and an allowlist of
  Microsoft Xbox Live CDN hosts.

## Build the signed MSIX installer

`Packaging\Build-Package.ps1` builds and signs the launcher, MSIX, and one-file installer. The private signing key is
not included in the source archive. The script currently expects the LatiNova signing certificate in the current
user certificate store and validates its thumbprint. If a different certificate is used, update all of these together:

- the build-script signing thumbprint;
- the embedded public `.cer`;
- the expected thumbprint in `Packaging\Installer\InstallerService.cs`;
- the MSIX Publisher value, if the certificate subject changes.

Never commit or distribute a PFX, private key, certificate password, or signing token.

The script also rebuilds and signs the independently authored
`NativeCore/LatiNovaCore` downloader. It also reproducibly builds the embedded
MIT game-launch-helper from `ThirdParty/game-launch-helper` by using
`Packaging/Build-GameLaunchHelper.ps1`. The helper binary is intentionally
excluded from the source ZIP; the build script and complete preferred source
are included.

## Website, updater, and Discord membership gate

The Cloudflare Pages site and Worker source are in `Packaging\UpdateSite`.
`Packaging\Build-UpdateSite.ps1` assembles the static site, App Installer update
files, installer download, and Discord OAuth membership gate. The public
Discord application and guild identifiers are configuration, not secrets.
The deployer must configure `DISCORD_CLIENT_SECRET` and `SESSION_SECRET` as
Cloudflare encrypted secrets. Their values and all signing private keys are
intentionally absent from this archive. The `/stable/` update endpoints bypass
the browser login gate so Windows App Installer can update installed clients.

`Build-UpdateSite.ps1` also creates `LatiNovaClient-1.00-source.zip` and links
the website and Worker responses to
`/downloads/LatiNovaClient-1.00-source.zip`. The source ZIP, signed MSIX, and
signed installer exceed the Cloudflare Pages 25 MiB single-asset limit. Upload
all three files to one R2 bucket under the exact `releases/` object keys listed
in the generated `DEPLOYMENT.json`, bind that bucket to the Pages project as
`RELEASE_SOURCES`, and redeploy. The Worker serves all three public download
routes from R2 with GET, HEAD, and byte-range support. The source route is
intentionally available without Discord authentication so every remote Worker
user receives the AGPL source offer. Do not publish a release while any release
route returns 404 or 503.

To create a clean source archive without build outputs or private keys:

```powershell
.\Packaging\Build-Source.ps1 -Version 1.00
```

## Included DLL source

`Resources\Client\LatiNova-1.26.42-source-audited.zip` contains the C++ LatiNova source corresponding to the bundled
release line. The compiled DLL remains present because the launcher embeds and verifies that exact artifact by SHA-256.
Refer to the licenses and third-party notices inside that archive before redistribution.

## Licensing and notices

The launcher and bundled LatiNova combined work are distributed under AGPL-3.0. The game-launch-helper remains MIT-licensed. Read `LICENSE`, `NOTICE.md`,
`THIRD_PARTY_NOTICES.md`, `TRADEMARKS.md`, and `LEGAL_REVIEW.md`. The Version Manager is independently implemented and contains no
LeviLauncher or Flarial Launcher application code or binary; the separately licensed Aetopia helper is the explicit exception described above. Release metadata is referenced at runtime as described above.

## Security

Read `SECURITY_AUDIT.md` before modifying process injection, plugin scripting, package signing, or the local shop API.
Custom DLL mode intentionally runs a user-selected DLL inside Minecraft and is not a sandbox.
