This commit is contained in:
BarsTiger
2022-01-31 18:52:56 +02:00
parent d3a82cc44a
commit d71cbb8337
5 changed files with 54 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
cd ..
pip install -r requirements.txt
pyinstaller --noconfirm --icon "img/icon.ico" --onefile --console "horsy_updater.py"
rmdir /s /q __pycache__
del horsy_updater.spec

View File

@@ -0,0 +1,7 @@
cd ..
pip install -r requirements.txt
rmdir /s /q build
pyinstaller --noconfirm --icon "img/icon.ico" --onefile --console "horsy_updater.py"
rmdir /s /q __pycache__
del horsy_updater.spec
rmdir /s /q build

View File

@@ -3,6 +3,7 @@ import os
os.system("xcopy /s /Y dist\horsy.exe bin\horsy.exe*")
os.system("xcopy /s /Y dist\horsygui.exe bin\horsygui.exe*")
os.system("xcopy /s /Y dist\horsy_installer.exe bin\installer-horsy-win.exe*")
os.system("xcopy /s /Y dist\horsy_updater.exe bin\horsy_updater.exe*")
with open("web_vars/version", "r") as f_r:
version = f_r.readline()

View File

@@ -188,7 +188,7 @@ def install():
ui.logs_box.append("Adding task to download horsygui")
threads.append(threading.Thread(target=urllib.request.urlretrieve,
args=("https://github.com/BarsTiger/horsy/raw/master/bin/horsygui.exe",
os.path.join(path_to_install) + '/horsy.exe'), ))
os.path.join(path_to_install) + '/horsygui.exe'), ))
try:
ui.logs_box.append("Starting tasks")
for thread in threads:

View File

@@ -0,0 +1,40 @@
import argparse
import urllib.request
import threading
import ctypes
import sys
import os
parser = argparse.ArgumentParser(description='horsy updater')
parser.add_argument('option', nargs='?')
args = parser.parse_args()
option = args.option
path_to_install = os.popen('echo %HORSYPATH%').read().replace('\n', '') # Get installation folder
if not os.path.exists(path_to_install):
os.makedirs(path_to_install)
if not os.path.exists(path_to_install + "\\apps"):
os.makedirs(path_to_install + "\\apps")
threads = list()
threads.append(threading.Thread(target=urllib.request.urlretrieve,
args=("https://github.com/BarsTiger/horsy/raw/master/bin/horsy.exe",
os.path.join(path_to_install) + '/horsy.exe'), ))
if os.path.exists(path_to_install + '/horsygui.exe'):
threads.append(threading.Thread(target=urllib.request.urlretrieve,
args=("https://github.com/BarsTiger/horsy/raw/master/bin/horsygui.exe",
os.path.join(path_to_install) + '/horsygui.exe'), ))
try:
for thread in threads:
thread.start()
except:
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1)
sys.exit()
urllib.request.urlretrieve("https://github.com/BarsTiger/horsy/raw/master/web_vars/version",
os.path.join(path_to_install) + '/apps/version')
for thread in threads:
thread.join()
os.system(option)