diff --git a/horsy_installer.py b/horsy_installer.py index ee4ec65..3877162 100644 --- a/horsy_installer.py +++ b/horsy_installer.py @@ -6,6 +6,9 @@ import urllib.request import os import threading import ctypes +import winshell +from win32com.client import Dispatch +import pythoncom class Ui_MainWindow(object): @@ -209,6 +212,20 @@ def install(): for thread in threads: thread.join() ui.logs_box.append("Downloading finished") + if ui.install_gui_check.isChecked(): + ui.logs_box.append("Creating shortcuts") + desktop = winshell.desktop() + path = os.path.join(desktop, "horsy GUI.lnk") + target = os.path.join(path_to_install) + '/horsygui.exe' + wDir = os.path.join(path_to_install) + icon = os.path.join(path_to_install) + '/horsygui.exe' + pythoncom.CoInitializeEx(0) + shell = Dispatch('WScript.Shell') + shortcut = shell.CreateShortCut(path) + shortcut.Targetpath = target + shortcut.WorkingDirectory = wDir + shortcut.IconLocation = icon + shortcut.save() ui.logs_box.append("Installation complete") threading.Thread(target=wait_for_finish).start() diff --git a/modules/change_password.py b/modules/change_password.py index e074778..a103bb1 100644 --- a/modules/change_password.py +++ b/modules/change_password.py @@ -1,7 +1,7 @@ import requests import modules.gui as gui import threading -from modules.auth import del_auth +from modules.auth import del_auth, get_auth import modules.vars as horsy_vars import json from PyQt5 import QtWidgets @@ -40,6 +40,9 @@ def change(oldpass, newpass): elif r == '': gui.popup('Success', 'Success, your password has been changed') + config['auth'] = {'email': config['auth']['email'], 'password': newpass} + with open(horsy_vars.horsypath + 'config.cfg', 'w') as f: + json.dump(config, f) else: print('[red]Unknown error, please try again[/red]') diff --git a/requirements.txt b/requirements.txt index 5f8a08a..86b8c64 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ Pyinstaller tqdm algoliasearch PyQt5 -easygui \ No newline at end of file +easygui +winshell \ No newline at end of file diff --git a/web_vars/version b/web_vars/version index 573541a..c227083 100644 --- a/web_vars/version +++ b/web_vars/version @@ -1 +1 @@ -0 +0 \ No newline at end of file