From 57d99b56724365f8d4b46d4bf0c6e508aeeb40c9 Mon Sep 17 00:00:00 2001 From: Jonas <30421456+jonaskuske@users.noreply.github.com> Date: Thu, 2 Apr 2020 05:24:04 +0200 Subject: [PATCH] fix: quote filepath for PfxCertificate Installing the dev certificate via `Import-PfxCertificate` requires the path to be quoted, otherwise installation fails if the path contains whitespace --- lib/sign.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sign.js b/lib/sign.js index 8535085..9eda90f 100644 --- a/lib/sign.js +++ b/lib/sign.js @@ -83,7 +83,7 @@ function makeCert (parametersOrPublisherName, certFilePath, program) { const pk2pfx = path.join(program.windowsKit, 'pvk2pfx.exe') const pk2pfxArgs = ['-pvk', pvk, '-spc', cer, '-pfx', pfx] - const installPfxArgs = ['Import-PfxCertificate', '-FilePath', pfx, '-CertStoreLocation', '"Cert:\\LocalMachine\\TrustedPeople"'] + const installPfxArgs = ['Import-PfxCertificate', '-FilePath', `"${pfx}"`, '-CertStoreLocation', '"Cert:\\LocalMachine\\TrustedPeople"'] // Ensure the target directory exists fs.ensureDirSync(certFilePath)