Very good points, Mike. Indeed knowing the %PATH% variable doesn't help you very much, it's a systeem thing anyway, you maintain it in the control panel and Windows uses it to find some EXEs, etc. If you want to use something in Syswow64 or system32 depending on the OS being a 64bit or 32bit version you simply check the existance of Syswow64 first.
Taking into account bjitima use %SystemRoot% to test for Syswow64:
Code:
LOCAL lcSystemDir
lcSystemDir = Addbs(GetEnv("SystemRoot"))+"SysWOW64"
IF !Directory(lcSystemDir)
lcSystemDir = Addbs(GetEnv("SystemRoot"))+"System32"
ENDIF
That's all there is to it to find out which is the system dir for you to use as a 32bit process. Besides that due to system directory redirection you can always use Addbs(GetEnv("SystemRoot")+"System32", as access to it is redirected to SysWow64, but knowing the right dir in advance helps to save the redirection, of course.
Anything, that is officially installed via Installshield or other installers making use of the Windows Installer service have uninstall info in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\, the ffc registry class in registry.prg will help you read info from there.
That's another source of info and you know many programs install in %PROGRAMFILES%, if a user doesn't choose a different location, that different location still is stored in the uninstall information.
If you need the path to some automatable tool like Embarcadero Studio, why not talk to the vendor?
Anyway, define your environment as you need it, install some tool you need at your location configure it to a known location and make it configurable in case it's installed somewhere else. There also are lots of API calls to get a system directories or OLE server locations, eg see
and
Bye, Olaf.