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

Method GetIcingaInstallPath

lib/base/utility.cpp:1920–1940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1918}
1919
1920String Utility::GetIcingaInstallPath()
1921{
1922 char szProduct[39];
1923
1924 for (int i = 0; MsiEnumProducts(i, szProduct) == ERROR_SUCCESS; i++) {
1925 char szName[128];
1926 DWORD cbName = sizeof(szName);
1927 if (MsiGetProductInfo(szProduct, INSTALLPROPERTY_INSTALLEDPRODUCTNAME, szName, &cbName) != ERROR_SUCCESS)
1928 continue;
1929
1930 if (strcmp(szName, "Icinga 2") != 0)
1931 continue;
1932
1933 char szLocation[1024];
1934 DWORD cbLocation = sizeof(szLocation);
1935 if (MsiGetProductInfo(szProduct, INSTALLPROPERTY_INSTALLLOCATION, szLocation, &cbLocation) == ERROR_SUCCESS)
1936 return szLocation;
1937 }
1938
1939 return "";
1940}
1941
1942String Utility::GetIcingaDataPath()
1943{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected