Page 1 of 1

Running a .exe with Love2D

Posted: Sat Jun 09, 2012 12:32 am
by Bannana97
I am trying to make an automatic update .exe file.
Is it possible to execute .exe files with Love2D api?

Re: Running a .exe with Love2D

Posted: Sat Jun 09, 2012 2:28 am
by worldaway
https://love2d.org/wiki/Game_Distribution

scroll down, it should help.

Also you made a typo.*love2d, not love3d

Re: Running a .exe with Love2D

Posted: Sat Jun 09, 2012 5:13 am
by Bannana97
No not for distribution.
I wish to RUN a .exe file FROM the game, e.g.

love.run("C:/WINDOWS/system32/cmd.exe") or similar

Re: Running a .exe with Love2D

Posted: Sat Jun 09, 2012 6:01 am
by josefnpat
Bannana97 wrote:I am trying to make an automatic update .exe file.
Is it possible to execute .exe files with Love2D api?
Unless you recompile love, you will not be able to run external executables. Consider doing it a bit differently:

Either:
a) Write up a bat file that runs your exe first, and then the game on launch
b) If the game is out of date, tell your users to run update.exe
c) Attempty to do the update via lua's io system (I haven't tried this) and then have the user restart the game.

I hope this helps a bit.

Re: Running a .exe with Love2D

Posted: Sat Jun 09, 2012 6:10 am
by Nixola
Is a .bat file needed? Shouldn't "os.execute('nameofthe.exe')" be enough?

Re: Running a .exe with Love2D

Posted: Sat Jun 09, 2012 6:15 am
by josefnpat
Nixola wrote:Is a .bat file needed? Shouldn't "os.execute('nameofthe.exe')" be enough?
Yeah, Boolsheet just corrected me on irc.

I am so out of it; os.execute() should do the trick as well.

Re: Running a .exe with Love2D

Posted: Sat Jun 09, 2012 9:21 am
by Robin
It is possible (and pretty easy) to make a LÖVE game self-updating, that way your game is not platform-dependent and doesn't need an external program for updating.