Skip to content

Commit dea07ea

Browse files
committed
hack hack hack
1 parent 7e16bc0 commit dea07ea

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

packages/hadron-build/lib/target.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,20 @@ class Target {
436436
);
437437

438438
const electronWinstaller = require('electron-winstaller');
439-
await electronWinstaller.createWindowsInstaller(this.installerOptions);
439+
440+
// We monkey-patch the signtool.exe that comes with electron-winstaller
441+
// with our drop-in replace ment signtool.exe written in go so that
442+
// electron-winstaller will execute that. But it requires
443+
// @mongodb-js/signing-tools via node and that's only a dep of this
444+
// package. So change the working directory to packages/hadron-build so
445+
// that that would work.
446+
const oldCWD = process.cwd();
447+
process.chdir(path.join(__dirname, '..', '..'));
448+
try {
449+
await electronWinstaller.createWindowsInstaller(this.installerOptions);
450+
} finally {
451+
process.chdir(oldCWD);
452+
}
440453

441454
await fs.promises.rename(
442455
this.dest('RELEASES'),
-512 Bytes
Binary file not shown.

packages/hadron-build/signtool/signtool.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ func main() {
6666
if err != nil {
6767
fmt.Println("Error signing the file")
6868
fmt.Printf("%s\n", stdoutStderr)
69-
fmt.Println(err)
70-
// if we error out then we won't see much because of how electron-windows-installer fails
71-
return
69+
log.Fatal(err)
7270
}
7371

7472
fmt.Println("File signed successfully.")

0 commit comments

Comments
 (0)