4 # Permission is hereby granted, free of charge, to any person obtaining
5 # a copy of this software and associated documentation files (the
6 # "Software"), to deal in the Software without restriction, including
7 # without limitation the rights to use, copy, modify, merge, publish,
8 # distribute, sublicense, and/or sell copies of the Software, and to
9 # permit persons to whom the Software is furnished to do so, subject to
10 # the following conditions:
12 # The above copyright notice and this permission notice shall be included
13 # in all copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
16 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
17 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
33 from SCons.Tool.msvs import *
37 from SCons.Tool.MSCommon.common import debug
39 from SCons.Tool.MSCommon import get_default_version, \
42 regdata_6a = string.split(r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio]
43 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0]
44 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\ServicePacks]
46 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup]
47 "VsCommonDir"="C:\Program Files\Microsoft Visual Studio\Common"
48 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Developer Network Library - Visual Studio 6.0a]
49 "ProductDir"="C:\Program Files\Microsoft Visual Studio\MSDN98\98VSa\1033"
50 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++]
51 "ProductDir"="C:\Program Files\Microsoft Visual Studio\VC98"
54 regdata_6b = string.split(r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio]
55 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0]
56 "InstallDir"="C:\VS6\Common\IDE\IDE98"
57 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\ServicePacks]
59 "latest"=dword:00000005
60 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup]
61 "VsCommonDir"="C:\VS6\Common"
62 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual Basic]
63 "ProductDir"="C:\VS6\VB98"
64 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++]
65 "ProductDir"="C:\VS6\VC98"
66 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual Studio]
68 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft VSEE Client]
69 "ProductDir"="C:\VS6\Common\Tools"
70 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Visual Studio 98]
73 regdata_7 = string.split(r'''
74 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0]
75 "InstallDir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\"
76 "Source Directories"="C:\Program Files\Microsoft Visual Studio .NET\Vc7\crt\;C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\src\mfc\;C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\src\atl\"
77 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts]
78 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\CrystalReports]
80 "Package"="{F05E92C6-8346-11D3-B4AD-00A0C9B04E7B}"
81 "ProductDetails"="#15009"
84 "UseInterface"=dword:00000001
85 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\Visual Basic.NET]
87 "DefaultProductAttribute"="VB"
88 "Package"="{164B10B9-B200-11D0-8C61-00A0C91E29D5}"
89 "UseInterface"=dword:00000001
90 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\Visual C#]
92 "Package"="{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}"
93 "UseInterface"=dword:00000001
94 "DefaultProductAttribute"="C#"
95 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\VisualC++]
96 "UseInterface"=dword:00000001
97 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}"
98 "DefaultProductAttribute"="VC"
99 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup]
100 "Dbghelp_path"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\"
101 "dw_dir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\"
102 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\MSDN]
103 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\Msdn\1033\"
104 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\Servicing\SKU]
105 "Visual Studio .NET Professional - English"="{D0610409-7D65-11D5-A54F-0090278A1BB8}"
106 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VB]
107 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\Vb7\"
108 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VC]
109 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\Vc7\"
110 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VC#]
111 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\VC#\"
112 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\Visual Studio .NET Professional - English]
113 "InstallSuccess"=dword:00000001
114 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VS]
115 "EnvironmentDirectory"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\"
116 "EnvironmentPath"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\devenv.exe"
117 "VS7EnvironmentLocation"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\devenv.exe"
118 "MSMDir"="C:\Program Files\Common Files\Merge Modules\"
119 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\"
120 "VS7CommonBinDir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\"
121 "VS7CommonDir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\"
122 "VSUpdateDir"="C:\Program Files\Microsoft Visual Studio .NET\Setup\VSUpdate\"
123 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VS\BuildNumber]
125 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VS\Pro]
126 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\"
127 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC]
128 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC\VC_OBJECTS_PLATFORM_INFO]
129 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32]
130 @="{A54AAE91-30C2-11D3-87BF-A04A4CC10000}"
131 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories]
132 "Path Dirs"="$(VCInstallDir)bin;$(VSInstallDir)Common7\Tools\bin\prerelease;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;C:\Program Files\HTML Help Workshop\;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);C:\perl\bin;C:\cygwin\bin;c:\cygwin\usr\bin;C:\bin;C:\program files\perforce;C:\cygwin\usr\local\bin\i686-pc-cygwin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem"
133 "Library Dirs"="$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(VCInstallDir)PlatformSDK\lib\prerelease;$(VCInstallDir)PlatformSDK\lib;$(FrameworkSDKDir)lib"
134 "Include Dirs"="$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include\prerelease;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include"
135 "Source Dirs"="$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src"
139 regdata_7_1 = string.split(r'''
140 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1]
142 "Source Directories"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\crt\src\;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\src\mfc\;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\src\atl\"
143 "ThisVersionSolutionCLSID"="{246C57AE-40DD-4d6b-9E8D-B0F5757BB2A8}"
144 "ThisVersionDTECLSID"="{8CD2DD97-4EC1-4bc4-9359-89A3EEDD57A6}"
145 "InstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\"
146 "CLR Version"="v1.1.4322"
147 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts]
148 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Smart Device Extensions]
149 "UseInterface"=dword:00000001
150 "VS7InstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\"
151 "VBDeviceInstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VB7\"
152 "CSharpDeviceInstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\"
153 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Visual Basic.NET]
154 "UseInterface"=dword:00000001
155 "Package"="{164B10B9-B200-11D0-8C61-00A0C91E29D5}"
156 "DefaultProductAttribute"="VB"
158 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Visual C#]
159 "DefaultProductAttribute"="C#"
160 "UseInterface"=dword:00000001
161 "Package"="{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}"
163 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Visual JSharp]
165 "Package"="{E6FDF8B0-F3D1-11D4-8576-0002A516ECE8}"
166 "UseInterface"=dword:00000001
167 "DefaultProductAttribute"="Visual JSharp"
168 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\VisualC++]
169 "UseInterface"=dword:00000001
170 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}"
171 "DefaultProductAttribute"="VC"
172 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup]
173 "Dbghelp_path"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\"
174 "dw_dir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\"
175 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\CSDPROJ]
176 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\"
177 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\JSHPROJ]
178 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VJ#\"
179 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Servicing]
180 "CurrentSULevel"=dword:00000000
181 "CurrentSPLevel"=dword:00000000
183 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Servicing\Package]
188 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Servicing\SKU]
189 "Visual Studio .NET Professional 2003 - English"="{20610409-CA18-41A6-9E21-A93AE82EE7C5}"
190 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VB]
191 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\"
192 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VBDPROJ]
193 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\"
194 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VC]
195 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\"
196 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VC#]
197 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\"
198 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Visual Studio .NET Professional 2003 - English]
199 "InstallSuccess"=dword:00000001
200 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VS]
201 "EnvironmentDirectory"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\"
202 "EnvironmentPath"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe"
203 "VS7EnvironmentLocation"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe"
204 "MSMDir"="C:\Program Files\Common Files\Merge Modules\"
205 "VS7CommonBinDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\"
206 "VS7CommonDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\"
207 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\"
208 "VSUpdateDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Setup\VSUpdate\"
209 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VS\BuildNumber]
211 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VS\Pro]
212 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\"
213 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC]
214 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO]
215 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32]
216 @="{759354D0-6B42-4705-AFFB-56E34D2BC3D4}"
217 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories]
218 "Path Dirs"="$(VCInstallDir)bin;$(VSInstallDir)Common7\Tools\bin\prerelease;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;C:\Program Files\HTML Help Workshop\;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);C:\Perl\bin\;c:\bin;c:\cygwin\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Avid;C:\Program Files\backburner 2\;C:\Program Files\cvsnt;C:\Program Files\Subversion\bin;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\HTMLDoc"
219 "Library Dirs"="$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(VCInstallDir)PlatformSDK\lib\prerelease;$(VCInstallDir)PlatformSDK\lib;$(FrameworkSDKDir)lib"
220 "Include Dirs"="$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include\prerelease;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include"
221 "Source Dirs"="$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src"
222 "Reference Dirs"="$(FrameWorkDir)$(FrameWorkVersion)"
223 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\ToolDefaultExtensionLists]
224 "VCCLCompilerTool"="*.cpp;*.cxx;*.cc;*.c"
225 "VCLinkerTool"="*.obj;*.res;*.lib;*.rsc"
226 "VCLibrarianTool"="*.obj;*.res;*.lib;*.rsc"
227 "VCMIDLTool"="*.idl;*.odl"
228 "VCCustomBuildTool"="*.bat"
229 "VCResourceCompilerTool"="*.rc"
230 "VCPreBuildEventTool"="*.bat"
231 "VCPreLinkEventTool"="*.bat"
232 "VCPostBuildEventTool"="*.bat"
233 "VCBscMakeTool"="*.sbr"
235 "VCWebServiceProxyGeneratorTool"="*.discomap"
236 "VCWebDeploymentTool"=""
237 "VCALinkTool"="*.resources"
238 "VCManagedResourceCompilerTool"="*.resx"
239 "VCXMLDataGeneratorTool"="*.xsd"
240 "VCManagedWrapperGeneratorTool"=""
241 "VCAuxiliaryManagedWrapperGeneratorTool"=""
242 "VCPrimaryInteropTool"=""
245 regdata_8exp = string.split(r'''
246 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0]
247 "CLR Version"="v2.0.50727"
248 "ApplicationID"="VCExpress"
249 "SecurityAppID"="{741726F6-1EAE-4680-86A6-6085E8872CF8}"
250 "InstallDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\"
251 "EnablePreloadCLR"=dword:00000001
252 "RestoreAppPath"=dword:00000001
253 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\InstalledProducts]
254 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\InstalledProducts\Microsoft Visual C++]
255 "UseInterface"=dword:00000001
256 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}"
257 "DefaultProductAttribute"="VC"
258 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\Setup]
259 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\Setup\VC]
260 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\VC\"
261 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\Setup\VS]
262 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\"
263 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC]
264 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC\VC_OBJECTS_PLATFORM_INFO]
265 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32]
266 @="{72f11281-2429-11d7-8bf6-00b0d03daa06}"
267 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\ToolDefaultExtensionLists]
268 "VCCLCompilerTool"="*.cpp;*.cxx;*.cc;*.c"
269 "VCLinkerTool"="*.obj;*.res;*.lib;*.rsc;*.licenses"
270 "VCLibrarianTool"="*.obj;*.res;*.lib;*.rsc"
271 "VCMIDLTool"="*.idl;*.odl"
272 "VCCustomBuildTool"="*.bat"
273 "VCResourceCompilerTool"="*.rc"
274 "VCPreBuildEventTool"="*.bat"
275 "VCPreLinkEventTool"="*.bat"
276 "VCPostBuildEventTool"="*.bat"
277 "VCBscMakeTool"="*.sbr"
278 "VCFxCopTool"="*.dll;*.exe"
280 "VCWebServiceProxyGeneratorTool"="*.discomap"
281 "VCWebDeploymentTool"=""
282 "VCALinkTool"="*.resources"
283 "VCManagedResourceCompilerTool"="*.resx"
284 "VCXMLDataGeneratorTool"="*.xsd"
285 "VCManifestTool"="*.manifest"
286 "VCXDCMakeTool"="*.xdc"
289 regdata_80 = string.split(r'''
290 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0]
291 "CLR Version"="v2.0.50727"
292 "ApplicationID"="VisualStudio"
293 "ThisVersionDTECLSID"="{BA018599-1DB3-44f9-83B4-461454C84BF8}"
294 "ThisVersionSolutionCLSID"="{1B2EEDD6-C203-4d04-BD59-78906E3E8AAB}"
295 "SecurityAppID"="{DF99D4F5-9F04-4CEF-9D39-095821B49C77}"
296 "InstallDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\"
297 "EnablePreloadCLR"=dword:00000001
298 "RestoreAppPath"=dword:00000001
299 "Source Directories"="C:\Program Files\Microsoft Visual Studio 8\VC\crt\src\;C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\src\mfc\;C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\src\atl\;C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\"
300 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\InstalledProducts]
301 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\InstalledProducts\Microsoft Visual C++]
302 "UseInterface"=dword:00000001
303 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}"
304 "DefaultProductAttribute"="VC"
305 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup]
306 "Dbghelp_path"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\"
307 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\EF]
308 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\EnterpriseFrameworks\"
309 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\Microsoft Visual Studio 2005 Professional Edition - ENU]
311 "InstallSuccess"=dword:00000001
312 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VC]
313 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\VC\"
314 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VS]
315 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\"
316 "VS7EnvironmentLocation"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe"
317 "EnvironmentPath"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe"
318 "EnvironmentDirectory"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\"
319 "VS7CommonDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\"
320 "VS7CommonBinDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\"
321 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VS\BuildNumber]
322 "1033"="8.0.50727.42"
323 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VS\Pro]
324 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\"
325 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC]
326 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC\VC_OBJECTS_PLATFORM_INFO]
327 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32]
328 @="{72f11281-2429-11d7-8bf6-00b0d03daa06}"
329 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\ToolDefaultExtensionLists]
330 "VCCLCompilerTool"="*.cpp;*.cxx;*.cc;*.c"
331 "VCLinkerTool"="*.obj;*.res;*.lib;*.rsc;*.licenses"
332 "VCLibrarianTool"="*.obj;*.res;*.lib;*.rsc"
333 "VCMIDLTool"="*.idl;*.odl"
334 "VCCustomBuildTool"="*.bat"
335 "VCResourceCompilerTool"="*.rc"
336 "VCPreBuildEventTool"="*.bat"
337 "VCPreLinkEventTool"="*.bat"
338 "VCPostBuildEventTool"="*.bat"
339 "VCBscMakeTool"="*.sbr"
340 "VCFxCopTool"="*.dll;*.exe"
342 "VCWebServiceProxyGeneratorTool"="*.discomap"
343 "VCWebDeploymentTool"=""
344 "VCALinkTool"="*.resources"
345 "VCManagedResourceCompilerTool"="*.resx"
346 "VCXMLDataGeneratorTool"="*.xsd"
347 "VCManifestTool"="*.manifest"
348 "VCXDCMakeTool"="*.xdc"
351 regdata_cv = string.split(r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion]
352 "ProgramFilesDir"="C:\Program Files"
353 "CommonFilesDir"="C:\Program Files\Common Files"
354 "MediaPath"="C:\WINDOWS\Media"
361 def __init__(self, dict=None):
367 def Dictionary(self, key = None):
370 return self.dict[key]
372 def __setitem__(self,key,value):
373 self.dict[key] = value
375 def __getitem__(self,key):
376 return self.dict[key]
378 def has_key(self,name):
379 return self.dict.has_key(name)
382 """key class for storing an 'open' registry key"""
383 def __init__(self,key):
386 # Warning: this is NOT case-insensitive, unlike the Windows registry.
387 # So e.g. HKLM\Software is NOT the same key as HKLM\SOFTWARE.
389 """node in the dummy registry"""
390 def __init__(self,name):
398 if self.valdict.has_key(val):
399 return (self.valdict[val],1)
401 raise SCons.Util.RegError
403 def addValue(self,name,val):
404 self.valdict[name] = val
405 self.valarray.append(name)
407 def valindex(self,index):
410 rv = (self.valarray[index],self.valdict[self.valarray[index]],1)
412 raise SCons.Util.RegError
415 def key(self,key,sep = '\\'):
416 if key.find(sep) != -1:
417 keyname, subkeys = key.split(sep,1)
422 # recurse, and return the lowest level key node
424 return self.keydict[keyname].key(subkeys)
426 return self.keydict[keyname]
428 raise SCons.Util.RegError
430 def addKey(self,name,sep = '\\'):
431 if string.find(name, sep) != -1:
432 keyname, subkeys = string.split(name, sep, 1)
437 if not self.keydict.has_key(keyname):
438 self.keydict[keyname] = RegNode(keyname)
439 self.keyarray.append(keyname)
441 # recurse, and return the lowest level key node
443 return self.keydict[keyname].addKey(subkeys)
445 return self.keydict[keyname]
447 def keyindex(self,index):
448 return self.keydict[self.keyarray[index]]
453 def _doStr(self, indent = ''):
455 for value in self.valarray:
456 rv = rv + '%s"%s" = "%s"\n' % (indent, value, self.valdict[value])
457 for key in self.keyarray:
458 rv = rv + "%s%s: {\n"%(indent, key)
459 rv = rv + self.keydict[key]._doStr(indent + ' ')
460 rv = rv + indent + '}\n'
464 """registry class for storing fake registry attributes"""
465 def __init__(self,data):
466 """parse input data into the fake registry"""
467 self.root = RegNode('REGISTRY')
468 self.root.addKey('HKEY_LOCAL_MACHINE')
469 self.root.addKey('HKEY_CURRENT_USER')
470 self.root.addKey('HKEY_USERS')
471 self.root.addKey('HKEY_CLASSES_ROOT')
475 def parse(self, data):
477 keymatch = re.compile('^\[(.*)\]$')
478 valmatch = re.compile('^(?:"(.*)"|[@])="(.*)"$')
480 m1 = keymatch.match(line)
482 # add a key, set it to current parent
483 parent = self.root.addKey(m1.group(1))
485 m2 = valmatch.match(line)
487 parent.addValue(m2.group(1),m2.group(2))
489 def OpenKeyEx(self,root,key):
490 if root == SCons.Util.HKEY_CLASSES_ROOT:
491 mykey = 'HKEY_CLASSES_ROOT\\' + key
492 if root == SCons.Util.HKEY_USERS:
493 mykey = 'HKEY_USERS\\' + key
494 if root == SCons.Util.HKEY_CURRENT_USER:
495 mykey = 'HKEY_CURRENT_USER\\' + key
496 if root == SCons.Util.HKEY_LOCAL_MACHINE:
497 mykey = 'HKEY_LOCAL_MACHINE\\' + key
498 debug("Open Key:%s"%mykey)
499 return self.root.key(mykey)
501 def DummyOpenKeyEx(root, key):
502 return registry.OpenKeyEx(root,key)
504 def DummyEnumKey(key, index):
507 rv = key.keyarray[index]
509 raise SCons.Util.RegError
510 # print "Enum Key",key.name,"[",index,"] =>",rv
513 def DummyEnumValue(key, index):
514 rv = key.valindex(index)
515 # print "Enum Value",key.name,"[",index,"] =>",rv
518 def DummyQueryValue(key, value):
519 rv = key.value(value)
520 # print "Query Value",key.name+"\\"+value,"=>",rv
523 def DummyExists(path):
526 class msvsTestCase(unittest.TestCase):
527 """This test case is run several times with different defaults.
528 See its subclasses below."""
530 debug("THIS TYPE :%s"%self)
532 registry = self.registry
533 from SCons.Tool.MSCommon.vs import reset_installed_visual_studios
534 reset_installed_visual_studios()
536 def test_get_default_version(self):
537 """Test retrieval of the default visual studio version"""
539 debug("Testing for default version %s"%self.default_version)
541 v1 = get_default_version(env)
542 assert env['MSVS_VERSION'] == self.default_version, \
543 ("env['MSVS_VERSION'] != self.default_version",self.default_version, env['MSVS_VERSION'])
544 assert env['MSVS']['VERSION'] == self.default_version, \
545 ("env['MSVS']['VERSION'] != self.default_version",self.default_version, env['MSVS']['VERSION'])
546 assert v1 == self.default_version, (self.default_version, v1)
548 env = DummyEnv({'MSVS_VERSION':'7.0'})
549 v2 = get_default_version(env)
550 assert env['MSVS_VERSION'] == '7.0', env['MSVS_VERSION']
551 assert env['MSVS']['VERSION'] == '7.0', env['MSVS']['VERSION']
552 assert v2 == '7.0', v2
555 v3 = get_default_version(env)
560 env['MSVS_VERSION'] = override
561 v3 = get_default_version(env)
562 assert env['MSVS_VERSION'] == override, env['MSVS_VERSION']
563 assert env['MSVS']['VERSION'] == override, env['MSVS']['VERSION']
564 assert v3 == override, v3
566 def _TODO_test_merge_default_version(self):
567 """Test the merge_default_version() function"""
570 def test_query_versions(self):
571 """Test retrieval of the list of visual studio versions"""
572 v1 = query_versions()
573 assert not v1 or str(v1[0]) == self.highest_version, \
574 (v1, self.highest_version)
575 assert len(v1) == self.number_of_versions, v1
577 class msvs6aTestCase(msvsTestCase):
578 """Test MSVS 6 Registry"""
579 registry = DummyRegistry(regdata_6a + regdata_cv)
580 default_version = '6.0'
581 highest_version = '6.0'
582 number_of_versions = 1
584 '6.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio\\VC98', 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio\\VC98\\Bin'},
590 default_install_loc = install_locs['6.0']
592 class msvs6bTestCase(msvsTestCase):
593 """Test Other MSVS 6 Registry"""
594 registry = DummyRegistry(regdata_6b + regdata_cv)
595 default_version = '6.0'
596 highest_version = '6.0'
597 number_of_versions = 1
599 '6.0' : {'VSINSTALLDIR': 'C:\\VS6\\VC98', 'VCINSTALLDIR': 'C:\\VS6\\VC98\\Bin'},
605 default_install_loc = install_locs['6.0']
607 class msvs6and7TestCase(msvsTestCase):
608 """Test MSVS 6 & 7 Registry"""
609 registry = DummyRegistry(regdata_6b + regdata_7 + regdata_cv)
610 default_version = '7.0'
611 highest_version = '7.0'
612 number_of_versions = 2
614 '6.0' : {'VSINSTALLDIR': 'C:\\VS6\\VC98',
615 'VCINSTALLDIR': 'C:\\VS6\\VC98\\Bin'},
616 '7.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7',
617 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7\\Tools'},
622 default_install_loc = install_locs['7.0']
624 class msvs7TestCase(msvsTestCase):
625 """Test MSVS 7 Registry"""
626 registry = DummyRegistry(regdata_7 + regdata_cv)
627 default_version = '7.0'
628 highest_version = '7.0'
629 number_of_versions = 1
632 '7.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7',
633 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7\\Tools'},
638 default_install_loc = install_locs['7.0']
640 class msvs71TestCase(msvsTestCase):
641 """Test MSVS 7.1 Registry"""
642 registry = DummyRegistry(regdata_7_1 + regdata_cv)
643 default_version = '7.1'
644 highest_version = '7.1'
645 number_of_versions = 1
649 '7.1' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7',
650 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\Tools'},
654 default_install_loc = install_locs['7.1']
656 class msvs8ExpTestCase(msvsTestCase): # XXX: only one still not working
657 """Test MSVS 8 Express Registry"""
658 registry = DummyRegistry(regdata_8exp + regdata_cv)
659 default_version = '8.0Exp'
660 highest_version = '8.0Exp'
661 number_of_versions = 1
667 '8.0Exp' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8',
668 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8\\VC'},
670 default_install_loc = install_locs['8.0Exp']
672 class msvs80TestCase(msvsTestCase):
673 """Test MSVS 8 Registry"""
674 registry = DummyRegistry(regdata_80 + regdata_cv)
675 default_version = '8.0'
676 highest_version = '8.0'
677 number_of_versions = 1
682 '8.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8',
683 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8\\VC'},
686 default_install_loc = install_locs['8.0']
688 class msvsEmptyTestCase(msvsTestCase):
689 """Test Empty Registry"""
690 registry = DummyRegistry(regdata_none)
691 default_version = '9.0'
692 highest_version = None
693 number_of_versions = 0
701 default_install_loc = install_locs['8.0Exp']
703 if __name__ == "__main__":
705 # only makes sense to test this on win32
706 if sys.platform != 'win32':
707 sys.stdout.write("NO RESULT for msvsTests.py: '%s' is not win32\n" % sys.platform)
710 SCons.Util.RegOpenKeyEx = DummyOpenKeyEx
711 SCons.Util.RegEnumKey = DummyEnumKey
712 SCons.Util.RegEnumValue = DummyEnumValue
713 SCons.Util.RegQueryValueEx = DummyQueryValue
715 os.path.exists = DummyExists # make sure all files exist :-)
716 os.path.isfile = DummyExists # make sure all files are files :-)
717 os.path.isdir = DummyExists # make sure all dirs are dirs :-)
732 for test_class in test_classes:
733 print "TEST: ", test_class.__doc__
734 back_osenv = copy.deepcopy(os.environ)
736 # XXX: overriding the os.environ is bad, but doing it
737 # correctly is too complicated for now. Those tests should
739 for k in ['VS71COMNTOOLS',
742 if os.environ.has_key(k):
745 suite = unittest.makeSuite(test_class, 'test_')
746 if not unittest.TextTestRunner().run(suite).wasSuccessful():
755 # indent-tabs-mode:nil
757 # vim: set expandtab tabstop=4 shiftwidth=4: