From: T on
I have a Python app which I converted to an EXE (all files separate;
single EXE didn't work properly) via py2exe - I plan on distributing
this and would like the ability to remotely upgrade the program (for
example, via HTTP/HTTPS). Looks like it's not just the EXE that I
will need need to replace (DLLs, the library.zip, etc.). What would
be the best way to go about doing this?
From: Ryan Kelly on
On Thu, 2010-02-18 at 07:46 -0800, T wrote:
> I have a Python app which I converted to an EXE (all files separate;
> single EXE didn't work properly) via py2exe - I plan on distributing
> this and would like the ability to remotely upgrade the program (for
> example, via HTTP/HTTPS). Looks like it's not just the EXE that I
> will need need to replace (DLLs, the library.zip, etc.). What would
> be the best way to go about doing this?


I've been working on an auto-update framework for my own frozen apps,
you might find it useful:

http://pypi.python.org/pypi/esky

Docs are a little scarce at the moment, the next release will hopefully
come with a short tutorial (as well as support for cx_freeze and maybe
py2app, depending on how adventurous I'm feeling).


Cheers,

Ryan

--
Ryan Kelly
http://www.rfk.id.au | This message is digitally signed. Please visit
ryan(a)rfk.id.au | http://www.rfk.id.au/ramblings/gpg/ for details

From: CM on
On Feb 18, 7:19 pm, Ryan Kelly <r...(a)rfk.id.au> wrote:
> On Thu, 2010-02-18 at 07:46 -0800, T wrote:
> > I have a Python app which I converted to an EXE (all files separate;
> > single EXE didn't work properly) via py2exe - I plan on distributing
> > this and would like the ability to remotely upgrade the program (for
> > example, via HTTP/HTTPS).   Looks like it's not just the EXE that I
> > will need need to replace (DLLs, the library.zip, etc.).  What would
> > be the best way to go about doing this?
>
> I've been working on an auto-update framework for my own frozen apps,
> you might find it useful:
>
>  http://pypi.python.org/pypi/esky
>
> Docs are a little scarce at the moment, the next release will hopefully
> come with a short tutorial (as well as support for cx_freeze and maybe
> py2app, depending on how adventurous I'm feeling).
>
>   Cheers,
>
>      Ryan


This looks pretty interesting and useful.

Just to help me understand it a bit more: what is it that users will
download from some web page in order to initially get the py2exe'd app
on their system? Is it "really" an "esky", with the app's .exe file
inside it (but the esky is named the same as the app)? And then when
they want to update, the app's code calls the esky class to do the
work of swapping out the appropriate .exe file? Something like this?
Sorry if I am confused as to how this works.

Would this also work if one used InnoSetup to install the exe on the
user's system?

Thanks,
Che

From: T on
On Feb 18, 7:19 pm, Ryan Kelly <r...(a)rfk.id.au> wrote:
> On Thu, 2010-02-18 at 07:46 -0800, T wrote:
> > I have a Python app which I converted to an EXE (all files separate;
> > single EXE didn't work properly) via py2exe - I plan on distributing
> > this and would like the ability to remotely upgrade the program (for
> > example, via HTTP/HTTPS).   Looks like it's not just the EXE that I
> > will need need to replace (DLLs, the library.zip, etc.).  What would
> > be the best way to go about doing this?
>
> I've been working on an auto-update framework for my own frozen apps,
> you might find it useful:
>
>  http://pypi.python.org/pypi/esky
>
> Docs are a little scarce at the moment, the next release will hopefully
> come with a short tutorial (as well as support for cx_freeze and maybe
> py2app, depending on how adventurous I'm feeling).
>
>   Cheers,
>
>      Ryan
>
> --
> Ryan Kellyhttp://www.rfk.id.au |  This message is digitally signed. Please visit
> r...(a)rfk.id.au        |  http://www.rfk.id.au/ramblings/gpg/for details
>
>  signature.asc
> < 1KViewDownload

Thanks Ryan..this looks like it could be what I'm looking for, but I'm
still a bit unsure of how exactly how it works. Do you happen to have
an idea approx when the next release w/ tutorial will be out?
From: Ryan Kelly on
On Thu, 2010-02-18 at 20:32 -0800, CM wrote:
> On Feb 18, 7:19 pm, Ryan Kelly <r...(a)rfk.id.au> wrote:
> > On Thu, 2010-02-18 at 07:46 -0800, T wrote:
> > > I have a Python app which I converted to an EXE (all files separate;
> > > single EXE didn't work properly) via py2exe - I plan on distributing
> > > this and would like the ability to remotely upgrade the program (for
> > > example, via HTTP/HTTPS). Looks like it's not just the EXE that I
> > > will need need to replace (DLLs, the library.zip, etc.). What would
> > > be the best way to go about doing this?
> >
> > I've been working on an auto-update framework for my own frozen apps,
> > you might find it useful:
> >
> > http://pypi.python.org/pypi/esky
> >
>
>
> This looks pretty interesting and useful.

Thanks :-)

> Just to help me understand it a bit more: what is it that users will
> download from some web page in order to initially get the py2exe'd app
> on their system? Is it "really" an "esky", with the app's .exe file
> inside it (but the esky is named the same as the app)?

Currently, it's just a zip file with the frozen app in it, which the
user unzips to wherever they want the app. When unzipped it looks like
this:

myapp.exe <-- actually the esky bootstrap exe
myapp-X.Y.Z.win32/
myapp.exe <-- the actual frozen app as produced by py2exe
python26.dll
...etc...

This could easily be wrapped in an installer - the important thing is
just that the files end up on the user's machine in the expected
directory structure.

> And then when
> they want to update, the app's code calls the esky class to do the
> work of swapping out the appropriate .exe file? Something like this?

Yes. The idea of having a "bootstrapping exe" is that actual
application code can be swapped out without having to overwrite the
executable file. As long as you don't change python versions, this
allows updates to be safe against system crashes, even on platforms
without atomic file replacement.

So the frozen app does this in a background thread:

Esky(sys.executable,"http://my.updates.com").auto_update()

And it hits the given url, grabs the latest zipfile, downloads and
unpacks and atomically places it into the application directory. Et
viola, your app is at the latest version.

From the packager's point of view, you run the "bdist_esky" distutils
command to generate the zipfile containing your latest version, then
simply upload it to your server.

> Would this also work if one used InnoSetup to install the exe on the
> user's system?

Yes, absolutely - in fact I plan to do this myself at some stage. All
that's required is that the files end up in the expected directory
structure.


Ryan


--
Ryan Kelly
http://www.rfk.id.au | This message is digitally signed. Please visit
ryan(a)rfk.id.au | http://www.rfk.id.au/ramblings/gpg/ for details