DelphiFAQ Home Search:

Silently installing an INF file from your Delphi application

 

comments2 comments. Current rating: 4 stars (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 { InstallINF }
  instance := ShellExecute(
    hParent,
    PChar('open'),
    PChar('rundll32.exe'),
    PChar('setupapi,InstallHinfSection DefaultInstall 132 ' + PathName),
    nil,
    SW_HIDE);
  
  Result := instance>32
end; { InstallINF } 
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  
rating
how to silent install flash_player.msi with delphi ?
2009-10-13, 14:05:30
anonymous from Turkey  
thank you maan

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: