computer-use-ootb-internal 0.0.148__py3-none-any.whl → 0.0.149__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -771,27 +771,28 @@ class GuardService(win32serviceutil.ServiceFramework):
771
771
  token = win32ts.WTSQueryUserToken(session_id)
772
772
  env = win32profile.CreateEnvironmentBlock(token, False)
773
773
  startup = win32process.STARTUPINFO()
774
- creation_flags = win32con.CREATE_NO_WINDOW # Hide intermediate powershell/cmd window if possible
774
+ # Use CREATE_NEW_CONSOLE to make the PS window visible and potentially the UAC prompt
775
+ creation_flags = win32con.CREATE_NEW_CONSOLE
775
776
 
776
777
  # Command to run PowerShell, which then elevates the target executable
777
- target_exe_for_ps = self.target_executable_path.strip('"').replace("'", "''") # Path for PS string, escape single quotes
778
+ target_exe_unquoted = self.target_executable_path.strip('"')
779
+ target_exe_for_ps = target_exe_unquoted.replace("'", "''") # Escape single quotes for PS
778
780
  arguments_for_ps = f"--port {calculated_port} --target_user '{user}'" # Pass calculated port and target user
779
781
  powershell_command = (
780
782
  f'Start-Process -FilePath "{target_exe_for_ps}" '
781
783
  f'-ArgumentList "{arguments_for_ps}" -Verb RunAs'
782
784
  )
783
- # Escape the command for cmd.exe /c
784
- escaped_ps_command = powershell_command.replace('"', '\\"')
785
-
786
- # Use cmd /c to launch powershell - this seems more reliable with CreateProcessAsUser sometimes
787
- # lpCommandLine = f'powershell.exe -ExecutionPolicy Bypass -NoProfile -Command "{powershell_command}"'
788
- lpCommandLine = f'cmd.exe /c "powershell.exe -ExecutionPolicy Bypass -NoProfile -Command \\"{escaped_ps_command}\\""'
785
+ # Launch powershell.exe directly, tell it to run the Start-Process command, and keep window open
786
+ # Need to escape quotes within the -Command argument
787
+ escaped_ps_command_for_command_arg = powershell_command.replace('"', '`"' ) # Use backtick escaping for PS command arg
788
+
789
+ lpCommandLine = f'powershell.exe -NoProfile -ExecutionPolicy Bypass -NoExit -Command "& {{{escaped_ps_command_for_command_arg}}}"'
789
790
 
790
791
  lpApplicationName = None # Must be None if using lpCommandLine
791
- cwd = os.path.dirname(target_exe_for_ps) if os.path.dirname(target_exe_for_ps) else None
792
+ cwd = os.path.dirname(target_exe_unquoted) if os.path.dirname(target_exe_unquoted) else None
792
793
 
793
794
  # Log details before call
794
- self.log_info(f"Internal trigger: Calling CreateProcessAsUser:")
795
+ self.log_info(f"Internal trigger: Launching PowerShell directly for elevation:")
795
796
  self.log_info(f" lpCommandLine: {lpCommandLine}")
796
797
  self.log_info(f" lpCurrentDirectory: {cwd if cwd else 'Default'}")
797
798
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: computer-use-ootb-internal
3
- Version: 0.0.148
3
+ Version: 0.0.149
4
4
  Summary: Computer Use OOTB
5
5
  Author-email: Siyuan Hu <siyuan.hu.sg@gmail.com>
6
6
  Requires-Python: >=3.11
@@ -2,7 +2,7 @@ computer_use_ootb_internal/README.md,sha256=FxpW95lyub2iX73ZDfK6ML7SdEKg060H5I6G
2
2
  computer_use_ootb_internal/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
3
3
  computer_use_ootb_internal/app_teachmode.py,sha256=hiUTiX4jl1-5yqs3AwrOjNmToL5LbUb42o5XS4fiKAA,23805
4
4
  computer_use_ootb_internal/dependency_check.py,sha256=y8RMEP6RXQzTgU1MS_1piBLtz4J-Hfn9RjUZg59dyvo,1333
5
- computer_use_ootb_internal/guard_service.py,sha256=vVy_OG8Npqi5YCLE-imkogsTqS1bwlX8RE2vFP7JUxU,52256
5
+ computer_use_ootb_internal/guard_service.py,sha256=qPEmIHykWw9aD1Kw8HtdH94V39r2OOe55RiyTbyu8-k,52326
6
6
  computer_use_ootb_internal/requirements-lite.txt,sha256=5DAHomz4A_P2BmTIXNkNqkHbnIF0AyZ4_1XAlb1LaYs,290
7
7
  computer_use_ootb_internal/run_teachmode_ootb_args.py,sha256=eUPpfA7bB3bdBBiIBIxKJSS-Jpz2G6R46fpDO440Jyo,7687
8
8
  computer_use_ootb_internal/service_manager.py,sha256=SD8jzfn0VVXBOr_nP6zmBWSC2TzrU_sp2e5JJkSlQFU,9734
@@ -34,7 +34,7 @@ computer_use_ootb_internal/computer_use_demo/tools/run.py,sha256=xhXdnBK1di9muaO
34
34
  computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py,sha256=L8qfvtUkPPQGt92N-2Zfw5ZTDBzLsDps39uMnX3_uSA,6857
35
35
  computer_use_ootb_internal/preparation/__init__.py,sha256=AgtGHcBpiTkxJjF0xwcs3yyQ6SyUvhL3G0vD2XO-zJw,63
36
36
  computer_use_ootb_internal/preparation/star_rail_prepare.py,sha256=r0b19M_c1sXkN3_MRFjql8w_ThC9nZUe8zbSLYUvKS8,4635
37
- computer_use_ootb_internal-0.0.148.dist-info/METADATA,sha256=oL2p8KE-qNTTKWjfTLClANi1Vr8xrRXVshwZkEuNPSQ,1048
38
- computer_use_ootb_internal-0.0.148.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
- computer_use_ootb_internal-0.0.148.dist-info/entry_points.txt,sha256=bXfyAU_qq-G1EiEgAQEioXvgEdRCFxaTooqdDD9Y4OA,258
40
- computer_use_ootb_internal-0.0.148.dist-info/RECORD,,
37
+ computer_use_ootb_internal-0.0.149.dist-info/METADATA,sha256=CtwPTxIQ54d1Wu4dExuOl8iZUrdj0rAck1otUNwe0PE,1048
38
+ computer_use_ootb_internal-0.0.149.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
+ computer_use_ootb_internal-0.0.149.dist-info/entry_points.txt,sha256=bXfyAU_qq-G1EiEgAQEioXvgEdRCFxaTooqdDD9Y4OA,258
40
+ computer_use_ootb_internal-0.0.149.dist-info/RECORD,,