My setup routine using distutils that works perfectly fine on Windows XP does not work for Windows 7. Here are the specifics:
My package has a lot of config files which I install into %APPDATA%. On Windows I run setup.py with the bdist_wininst option to create an installer. On Win7 the installer is then executed as Administrator so that the module can be installed into %PROGRAMFILES%\Python etc. The installation does not report any errors but as you might have guessed the config files will not have been installed into %APPDATA% nor anywhere else (I searched for them).
If I open a cmd as Administrator and install my package with the install option directly (setup.py install), everything works perfectly fine however.
So, what am I missing here? Is this a limitation in the graphical installer or am I doing something wrong?
The distutils package provides support for building and installing additional modules into a Python installation. The new modules may be either 100%-pure Python, or may be extension modules written in C, or may be collections of Python packages which include modules coded in both Python and C.
By default the Python installer for Windows places its executables in the user's AppData directory, so that it doesn't require administrative permissions. If you're the only user on the system, you might want to place Python in a higher-level directory (e.g. C:\Python3. 7 ) to make it easier to find.
You may use something like the common solution on *nix. Install the config files to %PROGRAMFILES%
, and copy them to %APPDATA%
when the program detects a particular user is running the program for the first time (which can be detected by checking that the config files are missing).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With