Skip to content

Commit 0ae8d71

Browse files
committed
Update update_page.py
Remove old version directory Exit the program
1 parent 4a65cf3 commit 0ae8d71

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/gui/pages/update_page.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from ...libs.lib import CONFIG_FILE
1212

1313

14+
import logging
15+
1416
import logging
1517

1618
async def update_async(latest_release):
@@ -40,10 +42,14 @@ async def update_async(latest_release):
4042
shutil.move(exe_asset['name'], exe_path)
4143

4244

43-
# remove old directory
45+
# Rimuovere lavecchia cartella dell' applicazione
46+
shutil.rmtree(os.path.dirname(os.path.dirname(lib.resource_path(""))))
4447

4548
# Avvia l'applicazione aggiornata
4649
os.startfile(exe_path)
50+
51+
# Chiude la vecchia applicazione
52+
os._exit(0)
4753
else:
4854
error_message = "Nessun file exe trovato nella release più recente."
4955
logger.error(error_message)

0 commit comments

Comments
 (0)