Skip to content

Commit f656b1b

Browse files
authored
Update update.py
1 parent f810184 commit f656b1b

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/update.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from debug import debug_print
33

44
UPDATE_URL = 'https://raw.githubusercontent.com/rompelhd/AdminFreeExec/refs/heads/main/version'
5-
CURRENT_VERSION = '0.2.1'
5+
CURRENT_VERSION = '0.2.0'
66
LATEST_VERSION = None
77

88
def check_update_applicationfor_update():
@@ -24,3 +24,19 @@ def result_update():
2424

2525
def update_application():
2626
debug_print(f"Actualizando", "INFO")
27+
28+
URLUPD = "https://github.com/rompelhd/AdminFreeExec/releases/tag/v" + LATEST_VERSION
29+
response = requests.get(URLUPD)
30+
31+
if "AdminFreeExec.exe" in response.text:
32+
download_url = "https://github.com/rompelhd/AdminFreeExec/releases/download/v" + LATEST_VERSION + "/AdminFreeExec.exe"
33+
exe_response = requests.get(download_url)
34+
35+
if exe_response.status_code == 200:
36+
with open("AdminFreeExec.exe", "wb") as f:
37+
f.write(exe_response.content)
38+
debug_print("AdminFreeExec.exe descargado y sobrescrito", "INFO")
39+
else:
40+
debug_print("Error al descargar AdminFreeExec.exe", "ERROR")
41+
else:
42+
debug_print("AdminFreeExec.exe no encontrado", "WARNING")

0 commit comments

Comments
 (0)