Skip to content

Commit

Permalink
env SIGNTOOL_PATH and USE_SYSTEM_SIGNCODE, windows server 2008 R2 sig…
Browse files Browse the repository at this point in the history
…ntool version
  • Loading branch information
develar committed May 25, 2016
1 parent 7db03bc commit 256abf0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var ChildProcess = require('child_process')
var fs = require('fs')
var path = require('path')
var os = require('os')

exports.sign = function (options, callback) {
var signOptions = Object.assign({}, options)
Expand Down Expand Up @@ -123,7 +124,7 @@ function spawnSign (options, outputPath, callback) {
spawnOptions.stdio = ['ignore', 'ignore', 'pipe']
}

console.log("spawning " + getSigncodePath(options) + " " + args.join(' '));
// console.log("spawning " + getSigncodePath(options) + " " + args.join(' '));
var signcode = ChildProcess.spawn(getSigncodePath(options), args, spawnOptions)

var stderr = ''
Expand Down Expand Up @@ -208,12 +209,16 @@ function getOutputPath (inputPath, hash) {
}

function getSigncodePath (options) {
if (options.signcodePath) {
return options.signcodePath;
var result = options.signcodePath || process.env.SIGNTOOL_PATH
if (result) {
return result
}
if (process.env.USE_SYSTEM_SIGNCODE || process.platform === 'linux') {
return "osslsigncode"
}

if (process.platform === 'win32') {
return path.join(__dirname, 'vendor', 'signtool.exe')
return path.join(__dirname, 'vendor', 'windows-' + (os.release().startsWith('6.') ? '6' : '10'), 'signtool.exe')
} else {
return path.join(__dirname, 'vendor', process.platform, 'osslsigncode')
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "signcode-tf",
"version": "0.6.3",
"version": "0.7.3",
"description": "Sign Windows executables from a Mac",
"repository": "https://github.com/kevinsawicki/signcode",
"main": "index.js",
Expand Down
File renamed without changes.
Binary file added vendor/windows-6/signtool.exe
Binary file not shown.

0 comments on commit 256abf0

Please sign in to comment.