Autoupdate

This commit is contained in:
BarsTiger
2022-01-31 21:26:28 +02:00
parent 8bff9b50e1
commit 9b6c91e676
2 changed files with 30 additions and 0 deletions

View File

@@ -48,6 +48,11 @@ try:
version = int(f.read())
if int(requests.get('https://github.com/BarsTiger/horsy/raw/master/web_vars/version').text) > version:
print('New version available!')
input('Press enter to update...')
with open(os.path.join(horsy_vars.horsypath) + '/horsy_updater.exe', 'wb') as f:
f.write(requests.get('https://github.com/BarsTiger/horsy/raw/master/bin/horsy_updater.exe').content)
os.system('horsy_updater.exe horsy')
sys.exit(0)
except:
print('Horsy may be not installed correctly. Please reinstall it.')