Skip to content

Commit

Permalink
added self-updating capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Apr 3, 2016
1 parent f069f44 commit a7dcc22
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
18 changes: 17 additions & 1 deletion BlenderUpdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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_
Expand All @@ -113,7 +128,8 @@ def about(self):
Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0"><span style=" text-decoration:\
underline; color:#2980b9;">Apache 2.0 license</span></a></p><p>Project home: \
<a href="https://github.com/tobkum/BlenderUpdater"><span style=" text-decoration:\
underline; color:#2980b9;">https://github.com/tobkum/BlenderUpdater</a></p></body></html>'
underline; color:#2980b9;">https://github.com/tobkum/BlenderUpdater</a></p> \
Application version: ' + appversion + '</body></html>'
QtGui.QMessageBox.about(self, 'About', aboutText)

def check_dir(self):
Expand Down
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import sys
from esky import bdist_esky
from distutils.core import setup
from esky.bdist_esky import Executable


setup(
name = 'BlenderUpdater',
version = '0.4',
options = {"bdist_esky": {
"freezer_module":"cxfreeze"
}},
scripts = [Executable('BlenderUpdater.py', gui_only=True)],)

0 comments on commit a7dcc22

Please sign in to comment.