Anyone want to add automatic app updates to wxPython with me?

411 views
Skip to first unread message

Wasi Khan

unread,
Nov 29, 2016, 3:42:59 AM11/29/16
to wxPython-users
Hi guys. I have been working with wxPython for almost two years, and I just shipped a product using it. Although I love wxPython, serving new updates in this almost legacy format is a pain. I use esky right now to do that, but to be honest its not that great. You have to manage multiple set-up files, plus the annoying UAC thing and then keeping a separate zip on an FTP on a server. 

Instead of updating compiling code, why not just teach a base program to just fetch up the latest version from a repo or something and just run that. I am not talking about changing "core" wxPython but just adding this functionality over it. 

I wrote  a small blog post about the approach I am suggesting which can be found her (just a two minute read): https://medium.com/@wasified/streamable-applications-7ad03d041e42#.t9o7n0gnn

If anyone is interested working with me, please let me know. Cheers!
Message has been deleted

Steve Barnes

unread,
Nov 29, 2016, 1:24:36 PM11/29/16
to wxpytho...@googlegroups.com


On 29/11/2016 12:57, sebastian lópez wrote:
> Hi
>
> I think your aproach could have some security isues, also actually is
> posible to create egg packages and your app should load them
>
> |
> fori inrange(10):
>
> |
>
>
>
>
> in order to update the egg files you could use something as this:
>
> |
> import re
> import urllib2
> import wx
>
> ......
>
> # sei_glob is a kind of container
> def checkPlugins():
> # URL to download the file
> url = sei_glob.UPDATE_URL
> content = urllib2.urlopen(url).read()
> result = re.findall(r'href="(\S+).egg', content)
> modulos2download = dict()
> for res in result:
> nombre, version, pythonVersion = res.split('/')[-1].split('-')[:3]
> modulos2download[nombre] = {'version':version,
> 'url':res+'.egg','pyver':pythonVersion}
> path2saveModule = os.path.join(sei_glob.installDir, 'plugins')
> udpatedModulesList = ''
> updated = False
> for moduleName, data in modulos2download.items():
> try:
> if sei_glob.ModulosVersiones[moduleName] < data['version']:
> # download the file
> self.downloadFile(data['url'], path2saveModule)
> udpatedModulesList += moduleName + ' V '+
> data['version']+ '\n'
> updated = True
> except KeyError:
> downloadFile(data['url'], path2saveModule)
> if updated:
> wx.MessageBox('Next modules were
> updated:\n\n'+udpatedModulesList+'\n\nRestart the app',
> caption=sei_glob.PROG_NAME,
> style=wx.OK|wx.ICON_INFORMATION)
>
> def downloadFile(url, path2Store):
> posiblePath = urllib2.urlparse.urlsplit(url).path
> local_filename = posiblePath.split('/')[-1]
> r = requests.get(url)
> f = open(os.path.join(path2Store, local_filename), 'wb')
> for chunk in r.iter_content(chunk_size=70*1024): # 75kb at a time
> if chunk: # filter out keep-alive new chunks
> f.write(chunk)
> f.close()
> |
>
>
>
>
It would be far better to create Wheel format files for extensions, as
the Phoenix project, (https://wiki.wxpython.org/ProjectPhoenix), does
for wxPython itself see https://wxpython.org/Phoenix/snapshot-builds/
for snapshots, then you can distribute your libraries, with pre-compiled
extensions for specific platforms if required. This is the whole point
of the wheel format - pure python libraries can be distributed as a
single file but libraries that have platform dependencies are multiple
files and pip knows how to select between them. (See POP 427
https://www.python.org/dev/peps/pep-0427/ for details on the wheel format)

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

James Wettenhall

unread,
Nov 30, 2016, 4:56:18 PM11/30/16
to wxpytho...@googlegroups.com
Hi,

I would love to see a wxPython wiki page discussing the pros and cons of various approaches for auto-updating wxPython applications.  I too have tried the method of grabbing wxPython code from a URL as a proof of concept.  But to get it working nicely and securely in production requires a bit more thought.  A wiki page could include approaches such as this: https://github.com/phfaist/updater4pyi/

The security implications need some thought.  Maybe the first time the application runs, the user could be asked whether they trust the certificate of the HTTPS site the updates are coming from?  And if it's a GitHub repo, all repo owners should have two-factor authentication turned on.  But the binary wheel approach sounds better.  Maybe your Continuous Integration workflow can automatically build binary wheels each time you commit?  But for building and distributing binaries, do you trust your Continuous Integration service with your code-signing certificate, or do you want to distribute unsigned binaries?

Maybe automatic updates could only be done for minor version increments e.g. from v1.5.1 to v1.5.2, but for v1.6, the user would be told that the application needs to restart, so that dependencies can be reinstalled as necessary and reimported after the application restarts.  It would be nice to be able to update dependencies quickly to patch a security issue, so maybe the application restart workflow could also be used for critical security updates as well as major version updates.

Cheers,
James



--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ignace danneels

unread,
Dec 4, 2016, 10:57:27 AM12/4/16
to wxPython-users
I recently bought the book "wxPython Application Development Cookbook"

As of wxPython 2.9, there's an extension module that provides a mixin class called SoftwareUpdate, which integrates the update features of the Esky auto-update framework into a wxPython application.
I have to be honest that I haven't worked with it yet.

I hope it helps you.

Mike Driscoll

unread,
Dec 5, 2016, 3:00:07 PM12/5/16
to wxPython-users


On Sunday, December 4, 2016 at 9:57:27 AM UTC-6, Blue Flash wrote:
I recently bought the book "wxPython Application Development Cookbook"

As of wxPython 2.9, there's an extension module that provides a mixin class called SoftwareUpdate, which integrates the update features of the Esky auto-update framework into a wxPython application.
I have to be honest that I haven't worked with it yet.

I hope it helps you.

I actually wrote about using SoftwareUpdate on my blog a few years ago - http://www.blog.pythonlibrary.org/2013/07/12/wxpython-updating-your-application-with-esky/

It would be fun to write up something that uses wheels though.

- Mike

James Wettenhall

unread,
Dec 5, 2016, 4:35:40 PM12/5/16
to wxpytho...@googlegroups.com
Hi,

I think we're hijacking Wasi's email thread a bit - he was talking more about having an always up-to-date application like a Javascript webpage.

But I'm interested in the other approach too.  My biggest concern with approaches based on Esky is that they seem to use py2exe on Windows, whereas I have switched to PyInstaller because I had issues with using code signing certificates with py2exe.   Also, the Python 2.7.x compatible version of py2exe hasn't been actively maintained for a while.  https://pypi.python.org/pypi/py2exe/ says: py2exe for Python 2 is still available at http://sourceforge.net/project/showfiles.php?group_id=15583 but the latest build on SourceForge seems to be from 2008-11-16.

There's a GitHub Issue for adding PyInstaller support to Esky: https://github.com/cloudmatrix/esky/issues/18 which has been open since Sep 28, 2012.
Towards the end of the Issue comments (early 2015), people seem to be giving up on the idea of PyInstaller support in Esky, and looking at:

In that GitHub Issue thread, there's a link to an attempt to describe how to make code signing work with py2exe: https://github.com/rfk/www.rfk.id.au/blob/master/content/blog/entry/code-signing-py2exe/index.html but then there is a comment saying: Aha, yep, I had forgotten about this bug that prevents the scheme I described above from working: http://bugs.python.org/issue5950

If we use something like InnoSetup (http://www.jrsoftware.org/isinfo.php) to distribute our applications, then maybe we can just sign the setup.exe created by InnoSetup, not the Application.exe created by py2exe?

So, given that I would love have software update support on Windows, is it worth switching back from PyInstaller to py2exe?  Using the py2exe for Python 2 which hasn't been updated since 2008 frightens me, but migrating my wxPython application from Python 2.7 to Python 3 (to use the latest py2exe) frightens me too!

Cheers,
James

Mike Driscoll

unread,
Dec 5, 2016, 4:47:38 PM12/5/16
to wxpytho...@googlegroups.com
Just for the record, py2exe does support Python 3 - https://pypi.python.org/pypi/py2exe/0.9.2.0 although the Python 2 version does seem to be dead.

But yes, it would be nice if Esky supported other packages like PyInstaller, bbfreeze or the like.

- Mike

Wasi Khan

unread,
Dec 17, 2016, 10:01:05 AM12/17/16
to wxPython-users
James, you mentioned that you've tried the approach of updating apps via HTTP. Do you some have some code?

Also, I used PyInstaller to package my app too but switched only due to Esky. I really don't think they're concerned about adding pyinstaller though.

James Wettenhall

unread,
Jan 15, 2017, 1:08:24 AM1/15/17
to wxpytho...@googlegroups.com
Hi,

I noticed a message in Esky's GitHub README from August 2016 saying:

"Esky, is again unmaintained. I would reccomend trying pyinstaller and pyupdater It seems to be the king."

So I have been trying out PyUpdater with wxPython here:


PyUpdater uses PyInstaller which I prefer over py2exe.

There's a lot more that PyUpdater can do than what I have included in the demo, e.g. updating bundled assets.  See: http://www.pyupdater.org/

It only supports PyInstaller's --onefile mode currently, not --onedir.

The demo I've put together doesn't include a GUI for telling the user that a new version is available.  It's just a trivial wxPython app which can check for and apply updates before beginning the wxPython main loop.

Feedback and contributions are most welcome!

Cheers,
James



Sent from my iPhone

Tyson Doggerz

unread,
Nov 25, 2017, 2:31:42 PM11/25/17
to wxPython-users
Hi there :),

Awesome guide by the way.

I am needing to update my application on windows and could use a little help.  Could you provide a tutorial/guide with reference to free Amazon Server or with AWS S3?  I noticed you used an example site, but I'm struggling to get it working as it keeps giving me:  [ERROR] Missing PYU_AWS_ID

 Would be happy to compensate if not motivated.  

Thanks :)

Wasi Khan

unread,
Nov 25, 2017, 2:43:01 PM11/25/17
to wxpytho...@googlegroups.com
Hi Tyson,
Which updating framekwork are you using?  As far as using Amazon Server I think you can use any kind of server to host your app I believe: all you need to is to hit a url.

Wasi 

--
You received this message because you are subscribed to a topic in the Google Groups "wxPython-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/QdZEBDcT_YY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wxpython-users+unsubscribe@googlegroups.com.

kenneth Kenny

unread,
May 18, 2019, 10:17:13 PM5/18/19
to wxPython-users
Hi,

I created an EXE file using pyinstaller. I'm looking for a method to auto update the app. I'm currently using python 3.6 and pyqt5 . please suggest.
To unsubscribe from this group and all its topics, send an email to wxpytho...@googlegroups.com.

Wasi Khan

unread,
May 19, 2019, 5:33:48 PM5/19/19
to wxpytho...@googlegroups.com
Use pyupdater, I think that is the default now.

To unsubscribe from this group and all its topics, send an email to wxpython-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/2733bdba-2a10-4fef-92ca-b1686c522d34%40googlegroups.com.

kenneth Kenny

unread,
May 19, 2019, 10:49:36 PM5/19/19
to wxpytho...@googlegroups.com

Hi Wasi Khan,

I'm trying to use pyupdater. But i find it difficult to understand. Do you have experience with pyupdater?

Is it simple?


To unsubscribe from this group and all its topics, send an email to wxpython-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/CAKz1%3DRv4O_2k-hTibSP1i7iNYsEFo%3D%2BnpZjrt0tKX1i2wO%2BQ3g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages