bool WindowsLPIAction::Download(ProgressStatus progress, void *data) { GetTempPath(MAX_PATH, m_szFilename); Url url(m_actionDownload.GetFileName(_getDownloadID())); wcscat_s(m_szFilename, url.GetFileName()); return _getFile(_getDownloadID(), m_szFilename, progress, data); }
bool WindowsLPIAction::IsNeed() { if (status == CannotBeApplied) return false; bool bNeed = false; if (_getDownloadID() != DI_UNKNOWN) { if (_isLangPackInstalled() == false || _isDefaultLanguage() == false) { bNeed = true; } else { status = AlreadyApplied; } } else { status = CannotBeApplied; _getStringFromResourceIDName(IDS_WINDOWSLPIACTION_UNSUPPORTEDVERSION, szCannotBeApplied); g_log.Log(L"WindowsLPIAction::IsNeed. Unsupported Windows version"); } g_log.Log(L"WindowsLPIAction::IsNeed returns %u", (wchar_t *) bNeed); return bNeed; }
bool MSOfficeLPIAction::Download(ProgressStatus progress, void *data) { bool bFile1, bFile2; ConfigurationFileActionDownload downloadVersion; assert(_getDownloadID() != NULL); downloadVersion = ConfigurationInstance::Get().GetRemote().GetDownloadForActionID(GetID(), wstring(_getDownloadID())); wcscpy_s(m_szFilename, downloadVersion.GetFilename().c_str()); wcscpy_s(m_szFullFilename, m_szTempPath); wcscat_s(m_szFullFilename, m_szFilename); bFile1 = m_downloadManager->GetFileAndVerifyAssociatedSha1(downloadVersion, m_szFullFilename, progress, data); if (_needsInstallConnector()) { downloadVersion = ConfigurationInstance::Get().GetRemote().GetDownloadForActionID(GetID(), wstring(L"OutlookHotmailConnector")); m_connectorFile = m_szTempPath; m_connectorFile += downloadVersion.GetFilename().c_str(); bFile2 = m_downloadManager->GetFileAndVerifyAssociatedSha1(downloadVersion, m_connectorFile, progress, data); return bFile1 == true && bFile2 == true; } else { return bFile1; } }
void Windows8LPIAction::CheckPrerequirements(Action * action) { if (_isASupportedSystemLanguage() == false) { _getStringFromResourceIDName(IDS_WINDOWSLPIACTION_NOSPFR, szCannotBeApplied); g_log.Log(L"Windows8LPIAction::CheckPrerequirements. Unsupported base language"); SetStatus(CannotBeApplied); return; } if (_isAlreadyApplied()) { SetStatus(AlreadyApplied); return; } ConfigurationFileActionDownload downloadVersion; downloadVersion = ConfigurationInstance::Get().GetRemote().GetDownloadForActionID(GetID(), wstring(_getDownloadID())); if (downloadVersion.IsEmpty()) { _getStringFromResourceIDName(IDS_NOTSUPPORTEDVERSION, szCannotBeApplied); g_log.Log(L"Windows8LPIAction::CheckPrerequirements. Version not supported"); SetStatus(CannotBeApplied); return; } }
bool Windows8LPIAction::Download(ProgressStatus progress, void *data) { wchar_t filename[MAX_PATH]; ConfigurationFileActionDownload downloadVersion; downloadVersion = ConfigurationInstance::Get().GetRemote().GetDownloadForActionID(GetID(), wstring(_getDownloadID())); GetTempPath(MAX_PATH, filename); wcscat_s(filename, downloadVersion.GetFilename().c_str()); m_filename = filename; return m_downloadManager->GetFileAndVerifyAssociatedSha1(downloadVersion, filename, progress, data); }
void IELPIAction::CheckPrerequirements(Action * action) { Prerequirements pre; ActionStatus status; if (GetStatus() == CannotBeApplied) status = Selected; else status = GetStatus(); szCannotBeApplied[0] = NULL; pre = _checkPrerequirements(); if (pre != PrerequirementsOk) { switch (pre) { case UnknownIEVersion: _getStringFromResourceIDName(IDS_IELPIACTION_UNKNOWNIE, szCannotBeApplied); break; default: break; } } else if (action != NULL) { switch (_checkPrerequirementsDependand(action)) { case AppliedInWinLPI: _getStringFromResourceIDName(IDS_IELPIACTION_APPLIEDINWINLPI, szCannotBeApplied); break; case NeedsWinLPI: _getStringFromResourceIDName(IDS_IELPIACTION_IENEEDWINLPI, szCannotBeApplied); break; case NoLangPackAvailable: _getStringFromResourceIDName(IDS_IELPIACTION_NOPACKAGE, szCannotBeApplied); break; default: break; } } g_log.Log(L"IELPIAction::CheckPrerequirements: %s", wcslen(szCannotBeApplied) > 0 ? szCannotBeApplied: L"Ok"); if (wcslen(szCannotBeApplied) > 0) { status = CannotBeApplied; } else { if (_getDownloadID() != NULL) { if (_isLangPackInstalled()) { status = AlreadyApplied; } } else { status = CannotBeApplied; } } SetStatus(status); }
bool IELPIAction::Download(ProgressStatus progress, void *data) { if (_createTempDirectory() == false) return false; wstring filename; ConfigurationFileActionDownload downloadVersion; downloadVersion = ConfigurationInstance::Get().GetRemote().GetDownloadForActionID(GetID(), _getDownloadID()); GetTempPath(MAX_PATH, m_filename); wcscat_s(m_filename, downloadVersion.GetFilename().c_str()); return m_downloadManager->GetFile(downloadVersion, m_filename, progress, data); }