Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incompatible Windows sign tool in end user environment. #6817

Merged
merged 4 commits into from
May 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/quiet-pandas-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

fix: incompatible Windows sign tool in end user environment. Unify code logic to give end-user a chance to assign correct signtool.exe path with environment variable
9 changes: 4 additions & 5 deletions packages/app-builder-lib/src/codeSign/windowsCodeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,18 @@ export async function getCertificateFromStoreInfo(options: WindowsConfiguration,
export async function doSign(configuration: CustomWindowsSignTaskConfiguration, packager: WinPackager) {
// https://github.com/electron-userland/electron-builder/pull/1944
const timeout = parseInt(process.env.SIGNTOOL_TIMEOUT as any, 10) || 10 * 60 * 1000

let tool: string
// unify logic of signtool path location
const toolInfo = await getToolPath()
const tool = toolInfo.path
// decide runtime argument by cases
let args: Array<string>
let env = process.env
let vm: VmManager
if (configuration.path.endsWith(".appx") || !("file" in configuration.cscInfo!) /* certificateSubjectName and other such options */) {
vm = await packager.vm.value
tool = getWinSignTool(await getSignVendorPath())
args = computeSignToolArgs(configuration, true, vm)
} else {
vm = new VmManager()
const toolInfo = await getToolPath()
tool = toolInfo.path
args = configuration.computeSignToolArgs(process.platform === "win32")
if (toolInfo.env != null) {
env = toolInfo.env
Expand Down