fix(installer): 최종 리소스팩 자동 적용 실패를 UI 에 경고

options.txt 자동 적용이 실패하면(권한/잠금/손상 등) 예전엔 성공처럼 "자동 적용됩니다"
로 보였다. 이제 finalResourcepack:install 이 applied=false 를 반환하고, 렌더러가
"받았지만 자동 적용 실패 — 직접 켜주세요" 경고를 표시한다(다운로드 자체는 성공). 0.4.23→0.4.24.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-28 22:36:57 +09:00
parent 68e2312ce7
commit 80059d6696
5 changed files with 19 additions and 8 deletions

View File

@@ -280,7 +280,7 @@ ipcMain.handle('terms:listFinal', async (): Promise<{ ok: boolean; terms?: Array
})
// 최종 리소스팩(zip)을 /file/resourcepacks/outputs/ 에서 받아 .mc_custom/resourcepacks/ 에 저장.
ipcMain.handle('finalResourcepack:install', async (): Promise<{ ok: boolean; path?: string; message?: string }> => {
ipcMain.handle('finalResourcepack:install', async (): Promise<{ ok: boolean; path?: string; message?: string; applied?: boolean; applyMessage?: string }> => {
const pack = state.selectedKey ? state.packs.get(state.selectedKey) : undefined
if (!pack) return { ok: false, message: t('errors.packNotFound2') }
const finalName = pack.pack.finalResourcepackPath
@@ -311,10 +311,14 @@ ipcMain.handle('finalResourcepack:install', async (): Promise<{ ok: boolean; pat
try {
await enableResourcePackInOptions(gameDir, cleaned)
sendLog(t('log.finalResourcepackApplied', { name: cleaned }))
return { ok: true, path: dest, applied: true }
} catch (err) {
sendLog(t('log.finalResourcepackApplyFail', { message: (err as Error).message }))
// 다운로드는 됐지만 자동 적용(options.txt)에 실패 → 성공으로 숨기지 말고 렌더러가
// 경고를 띄우도록 applied=false 로 알린다(사용자가 직접 켤 수 있게).
const msg = (err as Error).message
sendLog(t('log.finalResourcepackApplyFail', { message: msg }))
return { ok: true, path: dest, applied: false, applyMessage: msg }
}
return { ok: true, path: dest }
} catch (error) {
// 실패 시 부분/0바이트 zip 이 마인크래프트 리소스팩 목록에 깨진 채로 남지 않도록 삭제.
if (dest) await fsp.rm(dest, { force: true }).catch(() => {})

View File

@@ -20,8 +20,8 @@ const api = {
// 최종 리소스팩 다운로드용 약관 목록 (showInFinalResourcepack 필터)
getFinalTermsList: (): Promise<{ ok: boolean; terms?: Array<{ kind: string; label: string }>; message?: string }> =>
ipcRenderer.invoke('terms:listFinal'),
// 최종 리소스팩 다운로드 실행
installFinalResourcepack: (): Promise<{ ok: boolean; path?: string; message?: string }> =>
// 최종 리소스팩 다운로드 실행. applied=false 면 다운로드는 됐지만 자동 적용 실패.
installFinalResourcepack: (): Promise<{ ok: boolean; path?: string; message?: string; applied?: boolean; applyMessage?: string }> =>
ipcRenderer.invoke('finalResourcepack:install'),
// 3-1