diff --git a/Framework/install_handler/long_poll_handler.py b/Framework/install_handler/long_poll_handler.py index 6a2432f4..87882fa0 100644 --- a/Framework/install_handler/long_poll_handler.py +++ b/Framework/install_handler/long_poll_handler.py @@ -276,6 +276,12 @@ async def on_message(self, message: Response) -> None: } ) elif action == "group_install": + + user_password = "" + if message.value.item: + user_password = ( + getattr(message.value.item, "user_password", "") or "" + ) await send_response( { "action": "group_install", @@ -294,7 +300,14 @@ async def on_message(self, message: Response) -> None: if i["install_function"] ] for func in functions: - await func() + # Check if function accepts parameters + sig = inspect.signature(func) + if len(sig.parameters) > 0: + # Function accepts parameters, pass user_password + await func(user_password) + else: + # Function doesn't accept parameters, call without (backward compatibility) + await func() await send_response( { "action": "group_install", diff --git a/Framework/install_handler/route.py b/Framework/install_handler/route.py index 2a228893..802cde65 100644 --- a/Framework/install_handler/route.py +++ b/Framework/install_handler/route.py @@ -110,7 +110,7 @@ "os": ["darwin"], "status_function": xcode.check_status, "install_function": xcode.install, - "user_password": "yes", + "user_password": True, }, { "name": "Simulator", @@ -121,7 +121,7 @@ "os": ["darwin"], "status_function": simulator.check_status, "install_function": simulator.install, - "user_password": "yes", + "user_password": True, }, ], }, @@ -167,7 +167,7 @@ "os": ["windows", "linux", "darwin"], "status_function": mozilla.check_status, "install_function": mozilla.install, - "user_password": False, + "user_password": True, }, { "name": "Edge", @@ -178,7 +178,7 @@ "os": ["windows", "linux", "darwin"], "status_function": edge.check_status, "install_function": edge.install, - "user_password": "yes", + "user_password": True, }, ], }, @@ -198,7 +198,7 @@ "os": ["darwin"], "status_function": macos_xcode.check_status, "install_function": macos_xcode.install, - "user_password": "yes", + "user_password": True, } ], }, @@ -219,7 +219,7 @@ "os": ["windows"], "status_function": inspector.check_status, "install_function": inspector.install, - "user_password": "no", + "user_password": False, } ], }, diff --git a/Framework/install_handler/web/edge.py b/Framework/install_handler/web/edge.py index 622349cc..2e8589f6 100644 --- a/Framework/install_handler/web/edge.py +++ b/Framework/install_handler/web/edge.py @@ -679,6 +679,7 @@ async def _verify_edge_installation(): async def install(user_password: str = "") -> bool: + """Main function to install Microsoft Edge""" print("[installer][web-edge] Installing Microsoft Edge...")