Implement update installer

This commit is contained in:
Andrew
2013-12-05 20:32:12 -06:00
parent 48ec8e67b8
commit e90f1a2756
12 changed files with 133 additions and 73 deletions

View File

@ -57,7 +57,7 @@ protected:
struct VersionFileEntry
{
QString path;
bool isExecutable;
int mode;
FileSourceList sources;
QString md5;
};
@ -70,9 +70,9 @@ protected:
*/
struct UpdateOperation
{
static UpdateOperation CopyOp(QString fsource, QString fdest) { return UpdateOperation{OP_COPY, fsource, fdest, 644}; }
static UpdateOperation MoveOp(QString fsource, QString fdest) { return UpdateOperation{OP_MOVE, fsource, fdest, 644}; }
static UpdateOperation DeleteOp(QString file) { return UpdateOperation{OP_DELETE, file, "", 644}; }
static UpdateOperation CopyOp(QString fsource, QString fdest, int fmode=0644) { return UpdateOperation{OP_COPY, fsource, fdest, fmode}; }
static UpdateOperation MoveOp(QString fsource, QString fdest, int fmode=0644) { return UpdateOperation{OP_MOVE, fsource, fdest, fmode}; }
static UpdateOperation DeleteOp(QString file) { return UpdateOperation{OP_DELETE, file, "", 0644}; }
static UpdateOperation ChmodOp(QString file, int fmode) { return UpdateOperation{OP_CHMOD, file, "", fmode}; }
//! Specifies the type of operation that this is.
@ -84,8 +84,8 @@ protected:
OP_CHMOD,
} type;
//! The source file. If this is a DELETE or CHMOD operation, this is the file that will be modified.
QString source;
//! The file to operate on. If this is a DELETE or CHMOD operation, this is the file that will be modified.
QString file;
//! The destination file. If this is a DELETE or CHMOD operation, this field will be ignored.
QString dest;
@ -145,6 +145,11 @@ protected:
*/
virtual void processFileLists();
/*!
* Takes the operations list and writes an install script for the updater to the update files directory.
*/
virtual void writeInstallScript(UpdateOperationList& opsList, QString scriptFile);
VersionFileList m_downloadList;
UpdateOperationList m_operationList;