This commit is contained in:
Cheng Zhao 2015-03-23 09:51:50 +08:00
parent adce07785a
commit 414c91a637

View file

@ -2,16 +2,11 @@ var fs = require('fs');
var path = require('path'); var path = require('path');
var runas = require('runas'); var runas = require('runas');
/* FIXME: C:\\Program Files\\ should comes from env variable
And for 32 bit msdia80 is should be placed at %ProgramFiles(x86)% */
var source = path.resolve(__dirname, '..', '..', 'vendor', 'breakpad', 'msdia80.dll'); var source = path.resolve(__dirname, '..', '..', 'vendor', 'breakpad', 'msdia80.dll');
var target = 'C:\\Program Files\\Common Files\\Microsoft Shared\\VC\\msdia80.dll'; var target = 'C:\\Program Files\\Common Files\\Microsoft Shared\\VC\\msdia80.dll';
if (fs.existsSync(target)) if (fs.existsSync(target))
return; return;
runas('cmd', ['/K', runas('cmd',
'copy', source, target, ['/K', 'copy', source, target, '&', 'regsvr32', '/s', target, '&', 'exit'],
'&', 'regsvr32', '/s', target, {admin: true});
'&', 'exit'],
{admin:true}
);