{"record":{"id":"9b8676f1b0f1d42b","repo":"DioxusLabs/dioxus","slug":"signtool-exe-failed-with-exit-code","errorCode":null,"errorMessage":"signtool.exe failed with exit code: {:?}","messagePattern":"signtool\\.exe failed with exit code: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/bundler/windows.rs","lineNumber":903,"sourceCode":"            );\n        } else {\n            args.push(\"/t\".to_string());\n            args.push(timestamp_url.clone());\n        }\n    }\n\n    args.push(path.to_string_lossy().to_string());\n\n    tracing::debug!(\"Running signtool with args: {:?}\", args);\n\n    let status = Command::new(\"signtool.exe\")\n        .args(&args)\n        .status()\n        .await\n        .context(\"Failed to run signtool.exe. Is the Windows SDK installed?\")?;\n\n    if !status.success() {\n        bail!(\"signtool.exe failed with exit code: {:?}\", status.code());\n    }\n\n    Ok(())\n}\n\n/// Render a Handlebars template with the given data.\n///\n/// Handlebars treats `\\{{` as an escape sequence that outputs a literal `{{`.\n/// This is a problem for Windows paths like `$INSTDIR\\{{product_name}}` where\n/// the backslash is a path separator, not an escape. We work around this by\n/// replacing `\\{{` with a placeholder before Handlebars parses the template,\n/// then restoring the backslash in the rendered output.\nfn render_template(template: &str, data: &BTreeMap<String, JsonValue>) -> Result<String> {\n    const BACKSLASH_PLACEHOLDER: &str = \"\\x00BSEP\\x00\";\n    let replacement = String::from(BACKSLASH_PLACEHOLDER) + \"{{\";\n    let safe_template = template.replace(\"\\\\{{\", &replacement);\n    let mut hbs = Handlebars::new();\n    hbs.set_strict_mode(false);","sourceCodeStart":885,"sourceCodeEnd":921,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/bundler/windows.rs#L885-L921","documentation":"Raised in run_signtool_sign (invoked from try_sign_windows) after invoking signtool.exe with the assembled signing arguments (certificate, timestamp URL, target path): the tool ran but exited with a non-success status. This is an external tool failure from the Windows SDK signer — common causes are an invalid/expired certificate or bad signtool arguments — distinct from the earlier 'Failed to run signtool.exe' error which fires when the binary cannot be spawned at all.","triggerScenarios":"Thrown at packages/cli/src/bundler/windows.rs:903 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["signtool.exe failed. Ensure the certificate is installed and the signtool arguments are valid."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}