Can anyone help me test this code on Linuxes and Windows? I tested on
Ubuntu Mate and
WinXP, it works but I want to make sure it 'really' works. Or maybe you have better suggestion.
function GetDesktopPath: string;
var
S: string;
begin
{$ifdef WINDOWS}
S := GetEnvironmentVariable('HOMEDRIVE') + GetEnvironmentVariable('HOMEPATH');
{$endif}
{$ifdef LINUX}
S := GetEnvironmentVariable('HOME');
{$endif}
Result := S + DirectorySeparator + 'Desktop' + DirectorySeparator;
end;
Note:
SysUtils unit is required.