« My first Cherokee patch commited! | Main | WTF! PyGTK is f**king everywere! »

My chrismas present: All-in-One win32 python installer.

Since my Cherokee patch, I've been playing around with NSIS, the Windows tool for building installers. One of my obsessions with software is that entry barriers should be as low as possible in order to have a successful product and let people enjoy with it.

I've been using Python and PyGTK for five years, I think that right now, are probably the easiest and funniest tools to get introduced into software development and gui programming on the free software world. One of the most interesting feature is that they're both cross-platform, so you can write software that can run in 90% of its code on almost any UNIX, Windows and Mac OS X.

Although, the problem with PyGTK is that is hard to setup on the most popular enviroment,  Windows, which kills its potential success on the mass audience.  Why is that hard to setup a PyGTK working enviroment right now? Well, let's take a look on the steps you need to take if you don't know anything about python and/or pygtk:

  1. Go to pygtk.org
  2. Go to the download section and figure out where the Windows installer is.
  3. Download the PyGTK Windows Installer from the GNOME FTP.
  4. Install it and figure out that you need the Python Installer (that's not explained).
  5. Install it and figure out that you also need PyCairo and PyGobject. (not explained)
  6. Install Py[Cairo|Object], try PyGTK, and figure out that you also need the  GTK+ runtime for windows, which is on an unofficial webpage, since the official win32 gtk+ binaries are a bunch of .zip files. (not explained and very hard to figure out)
  7. Write "Hello World!".

As a summary, you have:

  • 5 different installers from 3 different sites
  • 3 critical steps not explained from the website, which force people to ask google and waste lot of time.

I would like to know how many windows users (which are the most of the people out there) have had gave up before to be able to even write a hello world and make it work.

Solutions? Well, the website issue is been addressed since I've been discussing this on the mailing list. Join the discussion.

Until then I've been using my NSIS-fu, and I've created a rudimentary installer that has everything together:



There is some things that I want to fix, for example, the PyGTK modules cannot be installed in silent mode, so it appears three dialogs "extra" that I would like to override. I also would like to fix some uninstalling problems and be able to detect previous Gtk+ or Python installations on runtime.

If you wanna help, patches are welcome:

Comments

Cheers to you for doing this! I'm going to download and check out the .nsi to see if I can help it out.

Hopefully you'll hear from me. :)

Nice.

That's nice. However keep in mind that if you want people to be able to install more than one instance, never use anything besides msi packages. In Windows world msi packages can be rolled out organization wide in minutes without any extra work, other installer types can not.

Using plain vanilla Active Directory you can take any sane msi package, optionally customize it (using Orca for instance) and mandate that the workstations install it. I spent myself one hour doing 3500 Firefox installations :-)

It's the Firefox project's greatest blunder for instance. It's harder to roll out Firefox to replace IE if there is no proper installer available. Luckily there are 3rd party msi packages that rock and make it all possible.. Many people distrust 3rd party packagings and it probably hurts Firefox majorly.

@Mike

I agree, but I don't know any free software tools to build msi installers.

How about http://wix.sourceforge.net/ ?

Sf.net knows actually a few.

If I recall correctly one of them is eve genuine open source by Microsoft.. hah

@Mike

Awesome! I'll take a look of them.

BTW, I cannot build a .msi file until I setup all the files needed by separate so I can override the "embedding" method.

Beautiful!

Can I translate this to spanish and publish it in my blog?

Thanks
Marcelo

Great !
Thanks !

@Marcelo:

Of course you can!

Seems that I can't download the pygtk installer you've created, as the server times out. Has someone possibly mirrored it now?

Thanks for doing this, I completely agree with you about entry barriers, it needs to be simple stuff.

Yet another Thank you.

I use dynamips to prep for the CCIE Security exam and it requires python gtk.

Your exe saved my life.

Thank you!~

Vex

Seems just broken for me. It includes a python distribution, but it installs and then UNINSTALLS that, so later steps complain about no python. And it incorrectly installed over my existing python 2.4 install, without noticing it was the wrong version.

Good idea, maybe, but more work needed.

This is just great! I am a rather good Windows power user, but this thing of Python + PyGTK was really weird and hard to figure out, especially when you are not sure on which tools you want to use: infact, I abandoned the idea of trying PyGTK, which really was my first try, in favour of WxWidgets, just because they were simply easy to install! Now, I'm beginning to use Linux, and I am a really newbie at it: nevertheless, it has been a matter of minutes to successfully setup and run a working Python + PyGTK hello world app! Then, sweeted by how easy it was in Linux, I thought: maybe with time they have perfected the installation process in Windows too, so I tried to setup the environment the usual way, with still no success. Until now, when I saw your "package", and read this blog entry, finally I've figured out what damn was wrong, and thanks to your easy installation of all the required stuff I finally can enjoy coding PyGTK on both Linux and Windows. What a great gift, thank you!

Please please please !!!
Please if you can
MysqlDB for python 2.5 on windows platform compile or join this installer
( sorry my bad english)

On our webpage we have a MySQL-driven events-calendar for Alicante/Murcia in Spain. In order to speed up passing the events to our database I wrote a gtk/pygtk/MySQLdb/python application (6.000 lines of python code) that really makes handling data very comfortable.
However, our externals that use the app to access the database server love the program but hate setting up all the stuff needed. It's a great idea to bundle everything into one installer

Hi

This one in all package is wonderfull as i was one of the windows users who whated to have pygtk... Many thanks. I hope in future the same sort of pakages will be avialble.

Good work!

Would be nice if the installer shows all version numbers.

And the best would be to have a MSI package.

Then this installer should be placed on http://www.pygtk.org/downloads.html as an alternative to the other installers.

This is really great. i have tried and now trying again to get this working.
Can we just clarify. All I need it to first install Python 2.5 and then install this and I'm good to go?

Can someone also please fill me in on what else I need if I want to use glade, and then also compile? So far I've found py2exe-0.6.6.win32-py2.5.exe from http://www.py2exe.org/, gtk-dev-2.10.7-win32-1.exe and libglade-2.4.0-dev.zip from http://gladewin32.sourceforge.net.
I THINK that's all I need??
I saw some reference to tepache (http://www.gnomefiles.org/app.php/tepache), but I don't know if its really required. Thanks!

I tested it, it great!

Can you incorporate it in the installer? My program, which is written under linux, uses python-glade package. I am seeking hard to see if there is a python-glade for win32 which is compatible with the linux one ......

I've figured out. After installing this all-in-one installer, go to http://gladewin32.sourceforge.net and download libglade-bin, and extract it to bin of gtkdir, which is all-in-one-install-path\gtk\bin.

Voilà, your python-glade app can run!

See also this faq entry: http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq21.002.htp

Great stuff, but ... on a fresh win2K I the install didn't finish, since I missed MSVCR71.dll which is needed by pycairo IIRC.

I downloaded it, put into system32-folder and it went through.

Suggestion: put that dll into the package and install it if there isn't a newer version available.

-- hgb

Thanks so much!

In particular, thanks very much for installing a 'private' version of Python 2.5. I wasn't ready to upgrade from Python 2.4, but now, not only do I have a working PyGTK, but I also have a Python 2.5 version I can experiment with.

Incidentally, I had to install gtk-dev-2.10.7-win32-1.exe to fix a .dll problem after using pygtk-setup.exe, but I'm not sure if this was just a glitch, or if there's a real problem.

Yours,

Murray

Thanks for the nice install however you must warn people that it installs python2.5. This can cause many conflicts with other existing site packages. If there is no way to create a version for python2.4 people should be warned that 2.5 will become the default. THANKS again.

If this is done with NSIS should I presume that I could easily add my python proggie and extra modules to the installer and send one file to a customer instead of going around installing 5 pakcages like before or suffer py2exe headache like yet before?

I hope so :)

I think that having an all-in-one PyGTK installer for Windows is not only convenient, but is actually essential to get PyGTK to work reliably on Windows. This has to do with the different C runtimes being used by Python and GTK.

Python 2.5 uses the msvcr71.dll runtime, whereas the GTK DLLs use msvcrt.dll. These two DLLs should not be mixed: Each application should link to either msvcrt.dll or msvcr71.dll (see the Microsoft developer's website for more information). Downloading and installing the GTK DLLs and the PyGTK-only installer results in an incompatibility. This may or may not reveal itself, but I have run into the situation that this incompatibility caused PyGTK to crash on Windows.

Would it be possible to recompile the GTK DLLs for this all-in-one installer such that they use msvcr71.dll instead of msvcrt.dll? It may be a hassle to compile GTK on Windows, but I may be able to help you with that if you run into some problems.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment