Winston C. Yang
Winston C. Yang

Reputation: 1507

What tool can run in Linux, create an installer for a Python program, and install it on Windows?

I have a Python program that runs in Linux.

My customers may want to run the Python program on Windows.

Assume that they do not want to install Python, PyGTK, or Linux.

Is there a tool, preferably free ("open-source") software, that can run in Linux, take my Python program, and create an installer that will install it on Windows?

(Specifics: My program is in Python 2.6.6, with PyGTK, on Ubuntu 10.10, on VirtualBox, on Windows. I do not have admin rights on my Windows machine, so I am limited in what I can install on the Windows side.)

Upvotes: 4

Views: 413

Answers (3)

WombatPM
WombatPM

Reputation: 2609

py2exe will get you a win32 exe file, along with a few pyd files and a zip archive. You can zip the entire dist folder and deploy it that way. However, if you need a GUI simple user installer you'll have to build that in a separate step.

Options:

  1. create Zip archive, manually extract

  2. DOS style BAT file to copy specific files to predefined locations

  3. Build a MSI style installer using WiX. This can be done by running Mono for Windows under Wine.

  4. Bite the bullet, get access to a Windows box (real or virtual) and use py2exe along with NSIS or Inno Setup. There are some nice examples on the py2exe wiki that show how to combine the py2exe setup script with the automatic creation and generation of the Innosetup script. One command on the commandline , python setup.py py2exe and out pops an installer exe.

As mentioned above, py2exe isn't ready for Python 3.x yet.

Upvotes: 1

Apalala
Apalala

Reputation: 9224

Use py2exe. The .exe must be generated from Windows (Wine is fine), but that's it. You're good up to Python 2.7 (no 3.x support yet).

Upvotes: 0

Tyler
Tyler

Reputation: 155

You could look into NSIS and see if you could script it to pull in the dependencies. I'm not really sure what your specifics are but I'm unaware of anything that offers a single-click solution.

Upvotes: 0

Related Questions