mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2025-02-18 09:21:13 +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
|
#ifdef PLATFORM_MAC
|
||||||
#include <Security/Security.h>
|
#include <Security/Security.h>
|
||||||
|
#include <mach-o/dyld.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int ProcessUtils::runSync(const std::string& executable,
|
int ProcessUtils::runSync(const std::string& executable,
|
||||||
|
@ -293,6 +294,13 @@ std::string ProcessUtils::currentProcessPath()
|
||||||
std::string path = FileOps::canonicalPath("/proc/self/exe");
|
std::string path = FileOps::canonicalPath("/proc/self/exe");
|
||||||
LOG(Info,"Current process path " + path);
|
LOG(Info,"Current process path " + path);
|
||||||
return 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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue