From 3a3508ebfdbb926dc4ec1308b96751cdd143ae57 Mon Sep 17 00:00:00 2001 From: BarsTiger Date: Fri, 28 Jan 2022 19:26:14 +0200 Subject: [PATCH] New .bat system --- horsy.py | 7 ++++++- horsy_updater.py | 0 modules/gui_manager.py | 4 +++- modules/manager.py | 4 +++- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 horsy_updater.py diff --git a/horsy.py b/horsy.py index fcc6d4e..498565b 100644 --- a/horsy.py +++ b/horsy.py @@ -1,7 +1,7 @@ import argparse import os import sys - +import requests import modules.tui as tui from modules.console import cls from modules.virustotal import add_to_cfg @@ -28,6 +28,11 @@ if not os.path.isfile(horsy_vars.horsypath + 'config.cfg'): with open(horsy_vars.horsypath + 'config.cfg', 'w') as f: f.write('{}') +# Checking version +with open(horsy_vars.horsypath + 'apps/version', 'r') as f: + version = f.read() + + # Displaying the logo os.system('title horsy') cls() diff --git a/horsy_updater.py b/horsy_updater.py new file mode 100644 index 0000000..e69de29 diff --git a/modules/gui_manager.py b/modules/gui_manager.py index 4f9f6c4..fdc44c6 100644 --- a/modules/gui_manager.py +++ b/modules/gui_manager.py @@ -122,7 +122,9 @@ def install(package): with open('{1}apps/{0}.bat'.format(r['name'], horsy_vars.horsypath), 'w') as f: f.write(f"@ECHO off\n") - f.write(f"{horsy_vars.horsypath}apps/{r['name']}/{r['run']} %*\n") + f.write(f"{horsy_vars.horsypath[0:2:1]}\n") + f.write(f"cd %horsypath%/apps/{r['name']}\n") + f.write(f"{r['run']} %*\n") def wait_for_success(): while success != 2: diff --git a/modules/manager.py b/modules/manager.py index 94c8900..da12cd9 100644 --- a/modules/manager.py +++ b/modules/manager.py @@ -114,7 +114,9 @@ def install(package, is_gui=False, UiDownloadWindow=None, ui_download=None): with open('{1}apps/{0}.bat'.format(r['name'], horsy_vars.horsypath), 'w') as f: f.write(f"@ECHO off\n") - f.write(f"{horsy_vars.horsypath}apps/{r['name']}/{r['run']} %*\n") + f.write(f"{horsy_vars.horsypath[0:2:1]}\n") + f.write(f"cd %horsypath%/apps/{r['name']}\n") + f.write(f"{r['run']} %*\n") print(f"[green][OK] All done![/]") print(f"[green]You can run your app by entering [italic white]{r['name']}[/] in terminal[/]")