Commit graph

22 commits

Author SHA1 Message Date
Robert Knight
ef6809e0fe Fix updater cleanup of temporary directory on Windows
* On Windows FileOps::removeFile() fails for updater.exe
   since that file is in use by the current process.

   Whilst it is not possible to remove the file whilst it
   is in use, it can be moved or scheduled for deletion on reboot.

   This commit changes FilesOps::removeFile() to simulate the
   behavior of unlink() on Linux by moving in-use files to
   a temporary directory and then scheduling for them to
   be removed on restart.
2011-08-26 12:55:09 +01:00
Robert Knight
b4311d79a9 Rename Dir to DirIterator 2011-08-24 11:53:02 +01:00
Robert Knight
25e5a1c66c Make FileOps::createSymLink() a no-op which logs a warning under Windows instead of reporting an error.
This allows the cross-platform unit test to pass on Windows, since it includes creation of a symlink.
2011-08-22 19:21:29 +01:00
Robert Knight
66a6afcb01 Fix typo in FileOps::extractFromZip()
Use the correct parameter in the exception message.
2011-08-22 19:08:28 +01:00
Robert Knight
f35d935eab Add error code from GetLastError() to IOException::what() message 2011-08-22 18:57:03 +01:00
Robert Knight
57e13d941b Fix dir iteration on Windows
Instead of passing the directory to FindFirstFile(), a wildcard
of the form C:\Path\To\Dir\* needs to be passed.
2011-08-22 18:28:42 +01:00
Robert Knight
c0d1807252 Implement several FileOps functions under Win32 2011-08-22 18:03:27 +01:00
Robert Knight
f8d7cb3b4a Implement FileOps::touch() and FileOps::removeFile() for Win32 2011-08-22 16:59:23 +01:00
Robert Knight
e11cc9193a Fix MSVC++ compile error due to non-const array dimension values. 2011-08-22 16:36:39 +01:00
Robert Knight
b5adf1eb37 Skip compiling the FileOps::toUnixPermissions() helper method on Win32 2011-08-22 15:52:06 +01:00
Robert Knight
ced6b097b4 Remove unnecessary <malloc.h> include which is not found on Mac 2011-08-22 14:02:28 +01:00
Robert Knight
c1a5cce3da Convert Qt permission flags (from QFile::Permissions) to Unix mode_t flags.
This fixes the permissions set on files by the updater.
2011-08-22 10:01:25 +01:00
Robert Knight
9a0bee0358 Implement elevation under Linux using one of kdesudo, gksudo or gksu
* Add FileOps::fileName() to get the base name for a file
 * Add ProcessUtils::runSync() to run a process, wait for it to exit and then
   return the status code from that process.
 * Change ProcessUtils::runAsyncUnix() to use execvp() in order to search PATH
   for the specified binary if the filename is not absolute.
2011-08-22 00:32:33 +01:00
Robert Knight
55ebb233cb Add FileOps method to get the canonical path for a file and the Unix implementation. 2011-08-21 21:50:20 +01:00
Robert Knight
44c1937d96 Implement temp package directory removal on Unix. Untested. 2011-08-20 12:11:05 +01:00
Robert Knight
96793d262b Fix FileOps::touch()
creat() returns -1 on error or an fd otherwise which should be closed.
2011-08-20 00:58:09 +01:00
Robert Knight
ceb3b7d6a0 Add more detailed information to any file I/O errors and return true from FileOps::removeFile() if the file does not exist. 2011-08-20 00:46:07 +01:00
Robert Knight
71f197deb7 Add minizip library and use it to implement extraction of files from zip archives. 2011-08-20 00:38:05 +01:00
Robert Knight
fec68e523b Implement Unix version of dirname() 2011-08-19 21:23:55 +01:00
Robert Knight
8fea6c4202 Start implementing the Unix versions of functions in FileOps 2011-08-19 21:20:38 +01:00
Robert Knight
0a6630bc8c Add the core logic for installing and uninstalling files in UpdateInstaller 2011-08-19 21:03:10 +01:00
Robert Knight
66ade327db WIP - Standalone update installer with no dependency on Qt 2011-08-19 19:59:21 +01:00