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) が利用できない場合、更新は失敗します。
私が期待する動作は、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 の質問です。ご覧いただきありがとうございます(;_;)