]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport from trunk, rev. 1.11 and 1.12. Don't hardcode the Python
authorThomas Heller <theller@ctypes.org>
Wed, 22 Dec 2004 15:12:46 +0000 (15:12 +0000)
committerThomas Heller <theller@ctypes.org>
Wed, 22 Dec 2004 15:12:46 +0000 (15:12 +0000)
version number.

PC/bdist_wininst/install.c

index 515e9eae4d249eeabe8660e2ceeca3d4b963b32c..8a92364f3f8214828d4ec0210e92198f797c831c 100644 (file)
@@ -1510,12 +1510,15 @@ static void CloseLogfile(void)
 static HINSTANCE LoadPythonDll(char *fname)
 {
        char fullpath[_MAX_PATH];
+       char subkey_name[80];
        LONG size = sizeof(fullpath);
        HINSTANCE h = LoadLibrary(fname);
        if (h)
                return h;
-       if (ERROR_SUCCESS != RegQueryValue(HKEY_CURRENT_USER,
-                                          "SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath",
+       wsprintf(subkey_name,
+                "SOFTWARE\\Python\\PythonCore\\%d.%d\\InstallPath",
+                py_major, py_minor);
+       if (ERROR_SUCCESS != RegQueryValue(HKEY_CURRENT_USER, subkey_name,
                                           fullpath, &size))
                return NULL;
        strcat(fullpath, "\\");