Creating shortcuts in installer
This commit is contained in:
@@ -6,6 +6,9 @@ import urllib.request
|
|||||||
import os
|
import os
|
||||||
import threading
|
import threading
|
||||||
import ctypes
|
import ctypes
|
||||||
|
import winshell
|
||||||
|
from win32com.client import Dispatch
|
||||||
|
import pythoncom
|
||||||
|
|
||||||
|
|
||||||
class Ui_MainWindow(object):
|
class Ui_MainWindow(object):
|
||||||
@@ -209,6 +212,20 @@ def install():
|
|||||||
for thread in threads:
|
for thread in threads:
|
||||||
thread.join()
|
thread.join()
|
||||||
ui.logs_box.append("Downloading finished")
|
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")
|
ui.logs_box.append("Installation complete")
|
||||||
|
|
||||||
threading.Thread(target=wait_for_finish).start()
|
threading.Thread(target=wait_for_finish).start()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import requests
|
import requests
|
||||||
import modules.gui as gui
|
import modules.gui as gui
|
||||||
import threading
|
import threading
|
||||||
from modules.auth import del_auth
|
from modules.auth import del_auth, get_auth
|
||||||
import modules.vars as horsy_vars
|
import modules.vars as horsy_vars
|
||||||
import json
|
import json
|
||||||
from PyQt5 import QtWidgets
|
from PyQt5 import QtWidgets
|
||||||
@@ -40,6 +40,9 @@ def change(oldpass, newpass):
|
|||||||
|
|
||||||
elif r == '':
|
elif r == '':
|
||||||
gui.popup('Success', 'Success, your password has been changed')
|
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:
|
else:
|
||||||
print('[red]Unknown error, please try again[/red]')
|
print('[red]Unknown error, please try again[/red]')
|
||||||
|
|||||||
@@ -6,3 +6,4 @@ tqdm
|
|||||||
algoliasearch
|
algoliasearch
|
||||||
PyQt5
|
PyQt5
|
||||||
easygui
|
easygui
|
||||||
|
winshell
|
||||||
Reference in New Issue
Block a user