Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 40986bee11 | |||
| bf225f51e1 | |||
| 2371af4411 |
@@ -75,6 +75,7 @@
|
|||||||
"baseUrl": " URL: {{url}}",
|
"baseUrl": " URL: {{url}}",
|
||||||
"baseReceived": "베이스 리소스팩 받음 ({{kb}} KB)",
|
"baseReceived": "베이스 리소스팩 받음 ({{kb}} KB)",
|
||||||
"baseAbsent": "베이스 리소스팩 없음(resourcepackPath 빈 값) — 새 리소스팩으로 생성",
|
"baseAbsent": "베이스 리소스팩 없음(resourcepackPath 빈 값) — 새 리소스팩으로 생성",
|
||||||
|
"baseRemoved": "베이스 리소스팩 삭제: {{path}}",
|
||||||
"buildingZip": "리소스팩 zip 빌드 중… ({{name}})",
|
"buildingZip": "리소스팩 zip 빌드 중… ({{name}})",
|
||||||
"installComplete": "설치 완료: {{path}}",
|
"installComplete": "설치 완료: {{path}}",
|
||||||
"cancelRequested": "취소 요청됨. 실행 중 프로세스 {{count}}개 중단…",
|
"cancelRequested": "취소 요청됨. 실행 중 프로세스 {{count}}개 중단…",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "minecraft-music-quiz-installer",
|
"name": "minecraft-music-quiz-installer",
|
||||||
"version": "0.2.2",
|
"version": "0.2.5",
|
||||||
"description": "마인크래프트 음악퀴즈 간편설치기 + 관리 사이트",
|
"description": "마인크래프트 음악퀴즈 간편설치기 + 관리 사이트",
|
||||||
"main": "dist/installer/main.js",
|
"main": "dist/installer/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -421,6 +421,22 @@ ipcMain.handle('rp:install:start', async (): Promise<{ resourcepackPath: string
|
|||||||
|
|
||||||
// 2-6. %appdata%/.mc_custom/resourcepacks/ 에 배치 (위 빌드가 직접 outZipPath 에 저장)
|
// 2-6. %appdata%/.mc_custom/resourcepacks/ 에 배치 (위 빌드가 직접 outZipPath 에 저장)
|
||||||
sendLog(t('log.installComplete', { path: resourcepackPath }))
|
sendLog(t('log.installComplete', { path: resourcepackPath }))
|
||||||
|
|
||||||
|
// 2-7. 베이스 리소스팩은 우리가 임시폴더에 받아서 빌드에 이미 얹었으므로,
|
||||||
|
// 메인 설치기가 `.mc_custom/resourcepacks/<resourcepackPath>` 에 받아둔
|
||||||
|
// 원본 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 })
|
sendProgress({ phase: 'package', message: t('progress.installComplete'), done: true })
|
||||||
return { resourcepackPath }
|
return { resourcepackPath }
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -1128,46 +1128,49 @@ ipcMain.handle('client:install', async (_event, payload: ClientInstallPayload) =
|
|||||||
await fsp.mkdir(path.join(customRoot, 'mods'), { recursive: true })
|
await fsp.mkdir(path.join(customRoot, 'mods'), { recursive: true })
|
||||||
await fsp.mkdir(path.join(customRoot, 'resourcepacks'), { recursive: true })
|
await fsp.mkdir(path.join(customRoot, 'resourcepacks'), { recursive: true })
|
||||||
|
|
||||||
// 사용자가 기존 .minecraft 에 저장해둔 설정(options.txt, servers.dat 등)을
|
try {
|
||||||
// .mc_custom 으로 가져온다. 이미 있는 파일은 보존.
|
// 사용자가 기존 .minecraft 에 저장해둔 설정(options.txt, servers.dat 등)을
|
||||||
await copyMinecraftUserSettings(customRoot)
|
// .mc_custom 으로 가져온다. 이미 있는 파일은 보존.
|
||||||
|
await copyMinecraftUserSettings(customRoot)
|
||||||
|
|
||||||
if (payload.installPlatform && pack.pack.platform.type === 'fabric') {
|
if (payload.installPlatform && pack.pack.platform.type === 'fabric') {
|
||||||
await installFabricLoader(pack.pack, customRoot)
|
await installFabricLoader(pack.pack, customRoot)
|
||||||
} else if (payload.installPlatform && pack.pack.platform.type !== 'vanilla' && pack.pack.platform.downloadUrl) {
|
} else if (payload.installPlatform && pack.pack.platform.type !== 'vanilla' && pack.pack.platform.downloadUrl) {
|
||||||
const platformUrl = resolveManifestRelative(pack.pack.platform.downloadUrl, 'platforms')
|
const platformUrl = resolveManifestRelative(pack.pack.platform.downloadUrl, 'platforms')
|
||||||
const cacheDir = path.join(customRoot, 'platform-cache')
|
const cacheDir = path.join(customRoot, 'platform-cache')
|
||||||
await fsp.mkdir(cacheDir, { recursive: true })
|
await fsp.mkdir(cacheDir, { recursive: true })
|
||||||
const installerPath = path.join(cacheDir, deriveFileName(platformUrl) || 'platform-installer.jar')
|
const installerPath = path.join(cacheDir, deriveFileName(platformUrl) || 'platform-installer.jar')
|
||||||
sendLog(t('log.platformDownload', { type: pack.pack.platform.type, url: platformUrl }))
|
sendLog(t('log.platformDownload', { type: pack.pack.platform.type, url: platformUrl }))
|
||||||
await downloadFile(platformUrl, installerPath)
|
await downloadFile(platformUrl, installerPath)
|
||||||
sendLog(t('log.platformSaved', { path: installerPath }))
|
sendLog(t('log.platformSaved', { path: installerPath }))
|
||||||
} else if (!payload.installPlatform) {
|
} else if (!payload.installPlatform) {
|
||||||
sendLog(t('log.platformSkipped'))
|
sendLog(t('log.platformSkipped'))
|
||||||
|
}
|
||||||
|
|
||||||
|
await downloadModsFolder(pack.pack, customRoot)
|
||||||
|
await downloadResourcepackZip(pack.pack, customRoot)
|
||||||
|
|
||||||
|
if (payload.skipMap) {
|
||||||
|
// 참가자 모드: 이전 설치 흐름에서 설치러가 풀어둔 맵이 있다면 제거한다.
|
||||||
|
// 사용자가 직접 만든 월드는 마커에 포함되지 않으므로 그대로 보존된다.
|
||||||
|
await cleanupInstallerMap(customRoot)
|
||||||
|
sendLog(t('log.skipMapZip'))
|
||||||
|
} else {
|
||||||
|
await downloadMapZip(pack.pack, customRoot)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 런처가 .mc_custom 을 gameDir 로 잡아도 assets/libraries/versions 를
|
||||||
|
// 찾을 수 있도록 .minecraft 의 해당 폴더로 junction 링크.
|
||||||
|
await linkMinecraftRuntimeDirs(customRoot)
|
||||||
|
|
||||||
|
await updateLauncherProfile(pack.pack, customRoot)
|
||||||
|
} finally {
|
||||||
|
// 설치가 끝나면(또는 실패해도) 더 이상 필요 없는 platform-cache(다운받은
|
||||||
|
// fabric/forge/neoforge installer jar 캐시)를 삭제한다. 다음 실행에서 다시
|
||||||
|
// 받으면 되고, 남겨두면 사용자 .mc_custom 폴더만 차지한다. 실패 경로에서도
|
||||||
|
// 정리되도록 finally 에 둔다.
|
||||||
|
await fsp.rm(path.join(customRoot, 'platform-cache'), { recursive: true, force: true }).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
await downloadModsFolder(pack.pack, customRoot)
|
|
||||||
await downloadResourcepackZip(pack.pack, customRoot)
|
|
||||||
|
|
||||||
if (payload.skipMap) {
|
|
||||||
// 참가자 모드: 이전 설치 흐름에서 설치러가 풀어둔 맵이 있다면 제거한다.
|
|
||||||
// 사용자가 직접 만든 월드는 마커에 포함되지 않으므로 그대로 보존된다.
|
|
||||||
await cleanupInstallerMap(customRoot)
|
|
||||||
sendLog(t('log.skipMapZip'))
|
|
||||||
} else {
|
|
||||||
await downloadMapZip(pack.pack, customRoot)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 런처가 .mc_custom 을 gameDir 로 잡아도 assets/libraries/versions 를
|
|
||||||
// 찾을 수 있도록 .minecraft 의 해당 폴더로 junction 링크.
|
|
||||||
await linkMinecraftRuntimeDirs(customRoot)
|
|
||||||
|
|
||||||
await updateLauncherProfile(pack.pack, customRoot)
|
|
||||||
|
|
||||||
// 설치가 끝나면 더 이상 필요 없는 platform-cache(다운받은 fabric/forge/neoforge
|
|
||||||
// installer jar 캐시)를 삭제한다. 다음 실행에서 다시 받으면 되고, 남겨두면
|
|
||||||
// 사용자 .mc_custom 폴더만 차지한다.
|
|
||||||
await fsp.rm(path.join(customRoot, 'platform-cache'), { recursive: true, force: true }).catch(() => {})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
interface FabricInstallerMeta {
|
interface FabricInstallerMeta {
|
||||||
@@ -1216,7 +1219,16 @@ async function installFabricLoader(pack: PackDefinition, customRoot: string): Pr
|
|||||||
|
|
||||||
// 4) fabric-installer CLI 자동 실행.
|
// 4) fabric-installer CLI 자동 실행.
|
||||||
// client 모드 + -noprofile: launcher_profiles.json 은 우리 코드가 직접 갱신하므로 fabric-installer 가 덮어쓰지 않게 한다.
|
// client 모드 + -noprofile: launcher_profiles.json 은 우리 코드가 직접 갱신하므로 fabric-installer 가 덮어쓰지 않게 한다.
|
||||||
|
// JVM stdout 인코딩 강제 UTF-8:
|
||||||
|
// 한국 윈도우의 시스템 codepage 는 cp949(MS949) 라서 fabric-installer 가
|
||||||
|
// 한글을 cp949 로 stdout 에 쓰면 우리가 utf-8 로 디코드해서 깨져 보인다.
|
||||||
|
// `file.encoding` 은 default Charset, `stdout/stderr.encoding` 은
|
||||||
|
// System.out/err 의 PrintStream 인코딩(Java 18+). 둘 다 지정하면
|
||||||
|
// 구버전·신버전 JDK 모두에서 안전.
|
||||||
const args = [
|
const args = [
|
||||||
|
'-Dfile.encoding=UTF-8',
|
||||||
|
'-Dstdout.encoding=UTF-8',
|
||||||
|
'-Dstderr.encoding=UTF-8',
|
||||||
'-jar', installerJar,
|
'-jar', installerJar,
|
||||||
'client',
|
'client',
|
||||||
'-mcversion', pack.mcVersion,
|
'-mcversion', pack.mcVersion,
|
||||||
|
|||||||
Reference in New Issue
Block a user