473,765 Members | 2,137 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 2155
"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
1337
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
1879
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
4125
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
1718
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
9568
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
9398
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
10156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8831
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...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
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.