In general, when deploying an application for Linux systems it will be installed in /usr/share/bin or /usr/share/local/bin. So, if you want the app dir to store and read files for configuration/options etc. /usr/... won't be very useful. I suggest you use a folder in the user's HOME directory, for example a directory named ".appname" . You can get it using the following code:
function TForm1.getHomeFolder : String;
var
envlist : TStringList;
i : integer;
found : boolean;
home_folder : String;
begin
envList:=TStringlist.Create;
application.GetEnvironmentList(envList);
i:=0;
found:=false;
while( (i<envList.Count) AND (not found) )do
begin
if(AnsiContainsStr(envList.strings[i],'HOME='))then
begin
found := true;
end;
i:=i+1;
end;
if(found)then
begin
home_folder := copy(envList.Strings[i-1],6, length(envList.Strings[i-1])-5);
//showmessage('home_folder set to : '+home_folder);
end
else
begin
home_folder := '';
messageDlg('Error : Could not determine your home folder!',mtError,[mbOK],0);
selectDirectory('Choose your home folder', '/home', home_folder);
end;
//showmessage(target_folder);
envList.Free;
result:=home_folder;
end;