Skip to content

Commit

Permalink
fix: windows async signing
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Maietta authored and develar committed Mar 16, 2021
1 parent e6bc232 commit 9162711
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/app-builder-lib/src/codeSign/windowsCodeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ export async function sign(options: WindowsSignOptions, packager: WinPackager) {
let isNest = false
for (const hash of hashes) {
const taskConfiguration: WindowsSignTaskConfiguration = { ...options, hash, isNest }
await executor(
{
...taskConfiguration,
computeSignToolArgs: isWin => computeSignToolArgs(taskConfiguration, isWin),
},
packager
await Promise.resolve(
executor(
{
...taskConfiguration,
computeSignToolArgs: isWin => computeSignToolArgs(taskConfiguration, isWin),
},
packager
)
)
isNest = true
if (taskConfiguration.resultOutputPath != null) {
Expand Down
10 changes: 10 additions & 0 deletions test/src/windows/winCodeSignTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ function testCustomSign(sign: any) {
})
}

test.ifAll.ifNotCiMac(
"certificateFile/password - sign as async/await",
testCustomSign(async () => {
return
})
)
test.ifAll.ifNotCiMac(
"certificateFile/password - sign as Promise",
testCustomSign(() => Promise.resolve())
)
test.ifAll.ifNotCiMac("certificateFile/password - sign as function", testCustomSign(require("../helpers/customWindowsSign").default))
test.ifAll.ifNotCiMac("certificateFile/password - sign as path", testCustomSign(path.join(__dirname, "../helpers/customWindowsSign")))

Expand Down

1 comment on commit 9162711

@prcdpr
Copy link

@prcdpr prcdpr commented on 9162711 May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it fix "file is used by another process random error on signing?

Please sign in to comment.