(self, version)
| 127 | self.macros["$(%s)" % macro] = Reg.get_value(path, key) |
| 128 | |
| 129 | def load_macros(self, version): |
| 130 | self.set_macro("VCInstallDir", self.vsbase + r"\Setup\VC", "productdir") |
| 131 | self.set_macro("VSInstallDir", self.vsbase + r"\Setup\VS", "productdir") |
| 132 | self.set_macro("FrameworkDir", NET_BASE, "installroot") |
| 133 | try: |
| 134 | if version >= 8.0: |
| 135 | self.set_macro("FrameworkSDKDir", NET_BASE, |
| 136 | "sdkinstallrootv2.0") |
| 137 | else: |
| 138 | raise KeyError("sdkinstallrootv2.0") |
| 139 | except KeyError: |
| 140 | raise DistutilsPlatformError( |
| 141 | """Python was built with Visual Studio 2008; |
| 142 | extensions must be built with a compiler than can generate compatible binaries. |
| 143 | Visual Studio 2008 was not found on this system. If you have Cygwin installed, |
| 144 | you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""") |
| 145 | |
| 146 | if version >= 9.0: |
| 147 | self.set_macro("FrameworkVersion", self.vsbase, "clr version") |
| 148 | self.set_macro("WindowsSdkDir", WINSDK_BASE, "currentinstallfolder") |
| 149 | else: |
| 150 | p = r"Software\Microsoft\NET Framework Setup\Product" |
| 151 | for base in HKEYS: |
| 152 | try: |
| 153 | h = RegOpenKeyEx(base, p) |
| 154 | except RegError: |
| 155 | continue |
| 156 | key = RegEnumKey(h, 0) |
| 157 | d = Reg.get_value(base, r"%s\%s" % (p, key)) |
| 158 | self.macros["$(FrameworkVersion)"] = d["version"] |
| 159 | |
| 160 | def sub(self, s): |
| 161 | for k, v in self.macros.items(): |
no test coverage detected