Open exodustx0 opened 3 months ago
ugh, that's true. is there a better way to do this? anything more portable than readlink(/proc/self/exe)?
Note that, for the Windows implementation, the path may not fit in MAX_PATH
-length buffer when long path support is enabled. Also, I'm not sure what you're doing with the first argument to GetModuleFileNameA
, but the documentation suggests passing in NULL
to get the current process's executable path.
Yes, passing NULL gets the current EXE's path.
That is not necessarily the path Asar is in, if it's compiled as a DLL. That's what that first argument does.
MAX_PATH, however, is a valid objection.
I wasn't aware DLLs have inconsistent path reporting through GetModuleFileName
.
what are you talking about. there's nothing inconsistent there, GetModuleFileName returns the exe's path just fine if called from a dll with hmodule=null
it's just that that's not the path the dll is looking for. dlls don't need to be beside the exe, go look up where kernel32.dll is located
I misinterpreted your earlier message.
The manual (for both v1.90 and v2) states:
This is not true if
asar
is called throughPATH
, due toargv[0]
just beingasar
.