Search code examples
pythonpython-3.xwindows-installerinstallationexe

How to convert python file to installer


Hi everyone I want to convert my python file to installer(windows installer) not executable. I already make it executable through py2exe. How can I make an Installer of it. Is it possible.


Solution

  • Pyinstaller is a good option to convert python scripts to an windows executable. You can install it in cmd.exe as any user and run pip install pyinstaller or pip install --pre pyinstaller.

    you can then run it using pyinstaller. (sorry that i can't supply a automated script i wrote after a system restore. I'll write it again soon using pyqt5)

    syntax

    --onefile - puts the program and it's files into a exe.

    --onedir - put your program into a directory (folder) (faster than --onefile as it does not need to extract files)

    -c - create a console app.

    -w - create an app without the console.

    -i "[Path to .ico or exe with icon. e.g C:\Files\CODE\Icon.ico]" - set an icon for your app instead of the default snake-on-a-floppy-disk icon.

    you can read the rest here.

    You can then get inno setup and create an offline installer.

    [sorry, could not be bothered to type it again] i posted it on https://stackoverflow.com/posts/61597594