From 01cddf169b758014d536898f3fe5f8e4f8b09e00 Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 14 May 2005 17:52:41 +0000 Subject: [PATCH] search harder for the platform sdk git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4028 212acab6-be3b-0410-9dea-997c60f758d6 --- SCons/Tools/mstoolkit.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/SCons/Tools/mstoolkit.py b/SCons/Tools/mstoolkit.py index 5e121649..babd2099 100644 --- a/SCons/Tools/mstoolkit.py +++ b/SCons/Tools/mstoolkit.py @@ -70,16 +70,21 @@ def get_msvctoolkit_paths(): if os.environ.has_key('VCToolkitInstallDir'): MSToolkitDir = os.path.normpath(os.environ['VCToolkitInstallDir']) else: - # last resort -- default install location - MSToolkitDir = r'C:\Program Files\Microsoft Visual C++ Toolkit 2003' - + raise SCons.Errors.InternalError, "Microsoft Visual C++ Toolkit 2003 directory was not found in the `VCToolkitInstallDir` environment variable." + # look for platform sdk - PlatformSDKDir = "" - try: - PlatformSDKDir = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MicrosoftSDK\Directories\Install Dir')[0] - PlatformSDKDir = str(PlatformSDKDir) - except SCons.Util.RegError: - raise SCons.Errors.InternalError, "The Platform SDK directory was not found in the registry." + if os.environ.has_key('MSSdk'): + PlatformSDKDir = os.path.normpath(os.environ['MSSdk']) + else: + try: + PlatformSDKDir = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MicrosoftSDK\Directories\Install Dir')[0] + PlatformSDKDir = str(PlatformSDKDir) + except SCons.Util.RegError: + try: + PlatformSDKDir = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3\Install Dir')[0] + PlatformSDKDir = str(PlatformSDKDir) + except SCons.Util.RegError: + raise SCons.Errors.InternalError, "The Platform SDK directory was not found in the registry or in the `MSSdk` environment variable." include_path = r'%s\include;%s\include' % (MSToolkitDir, PlatformSDKDir) lib_path = r'%s\lib;%s\lib' % (MSToolkitDir, PlatformSDKDir)