win: Register msdia80.dll automatically when dumping symbols.

This commit is contained in:
Cheng Zhao 2013-11-26 22:05:32 +08:00
parent 401fe76acd
commit 386b921914
4 changed files with 21 additions and 8 deletions

View file

@ -18,14 +18,6 @@ softwares:
* [Windows 7 SDK](http://www.microsoft.com/en-us/download/details.aspx?id=8279)
* `Windows Headers` and `Visual C++ Compilers` are required.
If you want to dump breakpad symbols you also need to do this (you are free to
skip this step if you don't know what it is):
1. Get a copy of `msdia80.dll` and put it in
`C:\Program Files\Common Files\Microsoft Shared\VC\`.
2. As Administrator, run:
`regsvr32 "C:\Program Files\Common Files\Microsoft Shared\VC\msdia80.dll"`.
The instructions bellow are executed under [cygwin](http://www.cygwin.com),
but it's not a requirement, you can also build atom-shell under Windows's
console or other terminals.

View file

@ -7,6 +7,7 @@
"coffeelint": "~0.6.1",
"mocha": "~1.13.0",
"walkdir": "~0.0.7",
"runas": "~0.2.0",
"formidable": "~1.0.14",
"unzip": "~0.1.9",

View file

@ -47,6 +47,13 @@ def mkdir_p(path):
else: raise
def RegisterRequiredDll():
register = os.path.join(os.path.dirname(__file__), 'register_msdia80_dll.js')
node = os.path.join(SOURCE_ROOT, 'out', 'Release', 'atom.exe')
os.environ['ATOM_SHELL_INTERNAL_RUN_AS_NODE'] = '1'
subprocess.check_call([node, register]);
def GenerateSymbols(options, binaries):
"""Dumps the symbols of binary and places them in the given directory."""
@ -118,6 +125,7 @@ def main():
for directory in directories:
pdbs += glob.glob(os.path.join(directory, '*.pdb'))
RegisterRequiredDll();
GenerateSymbols(options, pdbs)
return 0

View file

@ -0,0 +1,12 @@
var fs = require('fs');
var path = require('path');
var runas = require('runas');
var source = path.resolve(__dirname, '..', '..', 'vendor', 'breakpad', 'msdia80.dll');
var target = 'C:\\Program Files\\Common Files\\Microsoft Shared\\VC\\msdia80.dll';
if (fs.existsSync(target))
return;
var copy = 'copy "' + source + '" "' + target + '"';
var register = 'regsvr32 "' + target + '"';
runas('cmd', ['/K', copy + ' & ' + register + ' & exit']);