From 680799b4ad9f039288d51aa7a6ceb26d74c53c51 Mon Sep 17 00:00:00 2001 From: Cosmo Myzrail Gorynych Date: Thu, 19 Sep 2024 15:15:28 +1200 Subject: [PATCH] =?UTF-8?q?:construction:=20Attempt=20to=20fix=20Windows?= =?UTF-8?q?=20symlinks=20=E2=84=962?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devSetup.gulpfile.js | 2 +- gulpfile.mjs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/devSetup.gulpfile.js b/devSetup.gulpfile.js index 4e66514d8..9a9d7be23 100644 --- a/devSetup.gulpfile.js +++ b/devSetup.gulpfile.js @@ -24,7 +24,7 @@ const cleanup = () => { const npmInstall = path => done => { console.log(`Running 'npm install' for ${path}…`); - spawnise.spawn((/^win/).test(process.platform) ? 'npm.cmd' : 'npm', ['install', '--install-links'], { + spawnise.spawn((/^win/).test(process.platform) ? 'npm.cmd' : 'npm', ['install'], { cwd: path || './', shell: true }) diff --git a/gulpfile.mjs b/gulpfile.mjs index d9e94db36..d991c2628 100644 --- a/gulpfile.mjs +++ b/gulpfile.mjs @@ -541,6 +541,17 @@ export const bakePackages = async () => { log.info('\'bakePackages\': Built to this location:', path.resolve(path.join('./build', `ctjs - v${pack.version}`))); }; +// Reinstalls npm packages without symbolic links, as creating them on Windows +// require administrative privileges and thus fail installation through itch app / unzipping. +export const fixWindowsSymlinks = async () => { + await $({ + cwd: `./build/ctjs - v${pack.version}/win32` + })`npm install --install-links --os=win32 --cpu=ia32`; + await $({ + cwd: `./build/ctjs - v${pack.version}/win64` + })`npm install --install-links --os=win32 --cpu=x64`; +}; + export const dumpPfx = () => { if (!process.env.SIGN_PFX) { log.warn('❔ \'dumpPfx\': Cannot find PFX certificate in environment variables. Provide it as a local file at ./CoMiGoGames.pfx or set the environment variable SIGN_PFX.'); @@ -643,6 +654,7 @@ export const packages = gulp.series([ patronsCache ]), bakePackages, + fixWindowsSymlinks, patchWindowsExecutables ]);