Ideas on self updating software?

J

Jaime Wyant

*long post alert!*

Can anyone give me some pointers on writing "self-updating" python
programs? I have an application that is almost ready for beta
testing. I want to be able to fix any bugs and push the updates out.

I have a *very vague* idea of how to attack this. The client will
have an auto-update feature that will hit the webserver via xml-rpc,
asking for updates. The server responds, sending back any updated
modules.

Ok. My first idea is to have *versions* of software tagged somehow.
A table (software_update -- not a permanent name, all I can come up
with right now :)) would exist with two columns:

version_number, updated_module

The first beta version of my software will be tagged 0.1. The first
load into my database would contain a row for each module. Assume I
only have 4 modules, named a, b, c and d:

The table (software_update) would contain the following rows:
0.1 a
0.1 b
0.1 c
0.1 d

Now, assume that later I update modules c, d and tag the module
verison 0.2. Now the table contains the following rows:
0.1 a
0.1 b
0.2 c
0.2 d

The idea is that the client sends the server its version. The server
queries software_update for all rows where version_number >
client_version_number. Then all modules are *pushed* down to the
client.

I realize that I'll have to worry about *duplicates* in revisions.
That is version 0.3 may also update module 'c'. I'll figure that out
later.

Okay, does this sound sound? =) Anyone have any other ideas on how
to tackle this?

jw
 
I

Istvan Albert

Jaime said:
Can anyone give me some pointers on writing "self-updating" python
programs? I have an application that is almost ready for beta
testing. I want to be able to fix any bugs and push the updates out.

Keep it simple. Write a separate application, called the updater
that can download and overwrite the existing modules.

During startup the application that needs to be updated could check
for new versions and ask the user to run the updater
if necessary.

It might save you a lot of trouble. And don't fool around with
databases, just download everything each time, zip it up if it is
too big.

Istvan.
 
J

Jorge Godoy

Jaime Wyant said:
Can anyone give me some pointers on writing "self-updating" python
programs? I have an application that is almost ready for beta
testing. I want to be able to fix any bugs and push the updates out.

You can try rsync'ing the differences from the installed software to
your reference repository. Or you can 'cvs update' it, or use any other
version management system.
I realize that I'll have to worry about *duplicates* in revisions.
That is version 0.3 may also update module 'c'. I'll figure that out
later.

Keep things simple. You can version each module independently and
create one with your systems version that is incremented each time an
update is applied. So, this version module will be constantly increased
and will show its version to your users when they ask for the version
running -- remember to make it the last update, in case something
fails... -- and the other modules will be updated independently.

I would go for the CVS approach: each file is independently versioned
and the product version is not limited or bound by the file version.
Okay, does this sound sound? =) Anyone have any other ideas on how
to tackle this?

rsync seems to be the simpler approach... ;-)


But, just issuing a warning about a new version seems to be the best
thing, leave the updates for the user (actually, to another application
activated by the user).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,206
Messages
2,571,069
Members
47,675
Latest member
RollandKna

Latest Threads

Top