Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7409313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:03:54+00:00 2026-05-29T06:03:54+00:00

I’m working on a component installer (only for Delphi XE2) and I would like

  • 0

I’m working on a component installer (only for Delphi XE2) and I would like to detect if the Delphi XE2 IDE is running. How would you detect it?

P.S. I know about the TAppBuilder window class name, but I need to detect also the IDE version.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:03:55+00:00Added an answer on May 29, 2026 at 6:03 am

    These are the steps to determine if the Delphi XE2 is running

    1) First Read the location of the the bds.exe file from the App entry in the \Software\Embarcadero\BDS\9.0 registry key which can be located in the HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE Root key.

    2) Then using the CreateToolhelp32Snapshot function you can check if exist a exe with the same name running.

    3) Finally using the PID of the last processed entry you can resolve the full file path of the Exe (using the GetModuleFileNameEx function) and then compare the names again.

    Check this sample code

    {$APPTYPE CONSOLE}
    
    {$R *.res}
    
    uses
    
      Registry,
      PsAPI,
      TlHelp32,
      Windows,
      SysUtils;
    
    function ProcessFileName(dwProcessId: DWORD): string;
    var
      hModule: Cardinal;
    begin
      Result := '';
      hModule := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, False, dwProcessId);
      if hModule <> 0 then
        try
          SetLength(Result, MAX_PATH);
          if GetModuleFileNameEx(hModule, 0, PChar(Result), MAX_PATH) > 0 then
            SetLength(Result, StrLen(PChar(Result)))
          else
            Result := '';
        finally
          CloseHandle(hModule);
        end;
    end;
    
    function IsAppRunning(const FileName: string): boolean;
    var
      hSnapshot      : Cardinal;
      EntryParentProc: TProcessEntry32;
    begin
      Result := False;
      hSnapshot := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
      if hSnapshot = INVALID_HANDLE_VALUE then
        exit;
      try
        EntryParentProc.dwSize := SizeOf(EntryParentProc);
        if Process32First(hSnapshot, EntryParentProc) then
          repeat
            if CompareText(ExtractFileName(FileName), EntryParentProc.szExeFile) = 0 then
              if CompareText(ProcessFileName(EntryParentProc.th32ProcessID),  FileName) = 0 then
              begin
                Result := True;
                break;
              end;
          until not Process32Next(hSnapshot, EntryParentProc);
      finally
        CloseHandle(hSnapshot);
      end;
    end;
    
    function RegReadStr(const RegPath, RegValue: string; var Str: string;
      const RootKey: HKEY): boolean;
    var
      Reg: TRegistry;
    begin
      try
        Reg := TRegistry.Create;
        try
          Reg.RootKey := RootKey;
          Result      := Reg.OpenKey(RegPath, True);
          if Result then
            Str := Reg.ReadString(RegValue);
        finally
          Reg.Free;
        end;
      except
        Result := False;
      end;
    end;
    
    function RegKeyExists(const RegPath: string; const RootKey: HKEY): boolean;
    var
      Reg: TRegistry;
    begin
      try
        Reg := TRegistry.Create;
        try
          Reg.RootKey := RootKey;
          Result      := Reg.KeyExists(RegPath);
        finally
          Reg.Free;
        end;
      except
        Result := False;
      end;
    end;
    
    
    function GetDelphiXE2LocationExeName: string;
    Const
     Key = '\Software\Embarcadero\BDS\9.0';
    begin
      Result:='';
        if RegKeyExists(Key, HKEY_CURRENT_USER) then
        begin
          RegReadStr(Key, 'App', Result, HKEY_CURRENT_USER);
          exit;
        end;
    
        if RegKeyExists(Key, HKEY_LOCAL_MACHINE) then
          RegReadStr(Key, 'App', Result, HKEY_LOCAL_MACHINE);
    end;
    
    
    Var
     Bds : String;
    
    begin
      try
         Bds:=GetDelphiXE2LocationExeName;
         if Bds<>'' then
         begin
           if  IsAppRunning(Bds) then
            Writeln('The Delphi XE2 IDE Is running')
           else
            Writeln('The Delphi XE2 IDE Is not running')
         end
         else
         Writeln('The Delphi XE2 IDE Is was not found');
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
      Readln;
    end.
    

    Addtional resources.
    Detecting installed delphi versions

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.