def execute(self, app_path, app_args, version, **kwargs):
multi_launchapp = self.parent<EOL>extra = multi_launchapp.get_setting("<STR_LIT>")<EOL>use_rez = False<EOL>if self.check_rez():<EOL><INDENT>from rez.resolved_context import ResolvedContext<EOL>from rez.config import config<EOL>config.parent_variables = ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]<EOL>rez_packages = extra["<STR_LIT>"]<EOL>context = ResolvedContext(rez_packages)<EOL>use_rez = True<EOL><DEDENT>system = sys.platform<EOL>shell_type = '<STR_LIT>'<EOL>if system == "<STR_LIT>":<EOL><INDENT>cmd = "<STR_LIT>" % (app_path, app_args)<EOL><DEDENT>elif self.parent.get_setting("<STR_LIT>") in ["<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>cmd = "<STR_LIT>" % (app_path, app_args)<EOL><DEDENT>elif system == "<STR_LIT>":<EOL><INDENT>cmd = "<STR_LIT>" % (app_path)<EOL>if app_args:<EOL><INDENT>cmd += "<STR_LIT>" % app_args.replace("<STR_LIT>", "<STR_LIT>")<EOL><DEDENT><DEDENT>elif system == "<STR_LIT:win32>":<EOL><INDENT>cmd = "<STR_LIT>" % (app_path, app_args)<EOL>shell_type = '<STR_LIT>'<EOL><DEDENT>if use_rez:<EOL><INDENT>n_env = os.environ.copy()<EOL>proc = context.execute_shell(<EOL>command=cmd,<EOL>parent_environ=n_env,<EOL>shell=shell_type,<EOL>stdin=False,<EOL>block=False<EOL>)<EOL>exit_code = proc.wait()<EOL>context.print_info(verbosity=True)<EOL><DEDENT>else:<EOL><INDENT>exit_code = os.system(cmd)<EOL><DEDENT>return {<EOL>"<STR_LIT>": cmd,<EOL>"<STR_LIT>": exit_code<EOL>}<EOL>
The execute functon of the hook will be called to start the required application

:param app_path: (str) The path of the application executable
:param app_args: (str) Any arguments the application may require
:param version: (str) version of the application being run if set in the "versions" settings
                      of the Launcher instance, otherwise None

:returns: (dict) The two valid keys are 'command' (str) and 'return_code' (int).