Opened 14 years ago

Closed 10 years ago

#1533 enhancement closed fixed (fixed)

Make Windows installers just use distutils

Reported by: TimothyFitz Owned by: TimothyFitz
Priority: normal Milestone:
Component: core Keywords: win32 install
Cc: teratorn, Cory Dodt, TimothyFitz, zooko@…, khorn, therve, Jean-Paul Calderone, Thijs Triemstra Branch:


Twisted on windows should switch from using a complicated custom build process to using distutils.


  • The current system has an added dependency of AAP, a tool which is not good.
  • The current system uses Inno setup, instead of the standard installer. This means we lose all of the baked in functionality of distutil's installer (which currently is a big list of common stuff python people want)
  • To build a windows installer, one has to follow a long list of complicated steps, that may or may not be accurate.
  • Our installers come out looking different from standard packages, adding to the confusion of using Twisted on windows.

The goal is to have the creation of a Twisted installer be as simple as python -bdist_wininst, with the only prerequisite being a valid C++ compiler.

Change History (24)

comment:1 Changed 14 years ago by TimothyFitz

Oh, and this should circumvent a bootstrapping issue that never should have existed in the process (building a windows installer for twisted requires twisted installed)

comment:2 Changed 14 years ago by teratorn

Cc: teratorn added

Python itself uses MSI these days for various reasons. Any thoughts on going that route?

comment:3 Changed 14 years ago by TimothyFitz

I agree, they're wonderful. Going the distutils route will give us free msi installers, since there is a command to build an msi installer. (this is bundled in 2.5, but works on 2.4 and 2.3)

comment:4 Changed 14 years ago by Cory Dodt

Eliminating external dependencies such as AAP and inno is lovely, but there are a few things the Twisted installer provides that a distutils installer does not:

  • Shortcut icons in the SM, including one for uninstall.
  • The command prompt environment with correct settings to use twistd, mktap etc.

In addition, where we eliminate one dependency we add another: the proposal to use MSI instead adds extra dependencies that have to be loaded for Python 2.3/2.4, as you said yourself.

The proposal currently on tpml to use setuptools would then add that as a dependency.

The "bootstrap" issue is nothing more than running from a twisted source tarball--exactly one step more than you would have to do to set it up any other way. (After all, Twisted has to be present in the filesystem to build an installer for it.)

Finally, we should be able to do a build without commercial MSVC, whatever else is done.

*All that said*, I like setuptools and I support this idea, but please make sure the existing features are not lost in translation.

comment:5 Changed 14 years ago by Cory Dodt

Cc: corydodt@… added

comment:6 Changed 14 years ago by TimothyFitz

Cc: TimothyFitz added

comment:7 Changed 13 years ago by zooko

Cc: zooko@… added

This already works. I install twisted on Windows XP with "./ install". I live without the aforementioned features -- shortcut icons, command prompt, installer.

I do this with gcc, not MSVC. I assume it would work just as well if I used MSVC compiler.

I just reproduced this with current trunk to be sure it still works.

comment:8 Changed 13 years ago by TimothyFitz

Summary: Make Windows installs just use distutilsMake Windows installers just use distutils

"./ install" isn't really a distutils install, it's a script that runs a set of distutils installers.

We can't, today, build an installer without shortcut icons or the command prompt. We can build an installer for each subproject.

comment:9 in reply to:  8 Changed 13 years ago by zooko

I see. Okay, so as a user of Twisted on Windows, I'd just like to mention that I'm satisfied with the current state of affairs, and I don't want an installer, shortcut icons, or a command prompt.

I *would* be happy to have a real distutils- or setuptools- packaged Twisted, so that my project ( ) could list Twisted among its managed dependencies and when I ship my project to a user, that user would get Twisted installed automatically.

Currently such users of get the dependencies on zfec, foolscap, simplejson, nevow, and pywin32 automatically handled, but they have to manually install pyOpenSSL and Twisted, which requires that they install zope.interface.

If Twisted used setuptools then it could in turn automatically satisfy its dependence on zope.interface, which would leave pyOpenSSL as the only dependency of the eight that user would need to manually install.

Using distutils or setuptools would also enable people to download and install Twisted by running "easy_install twisted" on the command-line instead of by downloading and executing and installer, which I for one would greatly prefer.

By the way, setuptools also provides a facility for making "executables" on various platforms, similarly to the way that win32/ does.

comment:10 Changed 13 years ago by Cory Dodt

Zooko, you probably want to contribute to #1286 to get Twisted to support setuptools.

comment:11 Changed 13 years ago by Cory Dodt

Cc: Cory Dodt added; corydodt@… removed

comment:12 Changed 11 years ago by zooko

Say... has this issue been fixed ? I like installing Twisted on Windows nowadays simply by "easy_install Twisted", or else by getting the sdist and running "python ./ install". How about you? How do you like installing Twisted on Windows?

comment:13 Changed 11 years ago by Jean-Paul Calderone

No, the Windows installer is still based on AAP or something.

I think you're primarily concerned with whether it's possible to install Twisted using distutils, but this ticket is primarily concerned with what the official binary Twisted Windows installer is based on.

comment:14 Changed 11 years ago by zooko

Let me put it like this: does the Twisted project have some data points showing that developers who work on Windows would be dis-satisfied with Twisted-for-windows being merely an sdist? Personally, as a developer who works on Windows, I would strongly prefer an sdist or a bdist over a gooey, clickable, unscriptable, unreproducible "installer" program. So I have 1 out of 1 data point saying that the idea of a gooey installer for Windows is a bad idea. Are there any other data points I can add to my collection? Should I open a different ticket for this topic?

comment:15 Changed 11 years ago by teratorn

I imagine that building MSIs for Twisted would alleviate most of your concerns about the current "gooey" installers. They are the standard Microsoft package format, and they are easy to script, and so on.

I think the binary installer definitely needs to stay. It is what people expect, and most people on Windows don't have a C compiler lying around. And if they do it probably isn't the same one that Python was built with, and as I understand it, this can cause compatibility issues sometimes.

I'll volunteer to review this work, but I'm flat out these days, and I can't take the responsibility for making it happen.

comment:16 Changed 11 years ago by zooko

We -- and -- deploy software which runs on Windows and which requires Twisted. Is absolutely and completely forbidden by our policy that we ask our users to download and run an installer in order to get Twisted. Instead, the installation has to happen automatically ( installs Twisted using setuptools/easy_install) or Twisted has to come bundled inside the product ( uses py2exe to include Twisted in the product).

Are there some products or some open source projects who require their users to download and run an installer for Twisted? I would be interested in examining the documentation and support forums of these products or projects.

Here is one:

comment:17 Changed 11 years ago by therve

FWIW, the current can produce a MSI, if we fix the version number (it doesn't work for prerelease and svn checkout, but should work for release). The problem is with other stuff done by the installer, like the shortcuts and the zope interface inclusion. We'd have to build a separate MSI for zope interface, which looks confusing.

The only benefit I see (except removing all the crap in win32/) from switching to bdist_msi would be to have a buildbot. It's not a high priority task, though.

comment:18 Changed 10 years ago by TimAllen

For the record, I saw another potential Twisted on Win32 user disappointed to discover that "easy_install twisted" didn't work.

Maybe it would be possible to put the official Twisted Win32 installer on the, and push a distutils-built bdist_wininst installer to PyPI for easy_install to find?

comment:19 Changed 10 years ago by khorn

Cc: khorn added

comment:20 Changed 10 years ago by Jean-Paul Calderone

Cc: therve Jean-Paul Calderone added

It sounds like we might actually be switching to an MSI installer for 10.0. None of the issues with this raised earlier on this ticket (command prompt, etc) have been addressed, as far as I know.

Is that right? If so, what can we do to fix it?

comment:21 Changed 10 years ago by Jean-Paul Calderone

Oh yea, see also #4325.

comment:22 Changed 10 years ago by therve

Indeed, the MSI solution doesn't have the command prompt. Nobody cared enough to actually do something about it, although it's technically possible to create shortcuts using postinstall script. Sidnei during the Pycon sprint redirected me to pywin32 See and

comment:23 Changed 10 years ago by Thijs Triemstra

Cc: Thijs Triemstra added

comment:24 Changed 10 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

So, we switched. If someone cares about the features we lost in the switch (which it's too bad that we lost maybe, but it's done so move on), please file new tickets.

Note: See TracTickets for help on using tickets.