public override void EntryPoint() { try { SetTaskStarted(m_TaskParameters.ErrorIndex); StackHashUtilities.SystemInformation.DisableSleep(); try { // Log on to WinQual. m_WinQualServices.LogOn(m_TaskParameters.UserName, m_TaskParameters.Password); // Call the WinQual services to download the cab. The cab info entry will also be updated. m_WinQualServices.GetCab( m_TaskParameters.ErrorIndex, m_TaskParameters.Product, m_TaskParameters.File, m_TaskParameters.Event, m_TaskParameters.Cab); } finally { } } catch (Exception ex) { LastException = ex; } finally { StackHashUtilities.SystemInformation.EnableSleep(); SetTaskCompleted(m_TaskParameters.ErrorIndex); } }
public override void EntryPoint() { bool loggedOn = false; try { SetTaskStarted(m_TaskParameters.ErrorIndex); // Don't allow the PC to go into sleep mode while syncing. StackHashUtilities.SystemInformation.DisableSleep(); try { // Log on to WinQual. m_WinQualServices.LogOn(m_TaskParameters.WinQualSettings.UserName, m_TaskParameters.WinQualSettings.Password); // Upload the file. m_WinQualServices.UploadFile(m_TaskParameters.FileName); } finally { try { if (loggedOn) { m_WinQualServices.LogOff(); } } catch (System.Exception ex) { DiagnosticsHelper.LogException(DiagSeverity.Warning, "Failed to log off Win Qual", ex); } } } catch (Exception ex) { LastException = ex; } finally { if (File.Exists(m_TaskParameters.FileName)) { File.Delete(m_TaskParameters.FileName); } StackHashUtilities.SystemInformation.EnableSleep(); SetTaskCompleted(m_TaskParameters.ErrorIndex); } }