Page 1 of 1

Non-Blocking Application Execution

Posted: Sun Apr 02, 2017 4:33 am
by khamarr3524
I'm trying to get an updater finished, and I want to make it so that if the game is launched without the updater being launched, it launches the updater, checks the files, and when it finishes launches the game again with an argument telling it the updater was launched. However, using os.execute() causes the updater to block, waiting for the application to end before closing. And using love.system.openURL() fails to open files when I attempt to pass arguments. What are my other options here?

Edit: I found the solution, and in order to make it platform independent I had to use separate calls.

For windows doing os.execute("start " .. appPath) causes it to not block.
For Unix doing os.execute(appPath .. " &") causes it to not block.