Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
node-version: 20.x
cache: 'yarn'
- name: Install
run: yarn install --frozen-lockfile
run: yarn install --immutable
- uses: continuousauth/action@4e8a2573eeb706f6d7300d6a9f3ca6322740b72d # v1.0.5
timeout-minutes: 60
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ jobs:
cache: 'yarn'
- name: Install (Node.js v16+)
if : ${{ matrix.node-version != '14.21' }}
run: yarn install --frozen-lockfile
run: yarn install --immutable
- name: Install (Node.js v14)
if : ${{ matrix.node-version == '14.21' }}
run: yarn install --frozen-lockfile --ignore-engines
run: yarn install --immutable --ignore-engines
- name: Test
run: yarn test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ vendor/7z.dll
vendor/7z.exe
hook.log
docs
.yarn/install-state.gz
942 changes: 942 additions & 0 deletions .yarn/releases/yarn-4.10.3.cjs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
enableScripts: false

nodeLinker: node-modules

npmMinimalAgeGate: 10080

npmPreapprovedPackages:
- "@electron/*"

yarnPath: .yarn/releases/yarn-4.10.3.cjs
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
"!vendor/7z.exe"
],
"scripts": {
"install": "node ./script/select-7z-arch.js",
"build": "tsc",
"docs": "npx typedoc",
"prepublish": "npm run build",
"prepack": "yarn build",
"lint": "eslint --ext .ts src spec",
"ava": "ava --timeout=60s",
"test": "npm run lint && npm run ava",
"test": "yarn lint && yarn ava",
"tdd": "ava --watch"
},
"dependencies": {
Expand Down Expand Up @@ -69,5 +68,6 @@
"require": [
"ts-node/register/transpile-only"
]
}
},
"packageManager": "[email protected]+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
}
23 changes: 0 additions & 23 deletions script/select-7z-arch.js

This file was deleted.

17 changes: 17 additions & 0 deletions src/7z.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import fs from 'fs';
import os from 'os';
import path from 'path';

export async function prepare7z() {
const baseDir = path.resolve(__dirname, '..');

/**
* Even if we're cross-compiling for a different arch like arm64,
* we still need to use the 7-Zip executable for the host arch
*/
const arch = os.arch;

// Copy the 7-Zip executable for the configured architecture.
fs.copyFileSync(path.resolve(baseDir, 'vendor/7z-' + arch + '.exe'), path.resolve(baseDir, 'vendor/7z.exe'));
fs.copyFileSync(path.resolve(baseDir, 'vendor/7z-' + arch + '.dll'), path.resolve(baseDir, 'vendor/7z.dll'));
}
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { exec } from 'child_process';
import spawn from './spawn-promise';
import { template } from 'lodash';
import { createSignTool, resetSignTool } from './sign';
import { prepare7z } from './7z';

export { SquirrelWindowsOptions } from './options';
export { SquirrelWindowsOptions as Options} from './options';
Expand Down Expand Up @@ -50,6 +51,8 @@ function checkIfCommandExists(command: string): Promise<boolean> {
* @see {@link https://github.com/Squirrel/Squirrel.Windows | Squirrel.Windows}
*/
export async function createWindowsInstaller(options: SquirrelWindowsOptions): Promise<void> {
await prepare7z();

let useMono = false;

const monoExe = 'mono';
Expand Down
Loading
Loading