howto py2exe/py2app for self updating application

Discussion in 'Python' started by SPE - Stani's Python Editor, Apr 22, 2006.

  1. Hi,

    I'm creating a GUI program
    with wxPython which will be distributed for Mac and Windows. The
    audience of the program is not technical at all (eg they've never
    heard about Python yet ;-), so everything should go automatically. The
    program should be able to update itself and to update its database
    (collection of .txt files). These are two separated things and don't
    happen simultaneously. I thought of the following:

    - seperate the code which will be updated and zip it to use a zipimport
    - zip the .txt files

    These files can then be downloaded (urllib or so) and if the download
    has completed succesfully, replace their old files. For the updated
    python code it is necessary to restart the program for the database
    not.

    These questions arise:

    ++ How can I bundle a zipimport file with py2exe/py2app? Let say this
    is the
    folder layout of the program:
    application.py
    code.zip (contains main.py, ui.py, etc..) *
    data.zip (contains .txt files) *
    other files (preferably bundled but not necessary) such as the
    wxPython libraries and whatever py2app will want to include

    (* means should be remote updatable/synchronizable)

    application.py is just a dummy file which calls code.main.main()

    Should I declare code.zip as a data file or as a python package?

    Of course it would be nice if someone be so kind to suggest a simple
    setup.py recipee for this...

    ++ I have Python2.4, wxPython2.6.3, OS X 10.4 Will it run on other
    versions of OS X? If not will a version compiled with py2app on OS X
    10.3 run on
    OS X 10.4 or do I need to provide a file for every OS X version?

    ++ Do I have to declare something special for py2app and wxPython?

    Thanks in advance,

    Stani

    PS Please cc your answer to spe.stani.be IatI gmail.com
     
    SPE - Stani's Python Editor, Apr 22, 2006
    #1
    1. Advertising

  2. SPE - Stani's Python Editor

    Guest

    of course!
    your can be carefully if you do it.
    but why you ask some here ? in http://www.python.org completly a module
    for your problem
    look and try again!

    [roRoNoaZoro]
     
    , Apr 22, 2006
    #2
    1. Advertising

  3. Can you be more specific? Which module do you mean at python.org?

    Stani
     
    SPE - Stani's Python Editor, Apr 22, 2006
    #3
  4. SPE - Stani's Python Editor

    Tony Meyer Guest

    > I'm creating a GUI program
    > with wxPython which will be distributed for Mac and Windows.

    [...]
    > The program should be able to update itself

    [...]

    By default, py2exe puts all the .pyc files used in a zip file. The
    simplest way to do this it let py2exe do what it normally does. Code
    all of the .py files as you would when running from source (i.e.
    you'll never explicitly use zipimport).

    To update, you then:

    1. Download the new .pyc files.
    2. Expand (use ZipFile) the existing py2exe zip.
    3. Replace the old .pyc files with the new ones.
    4. Rezip (use ZipFile) the .pyc files.
    5. Replace the old py2xe zip with the one containing the new files.
    6. Restart the program.

    This works (I use a more sophisticated version of this) well with
    py2exe. I haven't used py2app at all, but if it works much like
    py2exe, then all of the above still applies (certainly the steps are
    platform-agnostic).

    =Tony.Meyer
     
    Tony Meyer, Apr 23, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ralf W. Grosse-Kunstleve
    Replies:
    16
    Views:
    586
    Lonnie Princehouse
    Jul 11, 2005
  2. Ralf W. Grosse-Kunstleve
    Replies:
    18
    Views:
    599
    Bengt Richter
    Jul 11, 2005
  3. Ralf W. Grosse-Kunstleve
    Replies:
    2
    Views:
    404
    Dan Sommers
    Jul 12, 2005
  4. falcon
    Replies:
    0
    Views:
    379
    falcon
    Jul 31, 2005
  5. Bart Kastermans
    Replies:
    6
    Views:
    407
    Bart Kastermans
    Jul 13, 2008
Loading...

Share This Page