desktop_app/main.py
2025-09-09 18:08:46 +03:00

27 lines
856 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QIcon
from app.controllers.main_controller import MainController
import sys
import ctypes
def is_admin():
"""Проверяет, запущена ли программа с правами администратора"""
try:
return ctypes.windll.shell32.IsUserAnAdmin()
except:
return False
def main():
app = QApplication(sys.argv)
app.setWindowIcon(QIcon("app/icons/logo3.png"))
controller = MainController()
controller.show()
sys.exit(app.exec())
if __name__ == "__main__":
# if not is_admin():
# # Попытка перезапуска с правами администратора
# ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1)
# sys.exit()
main()