uses System.IOUtils;

procedure TForm1.FormCreate(Sender: TObject);
var
  S: string;
begin
  { 三种方法结果一致: C:\Users\wy\AppData\Roaming }
  S := GetHomePath;                       // SysUtils, 能跨平台且简单, 在 Windows 下使用 SHGetFolderPath 完成
  S := TPath.GetHomePath;                 // System.IOUtils
  S := GetEnvironmentVariable('APPDATA'); // 以前一直用这个
end;