mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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.
This commit is contained in:
parent
cdd6e4d753
commit
9cc5cb7c4b
1 changed files with 6 additions and 3 deletions
|
@ -611,12 +611,15 @@ PyMethodDef meth[] = {
|
||||||
static HINSTANCE LoadPythonDll(char *fname)
|
static HINSTANCE LoadPythonDll(char *fname)
|
||||||
{
|
{
|
||||||
char fullpath[_MAX_PATH];
|
char fullpath[_MAX_PATH];
|
||||||
|
char subkey_name[80];
|
||||||
LONG size = sizeof(fullpath);
|
LONG size = sizeof(fullpath);
|
||||||
HINSTANCE h = LoadLibrary(fname);
|
HINSTANCE h = LoadLibrary(fname);
|
||||||
if (h)
|
if (h)
|
||||||
return h;
|
return h;
|
||||||
if (ERROR_SUCCESS != RegQueryValue(HKEY_CURRENT_USER,
|
wsprintf(subkey_name,
|
||||||
"SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath",
|
"SOFTWARE\\Python\\PythonCore\\%s.%s\\InstallPath",
|
||||||
|
py_major, py_minor);
|
||||||
|
if (ERROR_SUCCESS != RegQueryValue(HKEY_CURRENT_USER, subkey_name,
|
||||||
fullpath, &size))
|
fullpath, &size))
|
||||||
return NULL;
|
return NULL;
|
||||||
strcat(fullpath, "\\");
|
strcat(fullpath, "\\");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue