Skip to content

Commit

Permalink
feat: Allowed signWithParams with certificateFile/Password (#190)
Browse files Browse the repository at this point in the history
Changed the logic in parsing the signWithParams to allow for using them
alongside the certificate options, rather than instead of them.

This stems from times I was debugging the sigining procedure, or
wanted to tweak it, but wished to do so without manually building
the arguments for the certificate file and password as well.

To make this change non-breaking, I added a conditional testing that
the user-provided signWithParams contain neither /f nor /p, and only
in the case that neither of those exists and both certificateFile
and certificatePassword are provided, both are used. Otherwise
the behavior is just like it currently is.
  • Loading branch information
guydav authored and MarshallOfSound committed Feb 28, 2019
1 parent b07643b commit 50bb564
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Expand Up @@ -158,7 +158,11 @@ export async function createWindowsInstaller(options) {

if (signWithParams) {
args.push('--signWithParams');
args.push(signWithParams);
if (!signWithParams.includes('/f') && !signWithParams.includes('/p') && certificateFile && certificatePassword) {
args.push(`${signWithParams} /a /f "${path.resolve(certificateFile)}" /p "${certificatePassword}"`);
} else {
args.push(signWithParams);
}
} else if (certificateFile && certificatePassword) {
args.push('--signWithParams');
args.push(`/a /f "${path.resolve(certificateFile)}" /p "${certificatePassword}"`);
Expand Down

0 comments on commit 50bb564

Please sign in to comment.