473,695 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

distutils, 'scripts' and Windows

Hi folks,

I'm looking at packaging a project I'm working on using distutils. The
project is for Windows and contains a COM server which needs
registration, so the installer needs to be a little more complicated
than usual. Looking at the options for the bdist_wininst command to
distutils, I see it's possible to specify
--install-script=<myinsta llscript>
which ought to do the trick. But to use this, myinstallscript itself
must first be installed by passing
scripts='myinst allscript'
to distutils.core. setup in setup.py. That will copy myinstallscript
into a particular location (C:\Python24\Sc ripts in my case) and leave
it there forever. Which raises a couple of questions:

- Why is myinstallscript left there forever? The documentation makes
some vague reference to needing it for uninstalling packages, but then
I can't actually find a way to uninstall packages.

- What is the use of the Scripts directory on Windows? It's not added
to my PATH, so unless I do that myself it won't do anything like it's
meant to on other platforms.

- Should I supply myinstallscript , or myinstallscript .py? I suspect the
latter, since that's the only way to give files types on Windows.

- Is there some other better way to perform post-installation actions?
Would it work out of a binary generated from bdist_wininst?

- Should I even be using distutils? It doesn't really matter that much
where the files are installed because the COM server can register
itself to run out of whatever location it happens to be in.

Thanks,
George

Jul 19 '05 #1
1 2149
"George van den Driessche" <gr***@bigfoot. com> wrote in message
news:d7******** ***********@new s.demon.co.uk.. .
Hi folks,

I'm looking at packaging a project I'm working on using distutils. The
project is for Windows and contains a COM server which needs registration,
so the installer needs to be a little more complicated than usual. Looking
at the options for the bdist_wininst command to distutils, I see it's
possible to specify
--install-script=<myinsta llscript>
which ought to do the trick. But to use this, myinstallscript itself must
first be installed by passing
scripts='myinst allscript'
to distutils.core. setup in setup.py. That will copy myinstallscript into a
particular location (C:\Python24\Sc ripts in my case) and leave it there
forever. Which raises a couple of questions:

- Why is myinstallscript left there forever? The documentation makes some
vague reference to needing it for uninstalling packages, but then I can't
actually find a way to uninstall packages.

- What is the use of the Scripts directory on Windows? It's not added to
my PATH, so unless I do that myself it won't do anything like it's meant
to on other platforms.

- Should I supply myinstallscript , or myinstallscript .py? I suspect the
latter, since that's the only way to give files types on Windows.

- Is there some other better way to perform post-installation actions?
Would it work out of a binary generated from bdist_wininst?
What I found, thanks to Martin Fuzzey, is that if you assign the result
of the setup() function to a variable, you can access all sorts of
interesting stuff after setup() completes. You need to do some
source reading, but it's quite instructive.

Also, if you check the parms after setup completes for "install" or
whatever other subcommand you're using to install the stuff, you
can then do pretty much whatever you want without having to
have another script. I convert line endings on all of my scripts
manually since distutils doesn't seem to do it. I should also
convert line endings on the documentation. Sigh.
- Should I even be using distutils? It doesn't really matter that much
where the files are installed because the COM server can register itself
to run out of whatever location it happens to be in.
I personally find distutils to be an absurd fit for my application
(PyFit). It does way more than I need, and doesn't do a lot of
other stuff that I need, and makes lots of assumptions about file
locations that are simply, um, well ...

Unfortunately, it's also the standard installation engine, so there's
no getting around it if you want to be consistent with what everyone
else is doing and future enhancements to the installation process
through the Python Package Index, eggs and a lot of other
stuff that's coming down the pike.

John Roth

Thanks,
George


Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1334
by: Jorge Godoy | last post by:
Hi! For the following setup.py, I get this error: byte-compiling /var/tmp/bhsys-buildroot/usr/lib/python2.3/site-packages/bhsys/Impressao.py to Impressao.pyc byte-compiling /var/tmp/bhsys-buildroot/usr/lib/python2.3/site-packages/bhsys/bhsys.py to bhsys.pyc running install_scripts
5
1876
by: Lonnie Princehouse | last post by:
I'm in a situation where I need to distribute several interdependent Python packages. There are good reasons not to combine them all into one package. Distutils doesn't seem to be able to bundle a heterogeneous mix of multiple packages and modules, and so I've currently got people launching three installers in the proper sequence in order to get software installed, which seems needlessly complicated and confusing. There must be a better...
15
4120
by: Colin J. Williams | last post by:
The distutils download page has: -------------------------------------------------------- Current stable release The current stable release is Distutils 1.0.2; you can download it as: * Distutils-1.0.2.tar.gz (source distribution) (233k) * Distutils-1.0.2.zip (source distribution) (274k) * Distutils-1.0.2.win32.exe (Windows installer) (187k)
1
1717
by: Terry Hancock | last post by:
Some time ago, I got the idea that I wanted to build image resources from vector graphic originals, instead of marshalling hundreds of tiny little icon images by hand. I wrote "BuildImage" to do this for me, and so far, it works very well, so I'm trying to make it easier to use and available to more developers. There is a brief (and somewhat dated) tutorial explaining what BuildImage itself does at:
0
8656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8590
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9005
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8869
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7693
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3025
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1988
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.