|
|
|
@@ -1128,6 +1128,7 @@ 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 })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
// 사용자가 기존 .minecraft 에 저장해둔 설정(options.txt, servers.dat 등)을
|
|
|
|
// 사용자가 기존 .minecraft 에 저장해둔 설정(options.txt, servers.dat 등)을
|
|
|
|
// .mc_custom 으로 가져온다. 이미 있는 파일은 보존.
|
|
|
|
// .mc_custom 으로 가져온다. 이미 있는 파일은 보존.
|
|
|
|
await copyMinecraftUserSettings(customRoot)
|
|
|
|
await copyMinecraftUserSettings(customRoot)
|
|
|
|
@@ -1163,11 +1164,13 @@ ipcMain.handle('client:install', async (_event, payload: ClientInstallPayload) =
|
|
|
|
await linkMinecraftRuntimeDirs(customRoot)
|
|
|
|
await linkMinecraftRuntimeDirs(customRoot)
|
|
|
|
|
|
|
|
|
|
|
|
await updateLauncherProfile(pack.pack, customRoot)
|
|
|
|
await updateLauncherProfile(pack.pack, customRoot)
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
// 설치가 끝나면 더 이상 필요 없는 platform-cache(다운받은 fabric/forge/neoforge
|
|
|
|
// 설치가 끝나면(또는 실패해도) 더 이상 필요 없는 platform-cache(다운받은
|
|
|
|
// installer jar 캐시)를 삭제한다. 다음 실행에서 다시 받으면 되고, 남겨두면
|
|
|
|
// fabric/forge/neoforge installer jar 캐시)를 삭제한다. 다음 실행에서 다시
|
|
|
|
// 사용자 .mc_custom 폴더만 차지한다.
|
|
|
|
// 받으면 되고, 남겨두면 사용자 .mc_custom 폴더만 차지한다. 실패 경로에서도
|
|
|
|
|
|
|
|
// 정리되도록 finally 에 둔다.
|
|
|
|
await fsp.rm(path.join(customRoot, 'platform-cache'), { recursive: true, force: true }).catch(() => {})
|
|
|
|
await fsp.rm(path.join(customRoot, 'platform-cache'), { recursive: true, force: true }).catch(() => {})
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
interface FabricInstallerMeta {
|
|
|
|
interface FabricInstallerMeta {
|
|
|
|
|