20 #ifndef __UPDATERENGINE_H__ 21 #define __UPDATERENGINE_H__ 23 #include <iutil/objreg.h> 24 #include <iutil/vfs.h> 25 #include <iutil/cfgmgr.h> 26 #include <csutil/csstring.h> 27 #include <iutil/document.h> 28 #include <csutil/threading/thread.h> 29 #include <csutil/list.h> 37 #define UPDATER_VERSION 3.07 39 struct iConfigManager;
42 #define UPDATER_VERSION_MAJOR 3 43 #define UPDATER_VERSION_MINOR 07 45 #ifdef CS_PLATFORM_WIN32 46 #define SELFUPDATER_TEMPFILE_POSTFIX ".tmp.exe" 47 #define SELFUPDATER_POSTFIX ".exe" 49 #define SELFUPDATER_TEMPFILE_POSTFIX ".tmp.bin" 50 #define SELFUPDATER_POSTFIX ".bin" 58 volatile bool exitGUI;
61 volatile bool cancelUpdater;
64 volatile bool updateNeeded;
67 volatile bool updateAdminNeeded;
70 volatile bool performUpdate;
73 volatile bool checkIntegrity;
76 volatile bool updateChecked;
79 volatile bool outOfSync;
81 csString currentClientVersion;
83 CS::Threading::Mutex mutex;
86 CS::Threading::Condition synched;
90 csList<csString> consoleOut;
96 performUpdate =
false;
98 updateAdminNeeded =
false;
99 checkIntegrity =
false;
100 updateChecked =
false;
101 cancelUpdater =
false;
118 CS::Threading::MutexScopedLock lock(mutex);
143 CS::Threading::MutexScopedLock lock(mutex);
144 consoleOut.DeleteAll();
149 CS::Threading::MutexScopedLock lock(mutex);
150 consoleOut.PushBack(str);
155 CS::Threading::MutexScopedLock lock(mutex);
156 csString ret = consoleOut.Front();
157 consoleOut.PopFront();
163 return consoleOut.IsEmpty();
170 iObjectRegistry* object_reg;
198 void Init(csStringArray& args, iObjectRegistry* _object_reg,
const char* _appName,
201 void CheckAndUpdate(iDocumentNode* md5sums, csString baseurl,
bool accepted =
false);
202 void CheckMD5s(iDocumentNode* md5sums, csString baseurl,
bool accepted, csRefArray<iDocumentNode> *failed);
203 bool UpdateFile(csString baseurl, csString mountPath, csString filePath,
bool failedEx =
false,
bool inZipFile =
false);
205 csString GetMD5OfFile(csString filePath);
208 UpdaterEngine(csStringArray& args, iObjectRegistry* _object_reg,
const char* _appName);
209 UpdaterEngine(csStringArray& args, iObjectRegistry* _object_reg,
const char* _appName,
222 csPtr<iDocumentNode> GetRootNode(
const char* fileName, csRef<iDocument>* document = 0);
228 bool SelfUpdate(
int selfUpdating);
231 void GeneralUpdate();
234 void CheckForUpdates();
243 void CheckIntegrity(
bool automatic =
false);
252 void PrintOutput(
const char*
string, ...);
258 #endif // __UPDATERENGINE_H__
csString GetCurrentClientVersion()
void SetOutOfSync(bool v)
void SetPerformUpdate(bool v)
void SetCancelUpdater(bool v)
void SetCurrentClientVersion(csString v)
bool GetUpdateAdminNeeded()
UpdaterConfig * GetConfig() const
void SetUpdateAdminNeeded(bool v)
void SetUpdateNeeded(bool v)
void SetUpdateChecked(bool v)
void ConsolePush(csString str)
void SetCheckIntegrity(bool v)