diff --git a/devSetup.gulpfile.js b/devSetup.gulpfile.js index 4e66514d..9a9d7be2 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 d9e94db3..d991c262 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 ]);