void ITunesInspector::_readVersion()
{	
	vector <wstring> apps;
	wchar_t szName[1024] = L"";
	wchar_t szVersion[1024] = L"";
	bool bFound = false;

	_enumInstalledSoftware(apps);

	unsigned int i=0;
	while (i < apps.size() && (!bFound) )
	{
		wstring szFirstKey = UNINSTALL_REGKEY;
		wstring szSecondKey = L"\\"+ apps[i];
		wstring szKey = szFirstKey + szSecondKey;

		i++;

		if (m_registry->OpenKeyNoWOWRedirect(HKEY_LOCAL_MACHINE, (wchar_t*)szKey.c_str(), false))
		{
			m_registry->GetString(L"DisplayName", szName, sizeof(szName));

			if (!wcscmp(szName, L"iTunes"))
			{
				m_registry->GetString(L"DisplayVersion", szVersion, sizeof(szVersion));
				bFound = true;
			}
			m_registry->Close();
		}
	}
	
	g_log.Log(L"ITunesInspector::_readVersionInstalled '%s'", szVersion);
	m_KeyValues.push_back(InspectorKeyValue(L"version", szVersion));		
}
void LibreOfficeInspector::_readVersionInstalled()
{
	bool bKeys = true;
	DWORD dwIndex = 0;

	if (m_registry->OpenKey(HKEY_LOCAL_MACHINE, PROGRAM_REGKEY, false))
	{
		while (bKeys)
		{
			wstring key;

			bKeys = m_registry->RegEnumKey(dwIndex, key);
			dwIndex++;

			if (bKeys)
			{
				m_version = key;
				break;
			}
		}
		m_registry->Close();
	}
	g_log.Log(L"LibreOfficeInspector::_readVersionInstalled '%s'", (wchar_t *) m_version.c_str());

	m_KeyValues.push_back(InspectorKeyValue(L"version",m_version));
}
void LibreOfficeInspector::_getDictInstalled()
{
	wstring key;
	wchar_t szDictFound[10]=L"";

	key = PROGRAM_REGKEY;
	key += L"\\";
	key += m_version;

	if (m_registry->OpenKey(HKEY_LOCAL_MACHINE, (wchar_t*) key.c_str(), false))
	{
		wchar_t szFileName[MAX_PATH];

		if (m_registry->GetString(L"path", szFileName, sizeof(szFileName)))
		{
			int i;

			for (i = wcslen(szFileName); i > 0 && szFileName[i] != '\\' ; i--);
			if (i>0) i--;
			for (; i > 0 && szFileName[i] != '\\' ; i--);
			szFileName[i + 1] = NULL;
			wcscat_s(szFileName, L"share\\extensions\\dict-ca\\nul");

			if(GetFileAttributes(szFileName) != INVALID_FILE_ATTRIBUTES) wcscat_s(szDictFound, L"ca");
		}
		m_registry->Close();
	}
	g_log.Log(L"LibreOfficeInspector::_getDictInstalled '%s'", (wchar_t *) szDictFound);

	m_KeyValues.push_back(InspectorKeyValue(L"dict_files",szDictFound));
}
void LibreOfficeInspector::_readLanguage()
{
	XmlParser parser;
	wstring lang_found, file;	

	_getPreferencesFile(file);

	if (parser.Load(file))
	{
		parser.Parse(_readNodeCallback, &lang_found);

		if (m_version.size() > 0 && lang_found.size() == 0)
		{
			wstring locale;

			_readLocale(locale);
			lang_found = L"locale:" + locale;
		}

		g_log.Log(L"LibreOfficeInspector::_readLanguage. Preferences file '%s', language '%s'", (wchar_t *)file.c_str(), 
			(wchar_t *) lang_found.c_str());		
	}
	else
	{
		g_log.Log(L"LibreOfficeInspector::_readLanguage. Could not open '%s'", (wchar_t *) file.c_str());
	}

	m_KeyValues.push_back(InspectorKeyValue(L"lang",lang_found));
}
void LibreOfficeInspector::_getUIFilesInstalled()
{
	wstring key;
	wchar_t szUIFound[20]=L"";

	key = PROGRAM_REGKEY;
	key += L"\\";
	key += m_version;

	if (m_registry->OpenKey(HKEY_LOCAL_MACHINE, (wchar_t*) key.c_str(), false))
	{
		wchar_t szFileName[MAX_PATH];

		if (m_registry->GetString(L"path", szFileName, sizeof(szFileName)))
		{
			int i;

			for (i = wcslen(szFileName); i > 0 && szFileName[i] != '\\' ; i--);
			
			szFileName[i + 1] = NULL;
			wcscat_s(szFileName, L"resource\\svxca.res");

			if(GetFileAttributes(szFileName) != INVALID_FILE_ATTRIBUTES) wcscat_s(szUIFound, L"ca");

			for (i = wcslen(szFileName); i > 0 && szFileName[i] != '.' ; i--);
			szFileName[i] = NULL;
			wcscat_s(szFileName, L"-XV.res");
			if(wcslen(szUIFound) > 1) wcscat_s(szUIFound, L";");
			if(GetFileAttributes(szFileName) != INVALID_FILE_ATTRIBUTES) wcscat_s(szUIFound, L"ca-XV");

		}
		m_registry->Close();
	}
	g_log.Log(L"LibreOfficeInspector::_getUIFilesInstalled '%s'", (wchar_t *) szUIFound);

	m_KeyValues.push_back(InspectorKeyValue(L"ui_files",szUIFound));
}
void ITunesInspector::_readLangInstalled()
{
	wchar_t szLanguage[1024] = L"";
	bool found = false;
	
	if ( m_registry->OpenKey(HKEY_CURRENT_USER, PROGRAM_REGKEY, false))
	{
		m_registry->GetString(L"LangID", szLanguage, sizeof(szLanguage));
		if (wcslen(szLanguage) > 0){
			found = true;
		}
		m_registry->Close();
	}
	
	if ( (!found) && ( m_registry->OpenKey(HKEY_LOCAL_MACHINE, PROGRAM_REGKEY, false)) )
	{
		m_registry->GetString(L"InstalledLangID", szLanguage, sizeof(szLanguage));
		m_registry->Close();	
	}
	
	g_log.Log(L"ITunesInspector::_readLangInstalled '%s'", szLanguage);
	m_KeyValues.push_back(InspectorKeyValue(L"lang", szLanguage));
	
}
Beispiel #7
0
void ThunderbirdInspector::_readLanguage()
{	
	g_log.Log(L"ThunderbirdInspector::_readLanguage language %s", (wchar_t*) m_locale.c_str());
	m_KeyValues.push_back(InspectorKeyValue(L"language", m_locale.c_str()));
}
Beispiel #8
0
void ThunderbirdInspector::_readVersion()
{
	g_log.Log(L"ThunderbirdInspector::_readVersion version %s", (wchar_t*) m_version.c_str());
	m_KeyValues.push_back(InspectorKeyValue(L"version", m_version.c_str()));
}