sign-windows-32.js 975 B

123456789101112131415161718192021
  1. "use strict";
  2. const fs = require("fs");
  3. const path = require('path');
  4. const rootPath = path.join(__dirname, '..');
  5. const outPath = path.join(rootPath, 'out');
  6. const packedPath = path.join(outPath, 'flasher.js-win32-ia32');
  7. const exec = require('child_process').execSync;
  8. fs.readdir(packedPath, (err, files) => {
  9. const dllsAndExes = files.filter(file => {
  10. return file.endsWith(".dll") || file.endsWith(".exe");
  11. });
  12. dllsAndExes.forEach(run);
  13. });
  14. function run(file) {
  15. exec(`signtool.exe sign /a /d "Flasher.js" /du https://github.com/ThingsSDK/flasher.js /s MY /n "Andrew Chalkley" /fd sha1 /t http://timestamp.verisign.com/scripts/timstamp.dll /v "${path.join(packedPath, file)}"`);
  16. exec(`signtool.exe sign /a /d "Flasher.js" /du https://github.com/ThingsSDK/flasher.js /s MY /n "Andrew Chalkley" /fd sha256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td sha256 /as /v "${path.join(packedPath, file)}"`);
  17. }