简体   繁体   中英

Windows installer for a Python application created within Linux

Suppose I have a working application written in Python on some Linux distribution, I would like to know if it is possible to produce an executable for Windows within Linux, with pyinstaller or another similar program, and how to create some kind of Windows installer for that program that will place the program and some data in a relevant directory. Any advice is welcomed!

Thank you!

I've successfully used PyInstaller running under Wine to produce an executable which runs on Windows. Set up your Wine environment on Linux, putting a copy of PyInstaller in an appropriate location. eg drive_c\\pyinstaller-2.0 .

Also install Python for Windows in your Wine environment. You have to use the msiexec option run the Python installer.

wine msiexec /i python-2.6.6.msi

You might also need to install other dependencies such as pywin32 .

Then, simply run PyInstaller on you spec file:

wine c:/Python26/Python.exe c:/pyinstaller-2.0/pyinstaller.py <spec_file>

This takes care of creating an executable which will run under windows. Packaging this exe as part of an installer is an additional task for which you could use NSIS as suggested in other answers. I'm not sure if NSIS will successfully run under Wine on Linux, so this only answers half of your question.

If you need to make an installer , try these:

As suggested you can use wine http://www.winehq.org/ to run on Linux.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM