Launching an outside executable
by Steve D · in Torque Game Builder · 07/27/2010 (3:02 pm) · 10 replies
I did some forum searches but turned up nothing. Is there anyway in TGB to launch a non-TGB executable? My installer package includes an auto updater and it would be nice to have the auto updater run automatically everytime the game starts. Any ideas anyone?
#2
07/27/2010 (3:36 pm)
Hi Mike, thanks for the reply! At the risk of sounding really lazy, how does Torque launch a batch file? I didn't even know it could do that.
#4
07/27/2010 (4:39 pm)
Hello, it says it can't find the command RunBatchFile ?
#5
07/27/2010 (5:18 pm)
Could you make a batch file that runs the external exe, then your game?
#6
07/27/2010 (6:11 pm)
@ Patrick, that would work as well too! But any ideas on what the function name is?
#7
I've never seen the RunBatchFile command in script but I've also never looked for it. You can open up your source project and do a global search in there for it.
I think you could also create a function in source using the System or the ShellExecute namespace then expose that via a console method. This way it would be possible to create a callback that would execute once the first command is finished. Not simple but possible.
07/27/2010 (7:03 pm)
Steve,I've never seen the RunBatchFile command in script but I've also never looked for it. You can open up your source project and do a global search in there for it.
I think you could also create a function in source using the System or the ShellExecute namespace then expose that via a console method. This way it would be possible to create a callback that would execute once the first command is finished. Not simple but possible.
#8
07/27/2010 (8:32 pm)
@ Mike, is RunBatchFile a script function or is it a c++ level function in the TGB source code? Is there a script based solution to running a batch file?
#9
Batch files will work too as long as .bat is associated with cmd in the shell.
07/31/2010 (12:30 am)
Use shellExecute.shellExecute( "my/path/to/exe", "cmdline args", "working/directory" ); // arguments and WD are optional
Batch files will work too as long as .bat is associated with cmd in the shell.
#10
08/09/2010 (5:05 pm)
ShellExecute has real potential. Thanks!
Employee Michael Perry
ZombieShortbus