 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Bijal Guest
|
Posted: Thu Nov 23, 2006 9:13 am Post subject: Execute Dos Command from delphi win32 application. |
|
|
Hi,
I am very newbie to this Delphi world, specially i don't have much
knowledge about working with Windows API in Delphi Application.
I want to automate .bpl installer process from my application.
In Delpi win32 application, i am refering certain package (say
Pkg1).While running this delphi application, user has access to
chage/modify in package.So tht from application itself i want to
genrate modified .bpl file of tht package Pkg1 and also replace the
older with this new.All this shud happen from application.
So, for this i tried Dos Command uses dcc32.exe
C:\.....path\Pkg1\Pkg1.dpr -B.
Executing this command from cmd prompt externally, works well,replaces
older .bpl and .dcp file too.
Now to operate this dos command from application, I tried
CreateProcess( all params .....),
WaitForSingleObject
gives me Fatal error 'rtl' not found.
Somewhere read about use of batch or .cfg file may work.
But i don't know where and how to create and incorporate such files in
an application.
same error appears in outside cmd prompt also, if i m in running
mode.AS i closes application, file gets reload, but CreateProcess( )
doesn't creates/replaces older .bpl.
Also i thought to write one console application tht executes Dos
Command, and execute this appliation from (Delphi Win32 VCL ) my
application.
I am very sorry, but i m not able to do this.
Kindly give ur valuable time to solve my query.
Thnaks.
Looking forward for quick response.
With Regards,
Bijal... |
|
| Back to top |
|
 |
sean Guest
|
Posted: Fri Dec 29, 2006 5:23 pm Post subject: Re: Execute Dos Command from delphi win32 application. |
|
|
Bijal wrote:
| Quote: | So, for this i tried Dos Command uses dcc32.exe
C:\.....path\Pkg1\Pkg1.dpr -B.
Executing this command from cmd prompt externally, works well,replaces
older .bpl and .dcp file too.
Now to operate this dos command from application, I tried
CreateProcess( all params .....),
WaitForSingleObject
|
Add the unit 'shellapi' to your uses clause - like this:
uses ShellAPI;
Once you've done that, you can use the ShellExecute function as
follows:
ShellExecute(Handle, 'open', 'dcc32.exe', 'C:\.....path\Pkg1\Pkg1.dpr
-B', 0);
However, this function execute asynchronously - which means your
application will carry on running in it's own thread once this other
application has started.
To see an article on shellexecute - Go here:
http://www.latiumsoftware.com/en/delphi/00002.php
To see an article about non-asynchronous tasks, where you need to wait
for the task to finish, Go here:
http://www.latiumsoftware.com/en/delphi/00003.php
Though it sounds like your error is because your delphi installation is
missing the run time library 'rtl' - I'd recommend you reinstall it.
Regards
Sean Johnstone |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|