diff --git a/BlenderUpdater.py b/BlenderUpdater.py index 69c5b38..276401c 100644 --- a/BlenderUpdater.py +++ b/BlenderUpdater.py @@ -27,8 +27,13 @@ import configparser import shutil from distutils.dir_util import copy_tree +from esky import * +from esky.util import appexe_from_executable + + +appversion = '0.4' dir_ = '' config = configparser.ConfigParser() btn = {} @@ -97,6 +102,16 @@ def __init__(self, parent=None): self.btn_about.clicked.connect(self.about) # connect About button self.btn_path.clicked.connect(self.select_path) # connect the path button + ''' Auto-update function''' + if hasattr(sys, "frozen"): + exe = esky.Esky(sys.executable, "http://www.overmind-studios.de/blenderupdater") + if exe.find_update(): + reply = QtGui.QMessageBox.question(self, 'Update', "New version of BlenderUpdater available. Do you want to update?", + QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No) + if reply == QtGui.QMessageBox.Yes: + exe.auto_update() + else: + pass def select_path(self): global dir_ @@ -113,7 +128,8 @@ def about(self): Licensed under the Apache 2.0 license
Project home: \ https://github.com/tobkum/BlenderUpdater