Still lingering in my head and i think i found more elegant solution
This involve utilizing Windows Application Registration
https://learn.microsoft.com/en-us/wi...p-registration
In short the steps are:
1) add a key in the registry with your EXE name to this path
Zitat:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths\DelphiRuntimeTest.exe
then make sure the default (entry without name) in that key has the Application name and path like this
Code:
(default) REG_SZ D:\Projects Delphi\DelphiRuntime\
Win32\Debug\DelphiRuntimeTest.exe
and at last add the PATH value
Code:
PATH REG_SZ D:\Projects Delphi\DelphiRuntime\
Win32\Debug;D:\Program Files (x86)\Embarcadero\Studio\16.0\bin
and that is it !!
I tested it and it worked perfectly, thoughts on this:
1) For some reason, yet i don't understand it works fine with HKEY_LOCAL_MACHINE but didn't work with HKEY_CURRENT_USER on my
OS, yet again my
OS is %$#%$ the least, i heavily tweaked many things about paths and users, specially my user, so it might work for you with HKEY_CURRENT_USER.
2) Here how the registry entries look like
3) Not sure about adding the current directory in my case above "D:\Projects Delphi\DelphiRuntime\
Win32\Debug", most likely it is not needed.
Hope that helps.