BuildBot uses incorrect method for default location of Visual Studios
|Reported by:||TemporalBeing||Owned by:|
Buildbot presently uses a hard coded value for the default location of Visual Studios. This means that the user would need to use the 'installdir' parameter to the VS builders whenever they (i) install to a different drive, (ii) install to a different directory. This could be very common, especially on computers that have multiple OSes installed.
Fortunately, Microsoft did provide a nice way around this issue - look to the Windows Registry. Personally I have done this for scripting for VS6, VS2003, and VS2008 in which I can report the following registry keys work very well:
Visual Studios 6 HKLMSoftwareMicrosoftVisualStudio6.0SetupMicrosoft Visual C++ProductDir?
Visual Studios 7.1 (aka VS2003) HKLMSoftwareMicrosoftVisualStudio7.1SetupVSVS7CommonBinDir
Visual Studios 9 (aka VS2008) HKLMSoftwareMicrosoftVisualStudio9.0SetupVSVS7CommonBinDir
We should be able to use the pattern above (for VS7/9) for a starting point for later versions at the very least, using the following pattern:
Doing this provides two major benefits:
1) Default is now the default of the installed version of Visual Studios. So 'installdir' is only useful in very weird installations (such as having custom built installations or multiple installations of the same version on the same system, etc.)
2) Buildbot can now provide a check to see if the requested version of VS is installed prior to attempting the build, and provide a good error message if it is not (something like VS2008 is not installed on the buildSlave) as opposed to simply reporting that the build program (e.g. devenv.com or msbuild) was not found in the path.
The only potential problem is the client-server approach of Buildbot since the registry would need to be read on the build slave instead of the build master. This could provide some challenges to implementation.
PyWin32 provides support for accessing the registry via the the win32api module, which seems to use the same interfaces as VC++ code so it should be pretty straight forward. Python also natively supports the Windows Registry via the _winreg (2.x) and winreg (3.x) modules.
Change History (5)
comment:1 Changed 5 years ago by dustin
- Keywords windows added
- Milestone changed from undecided to 0.8.+