Skip to content

Commit

Permalink
🚧 Attempt to fix Windows symlinks №2
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Sep 19, 2024
1 parent cbedbc2 commit 680799b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion devSetup.gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down
12 changes: 12 additions & 0 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down Expand Up @@ -643,6 +654,7 @@ export const packages = gulp.series([
patronsCache
]),
bakePackages,
fixWindowsSymlinks,
patchWindowsExecutables
]);

Expand Down

0 comments on commit 680799b

Please sign in to comment.