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

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

Issue 282153003: [VS Addin] Fix several issues with install script. (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: visual_studio/NativeClientVSAddIn/InstallerResources/install.py
diff --git a/visual_studio/NativeClientVSAddIn/InstallerResources/install.py b/visual_studio/NativeClientVSAddIn/InstallerResources/install.py
index 4e31d95445ce8c4bd195b5ee42e0d5ab16f8018f..6b5afa0db4d3a7d41cf470e769b7283befb3a2de 100644
--- a/visual_studio/NativeClientVSAddIn/InstallerResources/install.py
+++ b/visual_studio/NativeClientVSAddIn/InstallerResources/install.py
@@ -26,8 +26,8 @@ PNACL_PLATFORM = 'PNaCl'
NACL_PLATFORM_OLD = 'NaCl'
PEPPER_PLATFORM = 'PPAPI'
-DEFAULT_VS_DIRECTORIES = ('%USERPROFILE%\\My Documents\\Visual Studio 2010',
- '%USERPROFILE%\\My Documents\\Visual Studio 2012')
+DEFAULT_VS_DIRECTORIES = ['%USERPROFILE%\\My Documents\\Visual Studio 2010',
+ '%USERPROFILE%\\My Documents\\Visual Studio 2012']
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -86,8 +86,6 @@ def UninstallAddin(vsuser_path):
def InstallAddin(vsuser_path):
- vsuser_path = os.path.expandvars(vsuser_path)
-
vsname = os.path.basename(vsuser_path)
if '2012' in vsname:
vs_version = '2012'
@@ -308,6 +306,14 @@ def main():
print "\nUninstall complete!\n"
return 0
+ # Verify that at least on Visual Studio user path exists, then
+ # filter out any that don't.
+ options.vsuser_path = [os.path.expandvars(p) for p in options.vsuser_path]
+ if not any(os.path.exists(p) for p in options.vsuser_path):
+ raise InstallError('Failed to find any suitable location to install the'
+ ' Addin. Tried:\n\t' + '\n\t'.join(options.vsuser_path))
+ options.vsuser_path = [p for p in options.vsuser_path if os.path.exists(p)]
+
try:
InstallMSBuild()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698