What it is
FractalLauncher v1.2.3 ("Microsoft Patch") is a feature-rich custom Minecraft launcher for Windows. Its backend is a Python package (launcher/) and its UI is a single self-contained 119 KB HTML file (assets/ui.html) rendered inside a native window by pywebview (Microsoft Edge WebView2). The Python and JavaScript sides talk over pywebview's js_api bridge: JS calls a 61-method API object, and Python pushes events back as DOM CustomEvents.
Feature highlights:
- Vanilla + all mod loaders — Fabric, Forge, Quilt, NeoForge (installer jars fetched & run automatically)
- Microsoft login — full Xbox OAuth2 flow (authorization-code + PKCE, Prism Launcher's public Azure client ID)
- Offline mode — with a full local Yggdrasil / authlib-injector skin server so offline skins actually work
- Multiple profiles & accounts — each profile owns its version, loader, RAM, JVM args, game dir, resolution
- 3D skin viewer — skinview3d (three.js) with cape support and 25 cape presets
- Modrinth browser — search/install mods, shaders and resource packs with dependency resolution and update checks
- Servers — curated server list + custom servers with real Server-List-Ping latency checks
- Screenshots editor, backups, diagnostics, console — canvas crop/blur/draw; zip backups of saves; Mesa3D
opengl32.dllconflict detector - AI-generated themes — type a description, a Cerebras LLM invents a palette
- 7 languages — en, fr, es, pt, de + novelty Pirate & Darija
- Performance tuning baked in — Aikar's G1GC flag set, ABOVE_NORMAL process priority, pre-launch asset cache audit, shipped mod-config presets
⚠ Architectural note: an older CustomTkinter desktop UI used to exist as launcher/app.py, but that file is gone. Every fallback path in main.py, bootstrap.py and pyoxidizer.bzl that references launcher.app is dead code that would crash if ever executed. The webview UI is the only real UI.
Entry points (root *.py)
| File | Role |
|---|---|
main.py167 lines |
Primary dev entry. Writes first-run ~/.FractalLauncher/config.json (auto-detects jdk/**/javaw.exe and Authlib/Authlib.jar at any depth), then starts a pywebview window loading assets/ui.html with API as js_api (1200×720, min 900×580, background #0d0f13). Fallback chain on failure: auto-pip install pywebview and retry → CustomTkinter UI (broken — launcher.app missing). |
main_webview.py113 lines |
Near-duplicate of main.py's webview path (adds a first_launch flag, frameless=False). No CTK fallback. Essentially superseded by main.py. |
bootstrap.py282 lines |
PyInstaller exe entry point. Handles the frozen environment (sys._MEIPASS vs cx_Freeze's exe-dir), pip-installs missing deps when not frozen (minecraft-launcher-lib, Pillow, requests, cryptography), checks the WebView2 runtime in the registry (HKLM/HKCU\Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}), writes first-run config relative to the exe dir, logs diagnostics to ~/.FractalLauncher/launcher.log, then starts the same pywebview window. |
All three copy-paste the same config-bootstrap logic (bundled Java/Authlib detection) rather than sharing it.
Other root files
| File | Role |
|---|---|
run.bat | Runs python main.py with an error-pause wrapper. |
requirements.txt | customtkinter, minecraft-launcher-lib>=6.4, Pillow, requests, cryptography, pywebview>=4.0. |
README.md | outdated Describes setup_and_run.py and launcher/app.py — neither exists. |
BUILD_INSTRUCTIONS.md | outdated Claims Nuitka is the default builder and mentions a cloudflared.exe auto-download that was removed from the code. |
launcher/ — the core package
3.1 webview_bridge.py (1,518 lines) — the JS↔Python API
class API (line 65) is exposed to JavaScript as window.pywebview.api and has 61 public methods. Every method is synchronous (pywebview marshals calls onto worker threads) and follows one return convention:
# success
{ "ok": True, ...payload }
# failure
{ "ok": False, "error": msg }
Bridge mechanics
- JS → Python: the UI never touches
pywebview.apidirectly; it caches the handle onpywebviewreadyand funnels everything through a generic dispatcher:
56 of the 61 methods are invoked this way fromasync function call(method, ...args) { const api = getApi(); if (!api) return { ok: false, error: 'API not ready' }; try { return await api[method](...args); } catch (e) { ... } }ui.html. - Python → JS: a single mechanism —
_push(event, data)(line 94) callswindow.evaluate_js("window.dispatchEvent(new CustomEvent(...))"). This is the onlyevaluate_jsusage in the entire codebase. - Async → sync adapters: callback-style backend functions are converted into blocking returns using
threading.Eventwith timeouts (search 25 s, mod install 10 s, download up to 60 s). - Path safety:
_safe_path()(line 20) does basename +os.path.realpathprefix checks for every file-delete/edit operation.
Events pushed Python → JS
| Event | When |
|---|---|
launch_state | {state:"launching"|"stopped"|"error", code, error} |
console_line | Every game log line + exit banner |
console_clear | Console cleared |
install_progress | {frac, speed, eta, downloaded, total…} during installs |
assets_cache | Pre-launch shared-cache audit report |
microsoft_login_success / microsoft_login_error | OAuth flow result |
mod_download_progress | Mod file download progress |
mods_list_updated | After install/delete/toggle of a mod |
dependency_installing | dead event pushed but never listened to in JS |
API methods, grouped by feature area
| Area | Methods |
|---|---|
| Profiles | get_profiles, get_active_profile, set_active_profile, create_profile, delete_profile, update_profile (camelCase→snake_case key map), edit_jvm_notepad (round-trips JVM args through notepad.exe, blocks ≤300 s) |
| Accounts / skins / capes | get_accounts, get_active_account, add_offline_account, start_microsoft_login, set_active_account, delete_account, set_skin, cache_skin_from_url, set_cape, clear_cape, get_cape_presets |
| Launch / console | launch (line 403 — full flow, see §7), get_console_log, clear_console, kill_game (terminate / SIGTERM), check_assets unused by UI |
| Mods / shaders / resource packs | search_content, search_mods, get_installed_mods, toggle_mod (.disabled rename), delete_mod, install_mod (returns top-10 compatible versions), download_mod_version (auto-installs required + optional Modrinth deps), get_profile_game_dir, get_installed_content / delete_content unused |
| Servers | get_servers, add_server, ping_server (hand-rolled Minecraft Server List Ping: varint packet, protocol 47, TCP, measures ms) |
| Settings | get_settings, save_settings, get_version_list, get_first_launch / complete_first_launch unused |
| AI themes | get_custom_themes, get_cerebras_key_status, set_cerebras_key, generate_custom_theme, open_theme_instructions, save_theme_to_file, import_custom_theme |
| Native dialogs | browse_file, browse_folder, open_folder |
| Diagnostics | run_diagnostics — Java/authlib presence, mod count, Mesa3D opengl32.dll detector ("may cause 7 FPS! Delete it."), OS + RAM info |
| Screenshots / backups | get_screenshots, save_edited_screenshot (base64 PNG), backup_now (zips profile saves/ → ~/.FractalLauncher/backups/), get_backups, delete_backup |
| Fonts | get_font_presets, get_uploaded_fonts, upload_font, delete_font |
3.2 game.py (1,135 lines) — install & launch engine
- Downloads: fully delegated to minecraft-launcher-lib (SHA-1 verified, internal ThreadPool). This module adds a global
requests.Sessionretry monkey-patch (_install_requests_retry, line 17 — 5× exponential backoff, because mll'sstream=Truebreaks mid-iteration where request-level patching can't help), a 5-minute version-manifest cache, 3-attempt retries oninstall_version/install_mod_loader, andcheck_assets_cache()(line 240) — a pre-launch cache audit (mergesinheritsFromparents, respects library rules, dedupes asset hashes) that drives the "Shared cache" UI. build_launch_options()(line 908):-Xmx=-Xms= profile RAM (heap never grows)- Full Aikar's G1GC flag set:
+UseG1GC, +DisableExplicitGC, +AlwaysPreTouch, G1NewSizePercent=30, G1MaxNewSizePercent=40, G1HeapRegionSize=16M, G1ReservePercent=20, G1HeapWastePercent=5, G1MixedGCCountTarget=4, MaxGCPauseMillis=200, InitiatingHeapOccupancyPercent=15, G1MixedGCLiveThresholdPercent=90, G1RSetUpdatingPauseTimePercent=5, SurvivorRatio=32, +PerfDisableSharedMem, MaxTenuringThreshold=1+ string dedup / OptimizeStringConcat / compressedOops - LWJGL software-OpenGL fallback & FML ignore-cert flags (prevents old-LWJGL "Pixel format not accelerated" crashes)
-javaagent:Authlib.jar=http://127.0.0.1:<port>inserted as the first JVM arg when a skin server port exists- Optional custom resolution; user JVM args from the profile;
executablePathfromconfig.java_path
- Mod loaders (
install_mod_loader, line 414): Fabric & Quilt via their official installer jars (maven.fabricmc.net / maven.quiltmc.org), Forge by unzipping the installer and executing its install-profile processors, NeoForge via--install-client— all run with the bundled Java, 3 retries. - Offline-account skin server (
_SkinServer, lines 566–890): a complete local Yggdrasil / authlib-injector HTTP server on127.0.0.1:<ephemeral>implementing/metadata (skinDomains + signaturePublickey),/skin&/capePNGs,session/minecraft/hasJoined&/profile, andauthserver/authenticate|refresh|validate|join. Textures are signed with a per-launch 4096-bit RSA keypair (SHA1withRSA / PKCS1v15) — exactly what authlib-injector expects. - Process launch (
launch_game, line 1001): clears MC'sassets/skins+assets/avatarscache so old accounts can't bleed through; startsPopenwithstdout=PIPE, stderr=STDOUT, WindowsABOVE_NORMAL_PRIORITY_CLASS(0x8000) plus an extraSetPriorityClass(ABOVE_NORMAL)boost; streamsstdoutline-by-line to the UI viaon_log; non-daemon thread so log draining finishes with the process; stops the skin server infinally.
⚠ "Hide launcher on game start" is not implemented. The hide_launcher_on_game setting is created, saved and read into settings.hideOnGame — but nothing ever hides or minimizes the window. It is currently inert.
3.3 auth.py (203 lines) — Microsoft OAuth
- Flow: authorization-code + PKCE (not device-code).
CLIENT_ID = "c36a9fb6-4f2a-41ff-90bd-ae7cc92031eb"— Prism Launcher's public Azure client ID (no Azure setup needed). Redirect:http://localhost:9876. - Steps:
mll.microsoft_account.get_secure_login_data()→ local one-shotHTTPServeron port 9876 (validates OAuthstatefor CSRF) →webbrowser.open(login_url)→ wait ≤300 s →complete_login()performs the full internal chain: login.live.com token → Xbox Live user authenticate → XSTS authorize →api.minecraftservices.com/login_with_xbox→ entitlements → profile. - Refresh:
refresh_microsoft_token()wraps mll; triggered before every launch; failures are swallowed so launch continues with the stale token. - Skin helpers:
_fetch_skin_url()(sessionserver textures property → base64 → skin URL) andfetch_skin_url_by_username()for offline-account previews. - No authlib-injector logic here — that lives in
game.py(§3.2).
3.4 profiles.py (196 lines) — data model
@dataclass Account: id, username, auth_type (microsoft/offline), uuid, access_token, refresh_token, skin_url, skin_path, skin_model (default/slim), cape_path.@dataclass Profile: id, name, version, mod_loader, mod_loader_version, account_id, ram_mb, jvm_args, game_dir, resolution_w/h, fullscreen.ProfileManagerpersists both to~/.FractalLauncher/profiles.jsonwith atomic writes (tmp file +os.replace). The loader is schema-tolerant: it filters each entry to the dataclass's known fields, so older files missing new fields load fine (defaults apply) and unknown keys are dropped — that is the entire "migration" system.- Offline accounts get a stable fake UUID:
uuid3(NAMESPACE_DNS, username), token"offline". - Removing an account also removes all profiles bound to it.
- security Tokens are stored in plaintext — no keyring, no DPAPI, no encryption.
3.5 mods.py (501 lines) — Modrinth-only mod manager
- API:
https://api.modrinth.com/v2with UAFractalLauncher/1.0 (contact@FractalLauncher.dev), 3× retry with linear backoff. No CurseForge integration and no modpack (.mrpack) support anywhere. - Search uses facets (
project_type:mod|shader|resourcepack+ MC version + loader via_LOADER_MAP); versions endpoint filtered bygame_versions/loaders; downloads are streamed 64 KB chunks with progress and partial-file cleanup. - Dependency resolver (
fetch_mod_dependencies): pulls the latest matching version'sdependenciesarray, keeps required + optional, resolves names via/v2/project/{id}. - Update checker (heuristic): derives a slug from the installed filename, compares latest primary file name.
- Mods live in each profile's own
<game_dir>/mods/; enable/disable is a.disabledrename; deletes are path-traversal-guarded (_sanitize_filename+ realpath prefix check).
3.6 theme.py (476 lines) + theme.py.backup
- 20 built-in themes: Lunar (default), Cyber, Forest, Eclipse, Sun, Amber, Nebula, Matrix, Glass, Dark, Ocean, Crimson, Aurora, Grid, Abyss, Green, Pink, Onyx, Ice, Gold.
- Each theme dict carries both full CustomTkinter keys (
BG_DARK, ACCENT, TEXT_PRIMARY…) and an 11-key webview schema (bg, panel, card, accent, tp, ts, tm, ok, warn, err) that maps directly onto CSS custom properties inui.html. _set_globals(theme)injects a preset into the module's globals (the CTk live-retheme mechanism);_build_ctk_theme(theme)derives a CTk appearance dict at runtime.theme.py.backupis the pre-redesign 7-theme version (Lunar-blue palette, includes the only light theme, "Slate Light"). It is imported nowhere — a dormant snapshot.
3.7 ai_theme.py (455 lines) — Cerebras LLM theme generator
- A real LLM client, not procedural:
POST https://api.cerebras.ai/v1/chat/completions(model discovery via/v1/models). Preferred models: llama3.1-8b → llama-3.3-70b → qwen-3-32b → … with automatic re-resolution and one retry if a model 404s. - User types "cyberpunk city at night" → system prompt demands raw JSON of exactly 18 hex keys (CTk schema) or 11 keys (webview schema) → response is fence-tolerant JSON-extracted, validated (
^#[0-9a-fA-F]{6}$), missing/invalid keys filled from defaults, saved as"AI: <first 40 chars of prompt>". - API key deliberately stored separate from config.json: plaintext
~/.FractalLauncher/cerebras_api_key.txt. Generated themes persist tocustom_themes.json/custom_themes_web.json. - Spoofs a Chrome User-Agent to bypass Cloudflare bot-blocking on the Cerebras API; explicit error handling for 401 / 403-Cloudflare-1010 / 404 / timeouts.
__init__.py contains only a comment — the package exports nothing; consumers import submodules directly.
assets/ — the frontend
4.1 ui.html (2,417 lines, 119 KB)
100% vanilla JS + hand-written CSS — no framework, no CDN, no build step, no modules. CSS custom properties on :root (--bg, --panel, --card, --accent, --tp, --ts, --tm, --ok, --warn, --err, --border, --r, --t) are the theming engine; previewTheme() writes them onto document.documentElement.style.
Pages (14)
| Page | Content |
|---|---|
pg-home | Hero banner with particle canvas, loader badge, profile/account/RAM/status, install progress, profile selector, big Launch button, action cards, Recent Activity |
pg-profiles / pg-accounts | Profile & account lists + create/add modals |
pg-skins | 3D skinview3d preview (WalkingAnimation, auto-rotate), upload dropzone, Classic/Slim toggle, Cape browse/presets/remove, Save to Account |
pg-mods / pg-shaders / pg-resourcepacks | Installed list (left) + Modrinth search/browse with 20-per-page pagination (right), version-picker install modal with progress |
pg-servers | Curated builtin list (Hypixel, CubeCraft, 2b2t, Wynncraft, …) + custom servers, async latency pings, Copy IP |
pg-hosting | LAN/tunnel hosting guide — orphaned no nav item points to it |
pg-screenshots | Grid → canvas editor modal with Crop/Blur/Draw tools |
pg-backups / pg-diagnostics | Backup Now + list; Run Checks (Java, authlib, Mesa3D, RAM) |
pg-console | Log output with heuristic level coloring, Copy Log / Logs Folder / Kill Game / Clear, install progress bar |
pg-settings | 2-column grid: language, theme (20 presets + AI custom themes + import/export base64 short codes), fonts (presets + uploads), mc dir, hide toggle, RAM slider 1024–16384, java path, authlib path, About, Save Settings |
Integration details
- All backend calls go through
call('method', …)→await window.pywebview.api.method(...). - Python→JS events: listeners for
launch_state,console_line,console_clear,install_progress,assets_cache,microsoft_login_success/error,mod_download_progress,mods_list_updated. - Bridge-ready lifecycle:
pywebviewreadyhandler + a 50 ms poller fallback in case the event fired before listeners attached. - SoundFX (lines 799–1008): a full Web Audio API synthesizer for click/pop/nav/launch/success/error sounds, wired to a global click delegation. Secret: press Ctrl+S twice quickly to mute/unmute.
- Scroll-position saver via MutationObserver that also monkey-patches
window.goto. - branding bug:
<title>and the status bar say "ExtremeLauncher" while i18n strings and the Python window title say FractalLauncher.
4.2 i18n.js (366 lines)
One flat global I18N object, ~175–184 snake_case keys per language, no namespaces/plurals/interpolation. 7 languages: en, fr, es, pt, de, pirate 🏴☠️ ("Set Sail!", "Grog Allocation") and darija 🇲🇦 (Moroccan Arabic in Latin script). Switching is instant via applyLanguage(lang) which re-texts every [data-i18n] element; persistence happens only on Save Settings. About 77 keys are actually wired in the HTML; roughly half of each dictionary is unused, and the username key referenced in markup is missing from all seven dictionaries.
4.3 lib/skinview3d.bundle.js
Vendored skinview3d v3.4.2 (jsDelivr/Terser minified, embeds three.js r156), exposing the global skinview3d namespace. Used only on the Skins page.
4.4 Other assets
capes/*.png— 25 cape presets (Minecon 2012/2013/2015/2016, cherryblossom, coppercape, glass, portal, nightsky, TikTok, Twitch, "silly cat", …) served byget_cape_presetsasfile:///images in the Cape Library grid.logo.ico(230 KB) — app icon used by all build scripts.CUSTOM_THEMES_SETUP.txt— help doc for the Cerebras flow (get a free key at cloud.cerebras.ai → Set API Key button or the plaintext key file → generate), opened by the Settings "Instructions" button.
Build & packaging pipeline
Four build generations coexist; only the PyInstaller path has produced artifacts (the 32 MB dist/FractalLauncher.exe is present).
| File(s) | Strategy | Status |
|---|---|---|
build_pyinstaller.pyFractalLauncher.spec |
PyInstaller onefile from bootstrap.py: --collect-all for webview/PIL/cryptography/minecraft-launcher-lib, bundles assets/ (jdk & Authlib ship beside the exe), icon assets/logo.ico, UPX on, no console. |
current produced dist/FractalLauncher.exe (32,250,557 bytes) and the build/FractalLauncher/ work dir |
build_msi.pynsis/installer.nsi |
Generates an NSIS script → makensis → per-user Setup.exe bundling exe + jdk + authlib + assets, with Start-Menu/Desktop shortcuts and Add/Remove Programs registry keys. |
stale the checked-in .nsi hardcodes old absolute paths E:\EL\FractalLauncher_full_fixed_v3\… and a lowercase authlib\ folder that is actually named Authlib\ |
build.py |
3-step: PyInstaller → stage Authlib/config/jdk (+optional cloudflared.exe) → cx_Freeze bdist_msi using a dummy stub exe that just re-launches the real one; per-user %LOCALAPPDATA%\FractalLauncher install, no admin rights. |
alternate references nonexistent assets/icon.ico (only logo.ico exists) |
build_pyoxidizer.pypyoxidizer.bzl |
PyOxidizer packaging of bootstrap.py + embedded assets. |
broken run_eval imports launcher.app (missing) |
build_installer.bat |
Orchestrates build_pyinstaller.py → build_msi.py (NSIS). |
helper |
Bundled runtime data
| Folder | Contents |
|---|---|
jdk/ |
A full Oracle JDK 25.0.2 LTS for Windows x86_64 (JAVA_RUNTIME_VERSION=25.0.2+10-LTS-69) — not a trimmed JRE: includes jmods, javac, javadoc, jconsole, Graal compiler modules. Auto-discovered by all entry points (walks the tree for javaw.exe) and written into config.json → java_path. |
Authlib/ |
Authlib.jar — the authlib-injector Java agent. Injected as -javaagent:Authlib.jar=http://127.0.0.1:<port> so the game talks to the launcher's local Yggdrasil server for offline skins. Path stored in config.json → authlib_injector_path. |
config/ |
A pre-tuned .minecraft/config snapshot for performance mods: sodium-mixins.properties & lithium.properties (default notices), modernfix-mixins.properties (4.3 KB of mixin toggles), entityculling.json (tick culling, nametags-through-walls, whitelists for Botania/Create/Alex's Caves/Quark/BetterEnd), trender.json, transition.json.⚠ No launcher code ever copies these into a game directory — only the MSI stages them. They are a "drop into .minecraft" optimization pack; the perf mods themselves (sodium/lithium/modernfix jars) are not auto-installed. |
logs/ |
Actual runtime artifacts from playing this workspace's game dir (FML client logs, rotated *.log.gz, latest.log, debug.log). Not source code. |
build/, dist/, __pycache__/ |
PyInstaller work products (PKG/PYZ/toc files, xref HTML) and stale bytecode for Python 3.12/3.13/3.14. Regenerable; not source. |
User data lives outside the repo in ~/.FractalLauncher/: config.json, profiles.json, cerebras_api_key.txt, custom_themes.json / custom_themes_web.json, skins/, backups/, fonts/, launcher.log.
How a launch actually flows
main.py/bootstrap.pywrite first-run config (bundled java + authlib paths, defaults), then start the pywebview window; onloaded→API.attach(pm, window)prefetches the version manifest (5-min cache).ui.htmlfirespywebviewready→ loads settings, custom themes, fonts → applies saved theme/language/font →loadHome().- User presses Launch →
call('launch')→API.launch()(bridge line 403):- re-entrancy guard; profile & account checks;
- refresh Microsoft token if applicable (result written back via
update_account_tokens); - push
launch_state{launching}; - resolve the installed version id through a 3-step search (name contains base+loader → exact profile.version → directory scan with
inheritsFromfallback); - push
assets_cache+ startinstall_progresstracking (sliding-window speed/ETA); - if missing: install vanilla (and then the mod loader) with 3× retries;
game.launch_game():- clear MC skin/avatar caches;
- offline account → boot
_SkinServer(RSA keypair, health-check), setauthlib_base_url = http://127.0.0.1:<port>; - build options (Aikar G1GC, authlib agent first, resolution, custom java) →
mll.command.get_minecraft_command()→Popenwith ABOVE_NORMAL priority; - stream stdout line-by-line →
console_lineevents;
- On exit:
launch_state{stopped, code}; skin server stopped infinally. The UI can re-fetch the whole buffer viaget_console_log()or kill a running game viakill_game().
External services contacted
| Service | Endpoints | Purpose |
|---|---|---|
| Mojang | launchermeta.mojang.com (version manifest), libraries.minecraft.net, resources.download.minecraft.net, sessionserver.mojang.com, api.mojang.com | Versions, libraries, assets (all SHA-1 verified), skins/profiles |
| Microsoft / Xbox / Minecraft Services | login.microsoftonline.com, login.live.com, user.auth.xboxlive.com, xsts.auth.xboxlive.com, api.minecraftservices.com | OAuth login + token refresh + profile (via minecraft-launcher-lib) |
| Fabric | meta.fabricmc.net, maven.fabricmc.net | Loader metadata + installer jar |
| Quilt | meta.quiltmc.org, maven.quiltmc.org | Loader metadata + installer jar |
| Forge | maven.minecraftforge.net | Installer jar + processors |
| NeoForge | maven.neoforged.net | Installer jar |
| Modrinth | api.modrinth.com/v2 (+ CDN download URLs) | Mods/shaders/resourcepacks search, versions, dependencies, downloads |
| Cerebras | api.cerebras.ai/v1/chat/completions, /v1/models | AI theme generation |
| Loopback only | 127.0.0.1:9876 (OAuth redirect), 127.0.0.1:<ephemeral> (Yggdrasil skin server), raw TCP ping to game servers on :25565, UDP probe of 8.8.8.8:80 for LAN-IP discovery | Local flows |
The Cloudflare tunnel (cloudflared.exe) that once exposed the skin server publicly was removed — only build-script staging and unused tunnel_proc variables remain.
Where data & secrets live
| Data | Location | Protection |
|---|---|---|
| Accounts (incl. Microsoft access + refresh tokens), profiles | ~/.FractalLauncher/profiles.json | plaintext |
| Launcher config (java_path, authlib_injector_path, default_mc_dir, theme, servers, hide_launcher_on_game) | ~/.FractalLauncher/config.json | plaintext |
| Cerebras AI API key | ~/.FractalLauncher/cerebras_api_key.txt | plaintext |
| Custom AI themes | ~/.FractalLauncher/custom_themes.json, custom_themes_web.json | — |
| Skins / backups / fonts / launcher log | ~/.FractalLauncher/{skins,backups,fonts}/, launcher.log | — |
No OS keychain, DPAPI, or Fernet/AES anywhere — the only use of the cryptography package is RSA texture-signing in game.py.
Notable issues & bugs found
- Settings corruption (functional bug).
save_settingswrites the JS payload verbatim, which uses camelCase keys (javaPath,authlibPath,defaultMcDir,hideOnGame), but every reader expects snake_case (java_path,authlib_injector_path,default_mc_dir,hide_launcher_on_game). After the user saves settings once from the UI, Java/authlib/custom-game-dir preferences silently stop being honored. Additionally,save_settingsoverwrites config.json wholesale with only the 8 settings keys — wiping pre-existingservers,first_launch, etc. hideOnGameis inert — saved, read into settings, never used to hide/minimize anything.launcher/app.pyis missing — the CTK fallbacks inmain.py,bootstrap.pyandpyoxidizer.bzlwould crash if reached.pg-hostingis unreachable — no sidebar item, nogoto('hosting').- Branding mismatch —
<title>and status bar say "ExtremeLauncher" (and the sidebar logo "EL") while everything else says FractalLauncher. - Secrets in plaintext — MS tokens in profiles.json, Cerebras key in its own text file.
- Dead code: 5 unused bridge methods (
check_assets,get_installed_content,delete_content,get_first_launch,complete_first_launch), duplicate_do_launchdefinition (bridge lines 494 & 500), unused_DownloadTracker/IncompleteReadException/_get_authlib_jvm_argin game.py, deaddependency_installingevent,restoreConsole()never called,theme.py.backup, leftovertunnel_procvariables. - Stale build inputs —
nsis/installer.nsihardcodesE:\EL\FractalLauncher_full_fixed_v3\…;build.pyreferences nonexistentassets/icon.ico; README/BUILD_INSTRUCTIONS describe nonexistent files (setup_and_run.py, Nuitka default, cloudflared auto-download). - Config folder never applied — the shipped
config/optimization presets are only staged by the MSI; no launcher code copies them into a game dir, and no perf-mod jars are auto-installed. - i18n gaps — the
usernamekey used in markup is missing from all 7 dictionaries; roughly half of each dictionary is unused; sidebar/mod/server/console strings are untranslated. _push()escaping only replaces'— mostly safe because payloads arejson.dumps-ed first, but it is the only sanitization beforeevaluate_js.
Complete file map
FractalLauncherOptimizable/
├── main.py # Primary entry: config bootstrap + pywebview UI (fallback: CTK — broken)
├── main_webview.py # Duplicate webview-only entry (superseded by main.py)
├── bootstrap.py # PyInstaller exe entry: dep install, WebView2 check, logging, UI start
├── run.bat # python main.py with error pause
├── requirements.txt # customtkinter, mll>=6.4, Pillow, requests, cryptography, pywebview>=4.0
├── README.md # Outdated overview
├── BUILD_INSTRUCTIONS.md # Outdated build docs (mentions Nuitka / cloudflared)
│
├── build_pyinstaller.py # [CURRENT] PyInstaller onefile build → dist/FractalLauncher.exe
├── FractalLauncher.spec # PyInstaller spec (collect-all webview/PIL/cryptography/mll)
├── build_msi.py # NSIS installer generator (stale absolute paths in output)
├── nsis/installer.nsi # Generated NSIS script (stale: E:\EL\... paths)
├── build.py # PyInstaller → stage → cx_Freeze bdist_msi (per-user, no admin)
├── build_pyoxidizer.py # PyOxidizer build (broken: imports launcher.app)
├── pyoxidizer.bzl # PyOxidizer config (broken run_eval)
├── build_installer.bat # Orchestrates PyInstaller → NSIS
│
├── launcher/ # Python backend package
│ ├── __init__.py # Comment only — no exports
│ ├── webview_bridge.py # class API — 61-method JS bridge (1,518 lines)
│ ├── game.py # Install/launch engine, G1GC tuning, local Yggdrasil server (1,135 lines)
│ ├── auth.py # Microsoft OAuth2+PKCE via minecraft-launcher-lib
│ ├── profiles.py # Account/Profile dataclasses + ProfileManager (profiles.json)
│ ├── mods.py # Modrinth search/install/deps/updates for mods, shaders, packs
│ ├── theme.py # 20 themes (CTk + webview schemas), _set_globals, _build_ctk_theme
│ ├── theme.py.backup # Dormant pre-redesign 7-theme snapshot
│ └── ai_theme.py # Cerebras LLM theme generator (plaintext key file)
│
├── assets/ # Frontend (bundled into the exe)
│ ├── ui.html # 2,417-line vanilla-JS launcher UI (14 pages, 8 modals)
│ ├── i18n.js # 7-language translation dict (incl. pirate & darija)
│ ├── lib/skinview3d.bundle.js # skinview3d v3.4.2 (embeds three.js r156)
│ ├── capes/*.png # 25 cape preset images
│ ├── logo.ico # App icon
│ └── CUSTOM_THEMES_SETUP.txt # Cerebras API-key setup guide
│
├── jdk/ # Bundled Oracle JDK 25.0.2 LTS (x86_64 Windows, full JDK)
├── Authlib/Authlib.jar # authlib-injector agent for offline skins
├── config/ # Shipped perf-mod configs (sodium/lithium/modernfix/entityculling/…)
│ # ⚠ never auto-applied by the launcher
├── logs/ # Runtime game logs (not source)
├── build/ # PyInstaller work artifacts (regenerable)
├── dist/FractalLauncher.exe # Built launcher, 32.2 MB
└── __pycache__/ # Stale bytecode (py3.12/3.13/3.14)
TL;DR — pywebview hosts a vanilla-JS HTML app; a 61-method Python API object does everything (Microsoft OAuth via Prism's client ID, Modrinth browsing, launches via minecraft-launcher-lib with Aikar GC tuning and ABOVE_NORMAL priority, a local Yggdrasil server + authlib-injector for offline skins, Cerebras-powered AI themes); state lives in ~/.FractalLauncher/*.json (plaintext); distribution is a 32 MB PyInstaller onefile exe + bundled Oracle JDK 25 + authlib jar, installable via NSIS or cx_Freeze MSI — with an "optimization" mod-config folder that is shipped but never auto-applied.
