29

Whenever I use the Gethomepath function of Delphi I keep getting Shell Script Invocation Error.

Was this function replaced by a newer one?

5
  • 1
    I can't help you since I don't know MacOS, but I'll leave here what is being called from Delphi GetHomePath function string(getenv(PAnsiChar(UTF8String('HOME')))). It could be helpful for those who don't have Delphi but know about MacOS development.
    – TLama
    Commented Jun 5, 2012 at 13:41
  • I just realised there was Freepascal 2.4.4 installed on the Mac... I'll upgrade it to 2.6 tomorrow. Hoping this will help. Commented Jun 5, 2012 at 14:54
  • Freepascal 2.6 doesn't solve the problem. Any ideas ? Commented Jun 6, 2012 at 6:09
  • 3
    I finally found a workaround for this: blogs.embarcadero.com/ao/2011/10/04/39144#comment-7998 So "S := ExtractFilePath(paramstr(0)); S := Copy(S, 1, length(S) - 14);" gets the job done. Commented Jun 11, 2012 at 13:52
  • note that on Stackoverflow you can post answers to your own questions, and accept them
    – mjn
    Commented Nov 2, 2012 at 15:25

1 Answer 1

1

I finally found a workaround for this: blogs.embarcadero.com/ao/2011/10/04/39144#comment-7998

So "S := ExtractFilePath(paramstr(0)); S := Copy(S, 1, length(S) - 14);" gets the job done.

Note that the length of S depends on your application title.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.