installer: write custom icon into Minecraft launcher profile

Minecraft launcher's "설치 설정" screen reads `profile.icon` from
launcher_profiles.json. We were leaving it unset, so the launcher fell
back to the default Furnace icon. Inline build/icon.png as a base64
data URL at build time (scripts/build-launcher-icon.cjs generates
src/installer/launcherIcon.ts) and set it on the profile we write.

The build/ directory isn't included in the electron-builder asar (it's
only used to point at the .ico for the exe), so a runtime read isn't
possible — the icon ships compiled into the bundle. To refresh after
changing icon.png, run `npm run build:launcher-icon` (it's wired into
`dist:win` so a fresh exe build always regenerates it).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 23:56:02 +09:00
parent 40986bee11
commit bc3841147f
4 changed files with 44 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ import type { Manifest, PackDefinition } from '../shared/types.js'
import { normalizePackDefinition } from '../shared/store.js'
import { loadEnv, getManifestUrl } from '../shared/env.js'
import { loadComponentI18n } from '../shared/i18n.js'
import { LAUNCHER_PROFILE_ICON } from './launcherIcon.js'
loadEnv()
@@ -1469,6 +1470,7 @@ async function updateLauncherProfile(pack: PackDefinition, gameDir: string): Pro
...existingProfile,
name: profileKey,
type: 'custom',
icon: LAUNCHER_PROFILE_ICON,
gameDir,
lastVersionId,
javaArgs