From 3aeb22bca8c58e3b7c677dd148293b211cc19e5b Mon Sep 17 00:00:00 2001 From: Maximilian Glas <954299+esride-mag@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:51:22 +0200 Subject: [PATCH] Update win32serviceutil.py Fixes the problem that a user is not sufficiently authorized to write to the registry (Access is denied error). There is no need to access the registry with full rights requested. We only need Read Access. --- lib/x32/win32/lib/win32serviceutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/x32/win32/lib/win32serviceutil.py b/lib/x32/win32/lib/win32serviceutil.py index 9ffabed..e47ecb6 100755 --- a/lib/x32/win32/lib/win32serviceutil.py +++ b/lib/x32/win32/lib/win32serviceutil.py @@ -83,7 +83,7 @@ def SmartOpenService(hscm, name, access): def LocateSpecificServiceExe(serviceName): # Given the name of a specific service, return the .EXE name _it_ uses # (which may or may not be the Python Service EXE - hkey = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\%s" % (serviceName), 0, win32con.KEY_ALL_ACCESS) + hkey = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\%s" % (serviceName), 0, win32con.KEY_READ) try: return win32api.RegQueryValueEx(hkey, "ImagePath")[0] finally: