diff options
-rw-r--r-- | ChangeLog.txt | 5 | ||||
-rwxr-xr-x | linden/indra/develop.py | 48 |
2 files changed, 50 insertions, 3 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 2ed9c6e..7e53fe1 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -4,6 +4,11 @@ | |||
4 | 4 | ||
5 | modified: linden/indra/cmake/Python.cmake | 5 | modified: linden/indra/cmake/Python.cmake |
6 | 6 | ||
7 | |||
8 | * Applied patch by Robin Cornelius for VWR-11138 - Make develop.py play nicely with express editions of Visual Studio. | ||
9 | |||
10 | modified: linden/indra/develop.py | ||
11 | |||
7 | 12 | ||
8 | 2009-09-14 McCabe Maxsted <hakushakukun@gmail.com> | 13 | 2009-09-14 McCabe Maxsted <hakushakukun@gmail.com> |
9 | 14 | ||
diff --git a/linden/indra/develop.py b/linden/indra/develop.py index bd8f080..207a48b 100755 --- a/linden/indra/develop.py +++ b/linden/indra/develop.py | |||
@@ -469,8 +469,15 @@ class WindowsSetup(PlatformSetup): | |||
469 | print 'Building with ', self.gens[version]['gen'] | 469 | print 'Building with ', self.gens[version]['gen'] |
470 | break | 470 | break |
471 | else: | 471 | else: |
472 | print >> sys.stderr, 'Cannot find a Visual Studio installation!' | 472 | print >> sys.stderr, 'Cannot find a Visual Studio installation, testing for express editions' |
473 | eys.exit(1) | 473 | for version in 'vc80 vc90 vc71'.split(): |
474 | if self.find_visual_studio_express(version): | ||
475 | self._generator = version | ||
476 | print 'Building with ', self.gens[version]['gen'] , "Express edition" | ||
477 | break | ||
478 | else: | ||
479 | print >> sys.stderr, 'Cannot find any Visual Studio installation' | ||
480 | eys.exit(1) | ||
474 | return self._generator | 481 | return self._generator |
475 | 482 | ||
476 | def _set_generator(self, gen): | 483 | def _set_generator(self, gen): |
@@ -523,6 +530,28 @@ class WindowsSetup(PlatformSetup): | |||
523 | print >> sys.stderr, "Didn't find ", self.gens[gen]['gen'] | 530 | print >> sys.stderr, "Didn't find ", self.gens[gen]['gen'] |
524 | return '' | 531 | return '' |
525 | 532 | ||
533 | def find_visual_studio_express(self, gen=None): | ||
534 | if gen is None: | ||
535 | gen = self._generator | ||
536 | gen = gen.lower() | ||
537 | try: | ||
538 | import _winreg | ||
539 | key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s\Setup\VC' % | ||
540 | self.gens[gen]['ver']) | ||
541 | value_str = (r'ProductDir') | ||
542 | print ('Reading VS environment from HKEY_LOCAL_MACHINE\%s\%s' % | ||
543 | (key_str, value_str)) | ||
544 | print key_str | ||
545 | |||
546 | reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE) | ||
547 | key = _winreg.OpenKey(reg, key_str) | ||
548 | value = _winreg.QueryValueEx(key, value_str)[0]+"IDE" | ||
549 | print 'Found: %s' % value | ||
550 | return value | ||
551 | except WindowsError, err: | ||
552 | print >> sys.stderr, "Didn't find ", self.gens[gen]['gen'] | ||
553 | return '' | ||
554 | |||
526 | def get_build_cmd(self): | 555 | def get_build_cmd(self): |
527 | if self.incredibuild: | 556 | if self.incredibuild: |
528 | config = self.build_type | 557 | config = self.build_type |
@@ -530,10 +559,23 @@ class WindowsSetup(PlatformSetup): | |||
530 | config = '\"%s|Win32\"' % config | 559 | config = '\"%s|Win32\"' % config |
531 | 560 | ||
532 | return "buildconsole %s.sln /build %s" % (self.project_name, config) | 561 | return "buildconsole %s.sln /build %s" % (self.project_name, config) |
562 | |||
563 | environment = self.find_visual_studio() | ||
564 | if environment == '': | ||
565 | environment = self.find_visual_studio_express() | ||
566 | if environment == '': | ||
567 | print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?" | ||
568 | else: | ||
569 | print >> sys.stderr, "\nSolution generation complete, as you are using an express edition the final\n stages will need to be completed by hand" | ||
570 | build_dirs=self.build_dirs(); | ||
571 | print >> sys.stderr, "Solution can now be found in:", build_dirs[0] | ||
572 | print >> sys.stderr, "Set %s as startup project" % self.project_name | ||
573 | print >> sys.stderr, "Set build target is Release or RelWithDbgInfo" | ||
574 | exit(0) | ||
533 | 575 | ||
534 | # devenv.com is CLI friendly, devenv.exe... not so much. | 576 | # devenv.com is CLI friendly, devenv.exe... not so much. |
535 | return ('"%sdevenv.com" %s.sln /build %s' % | 577 | return ('"%sdevenv.com" %s.sln /build %s' % |
536 | (self.find_visual_studio(), self.project_name, self.build_type)) | 578 | (environment, self.project_name, self.build_type)) |
537 | 579 | ||
538 | # this override of run exists because the PlatformSetup version | 580 | # this override of run exists because the PlatformSetup version |
539 | # uses Unix/Mac only calls. Freakin' os module! | 581 | # uses Unix/Mac only calls. Freakin' os module! |