00001
00002
00003
00004
00005
00006 #if !defined(AFX_FSUPDATEMGR_H__287BFC6A_1FC7_42E5_9BC8_9DEAA3381DCC__INCLUDED_)
00007 #define AFX_FSUPDATEMGR_H__287BFC6A_1FC7_42E5_9BC8_9DEAA3381DCC__INCLUDED_
00008
00009 #include "fsDownloadMgr.h"
00010 #if _MSC_VER > 1000
00011 #pragma once
00012 #endif
00013
00014 #include "list.h"
00015
00016 enum fsUpdateMgrEvent
00017 {
00018 UME_CONNECTING,
00019
00020 UME_RETREIVINGUPDLST,
00021 UME_RETREIVINGUPDATE,
00022 UME_UPDLSTDONE,
00023 UME_UPDATEDONE,
00024
00025 UME_FATALERROR,
00026 UME_NEWVERSIONAVAIL,
00027 UME_NEWVERSIONNOTAVAIL,
00028 UME_ERROR,
00029 };
00030
00031 typedef void (*fntUpdateMgrEventsFunc) (fsUpdateMgrEvent ev, LPVOID lp);
00032 typedef void (*fntUpdateMgrDescEvents) (LPCSTR pszEvent, LPVOID lp);
00033
00034 class fsUpdateMgr
00035 {
00036 friend class CPrg_UpdatePage;
00037 public:
00038
00039 void CheckForUpdate(bool bByUser);
00040
00041 void Update (BOOL bByFull);
00042
00043 BOOL StartUpdater();
00044
00045 BOOL IsStartUpdaterNeeded(BOOL bUpdaterWillBeLaunchedNow = TRUE);
00046
00047 void UpdateOnNextStart();
00048
00049 fs::list <CString>* GetWhatNew();
00050
00051 LPCSTR GetUpgSize();
00052
00053 LPCSTR GetFullSize();
00054
00055 void Stop();
00056
00057 LPCSTR GetBuildNumber();
00058 LPCSTR GetVersion();
00059
00060 BOOL IsRunning();
00061
00062 void SetDescEventsFunc (fntUpdateMgrDescEvents pfn, LPVOID lpParam);
00063 void SetEventsFunc (fntUpdateMgrEventsFunc pfn, LPVOID lp);
00064
00065 void ReadSettings();
00066 void SaveSettings();
00067
00068 vmsAutoUpdateType m_enAUT;
00069 CString m_strUpdateUrl;
00070
00071 fsUpdateMgr();
00072 virtual ~fsUpdateMgr();
00073
00074 fsDownloadMgr *m_dldr;
00075
00076 protected:
00077
00078 static void FixIniFileFor9x (LPCSTR pszIni);
00079
00080 bool m_bCheckingByUser;
00081 CString m_strUpdateFile;
00082
00083 void Event (LPCSTR pszEvent);
00084 static void _DownloadMgrDescEvents (fsDownloadMgr *pMgr, fsDownloadMgr_EventDescType enType, LPCSTR pszDesc, LPVOID lp);
00085 LPVOID m_lpEventsParam;
00086 fntUpdateMgrEventsFunc m_pfnEvents;
00087 LPVOID m_lpDescEventsParam;
00088 fntUpdateMgrDescEvents m_pfnDescEvents;
00089 void Event (fsUpdateMgrEvent ev);
00090
00091 CString m_strDlFullInstallPath;
00092 CString m_strDlUpgradesPath;
00093
00094 CString m_strUpgSize, m_strUpgFileName;
00095 CString m_strFullSize;
00096 CString m_strVersion;
00097 CString m_strBN;
00098 fs::list <CString> m_vWN;
00099
00100 void ProcessUpdateLstFile();
00101 BOOL m_bChecking;
00102
00103 static DWORD _DownloadMgrEvents (fsDownloadMgr *pMgr, fsDownloaderEvent, UINT, LPVOID lp);
00104 BOOL m_bRunning;
00105 };
00106
00107 #endif