All C++ applications loading any kind of image resources that are too big for embedding into the binary need this, yet I haven't seen a single okay solution for long-term maintenance. My goal is that programs written using my library should have a minimum amount of maintenance when moving from one operating system to another over centuries, so any temporary hacks won't do any good. I don't care about the cases when the program runs from memory or access is blocked by the operating system.
* System specific calls will only work for around 20 years before being deprecated. This has to work for at least 200 years.
* Using a register key won't work on systems without a register and probably requires system specific calls.
* argv[0] only returns the CLI alias or path to the desktop shortcut, which says nothing about the application's location.
* Using the current directory only worked in Windows 2000 and older where current directory was set to the application folder path even when called using a shortcut.
* Searching for a unique filename would be both slow and a security risk.
* Comments about "how one shouldn't know the application's path" won't load assets reliably.
* Passing the folder path as an argument requires hard-coded shortcuts, which will break if the folder moves.