[VSAddin] Don't require both 2010 and 2012 to be installed.

R=binji@chromium.org

Review URL: https://codereview.chromium.org/153163002

git-svn-id: https://nativeclient-sdk.googlecode.com/svn/trunk/src@1570 050acbb0-2703-11df-ab0a-9f3f633ae91d
diff --git a/InstallerResources/install.py b/InstallerResources/install.py
index e67c426..4e31d95 100644
--- a/InstallerResources/install.py
+++ b/InstallerResources/install.py
@@ -166,7 +166,6 @@
 
 
 def InstallMSBuild():
-
   # Ask user before installing PPAPI template.
   if options.install_ppapi is None:
     ppapi_answer = Ask("Set up configuration to enable Pepper development "
@@ -187,11 +186,22 @@
 
   root_2010 = os.path.join(options.msbuild_path,
                            'Microsoft.Cpp', 'v4.0', 'Platforms')
-  InstallMSBuildPlatforms(root_2010)
-
   root_2012 = os.path.join(options.msbuild_path,
                            'Microsoft.Cpp', 'v4.0', 'V110', 'Platforms')
-  InstallMSBuildPlatforms(root_2012)
+
+  if not os.path.exists(root_2012) and not os.path.exists(root_2010):
+    raise InstallError("MSBuild paths for Visual Studio 2010 and "
+                       "2012 are missing.\n"
+                       "Please install one or both before installing this "
+                       "AddIn.\n"
+                       "(%s)\n"
+                       "(%s)\n" % (root_2010, root_2012))
+
+  if os.path.exists(root_2010):
+    InstallMSBuildPlatforms(root_2010)
+
+  if os.path.exists(root_2012):
+    InstallMSBuildPlatforms(root_2012)
 
   if options.install_ppapi:
     pepper_dir = os.path.join(root_2010, PEPPER_PLATFORM)