【发布时间】:2016-02-13 18:27:03
【问题描述】:
我正在尝试使用Esky 差异补丁自动更新,但我无法让应用程序通过仅这些差异补丁进行更新。似乎总是需要完整版本才能正确更新。
因此,如果我在更新服务器中有 0.1 版和补丁以及最高 0.3 的完整文件版本,客户端应用程序将获取两个补丁和完整的最新版本文件:
updatesServer/
App-0.1.win32.zip (client version running)
App-0.2.win32.zip (this isn't fetched)
App-0.2.win32.from-0.1.patch (this is fetched first)
App-0.3.win32.zip (this is fetched third)
App-0.3.win32.from-0.2.patch (this is fetched second)
另外,如果最新版本不可用(本例中为 App-0.3.win32.zip),更新将失败。
behavior 我希望 Esky 能够获取补丁文件并进行更新,同时忽略其他可用的完整文件版本,因此更新速度非常快。有没有办法做到这一点?
环境信息:我使用的冰箱是 cx_freeze,我的 Python 版本是 3.4。
更新例程代码:
from esky import *
from esky.util import appexe_from_executable
def restart_this_app():
appexe = appexe_from_executable(sys.executable)
os.execv(appexe,[appexe] + sys.argv[1:])
if hasattr(sys, "frozen"):
app = esky.Esky(sys.executable, UPDATES_URL)
print("You are running version "+app.active_version)
print("Looking for updates...")
if app.find_update() is None:
print("No updates have been found.")
else:
print("Updates available. Updating...")
try:
app.auto_update()
except Exception as e:
print("Error while updating:", e)
else:
print("Update complete.")
print("Restarting app...")
time.sleep(3)
restart_this_app()
顺便说一句,这是我的第一个 StackOverflow 问题。感谢您查看它;)
【问题讨论】:
标签: esky