fix(installer-rp): URL-encode base pack path, output to .mc_custom + installer: no auto -Xms

리소스팩 간편설치기:
- 베이스 리소스팩 다운로드 URL 에 encodeURIComponent 적용. "Puzzle Resource
  Pack (basic).zip" 같이 공백·괄호가 들어간 파일명 정상 처리.
- 출력 경로를 %appdata%/.minecraft/resourcepacks/ → %appdata%/.mc_custom/
  resourcepacks/ 로 변경 (renderer 안내문, openFolder, 빌드 출력 일괄).
- 로드 직후 각 음악퀴즈의 베이스 등록 여부를 로그에 노출 (디버그용).
- 베이스 다운로드 시 실제 URL 도 로그에 출력.

음악퀴즈 간편설치기:
- mergeRamArgs: -Xms 가 기존에 없으면 추가하지 않도록 수정. clientMinRam
  은 "유저 PC 사양 최소 요구치" 의미이지 JVM 초기 힙이 아님. -Xmx 는
  계속 추천 RAM 으로 강제 갱신.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-13 00:48:46 +09:00
parent 82307d9d16
commit 5a018bcb8d
4 changed files with 22 additions and 18 deletions

View File

@@ -205,6 +205,9 @@ ipcMain.handle('rp:packs:load', async (_event, manifestUrlInput?: string): Promi
state.packs.clear()
for (const item of results) state.packs.set(item.key, item)
sendLog(`로드된 음악퀴즈: ${results.length}`)
for (const item of results) {
sendLog(` - ${item.key}: mc=${item.mcVersion || '?'} 베이스=${item.resourcepackPath || '(없음)'}`)
}
return results
})
@@ -344,9 +347,12 @@ ipcMain.handle('rp:install:start', async (): Promise<{ resourcepackPath: string
throwIfCancelled()
let baseZipPath: string | undefined
if (pack.resourcepackPath) {
const baseUrl = `${state.baseUrl}/file/resourcepacks/${pack.resourcepackPath.replace(/^\/+/, '')}`
// 파일명에 공백·괄호가 있을 수 있어 encodeURIComponent 로 인코딩.
const cleaned = pack.resourcepackPath.replace(/^\/+/, '')
const baseUrl = `${state.baseUrl}/file/resourcepacks/${encodeURIComponent(cleaned)}`
baseZipPath = path.join(tempRoot, 'base.zip')
sendLog(`베이스 리소스팩 다운로드: ${pack.resourcepackPath}`)
sendLog(`베이스 리소스팩 다운로드: ${cleaned}`)
sendLog(` URL: ${baseUrl}`)
sendProgress({ phase: 'package', message: '베이스 리소스팩 다운로드 중' })
try {
const buf = await fetchBuffer(baseUrl)
@@ -356,13 +362,13 @@ ipcMain.handle('rp:install:start', async (): Promise<{ resourcepackPath: string
throw new Error(`베이스 리소스팩 다운로드 실패: ${(err as Error).message}`)
}
} else {
sendLog('베이스 리소스팩 없음 — 새 리소스팩으로 생성')
sendLog('베이스 리소스팩 없음(resourcepackPath 빈 값) — 새 리소스팩으로 생성')
}
// 2-5. 리소스팩 zip 빌드 (pack.mcmeta + sounds.json + 음악·이미지, 베이스 위에 얹기)
throwIfCancelled()
const resourcepackName = `${state.selectedKey}_musicquiz.zip`
const resourcepackDir = path.join(getAppDataDir(), '.minecraft', 'resourcepacks')
const resourcepackDir = path.join(getMcCustomDir(), 'resourcepacks')
const resourcepackPath = path.join(resourcepackDir, resourcepackName)
sendLog(`리소스팩 zip 빌드 중… (${resourcepackName})`)
sendProgress({ phase: 'package', message: baseZipPath ? '베이스에 음악·사진 추가 중' : 'zip 빌드 중' })
@@ -377,7 +383,7 @@ ipcMain.handle('rp:install:start', async (): Promise<{ resourcepackPath: string
log: sendLog
})
// 2-6. %appdata%/.minecraft/resourcepacks/ 에 배치 (위 빌드가 직접 outZipPath 에 저장)
// 2-6. %appdata%/.mc_custom/resourcepacks/ 에 배치 (위 빌드가 직접 outZipPath 에 저장)
sendLog(`설치 완료: ${resourcepackPath}`)
sendProgress({ phase: 'package', message: '설치 완료', done: true })
return { resourcepackPath }
@@ -403,7 +409,7 @@ function throwIfCancelled(): void {
// ── IPC: 3단계 완료 ──────────────────────────────────
ipcMain.handle('rp:finish:openFolder', async () => {
const dir = path.join(getAppDataDir(), '.minecraft', 'resourcepacks')
const dir = path.join(getMcCustomDir(), 'resourcepacks')
if (!fs.existsSync(dir)) {
await fsp.mkdir(dir, { recursive: true })
}