[Patches] [ python-Patches-983775 ] Allow bdist_wininst to install for non-admin users

SourceForge.net noreply at sourceforge.net
Fri Jul 2 19:54:01 EDT 2004


Patches item #983775, was opened at 2004-07-02 09:56
Message generated for change (Comment added) made by mhammond
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=983775&group_id=5470

Category: Distutils and setup.py
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Mark Hammond (mhammond)
Assigned to: Mark Hammond (mhammond)
Summary: Allow bdist_wininst to install for non-admin users

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Mark Hammond (mhammond)
Date: 2004-07-03 09:54

Message:
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!

----------------------------------------------------------------------

Comment By: Thomas Heller (theller)
Date: 2004-07-03 05:34

Message:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=983775&group_id=5470



More information about the Patches mailing list