Advice for creating an installer for Enaml-based applications

113 views
Skip to first unread message

Brad Buran

unread,
Sep 21, 2018, 11:39:12 PM9/21/18
to Enaml
This has been asked about two and four years ago on this list, so I thought I'd follow up to see if anyone has more contemporary experience with packaging an Enaml-based application into a Windows installer. I've tried a few approaches including http://www.entropyreduction.al/python/distutils/2017/09/21/bundle-python-app-w-inno-setup.html; however, I keep hitting various walls. For example, I had to downgrade to Numpy 1.12 because 1.15 had a weird library incompatibility that only arises when bundling it for install. Now, I'm stuck at some weird Qt error that I haven't figured out yet.

Has anyone had good luck packaging an Enaml-based application? If so, do you mind sharing the installer scripts that you used? If I have good luck, I'll write up my experience and post it here. This installer would be for several open-source applications that are targeted at non-developers (i.e., people who don't want to have to deal with the more complex process of installing Python + third-party libraries and then Git-cloning a repo). 

Thanks!
Brad

frmdstryr

unread,
Oct 1, 2018, 11:42:47 PM10/1/18
to Enaml
Yes, at my previous job I made an enaml application that was bundled with cx_Freeze and installed using a nsis (and deb) installers and distributed to 100's of systems worldwide (internally). Unfortunately the scripts are all closed source and the process was not very easy.

Have you seen https://github.com/conda/constructor? That looks like the most promising new method (but I've yet to try it).

Brad Buran

unread,
Oct 2, 2018, 11:54:35 AM10/2/18
to frmd...@gmail.com, en...@googlegroups.com
> the process was not very easy

This seems to be a recurring refrain when it comes to bundling Python
applications using installers.

Thanks for the reminder about constructor. I was trying to follow the
instructions in
http://www.entropyreduction.al/python/distutils/2017/09/21/bundle-python-app-w-inno-setup.html
but ran into some issues with Numpy and Qt libraries when testing the
install. I'm sure these are solvable issues, but I haven't had a
chance to revisit the problem.

I'll look at constructor next and see if it's any more promising. In
theory, constructor should work extremely well (assuming all required
packages are available via conda).

Brad
> --
> You received this message because you are subscribed to a topic in the Google Groups "Enaml" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/enaml/L6QJOjhQsJA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to enaml+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Serhii Khalymon

unread,
Dec 6, 2018, 10:08:58 AM12/6/18
to Enaml
I really enjoy fbs build tool. It really helps build bundel of the apps fast and smoother. I've created a gist with example of setup config.

Also here is tutorial about fbs https://github.com/mherrmann/fbs-tutorial/

Naveen Michaud-Agrawal

unread,
Jan 9, 2019, 10:10:55 PM1/9/19
to Enaml
Hi Serhii,

Have you managed to build Enaml apps for Windows and OS X using fbs?

Regards,
Naveen

Serhii Khalymon

unread,
Dec 24, 2019, 7:05:59 PM12/24/19
to Enaml
Yes I do. The previous example is outdated a little bit. You need to overwrite __init__ inside of ApplicationContext:

Enter code here...

class CustomQtApplication(QtApplication):
"""Redirect from Enaml QtApplication to origin one.
Required by ApplicationContext"""

def __getattr__(self, item):
return getattr(self._qapp, item)


class AppContext(ApplicationContext):
def __init__(self):
if self.excepthook:
self.excepthook.install()
# Many Qt classes require a QApplication to have been instantiated.
# Do this here, before everything else, to achieve this:
self.app
# We don't build as a console app on Windows, so no point in installing
# the SIGINT handler:
if not is_windows():
self._signal_wakeup_handler = SignalWakeupHandler(
self.app._qapp, self._qt_binding.QAbstractSocket
)
self._signal_wakeup_handler.install()
if self.app_icon:
self.app.setWindowIcon(self.app_icon)

@cached_property
def app(self):
return CustomQtApplication()
Enter code here...
Reply all
Reply to author
Forward
0 new messages