OSDN Git Service

nvda_slave: launchNVDA action: Use ShellExecute to launch NVDA. release-2010.2beta1
authorJames Teh <jamie@jantrid.net>
Tue, 14 Sep 2010 03:24:47 +0000 (13:24 +1000)
committerJames Teh <jamie@jantrid.net>
Tue, 14 Sep 2010 03:24:47 +0000 (13:24 +1000)
This is necessary because when NVDA is built with uiAccess enabled, it is an elevated process and must be launched by the shell. Attempting to launch it otherwise fails.
Fixes the NVDA desktop shortcut and shortcut key for uiAccess builds.

source/nvda_slave.pyw

index 682a9ca..6e77b86 100755 (executable)
@@ -21,7 +21,12 @@ def main():
                        nvda_service.nvdaLauncher()\r
                elif action=="launchNVDA":\r
                        import subprocess\r
-                       subprocess.Popen([r"%s\nvda.exe"%sys.exec_prefix]+args)\r
+                       import shellapi\r
+                       import winUser\r
+                       shellapi.ShellExecute(0,None,\r
+                               ur"%s\nvda.exe"%sys.exec_prefix.decode("mbcs"),\r
+                               subprocess.list2cmdline(args).decode("mbcs"),\r
+                               None,winUser.SW_SHOWNORMAL)\r
                elif action=="setNvdaSystemConfig":\r
                        import config\r
                        config._setSystemConfig(args[0])\r