【问题标题】:Delphi XE4 / iOS deployment system not working?Delphi XE4 / iOS 部署系统不工作?
【发布时间】:2013-06-23 11:11:23
【问题描述】:

在 Delphi XE4 > Project > Deployment 我有一个名为“res.zip”的文件的引用它被设置为放置在远程路径“res.zip”

但是,“FileExists”在底层代码中返回 false(在 iOS 6.1 模拟器中运行):

procedure TFormMain.InitCreate_Uncompress;
var
  H: string;
  P: string;
  Z: TZipFile;
begin
  H := GetHomePath;
  P := H + PathDelim + 'res.zip'; 
  if FileExists(P) then
    begin
      Z := TZipFile.Create;
      try
        Z.Open(P, zmRead);
        Z.ExtractAll(H + PathDelim + 'Library');
      finally
        Z.Free;
      end;
    end
  ;
end;

【问题讨论】:

  • 当您在if FileExists 行上设置调试器断点并查看P 中的确切值时,您会看到什么?
  • 用 Path.Combine 组合路径元素
  • P is = '/Users/%user%/Library/Application Support/iPhone Simulator/6.1/Applications/BF8E7DA7-B92B-4AE7-9C98-7AC8DC223D16/res.zip'(其中 %user%是我的用户名)
  • @David 在调试期间检查路径时看起来正确。我对 iOS/模拟器路径做错了吗?

标签: ios delphi delphi-xe4


【解决方案1】:

在 Delphi 论坛中找到了答案。路径是

GetHomePath + PathDelim + Application.Title + '.app' + PathDelim;

【讨论】: