...check if the Internet Explorer is installed?

Author: Simon Grossenbacher
Homepage: http://www.swissdelphicenter.ch

Category: Internet / LAN

uses
  
registry;

function IE_installed(var Version: string): Boolean;
var
  
Reg: TRegistry;
begin
  
Reg := TRegistry.Create;
  with Reg do
  begin
    
RootKey := HKEY_LOCAL_MACHINE;
    OpenKey('Software\Microsoft\Internet Explorer', False);
    if ValueExists('Version') then
      
Version := ReadString('Version')
    else
      
Version := '';
    CloseKey;
    Free;
  end;
  Result := Version <> '';
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  
IE_Version: string;
begin
  if 
IE_Installed(IE_Version) then
    
ShowMessage(Format('Internet Explorer %s installed.', [IE_Version]));
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base