Windows with Delphi Windows API (94) Windows Filesystem (41) Windows Forms (69) Windows Graphics (38)
Exchange Links About this site Links to us 
|
Silently installing an INF file from your Delphi application
2 comments. Current rating: (1 votes). Leave comments and/ or rate it.
Question:
My self-written install program needs to install a 3rd party tool which comes with an .INF file. How do I call it up to install invisible ('silent install')?
Answer:
The INF file format has been around for many years at least since Windows 3 and it has many options including modifications in the registry, driver installation or date and version control. There are even free tools available to generate INF files.
Executing them from a Delphi application is no problem if you use the function shown below. Simply pass the path to the .INF file and handle of your form (use 0 if you have a console application).  | |  | | uses
ShellAPI;
function InstallINF(const PathName: string; hParent: HWND) : boolean;
var
instance: HINST;
begin
instance := ShellExecute(
hParent,
PChar('open'),
PChar('rundll32.exe'),
PChar('setupapi,InstallHinfSection DefaultInstall 132 ' + PathName),
nil,
SW_HIDE);
Result := instance>32
end;
| |  | |  | You don't like the formatting? Check out SourceCoder then!
Comments:
2008-07-02, 21:37:32 (updated: 2008-07-02, 21:48:26) |
donie_A_hidayat@yahoo.com
|
 |
|
|
how to silent install flash_player.msi with delphi ?
|
|
anonymous from Turkey
|
|
|
|
thank you maan
|
|