]> khamidou — GitHub mirrors - electron.git/commitdiff
Add runas as devDependencies, or the python script will install it again and again.
authorYonggang Luo <luoyonggang@gmail.com>
Sat, 21 Mar 2015 07:22:45 +0000 (15:22 +0800)
committerYonggang Luo <luoyonggang@gmail.com>
Sat, 21 Mar 2015 09:28:07 +0000 (17:28 +0800)
The options of register_msdia80_dll.js should be admin.
Fix the problem of runas not works cause it will escape command parameters by default.

package.json
script/bootstrap.py
tools/win/register_msdia80_dll.js

index 399cef3971dc55539d5dfd609562a3650e3151d8..a80cfd0733d344c751f09dcb361898b756058f22 100644 (file)
@@ -1,24 +1,21 @@
 {
   "name": "atom-shell",
   "version": "0.22.1",
-
   "licenses": [
     {
       "type": "MIT",
       "url": "http://github.com/atom/atom-shell/raw/master/LICENSE.md"
     }
   ],
-
   "devDependencies": {
-    "atom-package-manager": "0.144.0",
     "asar": "0.2.2",
+    "atom-package-manager": "0.144.0",
     "coffee-script": "~1.7.1",
     "coffeelint": "~1.3.0",
-    "request": "*"
+    "request": "*",
+    "runas": "^2.0.0"
   },
-
   "private": true,
-
   "scripts": {
     "preinstall": "node -e 'process.exit(0)'"
   }
index 2954cea326aa575c32c3883bf77dab9ce65a239f..fadc7a20bda1f53d87a276200ab41a0e7f03820f 100755 (executable)
@@ -29,8 +29,6 @@ def main():
   update_submodules()
   update_node_modules('.')
   bootstrap_brightray(args.url)
-  if sys.platform in ['win32', 'cygwin']:
-    install_runas()
 
   create_chrome_version_h()
   touch_config_gypi()
@@ -96,14 +94,6 @@ def update_win32_python():
     if not os.path.exists('python_26'):
       execute_stdout(['git', 'clone', PYTHON_26_URL])
 
-
-def install_runas():
-  # TODO This is needed by the tools/win/register_msdia80_dll.js, should move
-  # this to a better place.
-  with scoped_cwd(os.path.join(SOURCE_ROOT, 'tools', 'win')):
-    execute_stdout([NPM, 'install', 'runas'])
-
-
 def create_chrome_version_h():
   version_file = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
                               'libchromiumcontent', 'VERSION')
index a5a0508e18fcb14cf51ea7a43e9918ca4db8e2f2..b6e63ead3762320c3f039141952155474f133582 100644 (file)
@@ -2,11 +2,16 @@ var fs = require('fs');
 var path = require('path');
 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 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']);
+runas('cmd', ['/K',
+        'copy', source, target,
+        '&', 'regsvr32', '/s', target,
+        '&', 'exit'],
+        {admin:true}
+);
\ No newline at end of file