Jul 20, 2011
Use Linux to build win32 installers for Python apps
A python-based project I’m working on has a win32 user that I need to support. Until yesterday I’ve been moving to a win32 laptop in order to run python setup.py bdist_wininst so I can produce a self-installing executable. Then I discovered how trivial it is to use wine to do the job:
- Install wine. (
sudo aptitude install wine) - Install python into the wine environment. (Download an msi from python.org and run
msiexec /i python-x.x.x.msi.) - Install whatever prerequisite packages you need (e.g. wxPython) using
wineormsiexec. - When you’ve got everything ready to build, just do
wine c:/Python27/python.exe setup.py bdist_wininstand look in ./dist/ for your exe!