Distributing applications

Jaime Wyant programmer.py at gmail.com
Wed Mar 2 14:07:25 EST 2005


On 2 Mar 2005 10:43:38 -0800, Serge Orlov <Serge.Orlov at gmail.com> wrote:
> Jaime Wyant wrote:
> > I chose not to use py2exe because it made updating my app a bit
> > messier.  For instance, suppose I don't use the smtplib module in
> > version 1 of my software.  Py2exe realizes that and doesn't 'package'
> > smtplib with my executable.  Now, if I release version 1.1 which does
> > use smtplib, then I'd have to figure out how to get the updates out
> > without having the user redownload the entire application.  Granted,
> > I didn't put much thought into an update mechanism, but it seemed to
> > be messy at the time.
> 
> I don't follow you. How is that different compared to adding a module
> to your application? Let's say version 1.1 of your software has
> module1.py updated, module2.py added and it needs smtplib. You just
> bundle three compiled files and unpack them let's say to
> \program files\my software\module1.pyc
> \program files\my software\module2.pyc
> \program files\my software\python\smtplib.pyc
> 
> I don't see any mess.
> 

The way I *think* about it is this -->  To update my app, I only have
to download a new version of it... Being written in python, the app
itself is pretty small....

Suppose the following are true:
1) when the user installs my custom built python distribution they
also get version 1.0 of the app.
2) Suppose it is installed in c:\myapp (for simplicity).
3) I've just released version 1.1

Because *all* of the modules are in my custom built distribution, I
don't have to actively scan for new modules between releases.  So....
I can write a simple "updater" script that will:
1) download a new myapp.zip
2) remove the c:\myapp directory and its subdirs
3) unzip it to c:\myapp, overwriting what is there

After those three steps are complete, then my app is updated.  Super
simple.  All I have to do is "zip" up my application and post it to a
website somewhere...

IIRC, py2exe bundles things up in a .zip file.  So in order to update
a py2exe app i'd have to ->
1) check for new module dependencies
2) get the newly imported modules AND my newly updated modules back to
the client
3) update the zip file with the new modules.

This becomes especially hairy when someone is updating from 1.0 to say
1.5.  Then I have to keep track of all the deltas between 1.0/1.5.  My
way is much simpler because I don't have to keep up with *anything*. 
As long as I test my code against my custom built distribution, it
ought to JUST WORK.

I don't trust myself to keep up with anything ;).

However, if you have an idea on updating py2exe bundled apps, I'm all ears...

> >
> >If I have my own distribution, I can simply give the users an "update"
> > program that will query  my webserver which will download the latest
> > version for them automagically.  Because my distribution has all of
> > the modules already available, I don't have to worry about sending
> > them any missing modules.  Simply download the latest version of my
> > app and it works with my custom rolled distribution.
> >
> > But, this only works for Windows...
> 
> Why? As I understand "update" program was written by you, so what
> prevents it from working on other platforms besides testing?

Yes, but the *update* program runs in the context of my distribution
which is strictly bundled for windows.  Now, someone *could* build a
distributable version for Linux somehow (I guess) and then the update
techniques I mentioned would probably work there.

jw



More information about the Python-list mailing list