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:
@@ -1167,8 +1167,14 @@ function downloadFinalResourcepack() {
|
|||||||
if (res && res.ok) {
|
if (res && res.ok) {
|
||||||
bar.style.width = '100%'
|
bar.style.width = '100%'
|
||||||
percentEl.textContent = '100%'
|
percentEl.textContent = '100%'
|
||||||
|
if (res.applied === false) {
|
||||||
|
// 다운로드는 됐지만 자동 적용(options.txt) 실패 → 직접 켜라고 경고.
|
||||||
|
msg.textContent = tt('resourcepack.downloadDoneNotApplied', { message: res.applyMessage || '' })
|
||||||
|
msg.classList.add('error')
|
||||||
|
} else {
|
||||||
msg.textContent = tt('resourcepack.downloadDone')
|
msg.textContent = tt('resourcepack.downloadDone')
|
||||||
msg.classList.add('success')
|
msg.classList.add('success')
|
||||||
|
}
|
||||||
actions.innerHTML = '<button class="primaryBtn" id="rpNext">' + tt('common.next') + '</button>'
|
actions.innerHTML = '<button class="primaryBtn" id="rpNext">' + tt('common.next') + '</button>'
|
||||||
actions.querySelector('#rpNext').addEventListener('click', proceed)
|
actions.querySelector('#rpNext').addEventListener('click', proceed)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -168,6 +168,7 @@
|
|||||||
"downloadHeading": "최종 리소스팩 다운로드",
|
"downloadHeading": "최종 리소스팩 다운로드",
|
||||||
"downloading": "최종 리소스팩을 다운로드하는 중…",
|
"downloading": "최종 리소스팩을 다운로드하는 중…",
|
||||||
"downloadDone": "최종 리소스팩 다운로드 완료. 마인크래프트를 켜면 자동으로 적용됩니다.",
|
"downloadDone": "최종 리소스팩 다운로드 완료. 마인크래프트를 켜면 자동으로 적용됩니다.",
|
||||||
|
"downloadDoneNotApplied": "최종 리소스팩은 받았지만 자동 적용에 실패했습니다({{message}}). 마인크래프트 설정 → 리소스팩에서 직접 켜주세요.",
|
||||||
"downloadFailed": "최종 리소스팩 다운로드 실패: {{message}}"
|
"downloadFailed": "최종 리소스팩 다운로드 실패: {{message}}"
|
||||||
},
|
},
|
||||||
"step5": {
|
"step5": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "minecraft-music-quiz-installer",
|
"name": "minecraft-music-quiz-installer",
|
||||||
"version": "0.4.23",
|
"version": "0.4.24",
|
||||||
"description": "마인크래프트 음악퀴즈 간편설치기 + 관리 사이트",
|
"description": "마인크래프트 음악퀴즈 간편설치기 + 관리 사이트",
|
||||||
"main": "dist/installer/main.js",
|
"main": "dist/installer/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ ipcMain.handle('terms:listFinal', async (): Promise<{ ok: boolean; terms?: Array
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 최종 리소스팩(zip)을 /file/resourcepacks/outputs/ 에서 받아 .mc_custom/resourcepacks/ 에 저장.
|
// 최종 리소스팩(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
|
const pack = state.selectedKey ? state.packs.get(state.selectedKey) : undefined
|
||||||
if (!pack) return { ok: false, message: t('errors.packNotFound2') }
|
if (!pack) return { ok: false, message: t('errors.packNotFound2') }
|
||||||
const finalName = pack.pack.finalResourcepackPath
|
const finalName = pack.pack.finalResourcepackPath
|
||||||
@@ -311,10 +311,14 @@ ipcMain.handle('finalResourcepack:install', async (): Promise<{ ok: boolean; pat
|
|||||||
try {
|
try {
|
||||||
await enableResourcePackInOptions(gameDir, cleaned)
|
await enableResourcePackInOptions(gameDir, cleaned)
|
||||||
sendLog(t('log.finalResourcepackApplied', { name: cleaned }))
|
sendLog(t('log.finalResourcepackApplied', { name: cleaned }))
|
||||||
|
return { ok: true, path: dest, applied: true }
|
||||||
} catch (err) {
|
} 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) {
|
} catch (error) {
|
||||||
// 실패 시 부분/0바이트 zip 이 마인크래프트 리소스팩 목록에 깨진 채로 남지 않도록 삭제.
|
// 실패 시 부분/0바이트 zip 이 마인크래프트 리소스팩 목록에 깨진 채로 남지 않도록 삭제.
|
||||||
if (dest) await fsp.rm(dest, { force: true }).catch(() => {})
|
if (dest) await fsp.rm(dest, { force: true }).catch(() => {})
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ const api = {
|
|||||||
// 최종 리소스팩 다운로드용 약관 목록 (showInFinalResourcepack 필터)
|
// 최종 리소스팩 다운로드용 약관 목록 (showInFinalResourcepack 필터)
|
||||||
getFinalTermsList: (): Promise<{ ok: boolean; terms?: Array<{ kind: string; label: string }>; message?: string }> =>
|
getFinalTermsList: (): Promise<{ ok: boolean; terms?: Array<{ kind: string; label: string }>; message?: string }> =>
|
||||||
ipcRenderer.invoke('terms:listFinal'),
|
ipcRenderer.invoke('terms:listFinal'),
|
||||||
// 최종 리소스팩 다운로드 실행
|
// 최종 리소스팩 다운로드 실행. applied=false 면 다운로드는 됐지만 자동 적용 실패.
|
||||||
installFinalResourcepack: (): Promise<{ ok: boolean; path?: string; message?: string }> =>
|
installFinalResourcepack: (): Promise<{ ok: boolean; path?: string; message?: string; applied?: boolean; applyMessage?: string }> =>
|
||||||
ipcRenderer.invoke('finalResourcepack:install'),
|
ipcRenderer.invoke('finalResourcepack:install'),
|
||||||
|
|
||||||
// 3-1
|
// 3-1
|
||||||
|
|||||||
Reference in New Issue
Block a user