Sub-step 이전/다음 navigation + EULA popup flow

- Each 3-x and 4-x sub-step now has its own [이전][다음] action row at the bottom; 이전 returns to the previous sub-step (or previous main step on the first one) so users can move freely both directions
- 3-3 EULA: replace the inline checkbox with a modal popup. After server zip downloads, the renderer reads eula.txt via server:readEula; if absent, falls back to the live minecraft.net/en-us/eula HTML via server:fetchMinecraftEula and shows it in a sandboxed iframe
- Popup buttons: 동의 → server:acceptEula and proceed to RAM check; 비동의 / X / overlay click → "EULA 동의 실패. 다운로드를 취소합니다." and re-enable 다운로드 시작 for retry
- main.ts: stop auto-deleting eula.txt after server zip extraction so the popup can read whatever the zip provided
- 4-2 install completion now keeps a state.client.clientInstalled flag so backing into 4-2 doesn't force a re-install

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-11 03:25:10 +09:00
parent 6c042503d6
commit 01a34e08aa
4 changed files with 252 additions and 93 deletions

View File

@@ -295,11 +295,30 @@ ipcMain.handle('server:install', async (_event, payload: ServerInstallPayload) =
sendLog(`서버 설치 경로: ${installPath}`)
await downloadServerZip(pack.pack, installPath)
// 다운로드한 zip에 들어있을 수 있는 eula.txt를 그대로 보존한다.
// 동의 흐름은 renderer가 별도 IPC로 읽고 동의 시 덮어쓴다.
})
const eulaPath = path.join(installPath, 'eula.txt')
if (fs.existsSync(eulaPath)) {
await fsp.unlink(eulaPath)
sendLog('기존 eula.txt 삭제, 사용자 동의를 다시 받습니다.')
ipcMain.handle('server:readEula', async (_event, installPath: string): Promise<{ exists: boolean; content: string }> => {
if (!installPath) return { exists: false, content: '' }
const target = path.join(path.resolve(installPath), 'eula.txt')
try {
const content = await fsp.readFile(target, 'utf8')
return { exists: true, content }
} catch (error) {
if ((error as NodeJS.ErrnoException).code === 'ENOENT') return { exists: false, content: '' }
throw error
}
})
ipcMain.handle('server:fetchMinecraftEula', async (): Promise<{ url: string; html: string }> => {
const url = 'https://www.minecraft.net/en-us/eula'
try {
const buffer = await fetchBuffer(url)
return { url, html: buffer.toString('utf8') }
} catch (error) {
sendLog(`Minecraft EULA 페이지 조회 실패: ${(error as Error).message}`)
return { url, html: '' }
}
})

View File

@@ -19,6 +19,10 @@ const api = {
// 3-3
startServerInstall: (payload: ServerInstallPayload): Promise<void> =>
ipcRenderer.invoke('server:install', payload),
readEula: (installPath: string): Promise<{ exists: boolean; content: string }> =>
ipcRenderer.invoke('server:readEula', installPath),
fetchMinecraftEula: (): Promise<{ url: string; html: string }> =>
ipcRenderer.invoke('server:fetchMinecraftEula'),
acceptEula: (installPath: string): Promise<void> =>
ipcRenderer.invoke('server:acceptEula', installPath),
checkRam: (packKey: string): Promise<RamCheckResult> =>