From: Eric Ries <ericries@sp...> - 2005-03-22 21:57:42
Hey that is very exciting. I was wondering where the boot script lived. I=
'd like to be able to use standard python modules like urllib2 in the boo=
t script. It's my understanding that those modules would live in library.=
zip - is there a way to specify an alternate load path for the boot scrip=
> -----Original Message-----
> From: Thomas Heller [mailto:theller@...]
> Sent: Tuesday, March 22, 2005 04:44 PM
> To: eric.ries@...
> Cc: py2exe-users@...
> Subject: Re: [Py2exe-users] py2exe auto-updater
> "Eric Ries" <eric.ries@...> writes:
> > Hello,
> > I'm a long time py2exe user and fan. This evening, I was pondering wh=
> > it would be possible and/or hard to modify py2exe to support automati=
> > updates to the pyhton code for my application. I would love any feedb=
> > the idea before I start hacking away.
> > Here's what I was imagining:
> > 1) py2exe supports an optional "update-url"
> > 2) when the py2exe script starts up, before it loads library.zip (or
> > equivalent), it first loads updater.zip, which contains the update lo=
> > 3) the updater.zip file checks the update-url (via urllib2) to see if=
> > library.zip is still the latest version, if so, returns
> > 4) if library.zip is no up-to-date, updater downloads the new one, re=
> > library.zip, then returns
> > 5) the py2exe script continues as normal
> > This approach is not optimal (it doesn't handle binary modules, for
> > example), but it would certainly handle a lot of the cases that I've =
> > work around so far. Usually I have to write a seperate "updater/launc=
> > app that does the update checking. It'd be so much more elegant to ha=
> > all in one exe.
> > I'm wondering if anything like this has been attempted or if there is=
> > of attempting it without modifying start.c - any suggestions?
> The natural place where such code should be injected is into the boot
> script. The boot script resides in the exe itself - not in the
> library.zip file. The boot script for a normal exe is taken from
> lib/site-packages/py2exe/boot_common.py - you can either change that or=
> try to subclass py2exe and supply your own, custom boot script.
> With some effort, your scheme could probably even work for binary
> modules, even if they are used by the current exe, if you allow to
> restart the exe at the end of the update process: On windows XP at
> least, although you cannot delete or overwrite in use dlls, you can
> rename them, download the new ones with the correct filename, and when
> your exe restarts it uses the new ones.