From ae1e5ec65b40f121c993a06986335edac74061a8 Mon Sep 17 00:00:00 2001 From: N0VAN0M4LY <224130499+N0VAN0M4LY@users.noreply.github.com> Date: Wed, 2 Dec 2026 09:20:32 +0800 Subject: [PATCH] feat(repo): package portable zip in local Windows builds Clean and generate wtoffline-launcher--win-x64-portable.zip from win-unpacked directly inside scripts/build-windows-installer.ts so local package:win builds produce both the NSIS installer and the portable archive. Checked: root and launcher typechecks pass. --- scripts/build-windows-installer.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/build-windows-installer.ts b/scripts/build-windows-installer.ts index b5067ec..bcdf9d5 100644 --- a/scripts/build-windows-installer.ts +++ b/scripts/build-windows-installer.ts @@ -97,8 +97,9 @@ async function cleanInstallerOutput(version: string): Promise { if (relative(output, root) !== '') throw new Error('The installer output directory is redirected.'); const { installer, manifest, signature } = launcherReleaseFiles(version); + const portable = `wtoffline-launcher-${version}-win-x64-portable.zip`; const legacy = `WTOffline Launcher Setup ${version}.exe`; - const names = [installer, installer + '.blockmap', legacy, legacy + '.blockmap', manifest, signature, 'win-unpacked']; + const names = [installer, installer + '.blockmap', portable, legacy, legacy + '.blockmap', manifest, signature, 'win-unpacked']; const artifacts = []; for (const name of names) { const path = join(root, name); @@ -160,6 +161,13 @@ async function main(): Promise { }, }); for (const artifact of artifacts) console.info(artifact); + const portable = join(output, `wtoffline-launcher-${manifest.version}-win-x64-portable.zip`); + const unpackedGlob = join(output, 'win-unpacked', '*'); + execFileSync('powershell.exe', [ + '-NoProfile', '-NonInteractive', '-Command', + `Compress-Archive -Path "${unpackedGlob}" -DestinationPath "${portable}" -Force`, + ], { cwd: repository, stdio: 'inherit', windowsHide: true }); + console.info(portable); } finally { const actual = await realpath(stage); if (actual === stage && dirname(actual) === temp) await rm(stage, { recursive: true, force: true });