diff --git a/locales/installer-rp/ko-kr.json b/locales/installer-rp/ko-kr.json index dbdacea..fd927bc 100644 --- a/locales/installer-rp/ko-kr.json +++ b/locales/installer-rp/ko-kr.json @@ -75,6 +75,7 @@ "baseUrl": " URL: {{url}}", "baseReceived": "베이스 리소스팩 받음 ({{kb}} KB)", "baseAbsent": "베이스 리소스팩 없음(resourcepackPath 빈 값) — 새 리소스팩으로 생성", + "baseRemoved": "베이스 리소스팩 삭제: {{path}}", "buildingZip": "리소스팩 zip 빌드 중… ({{name}})", "installComplete": "설치 완료: {{path}}", "cancelRequested": "취소 요청됨. 실행 중 프로세스 {{count}}개 중단…", diff --git a/package.json b/package.json index 8bc70dd..2be94ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-music-quiz-installer", - "version": "0.2.4", + "version": "0.2.5", "description": "마인크래프트 음악퀴즈 간편설치기 + 관리 사이트", "main": "dist/installer/main.js", "scripts": { diff --git a/src/installer-rp/main.ts b/src/installer-rp/main.ts index a66c10c..c5cbf2b 100644 --- a/src/installer-rp/main.ts +++ b/src/installer-rp/main.ts @@ -421,6 +421,22 @@ ipcMain.handle('rp:install:start', async (): Promise<{ resourcepackPath: string // 2-6. %appdata%/.mc_custom/resourcepacks/ 에 배치 (위 빌드가 직접 outZipPath 에 저장) sendLog(t('log.installComplete', { path: resourcepackPath })) + + // 2-7. 베이스 리소스팩은 우리가 임시폴더에 받아서 빌드에 이미 얹었으므로, + // 메인 설치기가 `.mc_custom/resourcepacks/` 에 받아둔 + // 원본 zip 은 MC 리소스팩 목록에 굳이 남길 필요 없다. 삭제하되, 사용자가 + // outputPackName 을 base 파일명과 똑같이 둬서 우리가 방금 쓴 최종 zip 과 + // 같은 경로면 그대로 둔다(우리 산출물을 지우면 안 되므로). + if (pack.resourcepackPath) { + const basePackPath = path.join(resourcepackDir, pack.resourcepackPath) + if (path.resolve(basePackPath) !== path.resolve(resourcepackPath)) { + try { + await fsp.rm(basePackPath, { force: true }) + sendLog(t('log.baseRemoved', { path: basePackPath })) + } catch { /* 없으면 무시 */ } + } + } + sendProgress({ phase: 'package', message: t('progress.installComplete'), done: true }) return { resourcepackPath } } finally {