Under win7 the runtime (module) never gives me anything. I'd expect the first argument to always be the exe path but it's always empty.
I can confirm that the runtime returns empty values when a WinMain
function is used (even after the call to Runtime.initialize
).
Maybe Druntime should try and call the WinAPI functions to fill up the rt_args
/rt_cArgs
members if the compiler finds a WinMain
function. Typically one would use GetCommandLine or CommandLineToArgvW to extract the arguments. A bug should probably be filed for this to bugzilla.
As for the actual path of the current process, there is an open pull request that should make it into the next 2.064 release.