mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2024-11-26 13:51:11 +00:00
Implement ProcessUtils::currentProcessPath() on Mac
This allows the basic updater unit test to pass.
This commit is contained in:
parent
4d7ddc91d9
commit
8149afd091
1 changed files with 8 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
|||
|
||||
#ifdef PLATFORM_MAC
|
||||
#include <Security/Security.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
int ProcessUtils::runSync(const std::string& executable,
|
||||
|
@ -293,6 +294,13 @@ std::string ProcessUtils::currentProcessPath()
|
|||
std::string path = FileOps::canonicalPath("/proc/self/exe");
|
||||
LOG(Info,"Current process path " + path);
|
||||
return path;
|
||||
#elif defined(PLATFORM_MAC)
|
||||
uint32_t bufferSize = PATH_MAX;
|
||||
char buffer[bufferSize];
|
||||
_NSGetExecutablePath(buffer,&bufferSize);
|
||||
return buffer;
|
||||
#else
|
||||
return std::string();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue