-
-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1f1885
commit e7f7b71
Showing
3 changed files
with
36 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const childProcess = require('child_process'); | ||
|
||
exports.default = async function (configuration) { | ||
const SIGNTOOL_PATH = process.env.SIGNTOOL_PATH; | ||
const INSTALLER_CERT_WINDOWS_CER = process.env.INSTALLER_CERT_WINDOWS_CER; | ||
const CERT_PASSWORD = process.env.CERT_PASSWORD; | ||
const CONTAINER_NAME = process.env.CONTAINER_NAME; | ||
const filePath = configuration.path; | ||
|
||
if ( | ||
SIGNTOOL_PATH && | ||
INSTALLER_CERT_WINDOWS_CER && | ||
CERT_PASSWORD && | ||
CONTAINER_NAME | ||
) { | ||
childProcess.execSync( | ||
`"${SIGNTOOL_PATH}" sign -d "Arduino IDE" -f "${INSTALLER_CERT_WINDOWS_CER}" -csp "eToken Base Cryptographic Provider" -k "[{{${CERT_PASSWORD}}}]=${CONTAINER_NAME}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "${filePath}"`, | ||
{ stdio: 'inherit' } | ||
); | ||
} else { | ||
console.warn( | ||
'Custom windows signing was no performed: SIGNTOOL_PATH, INSTALLER_CERT_WINDOWS_CER, CERT_PASSWORD, and CONTAINER_NAME environment variables were not provided.' | ||
); | ||
process.exit(1); | ||
} | ||
}; |