From f92b631fc873a48fb8fa9950ace719003e7bc145 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Fri, 3 Mar 2023 17:19:40 +0530 Subject: Admin Privilege --- requirements.txt | 2 ++ src/main/python/mainApp.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 14e451a..8183dcf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,5 @@ pyqtgraph==0.10.0 pandas==1.0.1 numpy==1.17.3 PyQt5==5.15.1 +pyuac +pywin32 diff --git a/src/main/python/mainApp.py b/src/main/python/mainApp.py index d278f83..a2869b0 100644 --- a/src/main/python/mainApp.py +++ b/src/main/python/mainApp.py @@ -5,6 +5,7 @@ import ctypes import sys import datetime from functools import partial +import pyuac current = os.path.dirname(os.path.realpath(__file__)) parentPath = os.path.dirname(current) @@ -410,4 +411,7 @@ def main(): if __name__ == '__main__': - main() + if not pyuac.isUserAdmin(): + pyuac.runAsAdmin() + else: + main() -- cgit