Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow bdist_wininst to install for non-admin users #40492

Closed
mhammond opened this issue Jul 1, 2004 · 3 comments
Closed

Allow bdist_wininst to install for non-admin users #40492

mhammond opened this issue Jul 1, 2004 · 3 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@mhammond
Copy link
Contributor

mhammond commented Jul 1, 2004

BPO 983775
Nosy @mhammond, @theller
Files
  • install.patch: Patch as described.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/mhammond'
    closed_at = <Date 2004-07-02.23:54:01.000>
    created_at = <Date 2004-07-01.23:56:27.000>
    labels = ['library']
    title = 'Allow bdist_wininst to install for non-admin users'
    updated_at = <Date 2004-07-02.23:54:01.000>
    user = 'https://github.com/mhammond'

    bugs.python.org fields:

    activity = <Date 2004-07-02.23:54:01.000>
    actor = 'mhammond'
    assignee = 'mhammond'
    closed = True
    closed_date = None
    closer = None
    components = ['Distutils']
    creation = <Date 2004-07-01.23:56:27.000>
    creator = 'mhammond'
    dependencies = []
    files = ['6070']
    hgrepos = []
    issue_num = 983775
    keywords = ['patch']
    message_count = 3.0
    messages = ['46300', '46301', '46302']
    nosy_count = 2.0
    nosy_names = ['mhammond', 'theller']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue983775'
    versions = ['Python 2.4']

    @mhammond
    Copy link
    Contributor Author

    mhammond commented Jul 1, 2004

    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.

    @mhammond mhammond closed this as completed Jul 1, 2004
    @mhammond mhammond self-assigned this Jul 1, 2004
    @mhammond mhammond added the stdlib Python modules in the Lib dir label Jul 1, 2004
    @mhammond mhammond closed this as completed Jul 1, 2004
    @mhammond mhammond self-assigned this Jul 1, 2004
    @mhammond mhammond added the stdlib Python modules in the Lib dir label Jul 1, 2004
    @theller
    Copy link

    theller commented Jul 2, 2004

    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.

    @mhammond
    Copy link
    Contributor Author

    mhammond commented Jul 2, 2004

    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!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants