Launch godot game from another godot program

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By droc101

I am trying to make a launcher for multiple games (running on linux, more specifically Ubuntu.) Trying to open the game file with OS.shell_open(path) or OS.execute(path, args) does not work. The code i am using is as follows:

var PATH = dirs[index].replace("user://", OS.get_user_data_dir()) + "/" + data.binary
		print(PATH)
		OS.execute(PATH, PoolStringArray([]))
		get_tree().quit()

I have checked the path, and it is correct. Is this possible, and if so, what am I doing wrong?

:bust_in_silhouette: Reply From: Wakatta
var PATH = dirs[index].replace("user://", OS.get_user_data_dir()) + "/" + data.binary
print(PATH)
OS.execute(PATH, [], false)
yield(get_tree().create_timer(1.0), "timeout")
get_tree().quit()

This gets closer, but still nothing is opening. OS.execute() is returning 2043, if that matters at all. Does it matter if PATH has spaces (they are prefixed by a \ like i am executing it from command line.)

droc101 | 2021-08-22 21:47

Did some experimentation, removing the spaces from the name ended up working.

droc101 | 2021-08-22 21:49

Dang you beat me to it
That number is the Process iD in case you wanted to do more stuff with it

Wakatta | 2021-08-23 01:04