diff --git a/DMMGamePlayerFastLauncher.py b/DMMGamePlayerFastLauncher.py index 0a0f8b7..ec285c8 100644 --- a/DMMGamePlayerFastLauncher.py +++ b/DMMGamePlayerFastLauncher.py @@ -251,6 +251,7 @@ def run( elif self.non_request_admin: self.error_manager.error(error=ErrorManager.permission_error) else: + args = [f'"{arg}"' for arg in args] ctypes.windll.shell32.ShellExecuteW( None, "runas", args[0], " ".join(args[1:]), None, 1 ) diff --git a/Task.py b/Task.py index 05a2caf..3a63afc 100644 --- a/Task.py +++ b/Task.py @@ -7,11 +7,16 @@ for p in psutil.process_iter(attrs=("name", "pid", "cmdline")): if p.info["name"] != "DMMGamePlayerFastLauncher.exe": continue + cmdline = p.info["cmdline"] - if "--bypass-uac" in cmdline: - cmdline.remove("--bypass-uac") + if "--non-bypass-uac" not in cmdline: + cmdline.append("--non-bypass-uac") + cmdline = [f'"{cmd}"' for cmd in cmdline] os.kill(p.info["pid"], signal.SIGTERM) + print("killed " + " ".join(cmdline)) ctypes.windll.shell32.ShellExecuteW( None, "runas", cmdline[0], " ".join(cmdline[1:]), None, 1 ) break +else: + print("Error")