This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Allow bdist_wininst to install for non-admin users
Type: Stage:
Components: Distutils Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mhammond Nosy List: mhammond, theller
Priority: normal Keywords: patch

Created on 2004-07-01 23:56 by mhammond, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
install.patch mhammond, 2004-07-01 23:56 Patch as described.
Messages (3)
msg46300 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2004-07-01 23:56
Attached is a patch which allows a distutils binary
installation to work when Python is installed by a
non-admin, and the extension is also to be installed by
a non-admin user.

It makes the following changes:
* When enumerating the Python versions found, also
remember the HKEY they were found under.
* When installing, if Python was installed under HKCU,
we will too.  If Python was installed under HKLM, we
check the permissions of the current user, and install
where we can.
* The "root" key we use is a global variable - all
registry setting and delete functions use this global
rather than a hardcoded HKLM.
* A new entry is written to the install log, indicating
the key we used.  Uninstallation is based on this key.

Another change in this patch is that 'tempnam()' is
used rather than 'tmpnam()' - 'tmpnam' creates a temp
file on the root of the current drive, and if this is
readonly would explain the 'freopen' errors
occasionally reported.  'tempnam' creates the temp file
in the %TEMP% directory.

I've tested this when Python is installed by an admin,
but the person installing the extension does *not* have
admin permissions.  Assuming the user has write
permissions into the Python directory, this works
correctly.

As usual, assigning to Thomas for comment/review.
msg46301 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2004-07-02 19:34
Logged In: YES 
user_id=11105

I have read but not tested your patch.  Except that I assume
pywin32 build 202 installer already uses it, and it
installed fine for me.

It would be great if you check this in, probably these
related old bugs can also be closed then:
http://www.python.org/sf/555810
http://www.python.org/sf/555812

Thanks.
msg46302 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2004-07-02 23:54
Logged In: YES 
user_id=14198

Yes, pywin32-202 is built with this.
Checking in install.c;
new revision: 1.6; previous revision: 1.5

Thanks!
History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40492
2004-07-01 23:56:27mhammondcreate