[Python-checkins] python/dist/src/PC/bdist_wininst install.c, 1.10, 1.11

theller at users.sourceforge.net theller at users.sourceforge.net
Wed Dec 1 19:18:14 CET 2004


Update of /cvsroot/python/python/dist/src/PC/bdist_wininst
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19473

Modified Files:
	install.c 
Log Message:
Running the pre-install or post-install script did not work when
Python was installed with the 'only for me' option. The registry key
had a hardcoded '2.3' in it where the python version chosen for
installation should be used instead.

Will backport myself.


Index: install.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/bdist_wininst/install.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- install.c	19 Jul 2004 09:57:58 -0000	1.10
+++ install.c	1 Dec 2004 18:18:08 -0000	1.11
@@ -611,12 +611,15 @@
 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\\%s.%s\\InstallPath",
+		 py_major, py_minor);
+	if (ERROR_SUCCESS != RegQueryValue(HKEY_CURRENT_USER, subkey_name,
 					   fullpath, &size))
 		return NULL;
 	strcat(fullpath, "\\");
@@ -1793,7 +1796,7 @@
 			/* Strip the trailing backslash again */
 			python_dir[strlen(python_dir)-1] = '\0';
             
-            CheckRootKey(hwnd);
+			CheckRootKey(hwnd);
 	    
 			if (!OpenLogfile(python_dir))
 				break;



More information about the Python-checkins mailing list