943,600 Members | Top Members by Rank

Ad:
Jul 20th, 2005
0

Creating a delphi program to autoinstall other programs?

Expand Post »
Hi

I am trying to create a delphi program to autoinstall other multiple utilities such as adobe reader, winamp etc. I am firstly wondering how to execute an external exe file. and also, is there a way to pass mouse clicks through delphi to this external program?

Thanks

Sean Bedford
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sbedford is offline Offline
18 posts
since Jul 2005
Aug 16th, 2005
0

Re: Creating a delphi program to autoinstall other programs?

Hi,
I have an answer to 'how to execute an external exe file'.

Under 'implementation' and before your first procedure type in 'uses ShellAPI;'

After typing that in, add the following code to one of your procedures:

ShellExecute(Handle, 'open', 'type in the directory of your file e.g. c:\test.txt', nil, nil, SW_SHOWNORMAL);

Hope that helps
Reputation Points: 10
Solved Threads: 0
Newbie Poster
satrix36 is offline Offline
20 posts
since Aug 2005
Aug 17th, 2005
0

Re: Creating a delphi program to autoinstall other programs?

Thanks, that did the job!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sbedford is offline Offline
18 posts
since Jul 2005
Oct 17th, 2008
0

Re: Creating a delphi program to autoinstall other programs?

This works fine, but how can I replace the string of the file to execute by my string.

I have:

Var
txt : string;
.
.
txt := 'myprogram.exe'
.
.
ShellExecute(Handle, 'open', txt, nil, nil, SW_SHOWNORMAL);

This gives a compile error:
Incompatible types: 'String' and 'PAnsiChar'

How can I conver my string to PAnsiChar?
Reputation Points: 10
Solved Threads: 0
Light Poster
AKJo is offline Offline
48 posts
since Jan 2008
Oct 17th, 2008
0

Re: Creating a delphi program to autoinstall other programs?

You can convert it like any other conversion with pansichar(txt) or, you could have made the variable an ansichar and sent the pointer..
Reputation Points: 196
Solved Threads: 190
Posting Virtuoso
LizR is offline Offline
1,735 posts
since Aug 2008
Oct 31st, 2008
0

Re: Creating a delphi program to autoinstall other programs?

If just launch a new app then use ShellExecute, then you can hide them or hide your app to enable auto setup

------------------------------------

Self Cert best acne solution products
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Jacob777 is offline Offline
3 posts
since Oct 2008
Jun 15th, 2010
0
Re: Creating a delphi program to autoinstall other programs?
I would recommend you to creating SFX archive and add your executable myprogram.exe as run after extract item. In this way you need not to call shell execute for launching you application.If you want to know more about this then just let me know.
Thanks,
David
Reputation Points: 10
Solved Threads: 0
Newbie Poster
david Booch is offline Offline
1 posts
since Dec 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Problem with OpenProcess in Delphi 7
Next Thread in Pascal and Delphi Forum Timeline: Populating a Listveiw





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC