Skip to content

Commit

Permalink
Fix for Windows XP where REG QUERY returns with a header
Browse files Browse the repository at this point in the history
Older version os REG command return a header, so we need to skip it
  • Loading branch information
gpetrov committed Jun 30, 2014
1 parent dfd50b0 commit c07f688
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/registry.js
Expand Up @@ -358,7 +358,8 @@ Registry.prototype.get = function get (name, cb) {
}
}

var item = items[0] || ''
//Get last item - so it works in XP where REG QUERY returns with a header
var item = items[items.length-1] || ''
, match = ITEM_PATTERN.exec(item)
, name
, type
Expand Down Expand Up @@ -392,13 +393,13 @@ Registry.prototype.set = function set (name, type, value, cb) {

if (REG_TYPES.indexOf(type) == -1)
throw Error('illegal type specified.');

var args = ['ADD', this.path];
if (name == '')
args.push('/ve');
else
args = args.concat(['/v', name]);

args = args.concat(['/t', type, '/d', value, '/f']);

var proc = spawn('REG', args, {
Expand Down

0 comments on commit c07f688

Please sign in to comment.