-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCWebUpdate.h
61 lines (49 loc) · 1.55 KB
/
CWebUpdate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// CWebUpdate.h : header file
//
#include <Wininet.h>
#ifndef _CWEBUPDATE_H
#define _CWEBUPDATE_H
/////////////////////////////////////////////////////////////////////////////
// CWebUpdate definitions
class CWebUpdate
{
// Construction
public:
CWebUpdate(); // Standard constructor
// Base directory, specify true to use the exe's path
void SetLocalDirectory(LPCSTR pathTo, bool generate);
CString GetLocalDirectory() { return localDir; }
// Remote URLs/dirs
void SetUpdateFileURL(LPCSTR url) { updateURL = url; }
void SetRemoteURL(LPCSTR url) { remoteURL = url; }
CString GetRemoteURL() { return remoteURL; }
CString GetUpdateFileURL() { return updateURL; }
// Give back some information
int GetNumberSuccessful() { return numSuccess; }
int GetNumberDifferent() { return numDifferent; }
int GetNumberMissing() { return numMissing; }
CString GetSuccessfulAt(int i) { return successfulFiles.GetAt(i); }
CString GetDifferentAt(int i) { return differentFiles.GetAt(i); }
CString GetMissingAt(int i) { return missingFiles.GetAt(i); }
// Download missing files
bool DownloadMissing(int i);
bool DownloadDifferent(int i);
// Do the update
int DoUpdateCheck();
CString fileVer; //new version
// Implementation
protected:
CString remoteURL;
CString updateURL;
CString localDir;
CString lastError;
CStringArray successfulFiles;
int numSuccess;
CStringArray differentFiles;
int numDifferent;
CStringArray missingFiles;
int numMissing;
private:
CString DoSHA1Hash(LPCSTR filePath);
};
#endif