MCPcopy Create free account
hub / github.com/Icinga/icinga2 / GetNSISInstallPath

Function GetNSISInstallPath

icinga-installer/icinga-installer.cpp:112–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112static std::string GetNSISInstallPath(void)
113{
114 HKEY hKey;
115 //TODO: Change hardcoded key
116 if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Icinga Development Team\\ICINGA2", 0,
117 KEY_QUERY_VALUE | KEY_WOW64_32KEY, &hKey) == ERROR_SUCCESS) {
118 BYTE pvData[MAX_PATH];
119 DWORD cbData = sizeof(pvData) - 1;
120 DWORD lType;
121 if (RegQueryValueEx(hKey, nullptr, nullptr, &lType, pvData, &cbData) == ERROR_SUCCESS && lType == REG_SZ) {
122 pvData[cbData] = '\0';
123
124 return (char *)pvData;
125 }
126
127 RegCloseKey(hKey);
128 }
129
130 return "";
131}
132
133static bool CopyDirectory(const std::string& source, const std::string& destination)
134{

Callers 1

UpgradeNSISFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected