views:

96

answers:

3

How can I get the version IE installed in my computer?

A: 
uses
  Registry;

function GetIEVersion(Key: string): string;
var
  Reg: TRegistry;
begin
  Reg := TRegistry.Create;
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    Reg.OpenKey('Software\Microsoft\Internet Explorer', False);
    try
      Result := Reg.ReadString(Key);
    except
      Result := '';
    end;
    Reg.CloseKey;
  finally
    Reg.Free;
  end;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage('IE-Version: ' + GetIEVersion('Version')[1] + '.' + GetIEVersion('Version')[3]);
  ShowMessage('IE-Version: ' + GetIEVersion('Version'));
end;

Source: http://www.vbforums.com/showthread.php?t=342893

Aaron Harun
before I posted my question here, I've already seen this code but there's a comment there that this code couldn't retrieve the version if it reaches version 10 already. that's why i posted a question here.
jhodzzz
+3  A: 
uses
  Registry;

function GetIEVersion : string;
var
  Reg: TRegistry;
begin
  Reg := TRegistry.Create;
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    Reg.OpenKeyReadOnly('Software\Microsoft\Internet Explorer');
    try
      Result := Reg.ReadString('Version');
    except
      Result := '';
    end;
    Reg.CloseKey;
  finally
    Reg.Free;
  end;
end;

This function should return the currently installed version number of IE.

wimvds
+1  A: 

I've figured out a work-around on my problem so that I don't have to check for the version of the currently installed IE anymore. Thanks for the answers though. :)

jhodzzz
-1. Does not answer the question.
Rob Kennedy
oh..sorry..in case you haven't noticed, i'm also the one who posted this question..my intention on the post you commented was to let everyone know that i've already figured out the workaround on my problem..i'm new here..sorry.. :)
jhodzzz