Windows distribution suggestions?

Serge Orlov Serge.Orlov at gmail.com
Tue May 17 11:11:28 EDT 2005


Timothy Smith wrote:
> Ivan Voras wrote:
>
> >Paul Rubin wrote:
> >
> >
> >
> >>>your active code is then in some library.zip shared between the
> >>>three, and you need never change alice.exe, bob.exe, and carol.exe
> >>>
> >>>
> >>I think I understand what you're saying and it sounds like a very
> >>good idea.  Thanks.
> >>
> >>
> >
> >One thing about updating files - sorry if I'm stating general and
> >universal knowledge, but beware that on Windows you can't delete
and/or
> >replace a file if it's opened by any process.
> >
> >
> hence i found you must do this immediately after updating
>
> sys.path_importer_cache.clear()
> zipimport._zip_directory_cache.clear()
>
> then unload your app

I don't think it's a good idea to update files of a running
application. It's better to copy the current version into
another directory and after successful update switch over
to the new version.

Dirs during update:
c:\program files\mysoftware\current
c:\program files\mysoftware\latest

post update
c:\program files\mysoftware\previous
c:\program files\mysoftware\current

The advantage of the approach of keeping the previous version
is that your customers can always switch back to the previous
version even if the network is not available or your update
server is down. It's like an undo button. If the users know that
they can easily downgrade, they will more willing to upgrade.

  Serge.




More information about the Python-list mailing list