Open an exe file located in the game directory (SOLVED)

  • #1, by smac96Monday, 09. December 2013, 13:35 11 years ago
    Hi,

    Is there any way to open an exe file that is located in the game directory?

    For example, I have an external exe files (called "options.exe) that allows the players to change some game settings.

    In "Scene object > Actions > Left click > Execute a script", I tried to cheap it with the command
    startDefaultBrowser('options.exe')
    

    but of course it doesn't work smile

    Thank you in advance for your help smile

    Newbie

    97 Posts


  • #2, by SimonSMonday, 09. December 2013, 13:38 11 years ago
    Hi,

    Lua has commands for that, os.execute() is your call, see more here http://www.lua.org/manual/5.1/manual.html#pdf-os.execute

    Thread Captain

    1582 Posts

  • #3, by smac96Monday, 09. December 2013, 13:52 11 years ago
    Thank you SimonS.

    So do you think that my problem is solved with this code?
    os.execute (options.exe)
    


    Or this is not the correct syntax?

    Newbie

    97 Posts

  • #4, by SimonSMonday, 09. December 2013, 13:59 11 years ago
    You need quotes, so to say:
    os.execute ("options.exe")
    


    Problem is the search path, I don't know where your program will be. If I recall correctly, the Lua path is in Windows set to the Working Path (Path of the application visplayer.exe), other platforms behave differently.
    You must try out.

    Thread Captain

    1582 Posts

  • #5, by smac96Monday, 09. December 2013, 21:25 11 years ago
    Thank you. I will try it out smile

    Newbie

    97 Posts

  • #6, by smac96Monday, 09. December 2013, 23:00 11 years ago
    If I put the options.exe file inside the main directory of the game and then I set the command

    os.execute ("options.exe")
    


    Everything works correctly!

    Thank you!

    Newbie

    97 Posts