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.
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.
user1431596
On
Check DebugHook <> 0. The down side is that currently if your app is built with packages, DebugHook will return 0. But normally this is would be a very elegant and simple test. Works great in D2009, I just noticed that it has the package dependency bug in XE2 (http://qc.embarcadero.com/wc/qcmain.aspx?d=105365).
Copyright © 2021 Jogjafile Inc.
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
Appentry in the\Software\Embarcadero\BDS\9.0registry 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
GetModuleFileNameExfunction) and then compare the names again.Check this sample code
Addtional resources.
Detecting installed delphi versions