Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
556 views
in Technique[技术] by (71.8m points)

py2exe - Auto updating a python executable generated with pyinstaller

I have a desktop app that I'm working on and I am using PyInstaller to generate de distribution files.

I have chosen PyInstaller over py2exe because it is very easy to use and I don't need to care about windows dlls, but when I use py2exe I can simply use Esky to autoupdate, but I can't use it with PyInstaller.

So I don't know how to start a auto-updating application. Someone have some thoughts or just know how can I use PyInstaller and esky?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can create a launcher application for your main application and add all the update logic there. The launcher application does the following:

Displays a pop up (this gives a quick feedback to the user that the program is loading)

Checks the local and repository versions

if local < remote (say v1.0 < v2.0) then:

.... Check at the remote repository for the existence of an updater application called updater_v2.0.exe.

........ If there is one: download it run it and exit. (see bellow)

........ If there is not: download the latest main application exe and replace the local one (beware of file access rights at this step -- you're trying to write to c:program files).

if local > remote then:

.... Display an error/warning except if this is a developers workstation (you need a setting for this)

Start up the main application.

The purpose of the updater application is to accommodate cases where fetching a fresh main application exe is not enough. I also use it in order to update the launcher application itself (that's why the launcher is exiting as soon as it runs the updater - BTW give windows a bit of time before trying to overwrite the laucher executable)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...