Auto upgrade of compiled wxPython app is possible?

Hi,community!
I have a question that can be a little offtopic here.
So, sorry if it is.
Situation:
I've got compiled with py2exe wxPython GUI program.
It's ready to deploy on user computer.
What i need:
Some kind of automatic upgrade.
Let's suppose there is a brand new version of app.
Everytime, when the old version starts, it checks local network
and looks for the new version.
If it find something,then automatic upgrade must happens.
And old version replaces herself(or himself?) with the new one.
If someone have this problem in the past, i'd like to hear some hints.
Thanks in advance.

···

---
Igor. igor@tyumbit.ru

Maybe this gives you an idea:
There are a lot of tracebacks since it's a debug version.
build is a number I use for versions.
TransferProgress is a Progressbar derived class, you don't have to use.
You can replace the call to "gotChunk" with any "write" method of a file like
object.

    def fetchUpdate(self,build):
        from ftplib import FTP
        ftp=FTP('someplace.com')
        ftp.login()
        try:
            fn='ib_%s_%s.zip' % (sys.platform,build)
            sz=ftp.size(fn)
            if not sz:
                raise ValueError,"Zero Size"
            
            _trans=TransferProgress(self,'Download','Downloading %s' % fn, sz,
                                    chunk=8192,in_chunks=True,
                                    writer=open('ibupdate.zip', 'wb').write)
            ftp.retrbinary('RETR %s' % fn, _trans.gotChunk)
            ftp.close()
            _trans.Halt()
            file = zipfile.ZipFile('ibupdate.zip')
            dir=os.getcwd()
            for info in file.infolist():
                if info.filename[-1] != '/':
                    data = file.read(info.filename)
                    self.create_file(os.path.join(dir, info.filename), data)
            return True
        except:
            traceback.print_exc()
            ErrorDlg(self,"Error retrieving latest build")

        return False
            
    def create_file(self,pathname, data):
        print "Create File",pathname
        (head,tail)=os.path.split(pathname)
        (name,ext)=string.split(tail,'.')
        if ext=='exe' or ext=='dll':
            try:
                os.remove(head+os.sep+name+'old.'+ext)
            except:
                traceback.print_exc()
            try:
                os.rename(pathname,head+os.sep+name+'old.'+ext)
            except:
                traceback.print_exc()
        mkpath(os.path.dirname(pathname))
        file = open(pathname, "wb")
        file.write(data)
        file.close()

···

On Wednesday 17 September 2003 05:12 am, Igor Prischepoff wrote:

Hi,community!
I have a question that can be a little offtopic here.
So, sorry if it is.
Situation:
I've got compiled with py2exe wxPython GUI program.
It's ready to deploy on user computer.
What i need:
Some kind of automatic upgrade.
Let's suppose there is a brand new version of app.
Everytime, when the old version starts, it checks local network
and looks for the new version.
If it find something,then automatic upgrade must happens.
And old version replaces herself(or himself?) with the new one.
If someone have this problem in the past, i'd like to hear some hints.
Thanks in advance.
---
Igor. igor@tyumbit.ru

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

--
  UC

--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417