Skip to content

Commit

Permalink
fix(squirrel.windows): pass 7za path via env
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Oct 31, 2018
1 parent 90eb855 commit ce1de01
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/electron-builder-squirrel-windows/src/squirrelPack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class SquirrelBuilder {
"--releasify", nupkgPath,
"--releaseDir", this.outputDirectory
]
const out = (await exec(process.platform === "win32" ? path.join(this.options.vendorPath, "Update.com") : "mono", prepareArgs(args, path.join(this.options.vendorPath, "Update-Mono.exe")))).trim()
const out = (await execSw(this.options, args)).trim()
if (debug.enabled) {
debug(`Squirrel output: ${out}`)
}
Expand Down Expand Up @@ -210,12 +210,21 @@ async function pack(options: SquirrelOptions, directory: string, updateFile: str
await archivePromise
}

function execSw(options: SquirrelOptions, args: Array<string>) {
return exec(process.platform === "win32" ? path.join(options.vendorPath, "Update.com") : "mono", prepareArgs(args, path.join(options.vendorPath, "Update-Mono.exe")), {
env: {
...process.env,
SZA_PATH: path7za,
}
})
}

async function msi(options: SquirrelOptions, nupkgPath: string, setupPath: string, outputDirectory: string, outFile: string) {
const args = [
"--createMsi", nupkgPath,
"--bootstrapperExe", setupPath
]
await exec(process.platform === "win32" ? path.join(options.vendorPath, "Update.com") : "mono", prepareArgs(args, path.join(options.vendorPath, "Update-Mono.exe")))
await execSw(options, args)
//noinspection SpellCheckingInspection
await exec(path.join(options.vendorPath, "candle.exe"), ["-nologo", "-ext", "WixNetFxExtension", "-out", "Setup.wixobj", "Setup.wxs"], {
cwd: outputDirectory,
Expand Down

0 comments on commit ce1de01

Please sign in to comment.