Board index » delphi » executing other windows programs from Delphi 5

executing other windows programs from Delphi 5

How do I do this?
I need to do it because I want and easy one button update command to copy a
new version of a program from CD or floppy  whilst the program is running...
post Delphi 2 the I/O system wont let me copy (either way) my program.exe
whilst it is running!, therefore I could do this if I executed another
program that closed the first, then reinstated the original - helpful
comments please!
        best wishes,    RM.
 

Re:executing other windows programs from Delphi 5


Quote
On Sun, 13 Oct 2002 21:17:44 +0100, "RM" <no@email> wrote:
>How do I do this?
>I need to do it because I want and easy one button update command to copy a
>new version of a program from CD or floppy  whilst the program is running...
>post Delphi 2 the I/O system wont let me copy (either way) my program.exe
>whilst it is running!, therefore I could do this if I executed another
>program that closed the first, then reinstated the original - helpful
>comments please!

You use one of the Windows API commands to execute something.
ShellExecute is the easiest one.  For example,

ShellExecute(0, 'open', 'some.exe', 'some arguments', '.',
SW_SHOWNORMAL);

Other choices are ShellExecuteEx, and CreateProcess.

Duncan Murdoch

Re:executing other windows programs from Delphi 5


The way I do it is to copy the new version to a different extension

eg: XXX.EXE   to   XXX.UPD

run the new version ( Windows will run an EXE even if it is XXX.UPD)

close the old version

Then copy the running XXX.UPD  to  XXX.EXE
Then run XXX.EXE
and close down XXX.UPD

Quote
On Sun, 13 Oct 2002 21:17:44 +0100, "RM" <no@email> wrote:
>How do I do this?
>I need to do it because I want and easy one button update command to copy a
>new version of a program from CD or floppy  whilst the program is running...
>post Delphi 2 the I/O system wont let me copy (either way) my program.exe
>whilst it is running!, therefore I could do this if I executed another
>program that closed the first, then reinstated the original - helpful
>comments please!
>        best wishes,    RM.

Other Threads