Подтвердить что ты не робот

Получение пути приложения в Firemonkey

Итак, в VCL для получения пути к приложениям используйте следующую строку кода:

ExtractFilePath(Application.ExeName)

Я попробовал то же самое Firemokey, и я заметил, что ExeName больше не доступен. Какой код я могу использовать в качестве альтернативы этому?

4b9b3361

Ответ 1

Попробуйте использовать ParamStr (0) вместо Application.ExeName.

Ответ 2

Я использую

showmessage(System.SysUtils.GetCurrentDir);

и работает как шарм:)

Ответ 3

Я нашел на http://arcana.sivv.com/blog/, вы можете попробовать это:

X.Env.ExeFilename - возвращает фактическое имя исполняемого файла.

Вот некоторые объяснения из этого блога:

X.Env.SearchPath - Returns the currently registered search path on the system.
X.Env.AppFilename - Returns the "app" name of the application.  On OS X this is the application package in which the exe resides.  On Windows, this is the name of the folder in which the exe resides.
X.Env.ExeFilename - Returns the actual filename of the running executable.
X.Env.AppFolder - Returns the folder path to the executable, stopping at the level of the application package on OSX.
X.Env.ExeFolder - Returns the full folder path to the executable.
X.Env.TempFolder - Returns a writable temp folder path that can be used by your application.
X.Env.HomeFolder - Returns the user writable home folder.  On OS X this equates to /Users/username and on Windows,  C:\Users\username\AppData\Roaming or the appropriate path as set on the system.

Ответ 4

ExtractFileName(paramstr(0))

я использую