How do I create an installer for my completed wx python app

Good night,

I have created a simple converter app with wx python and I have used py installer to package it into an .exe file and it works. What I want to be able to do though is package it so that when the user downloads it, it will take them through an installer, which will place my programs into program files and allow it to appear on their desktop and start menu. So it will appear as an app instead of just an .exe file. Can someone lead me in the right direction? Thanks

I have tried various approaches to this over the years - this is definitely challenging. My requirements include: a) needing wx, numpy, matplotlib, and some custom scientific libraries, b) wanting “desktop shortcuts/apps” for end-users, c) wanting “no admin” install, fully in user-owned folders and easily uninstalled, and d) a preference for including a real Python environment and readable source code. I realize that might be a set of priorities that others do not share. But, I should also say that I have not had much success with the various “python to executable app” approaches, especially on all platforms.

For the past several years, I’ve been using Anaconda Python (or “miniconda”) and use either conda constructor (https://github.com/conda/constructor) or custom shell scripts to run the installation steps. One reason for this is that Anaconda Python and especially conda-forge keeps an up-to-date wxPython for all platforms, including Linux, has packages for all the normal scientific code, and is pretty well tested. The downsides are that conda is actually pretty slow, and that the set of latest packages changes rather often. One could hard-code in every package version - I find that mostly unnecessary, but it might be a wise thing to do.

With both constructor or shell/batch scripts, you can customize a “post-install” step. With “basic conda packages” already installed, I can use this to step to fix or update packages, say installing with pip. This is also where I build desktop shortcuts/apps (my main package has multiple apps, and at least so “python to executable app” tools don’t support that) using (shameless plug?) pyshortcuts (https://github.com/newville/pyshortcuts). And, since it is Anaconda Python and wxPython, this is also where I take care to fix the super-annoying Anaconda bug on macOS which requires running wxPython apps with pythonw.app instead of python'.

For me, another important consideration is how often I need to update packages and rebuild these installation scripts. I’ve been relying more and more on that “post-install script” to automatically update packages so that I can simply update packages on conda-forge or PyPI, and the same installer will then grab the latest version. This also allows knowledgeable users can update with conda and/or pip without having to install a completely new environment, or my apps can alert users that an update is available.

The shell (bash/Windows cmd) scripts and conda constructor scripts I use for my main app are at
(xraylarch/installers at master · xraypy/xraylarch · GitHub). Maybe you’ll find that approach useful.

1 Like

If I read your post right, you have a compiled executable from pyinstaller and want a way to package and distribute that in a more traditional installer. I was facing this problem a number of years ago. At the time, I encountered two viable options for my use case. The first is Inno Setup, which is free:
https://jrsoftware.org/isinfo.php

The second is Advanced Installer, which is free for open source projects:

I personally use advanced installer, since my project is open source and I could get a free license. It has the nice feature of being able to create .msi files, which Inno doesn’t (or didn’t, last I checked), which can have a few small advantages (and also a few small disadvantages).

There may well be other alternatives that have cropped up in the past few years, but those are where I would start.