From eafc6775984992fcf9d73898b5514df91a0b7f94 Mon Sep 17 00:00:00 2001 From: 954437801 <118098732+954437801@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:26:26 +0800 Subject: [PATCH] Add Windows platform verification in select-7z-arch.js Added platform verification to ensure the script runs only on Windows. --- script/select-7z-arch.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/script/select-7z-arch.js b/script/select-7z-arch.js index 7be25c8c..caea49c5 100644 --- a/script/select-7z-arch.js +++ b/script/select-7z-arch.js @@ -9,6 +9,17 @@ const arch = os.arch; console.log('Selecting 7-Zip for arch ' + arch); +// Verify Windows platform +try { + if (os.platform() !== 'win32') { + console.log('is not Windows'); + process.exit(0); + } +} catch (err) { + throw err; +} + + // Copy the 7-Zip executable for the configured architecture. try { fs.copyFileSync('vendor/7z-' + arch + '.exe', 'vendor/7z.exe');