July 24th, 2003, 06:47 AM
Running a child process
Hi Guys, I need to run a exe file.
I can get the pat of the file:
AnsiString EXEPath = ExtractFilePath(Application->ExeName )+"\\TMSlite\\setup.exe";
Now I dont know how to run this setup.exe.
I was trying to use execv etc but with no luck.:mad:
July 24th, 2003, 11:29 AM
Use the CreateProcess(), WinExec() or even the system() function.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
July 24th, 2003, 01:00 PM
Thanks a lot. Code below is doing the job.
if(FileExists(const AnsiString "g:\\TMSliteSetup.exe"))
SHELLEXECUTEINFO execinfo ;
memset (&execinfo, 0, sizeof (execinfo)) ;
execinfo.cbSize = sizeof (execinfo) ;
execinfo.lpVerb = "open" ;
execinfo.lpFile = "g:\\TMSlite\\setup.exe";
execinfo.fMask = SEE_MASK_NOCLOSEPROCESS ;
execinfo.nShow = SW_SHOWDEFAULT ;
ShellExecuteEx (&execinfo) ;