[Distutils] bdist_wininst and Vista User Account Control (UAC)

Thomas Heller theller at ctypes.org
Thu Jul 5 20:57:49 CEST 2007

Mark Hammond schrieb:
> The pywin32 extensions require (well, prefer) administrative access during
> installation - certain files are copied to the System32 directory and the
> registry at HKEY_LOCAL_MACHINE is written to.  Also, if I understand
> correctly, if Python happened to be installed into "\Program Files", admin
> access would be required to create any files in that directory tree - I'm
> not sure what permissions the \PythonXX directory are created with, but its
> not unreasable to assume that some shops might choose to secure that
> directory similarly to "\Program Files".

> So I see a few alternatives, but none are very desirable:

I have not yet even used vista, so I fear I cannot answer your questions,
or even offer an opinion...
> * Only make this "admin required" check if a specific version of Python is
> necessary (ie, the package contains extension modules).  This would leave
> pure-python packages out in the cold.
> * Live with the ugly UI that would result in performing that check after the
> Python version has been selected, and add the command-line processing
> necessary to make this work.

This sound like the most universal option to me.

> * Ignore the issue and try to educate people that they must explicitly use
> "Run as Administrator" for such packages on Vista.

What if the user does not have or cannot get admin rights?  Can he not install
the package then?

> I'm wondering if anyone has any opinions or thoughts on how we should handle
> this?

bdist_wininst has its own problems anyway - most severe the MSVC runtime dll issue.
Another one is that it won't work for 64-bit installations.

bdist_msi solves the 64-bit and MSVCRT issue.  I would expect that it also solves the
UAC problems.  OTOH it is not possible (AFAIK) to build bdist_msi installers on Linux systems.


More information about the Distutils-SIG mailing list