コード例 #1
0
void FullIntegrationDownloader::Run()
{
    // no initialization to do, so signal readiness immediately
    SignalReady();

    try
    {
      const std::string tmpdir = CreateUniqueTempDirectory();
      Settings::WriteConfigValue("UpdateTempDir", tmpdir);

      FullIntegrationDownloadSink sink(*this, tmpdir);
      DownloadFile(m_appcast.DownloadURL, &sink);
      sink.Close();
	  InstallUpdate(sink.GetFilePath());
    }
	CATCH_ALL_EXCEPTIONS
}
コード例 #2
0
void UpdateDownloader::Run()
{
    // no initialization to do, so signal readiness immediately
    SignalReady();

    try
    {
      const std::wstring tmpdir = CreateUniqueTempDirectory();
      Settings::WriteConfigValue("UpdateTempDir", tmpdir);

      UpdateDownloadSink sink(*this, tmpdir);
      DownloadFile(m_appcast.DownloadURL, &sink);
      sink.Close();
      UI::NotifyUpdateDownloaded(sink.GetFilePath(), m_appcast);
    }
    catch ( ... )
    {
        UI::NotifyUpdateError();
        throw;
    }
}
コード例 #3
0
ファイル: updatedownloader.cpp プロジェクト: Roxee/winsparkle
void UpdateDownloader::Run()
{
    // no initialization to do, so signal readiness immediately
    SignalReady();

    try
    {
      const std::wstring tmpdir = CreateUniqueTempDirectory();
      Settings::WriteConfigValue("UpdateTempDir", tmpdir);

      UpdateDownloadSink sink(*this, tmpdir);
      DownloadFile(m_appcast.DownloadURL, &sink, this);
      sink.Close();

      if (Settings::HasDSAPubKeyPem())
      {
          SignatureVerifier::VerifyDSASHA1SignatureValid(sink.GetFilePath(), m_appcast.DsaSignature);
      }
      else
      {
          // backward compatibility - accept as is, but complain about it
          LogError("Using unsigned updates!");
      }

      UI::NotifyUpdateDownloaded(sink.GetFilePath(), m_appcast);
    }
    catch (BadSignatureException&)
    {
        CleanLeftovers();  // remove potentially corrupted file
        UI::NotifyUpdateError(Err_BadSignature);
        throw;
    }
    catch ( ... )
    {
        UI::NotifyUpdateError();
        throw;
    }
}