3 # Copyright The SCons Foundation
5 # Permission is hereby granted, free of charge, to any person obtaining
6 # a copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to
10 # permit persons to whom the Software is furnished to do so, subject to
11 # the following conditions:
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 from SCons
.Tool
.msvs
import *
33 from SCons
.Tool
.MSCommon
.vs
import SupportedVSList
38 from SCons
.Tool
.MSCommon
.common
import debug
40 from SCons
.Tool
.MSCommon
import get_default_version
, \
42 from SCons
.Tool
.msvs
import _GenerateV6DSP
, _GenerateV7DSP
, _GenerateV10DSP
44 regdata_6a
= r
'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio]
45 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0]
46 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\ServicePacks]
48 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup]
49 "VsCommonDir"="C:\Program Files\Microsoft Visual Studio\Common"
50 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Developer Network Library - Visual Studio 6.0a]
51 "ProductDir"="C:\Program Files\Microsoft Visual Studio\MSDN98\98VSa\1033"
52 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++]
53 "ProductDir"="C:\Program Files\Microsoft Visual Studio\VC98"
56 regdata_6b
= r
'''[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio]
57 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0]
58 "InstallDir"="C:\VS6\Common\IDE\IDE98"
59 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\ServicePacks]
61 "latest"=dword:00000005
62 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup]
63 "VsCommonDir"="C:\VS6\Common"
64 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual Basic]
65 "ProductDir"="C:\VS6\VB98"
66 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++]
67 "ProductDir"="C:\VS6\VC98"
68 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual Studio]
70 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft VSEE Client]
71 "ProductDir"="C:\VS6\Common\Tools"
72 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\6.0\Setup\Visual Studio 98]
76 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0]
77 "InstallDir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\"
78 "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\"
79 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts]
80 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\CrystalReports]
82 "Package"="{F05E92C6-8346-11D3-B4AD-00A0C9B04E7B}"
83 "ProductDetails"="#15009"
86 "UseInterface"=dword:00000001
87 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\Visual Basic.NET]
89 "DefaultProductAttribute"="VB"
90 "Package"="{164B10B9-B200-11D0-8C61-00A0C91E29D5}"
91 "UseInterface"=dword:00000001
92 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\Visual C#]
94 "Package"="{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}"
95 "UseInterface"=dword:00000001
96 "DefaultProductAttribute"="C#"
97 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\InstalledProducts\VisualC++]
98 "UseInterface"=dword:00000001
99 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}"
100 "DefaultProductAttribute"="VC"
101 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup]
102 "Dbghelp_path"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\"
103 "dw_dir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\"
104 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\MSDN]
105 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\Msdn\1033\"
106 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\Servicing\SKU]
107 "Visual Studio .NET Professional - English"="{D0610409-7D65-11D5-A54F-0090278A1BB8}"
108 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VB]
109 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\Vb7\"
110 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VC]
111 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\Vc7\"
112 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VC#]
113 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\VC#\"
114 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\Visual Studio .NET Professional - English]
115 "InstallSuccess"=dword:00000001
116 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VS]
117 "EnvironmentDirectory"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\"
118 "EnvironmentPath"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\devenv.exe"
119 "VS7EnvironmentLocation"="C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\devenv.exe"
120 "MSMDir"="C:\Program Files\Common Files\Merge Modules\"
121 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\"
122 "VS7CommonBinDir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\"
123 "VS7CommonDir"="C:\Program Files\Microsoft Visual Studio .NET\Common7\"
124 "VSUpdateDir"="C:\Program Files\Microsoft Visual Studio .NET\Setup\VSUpdate\"
125 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VS\BuildNumber]
127 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\Setup\VS\Pro]
128 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET\"
129 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC]
130 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC\VC_OBJECTS_PLATFORM_INFO]
131 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32]
132 @="{A54AAE91-30C2-11D3-87BF-A04A4CC10000}"
133 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories]
134 "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"
135 "Library Dirs"="$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(VCInstallDir)PlatformSDK\lib\prerelease;$(VCInstallDir)PlatformSDK\lib;$(FrameworkSDKDir)lib"
136 "Include Dirs"="$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include\prerelease;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include"
137 "Source Dirs"="$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src"
142 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1]
144 "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\"
145 "ThisVersionSolutionCLSID"="{246C57AE-40DD-4d6b-9E8D-B0F5757BB2A8}"
146 "ThisVersionDTECLSID"="{8CD2DD97-4EC1-4bc4-9359-89A3EEDD57A6}"
147 "InstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\"
148 "CLR Version"="v1.1.4322"
149 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts]
150 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Smart Device Extensions]
151 "UseInterface"=dword:00000001
152 "VS7InstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\"
153 "VBDeviceInstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VB7\"
154 "CSharpDeviceInstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\"
155 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Visual Basic.NET]
156 "UseInterface"=dword:00000001
157 "Package"="{164B10B9-B200-11D0-8C61-00A0C91E29D5}"
158 "DefaultProductAttribute"="VB"
160 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Visual C#]
161 "DefaultProductAttribute"="C#"
162 "UseInterface"=dword:00000001
163 "Package"="{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}"
165 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\Visual JSharp]
167 "Package"="{E6FDF8B0-F3D1-11D4-8576-0002A516ECE8}"
168 "UseInterface"=dword:00000001
169 "DefaultProductAttribute"="Visual JSharp"
170 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\InstalledProducts\VisualC++]
171 "UseInterface"=dword:00000001
172 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}"
173 "DefaultProductAttribute"="VC"
174 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup]
175 "Dbghelp_path"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\"
176 "dw_dir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\"
177 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\CSDPROJ]
178 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\"
179 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\JSHPROJ]
180 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VJ#\"
181 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Servicing]
182 "CurrentSULevel"=dword:00000000
183 "CurrentSPLevel"=dword:00000000
185 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Servicing\Package]
190 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Servicing\SKU]
191 "Visual Studio .NET Professional 2003 - English"="{20610409-CA18-41A6-9E21-A93AE82EE7C5}"
192 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VB]
193 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\"
194 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VBDPROJ]
195 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\"
196 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VC]
197 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\"
198 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VC#]
199 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\"
200 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\Visual Studio .NET Professional 2003 - English]
201 "InstallSuccess"=dword:00000001
202 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VS]
203 "EnvironmentDirectory"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\"
204 "EnvironmentPath"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe"
205 "VS7EnvironmentLocation"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe"
206 "MSMDir"="C:\Program Files\Common Files\Merge Modules\"
207 "VS7CommonBinDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\"
208 "VS7CommonDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\"
209 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\"
210 "VSUpdateDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Setup\VSUpdate\"
211 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VS\BuildNumber]
213 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\Setup\VS\Pro]
214 "ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\"
215 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC]
216 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO]
217 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32]
218 @="{759354D0-6B42-4705-AFFB-56E34D2BC3D4}"
219 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories]
220 "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"
221 "Library Dirs"="$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(VCInstallDir)PlatformSDK\lib\prerelease;$(VCInstallDir)PlatformSDK\lib;$(FrameworkSDKDir)lib"
222 "Include Dirs"="$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include\prerelease;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include"
223 "Source Dirs"="$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src"
224 "Reference Dirs"="$(FrameWorkDir)$(FrameWorkVersion)"
225 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\ToolDefaultExtensionLists]
226 "VCCLCompilerTool"="*.cpp;*.cxx;*.cc;*.c"
227 "VCLinkerTool"="*.obj;*.res;*.lib;*.rsc"
228 "VCLibrarianTool"="*.obj;*.res;*.lib;*.rsc"
229 "VCMIDLTool"="*.idl;*.odl"
230 "VCCustomBuildTool"="*.bat"
231 "VCResourceCompilerTool"="*.rc"
232 "VCPreBuildEventTool"="*.bat"
233 "VCPreLinkEventTool"="*.bat"
234 "VCPostBuildEventTool"="*.bat"
235 "VCBscMakeTool"="*.sbr"
237 "VCWebServiceProxyGeneratorTool"="*.discomap"
238 "VCWebDeploymentTool"=""
239 "VCALinkTool"="*.resources"
240 "VCManagedResourceCompilerTool"="*.resx"
241 "VCXMLDataGeneratorTool"="*.xsd"
242 "VCManagedWrapperGeneratorTool"=""
243 "VCAuxiliaryManagedWrapperGeneratorTool"=""
244 "VCPrimaryInteropTool"=""
248 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0]
249 "CLR Version"="v2.0.50727"
250 "ApplicationID"="VCExpress"
251 "SecurityAppID"="{741726F6-1EAE-4680-86A6-6085E8872CF8}"
252 "InstallDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\"
253 "EnablePreloadCLR"=dword:00000001
254 "RestoreAppPath"=dword:00000001
255 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\InstalledProducts]
256 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\InstalledProducts\Microsoft Visual C++]
257 "UseInterface"=dword:00000001
258 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}"
259 "DefaultProductAttribute"="VC"
260 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\Setup]
261 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\Setup\VC]
262 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\VC\"
263 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\Setup\VS]
264 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\"
265 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC]
266 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC\VC_OBJECTS_PLATFORM_INFO]
267 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32]
268 @="{72f11281-2429-11d7-8bf6-00b0d03daa06}"
269 [HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\ToolDefaultExtensionLists]
270 "VCCLCompilerTool"="*.cpp;*.cxx;*.cc;*.c"
271 "VCLinkerTool"="*.obj;*.res;*.lib;*.rsc;*.licenses"
272 "VCLibrarianTool"="*.obj;*.res;*.lib;*.rsc"
273 "VCMIDLTool"="*.idl;*.odl"
274 "VCCustomBuildTool"="*.bat"
275 "VCResourceCompilerTool"="*.rc"
276 "VCPreBuildEventTool"="*.bat"
277 "VCPreLinkEventTool"="*.bat"
278 "VCPostBuildEventTool"="*.bat"
279 "VCBscMakeTool"="*.sbr"
280 "VCFxCopTool"="*.dll;*.exe"
282 "VCWebServiceProxyGeneratorTool"="*.discomap"
283 "VCWebDeploymentTool"=""
284 "VCALinkTool"="*.resources"
285 "VCManagedResourceCompilerTool"="*.resx"
286 "VCXMLDataGeneratorTool"="*.xsd"
287 "VCManifestTool"="*.manifest"
288 "VCXDCMakeTool"="*.xdc"
292 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0]
293 "CLR Version"="v2.0.50727"
294 "ApplicationID"="VisualStudio"
295 "ThisVersionDTECLSID"="{BA018599-1DB3-44f9-83B4-461454C84BF8}"
296 "ThisVersionSolutionCLSID"="{1B2EEDD6-C203-4d04-BD59-78906E3E8AAB}"
297 "SecurityAppID"="{DF99D4F5-9F04-4CEF-9D39-095821B49C77}"
298 "InstallDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\"
299 "EnablePreloadCLR"=dword:00000001
300 "RestoreAppPath"=dword:00000001
301 "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\"
302 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\InstalledProducts]
303 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\InstalledProducts\Microsoft Visual C++]
304 "UseInterface"=dword:00000001
305 "Package"="{F1C25864-3097-11D2-A5C5-00C04F7968B4}"
306 "DefaultProductAttribute"="VC"
307 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup]
308 "Dbghelp_path"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\"
309 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\EF]
310 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\EnterpriseFrameworks\"
311 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\Microsoft Visual Studio 2005 Professional Edition - ENU]
313 "InstallSuccess"=dword:00000001
314 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VC]
315 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\VC\"
316 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VS]
317 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\"
318 "VS7EnvironmentLocation"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe"
319 "EnvironmentPath"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe"
320 "EnvironmentDirectory"="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\"
321 "VS7CommonDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\"
322 "VS7CommonBinDir"="C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\"
323 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VS\BuildNumber]
324 "1033"="8.0.50727.42"
325 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Setup\VS\Pro]
326 "ProductDir"="C:\Program Files\Microsoft Visual Studio 8\"
327 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC]
328 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC\VC_OBJECTS_PLATFORM_INFO]
329 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32]
330 @="{72f11281-2429-11d7-8bf6-00b0d03daa06}"
331 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\ToolDefaultExtensionLists]
332 "VCCLCompilerTool"="*.cpp;*.cxx;*.cc;*.c"
333 "VCLinkerTool"="*.obj;*.res;*.lib;*.rsc;*.licenses"
334 "VCLibrarianTool"="*.obj;*.res;*.lib;*.rsc"
335 "VCMIDLTool"="*.idl;*.odl"
336 "VCCustomBuildTool"="*.bat"
337 "VCResourceCompilerTool"="*.rc"
338 "VCPreBuildEventTool"="*.bat"
339 "VCPreLinkEventTool"="*.bat"
340 "VCPostBuildEventTool"="*.bat"
341 "VCBscMakeTool"="*.sbr"
342 "VCFxCopTool"="*.dll;*.exe"
344 "VCWebServiceProxyGeneratorTool"="*.discomap"
345 "VCWebDeploymentTool"=""
346 "VCALinkTool"="*.resources"
347 "VCManagedResourceCompilerTool"="*.resx"
348 "VCXMLDataGeneratorTool"="*.xsd"
349 "VCManifestTool"="*.manifest"
350 "VCXDCMakeTool"="*.xdc"
354 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS]
355 "MSMDir"="C:\\Program Files (x86)\\Common Files\\Merge Modules\\"
356 "ProductDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\"
357 "VS7EnvironmentLocation"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe"
358 "EnvironmentPath"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe"
359 "EnvironmentDirectory"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\"
360 "VS7CommonDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\"
362 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\BuildNumber]
364 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\Community]
365 "ProductDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\"
366 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\JSLS_MSI]
367 "Version"="14.0.25527"
368 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\JSPS_MSI]
369 "Version"="14.0.25527"
370 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\Pro]
371 "ProductDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\"
372 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\professional]
373 "IsInstallInProgress"="0"
374 "CurrentOperation"="install"
375 "SetupFeedUri"="http://go.microsoft.com/fwlink/?LinkID=659004&clcid=0x409"
376 "SetupFeedLocalCache"="C:\\ProgramData\\Microsoft\\VisualStudioSecondaryInstaller\\14.0\\LastUsedFeed\\{68432bbb-c9a5-4a7b-bab3-ae5a49b28303}\\Feed.xml"
378 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\SecondaryInstaller]
379 [HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\SecondaryInstaller\AppInsightsTools]
380 "Version"="7.0.20620.1"
383 regdata_cv
= r
'''[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion]
384 "ProgramFilesDir"="C:\Program Files"
385 "CommonFilesDir"="C:\Program Files\Common Files"
386 "MediaPath"="C:\WINDOWS\Media"
393 def __init__(self
, dict=None) -> None:
394 self
.fs
= SCons
.Node
.FS
.FS()
400 def Dictionary(self
, key
= None):
403 return self
.dict[key
]
405 def __setitem__(self
, key
, value
) -> None:
406 self
.dict[key
] = value
408 def __getitem__(self
, key
):
409 return self
.dict[key
]
411 def __contains__(self
, key
) -> bool:
412 return key
in self
.dict
414 def get(self
, name
, value
=None):
415 if name
in self
.dict:
416 return self
.dict[name
]
421 return self
.fs
.Dir(name
)
425 """key class for storing an 'open' registry key"""
426 def __init__(self
,key
) -> None:
429 # Warning: this is NOT case-insensitive, unlike the Windows registry.
430 # So e.g. HKLM\Software is NOT the same key as HKLM\SOFTWARE.
432 """node in the dummy registry"""
433 def __init__(self
,name
) -> None:
441 if val
in self
.valdict
:
442 return (self
.valdict
[val
],1)
444 raise SCons
.Util
.RegError
446 def addValue(self
,name
,val
) -> None:
447 self
.valdict
[name
] = val
448 self
.valarray
.append(name
)
450 def valindex(self
,index
):
453 rv
= (self
.valarray
[index
],self
.valdict
[self
.valarray
[index
]],1)
455 raise SCons
.Util
.RegError
458 def key(self
,key
,sep
: str = '\\'):
459 if key
.find(sep
) != -1:
460 keyname
, subkeys
= key
.split(sep
,1)
465 # recurse, and return the lowest level key node
467 return self
.keydict
[keyname
].key(subkeys
)
469 return self
.keydict
[keyname
]
471 raise SCons
.Util
.RegError
473 def addKey(self
,name
,sep
: str = '\\'):
474 if name
.find(sep
) != -1:
475 keyname
, subkeys
= name
.split(sep
, 1)
480 if keyname
not in self
.keydict
:
481 self
.keydict
[keyname
] = RegNode(keyname
)
482 self
.keyarray
.append(keyname
)
484 # recurse, and return the lowest level key node
486 return self
.keydict
[keyname
].addKey(subkeys
)
488 return self
.keydict
[keyname
]
490 def keyindex(self
,index
):
491 return self
.keydict
[self
.keyarray
[index
]]
493 def __str__(self
) -> str:
496 def _doStr(self
, indent
: str = ''):
498 for value
in self
.valarray
:
499 rv
= rv
+ '%s"%s" = "%s"\n' % (indent
, value
, self
.valdict
[value
])
500 for key
in self
.keyarray
:
501 rv
= rv
+ "%s%s: {\n"%(indent
, key
)
502 rv
= rv
+ self
.keydict
[key
]._doStr
(indent
+ ' ')
503 rv
= rv
+ indent
+ '}\n'
507 """registry class for storing fake registry attributes"""
508 def __init__(self
,data
) -> None:
509 """parse input data into the fake registry"""
510 self
.root
= RegNode('REGISTRY')
511 self
.root
.addKey('HKEY_LOCAL_MACHINE')
512 self
.root
.addKey('HKEY_CURRENT_USER')
513 self
.root
.addKey('HKEY_USERS')
514 self
.root
.addKey('HKEY_CLASSES_ROOT')
518 def parse(self
, data
) -> None:
519 parents
= [None, None]
520 parents
[0] = self
.root
521 keymatch
= re
.compile(r
'^\[(.*)\]$')
522 valmatch
= re
.compile(r
'^(?:"(.*)"|[@])="(.*)"$')
524 m1
= keymatch
.match(line
)
526 # add a key, set it to current parent.
527 # Also create subkey for Wow6432Node of HKLM\Software;
528 # that's where it looks on a 64-bit machine (tests will fail w/o this)
529 parents
[0] = self
.root
.addKey(m1
.group(1))
530 if 'HKEY_LOCAL_MACHINE\\Software' in m1
.group(1):
531 p1
= m1
.group(1).replace('HKEY_LOCAL_MACHINE\\Software', 'HKEY_LOCAL_MACHINE\\Software\\Wow6432Node')
532 parents
[1] = self
.root
.addKey(p1
)
536 m2
= valmatch
.match(line
)
540 p
.addValue(m2
.group(1),m2
.group(2))
542 def OpenKeyEx(self
,root
,key
):
543 if root
== SCons
.Util
.HKEY_CLASSES_ROOT
:
544 mykey
= 'HKEY_CLASSES_ROOT\\' + key
545 if root
== SCons
.Util
.HKEY_USERS
:
546 mykey
= 'HKEY_USERS\\' + key
547 if root
== SCons
.Util
.HKEY_CURRENT_USER
:
548 mykey
= 'HKEY_CURRENT_USER\\' + key
549 if root
== SCons
.Util
.HKEY_LOCAL_MACHINE
:
550 mykey
= 'HKEY_LOCAL_MACHINE\\' + key
551 debug("Open Key:%s"%mykey
)
552 return self
.root
.key(mykey
)
554 def DummyOpenKeyEx(root
, key
):
555 return registry
.OpenKeyEx(root
,key
)
557 def DummyEnumKey(key
, index
):
560 rv
= key
.keyarray
[index
]
562 raise SCons
.Util
.RegError
564 # print "Enum Key",key.name,"[",index,"] =>",rv
567 def DummyEnumValue(key
, index
):
568 rv
= key
.valindex(index
)
570 # print "Enum Value",key.name,"[",index,"] =>",rv
573 def DummyQueryValue(key
, value
):
574 rv
= key
.value(value
)
576 # print "Query Value",key.name+"\\"+value,"=>",rv
579 def DummyExists(path
) -> bool:
582 def DummyVsWhere(msvc_version
, env
):
583 # not testing versions with vswhere, so return none
586 class msvsTestCase(unittest
.TestCase
):
587 """This test case is run several times with different defaults.
588 See its subclasses below."""
589 def setUp(self
) -> None:
590 debug("THIS TYPE :%s"%self
)
592 registry
= self
.registry
593 from SCons
.Tool
.MSCommon
.vs
import reset_installed_visual_studios
594 reset_installed_visual_studios()
596 self
.test
= TestCmd
.TestCmd(workdir
='')
597 # FS doesn't like the cwd to be something other than its root.
598 os
.chdir(self
.test
.workpath(""))
599 self
.fs
= SCons
.Node
.FS
.FS()
601 def test_get_default_version(self
) -> None:
602 """Test retrieval of the default visual studio version"""
604 debug("Testing for default version %s"%self
.default_version
)
606 v1
= get_default_version(env
)
608 assert env
['MSVS_VERSION'] == self
.default_version
, \
609 ("env['MSVS_VERSION'] != self.default_version",
610 env
['MSVS_VERSION'],self
.default_version
)
611 assert env
['MSVS']['VERSION'] == self
.default_version
, \
612 ("env['MSVS']['VERSION'] != self.default_version",
613 env
['MSVS']['VERSION'], self
.default_version
)
614 assert v1
== self
.default_version
, (self
.default_version
, v1
)
616 env
= DummyEnv({'MSVS_VERSION':'7.0'})
617 v2
= get_default_version(env
)
618 assert env
['MSVS_VERSION'] == '7.0', env
['MSVS_VERSION']
619 assert env
['MSVS']['VERSION'] == '7.0', env
['MSVS']['VERSION']
620 assert v2
== '7.0', v2
623 v3
= get_default_version(env
)
628 env
['MSVS_VERSION'] = override
629 v3
= get_default_version(env
)
630 assert env
['MSVS_VERSION'] == override
, env
['MSVS_VERSION']
631 assert env
['MSVS']['VERSION'] == override
, env
['MSVS']['VERSION']
632 assert v3
== override
, v3
634 def _TODO_test_merge_default_version(self
) -> None:
635 """Test the merge_default_version() function"""
638 def test_query_versions(self
) -> None:
639 """Test retrieval of the list of visual studio versions"""
640 v1
= query_versions()
641 assert not v1
or str(v1
[0]) == self
.highest_version
, \
642 (v1
, self
.highest_version
)
643 assert len(v1
) == self
.number_of_versions
, v1
645 def test_config_generation(self
) -> None:
646 """Test _DSPGenerator.__init__(...)"""
647 if not self
.highest_version
:
650 # Initialize 'static' variables
651 version_num
, suite
= msvs_parse_version(self
.highest_version
)
652 if version_num
>= 10.0:
653 function_test
= _GenerateV10DSP
655 elif version_num
>= 7.0:
656 function_test
= _GenerateV7DSP
659 function_test
= _GenerateV6DSP
662 # Avoid any race conditions between the test cases when we test
663 # actually writing the files.
664 dspfile
= 'test%s%s' % (hash(self
), suffix
)
666 str_function_test
= str(function_test
.__init
__)
669 # Create the cmdargs test list
670 list_variant
= ['Debug|Win32','Release|Win32',
671 'Debug|x64', 'Release|x64']
672 list_cmdargs
= ['debug=True target_arch=32',
673 'debug=False target_arch=32',
674 'debug=True target_arch=x64',
675 'debug=False target_arch=x64']
676 list_cppdefines
= [['_A', '_B', 'C'], ['_B', '_C_'], ['D'], []]
677 list_cpppaths
= [[r
'C:\test1'], [r
'C:\test1;C:\test2'],
678 [self
.fs
.Dir('subdir')], []]
679 list_cppflags
= [['/std:c++17', '/Zc:__cplusplus'],
680 ['/std:c++14', '/Zc:__cplusplus'],
681 ['/std:c++11', '/Zc:__cplusplus'], []]
683 def TestParamsFromList(test_variant
, test_list
):
685 Generates test data based on the parameters passed in.
689 2. Dictionary of expected result per variant.
691 def normalizeParam(param
):
693 Converts the raw data based into the AddConfig function of
694 msvs.py to the expected result.
696 Expects the following behavior:
697 1. A value of None will be converted to an empty list.
698 2. A File or Directory object will be converted to an
699 absolute path (because those objects can't be pickled).
700 3. Otherwise, the parameter will be used.
704 elif isinstance(param
, list):
705 return [normalizeParam(p
) for p
in param
]
706 elif hasattr(param
, 'abspath'):
712 (None, dict.fromkeys(test_variant
, '')),
713 ('', dict.fromkeys(test_variant
, '')),
714 (test_list
[0], dict.fromkeys(test_variant
, normalizeParam(test_list
[0]))),
715 (test_list
, dict(list(zip(test_variant
, [normalizeParam(x
) for x
in test_list
]))))
718 tests_cmdargs
= TestParamsFromList(list_variant
, list_cmdargs
)
719 tests_cppdefines
= TestParamsFromList(list_variant
, list_cppdefines
)
720 tests_cpppaths
= TestParamsFromList(list_variant
, list_cpppaths
)
721 tests_cppflags
= TestParamsFromList(list_variant
, list_cppflags
)
723 # Run the test for each test case
724 for param_cmdargs
, expected_cmdargs
in tests_cmdargs
:
725 for param_cppdefines
, expected_cppdefines
in tests_cppdefines
:
726 for param_cpppaths
, expected_cpppaths
in tests_cpppaths
:
727 for param_cppflags
, expected_cppflags
in tests_cppflags
:
730 # 'Testing %s. with :\n variant = %s \n cmdargs = "%s" \n cppdefines = "%s" \n cpppaths = "%s" \n cppflags = "%s"'
741 expected_configs
= {}
742 for platform
in ['Win32', 'x64']:
743 for variant
in ['Debug', 'Release']:
744 variant_platform
= '%s|%s' % (variant
, platform
)
745 runfile
= '%s\\%s\\test.exe' % (platform
, variant
)
746 buildtarget
= '%s\\%s\\test.exe' % (platform
, variant
)
747 outdir
= '%s\\%s' % (platform
, variant
)
749 # Create parameter list for this variant_platform
750 param_configs
.append([variant_platform
, runfile
, buildtarget
, outdir
])
752 # Create expected dictionary result for this variant_platform
753 expected_configs
[variant_platform
] = {
755 'platform': platform
,
757 'buildtarget': buildtarget
,
759 'cmdargs': expected_cmdargs
[variant_platform
],
760 'cppdefines': expected_cppdefines
[variant_platform
],
761 'cpppaths': expected_cpppaths
[variant_platform
],
762 'cppflags': expected_cppflags
[variant_platform
],
765 # Create parameter environment with final parameter dictionary
766 param_dict
= dict(list(zip(('variant', 'runfile', 'buildtarget', 'outdir'),
767 [list(l
) for l
in zip(*param_configs
)])))
768 param_dict
['cmdargs'] = param_cmdargs
769 param_dict
['cppdefines'] = param_cppdefines
770 param_dict
['cpppaths'] = param_cpppaths
771 param_dict
['cppflags'] = param_cppflags
773 # Hack to be able to run the test with a 'DummyEnv'
774 class _DummyEnv(DummyEnv
):
775 def subst(self
, string
, *args
, **kwargs
):
778 env
= _DummyEnv(param_dict
)
779 env
['MSVSSCONSCRIPT'] = ''
780 env
['MSVS_VERSION'] = self
.highest_version
781 env
['MSVSBUILDTARGET'] = 'target'
783 # Call function to test
784 genDSP
= function_test(dspfile
, source
, env
)
786 # Check expected result
787 self
.assertListEqual(list(genDSP
.configs
.keys()), list(expected_configs
.keys()))
788 for key
, v
in genDSP
.configs
.items():
789 self
.assertDictEqual(v
.__dict
__, expected_configs
[key
])
793 # Delete the resulting file so we don't leave anything behind.
794 for file in [dspfile
, dspfile
+ '.filters']:
795 path
= os
.path
.realpath(file)
801 class msvs6aTestCase(msvsTestCase
):
802 """Test MSVS 6 Registry"""
803 registry
= DummyRegistry(regdata_6a
+ regdata_cv
)
804 default_version
= '6.0'
805 highest_version
= '6.0'
806 number_of_versions
= 1
808 '6.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio\\VC98', 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio\\VC98\\Bin'},
814 default_install_loc
= install_locs
['6.0']
816 class msvs6bTestCase(msvsTestCase
):
817 """Test Other MSVS 6 Registry"""
818 registry
= DummyRegistry(regdata_6b
+ regdata_cv
)
819 default_version
= '6.0'
820 highest_version
= '6.0'
821 number_of_versions
= 1
823 '6.0' : {'VSINSTALLDIR': 'C:\\VS6\\VC98', 'VCINSTALLDIR': 'C:\\VS6\\VC98\\Bin'},
829 default_install_loc
= install_locs
['6.0']
831 class msvs6and7TestCase(msvsTestCase
):
832 """Test MSVS 6 & 7 Registry"""
833 registry
= DummyRegistry(regdata_6b
+ regdata_7
+ regdata_cv
)
834 default_version
= '7.0'
835 highest_version
= '7.0'
836 number_of_versions
= 2
838 '6.0' : {'VSINSTALLDIR': 'C:\\VS6\\VC98',
839 'VCINSTALLDIR': 'C:\\VS6\\VC98\\Bin'},
840 '7.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7',
841 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7\\Tools'},
846 default_install_loc
= install_locs
['7.0']
848 class msvs7TestCase(msvsTestCase
):
849 """Test MSVS 7 Registry"""
850 registry
= DummyRegistry(regdata_7
+ regdata_cv
)
851 default_version
= '7.0'
852 highest_version
= '7.0'
853 number_of_versions
= 1
856 '7.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7',
857 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET\\Common7\\Tools'},
862 default_install_loc
= install_locs
['7.0']
864 class msvs71TestCase(msvsTestCase
):
865 """Test MSVS 7.1 Registry"""
866 registry
= DummyRegistry(regdata_7_1
+ regdata_cv
)
867 default_version
= '7.1'
868 highest_version
= '7.1'
869 number_of_versions
= 1
873 '7.1' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7',
874 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\Tools'},
878 default_install_loc
= install_locs
['7.1']
880 class msvs8ExpTestCase(msvsTestCase
): # XXX: only one still not working
881 """Test MSVS 8 Express Registry"""
882 registry
= DummyRegistry(regdata_8exp
+ regdata_cv
)
883 default_version
= '8.0Exp'
884 highest_version
= '8.0Exp'
885 number_of_versions
= 1
891 '8.0Exp' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8',
892 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8\\VC'},
894 default_install_loc
= install_locs
['8.0Exp']
896 class msvs80TestCase(msvsTestCase
):
897 """Test MSVS 8 Registry"""
898 registry
= DummyRegistry(regdata_80
+ regdata_cv
)
899 default_version
= '8.0'
900 highest_version
= '8.0'
901 number_of_versions
= 1
906 '8.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8',
907 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 8\\VC'},
910 default_install_loc
= install_locs
['8.0']
912 class msvs140TestCase(msvsTestCase
):
913 """Test MSVS 140 Registry"""
914 registry
= DummyRegistry(regdata_140
+ regdata_cv
)
915 default_version
= '14.0'
916 highest_version
= '14.0'
917 number_of_versions
= 2
919 '14.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 14.0',
920 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 14.0\\VC'},
922 default_install_loc
= install_locs
['14.0']
924 class msvsEmptyTestCase(msvsTestCase
):
925 """Test Empty Registry"""
926 registry
= DummyRegistry(regdata_none
)
927 default_version
= SupportedVSList
[0].version
928 highest_version
= None
929 number_of_versions
= 0
937 default_install_loc
= install_locs
['8.0Exp']
939 if __name__
== "__main__":
941 # only makes sense to test this on win32
942 if sys
.platform
!= 'win32':
943 sys
.stdout
.write("NO RESULT for msvsTests.py: '%s' is not win32\n" % sys
.platform
)
946 SCons
.Util
.RegOpenKeyEx
= DummyOpenKeyEx
947 SCons
.Util
.RegEnumKey
= DummyEnumKey
948 SCons
.Util
.RegEnumValue
= DummyEnumValue
949 SCons
.Util
.RegQueryValueEx
= DummyQueryValue
950 SCons
.Tool
.MSCommon
.vc
.find_vc_pdir_vswhere
= DummyVsWhere
952 os
.path
.exists
= DummyExists
# make sure all files exist :-)
953 os
.path
.isfile
= DummyExists
# make sure all files are files :-)
954 os
.path
.isdir
= DummyExists
# make sure all dirs are dirs :-)
970 for test_class
in test_classes
:
972 # print("TEST: ", test_class.__doc__)
973 back_osenv
= copy
.deepcopy(os
.environ
)
975 # XXX: overriding the os.environ is bad, but doing it
976 # correctly is too complicated for now. Those tests should
978 for k
in ['VS71COMNTOOLS',
984 loader
= unittest
.TestLoader()
985 loader
.testMethodPrefix
= 'test_'
986 suite
= loader
.loadTestsFromTestCase(test_class
)
987 if not TestUnit
.cli
.get_runner()().run(suite
).wasSuccessful():
996 # indent-tabs-mode:nil
998 # vim: set expandtab tabstop=4 shiftwidth=4: