| 1918 | } |
| 1919 | |
| 1920 | String 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 | |
| 1942 | String Utility::GetIcingaDataPath() |
| 1943 | { |
nothing calls this directly
no outgoing calls
no test coverage detected