Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Unified Diff: visual_studio/NativeClientVSAddIn/InstallerResources/install.py

Issue 10790023: VS-Addin Build/Test/Install scripts (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: visual_studio/NativeClientVSAddIn/InstallerResources/install.py
diff --git a/visual_studio/NativeClientVSAddIn/InstallerResources/install.py b/visual_studio/NativeClientVSAddIn/InstallerResources/install.py
new file mode 100644
index 0000000000000000000000000000000000000000..1b088c67f5aad7fe29a511c061211efbc8492214
--- /dev/null
+++ b/visual_studio/NativeClientVSAddIn/InstallerResources/install.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Copies necessary add-in files into place to install the add-in.
+
+This script will copy the necessary files for the Visual Studio add-in
+to where Visual Studio can find them. It assumes the current directory
+contains the necessary files to copy.
+"""
+
+import os
+import platform
+import shutil
+
+if platform.system() != 'Windows':
binji 2012/07/17 00:05:58 Use the standard python file structure: http://goo
tysand 2012/07/17 01:18:18 Done.
+ raise Exception('Must install to Windows system')
binji 2012/07/17 00:05:58 2 space indent
tysand 2012/07/17 01:18:18 Done.
+
+# Ensure environment variables are set
+nacl_sdk_root = os.path.expandvars('%NACL_SDK_ROOT%')
binji 2012/07/17 00:05:58 just use os.getenv('NACL_SDK_ROOT', None) for this
tysand 2012/07/17 01:18:18 Done.
+chrome_path = os.path.expandvars('%CHROME_PATH%')
binji 2012/07/17 00:05:58 same here
tysand 2012/07/17 01:18:18 Done.
+if nacl_sdk_root == '%NACL_SDK_ROOT%':
+ raise Exception('Environment Variable NACL_SDK_ROOT is not set')
+if chrome_path == '%CHROME_PATH%':
+ raise Exception('Environment Variable CHROME_PATH is not set')
+
+# Copy the necessary files into place
+addInDir = os.path.expandvars(
+ '%USERPROFILE%\My Documents\Visual Studio 2010\Addins')
+shutil.copy('./NativeClientVSAddIn.AddIn', addInDir)
+shutil.copy('./NativeClientVSAddIn.dll', addInDir)

Powered by Google App Engine
This is Rietveld 408576698