|
1 | | -import { path7za } from "7zip-bin" |
2 | | -import { Arch, debug, exec, log, spawn, isEmptyOrSpaces } from "builder-util" |
| 1 | +import { Arch, debug, exec, log, spawn, isEmptyOrSpaces, getPath7za } from "builder-util" |
3 | 2 | import { copyFile, walk } from "builder-util/out/fs" |
4 | 3 | import { compute7zCompressArgs } from "app-builder-lib/out/targets/archive" |
5 | 4 | import { execWine, prepareWindowsExecutableArgs as prepareArgs } from "app-builder-lib/out/wine" |
6 | 5 | import { WinPackager } from "app-builder-lib/out/winPackager" |
7 | | -import { chmod, createWriteStream, stat, unlink, writeFile } from "fs-extra" |
| 6 | +import { createWriteStream, stat, unlink, writeFile } from "fs-extra" |
8 | 7 | import * as path from "path" |
9 | 8 | import * as archiver from "archiver" |
10 | 9 | import * as fs from "fs/promises" |
@@ -126,7 +125,7 @@ export class SquirrelBuilder { |
126 | 125 |
|
127 | 126 | private async createEmbeddedArchiveFile(nupkgPath: string, dirToArchive: string) { |
128 | 127 | const embeddedArchiveFile = await this.packager.getTempFile("setup.zip") |
129 | | - await chmod(path7za, 0o755) |
| 128 | + const path7za = await getPath7za() |
130 | 129 | await exec( |
131 | 130 | path7za, |
132 | 131 | compute7zCompressArgs("zip", { |
@@ -230,11 +229,10 @@ async function pack(options: SquirrelOptions, directory: string, updateFile: str |
230 | 229 | } |
231 | 230 |
|
232 | 231 | async function execSw(options: SquirrelOptions, args: Array<string>) { |
233 | | - await chmod(path7za, 0o755) |
234 | 232 | return exec(process.platform === "win32" ? path.join(options.vendorPath, "Update.com") : "mono", prepareArgs(args, path.join(options.vendorPath, "Update-Mono.exe")), { |
235 | 233 | env: { |
236 | 234 | ...process.env, |
237 | | - SZA_PATH: path7za, |
| 235 | + SZA_PATH: await getPath7za(), |
238 | 236 | }, |
239 | 237 | }) |
240 | 238 | } |
|
0 commit comments