Find $HOME or Windows equivalent with FreePascal
-
21-08-2019 - |
Question
My purpose is to deploy user configuration files under:
- $HOME/.appname for Unix/Linux.
- \Documents and Settings\(user)\Application Data\AppName for Windows.
What are the API's or group of functions that I can use, with the appropriate {$IFDEF}'s, so I can deploy my config files on the appropriate places?
Solution
Better use the correct function:
http://www.freepascal.org/docs-html/rtl/sysutils/getappconfigdir.html
result:=getappconfigdir(false)
OTHER TIPS
You'll likely end up using the GetEnvironmentVariable
function. Under Unix-like OSs, you will use the HOME
environment variable. Under Windows, you'll use the APPDATA
environment variable.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow