0
votes

In Delphi XE4 > Project > Deployment I have a reference to a file called "res.zip" It is set to be placed at remote path "res.zip"

However, "FileExists" returns false in underneath code (Running in iOS 6.1 simulator):

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;
1
When you set a debugger breakpoint on the if FileExists line and look at the exact value in P, what do you see? - Ken White
Combine path elements with Path.Combine - David Heffernan
P is = '/Users/%user%/Library/Application Support/iPhone Simulator/6.1/Applications/BF8E7DA7-B92B-4AE7-9C98-7AC8DC223D16/res.zip' (where %user% is my user name) - Tom
@David The path looks correct when inspecting it during debugging. Am I doing it wrong for iOS/simulator paths? - Tom

1 Answers

0
votes

Answer was found in Delphi forums. The path is

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