This solves a problem: if the file already existed and the current user
couldn't truncate it the auto update couldn't use the Gtk auto-updater.
In this commit it also deletes the file and avoids creating and closing
the file and opening again.
MD-20923
If a directory was removed from one version of the app
to the next, all of the files inside the directory
would be removed but a hierarchy of empty directories would
be left behind.
On OS X this caused code signing checks to fail after updating
from a release which stored code signing-related files in
'Contents/_CodeSignature' for an embedded framework to
'Versions/4/_CodeSignature', since the old _CodeSignature dir
was never removed.
MD-20523
test: auto: TestFileUtils
Also fix a build issue due to AuthorizationExecuteWithPriviledges
being deprecated in OS X 10.7 when setting the OS X min deployment
version to 10.7 or later.
MD-19353
test: none
When create-packages.rb was run under ruby 1.9.x the Updater
binary in the output dir lost its executable permissions.
This is the same issue and fix as previously applied in
0472a4e991
Since this is usually built in the context of a larger project,
the outer project will want to control where the updater is installed
to.
MD-19678 #time 5m
When building the updater target from outside the updater-installer/
build dir in the context of a larger project, CMake failed
to determine how to build libupdatergtk.so in the context
of the dependency chain updater -> updatershared -> libupdatergtk.cpp ->
libupdatergtk.so
Resolve this for now by adding an explicit updatershared ->
resource_updatergtk dependency.
MD-19678 #time 2h
The behavior of FileUtils.cp w.r.t. preserving the source file
mode changed between Ruby 1.8 and Ruby 1.9, in particular the execute
permission was not preserved for copied binaries so the test script
failed to launch them.
Set the :preserve attribute so that the source file's mode is
used.
MD-19678 #time 1h
* Remove the dependency on Cygwin being installed along with zip.exe
at a specific location.
Add a small cross-platform tool in zip.cpp which creates a zip
file using the contents of a given directory.
This also removes the need for passing different arguments to 'zip'
depending on the platform.
* Fix StringUtils::endsWith()
* Fix UpdateDialogWin32::quit(), when called on a background thread it
had no effect. Post the WM_QUIT message to the main thread.
Invoke [NSApp stop:] on the main thread. When invoked from
UpdateDialogCocoa::updateFinished() on the background thread
it had no effect as [NSApp stop:] only stops the current run loop.
* Add a test which runs the test-update.rb script
* Add a --auto-close option to the updater which auto-dismisses the
update dialog once installation is complete. This is used in
test-update.rb to make the script run without user interaction
being required.
MD-19678 #time 1h
Add an UpdateDialog base class which the different platform
implmentations implement and use this to:
* Remove the duplicated runWithUi() functions in main.cpp
* Reduce the amount of boilerplate for loading the GTK dialog at
runtime and falling back to the non-GTK 'dialog' if this fails.
MD-19678 #time 1h
* Remove the CMAKE_OSX_DEPLOYMENT_TARGET setting and just
rely on the -mmacosx-min-version argument.
* Avoid requiring a specific OS X SDK version - just use the
default one.
On Mac, this is important as TMPDIR points to a user-specific temp dir
which avoids a potential problem where an app bundle created in the temp dir
running as User A cannot later be replaced by a copy of the updater running
as User B.
MD-19088 #time 30m
Reviewed-by: Nicolas Esteves
FileUtils.ln_s() is not supported on Windows and the updater
doesn't support symlinks on Windows either.
Create a dummy 'real' file to uninstall instead.
MD-19006
When checking whether a file exists before uninstalling it, FileUtils::fileExists()
checked whether the link target existed instead of the link itself. Change fileExists()
to use lstat() instead of stat().
The updater uninstalls files in the order they are listed, if a file and a symlink to it
are both being uninstalled (eg. libMendeley.so.1.6.0 and the symlink libMendeley.so.1.6)
and the real file is removed first, uninstalling the symlink later failed due to the
above issue with uninstalling broken symlinks.
MD-19006
Copy the work-around for missing template symbols in the C++ runtime library
from Mendeley Desktop.
See the StackOverflow discussion referenced in the comment for more details.
Reviewed-by: Carles Pina