MCPcopy Create free account
hub / github.com/78/tenbox / ResolveDefaultRuntimeExePath

Function ResolveDefaultRuntimeExePath

src/manager/main.cpp:66–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66static std::string ResolveDefaultRuntimeExePath() {
67 wchar_t self[MAX_PATH]{};
68 DWORD len = GetModuleFileNameW(nullptr, self, MAX_PATH);
69 if (len == 0 || len >= MAX_PATH) {
70 return "tenbox-vm-runtime.exe";
71 }
72 std::string path = i18n::wide_to_utf8(self);
73 size_t sep = path.find_last_of("\\/");
74 if (sep == std::string::npos) {
75 return "tenbox-vm-runtime.exe";
76 }
77 path.resize(sep + 1);
78 path += "tenbox-vm-runtime.exe";
79 return path;
80}
81
82static void PrintUsage(const char* prog, const char* default_runtime) {
83 fprintf(stderr,

Callers 1

RunManagerAppFunction · 0.85

Calls 1

wide_to_utf8Function · 0.85

Tested by

no test coverage detected