Commit graph

316 commits

Author SHA1 Message Date
Remy Marquis
bb76b067ec fixed bz2 static link on Linux 2014-12-15 16:08:56 +01:00
Jacker
1c4e9d87a7 added execute arguments argument 2014-12-12 23:35:05 +02:00
jackeri
40c35f93cf setting executable overwrites the script values 2014-12-12 14:43:57 +02:00
jackeri
89bb4b2edc forgot to actually call the setExecutable 2014-12-12 11:18:55 +02:00
jackeri
a60da9122b added execute command so that we can start the main binary even if it was not updated, also added legacy branding 2014-12-12 10:32:06 +02:00
jackeri
9b72b1ad18 Merge remote-tracking branch 'upstream/master' 2014-12-10 12:23:36 +02:00
Carles Pina Estany
a779ecbbda Merge pull request #9 from cpina/MD-20923-fix_fail_ovewrite_file
Instead of always using the temporary file /tmp/libupdatergtk.so generates a unique filename.
2014-11-20 16:35:43 +00:00
Carles Pina
8e4df618c3 Deletes non-needed include.
MD-20923
2014-11-20 16:30:26 +00:00
Carles Pina
c24408d255 Close the file descriptor in the same method that had been opened.
MD-20923
2014-11-20 15:36:14 +00:00
Carles Pina
55f8918641 Uses stack-allocated array.
MD-20923
2014-11-20 12:45:04 +00:00
Carles Pina
3904349a06 Simplifies creating the char*, avoids using useless std::string
MD-20923
2014-11-20 12:03:38 +00:00
Carles Pina
0ef971a251 Uses std::string
MD-20923
2014-11-20 12:00:01 +00:00
Carles Pina
ac93a8b06f Uses tabs for indentation.
MD-20923
2014-11-19 16:39:32 +00:00
Carles Pina
8a68ba2844 Uses FileUtils::removeFile() instead of unlink()
MD-20923
2014-11-19 16:37:34 +00:00
Carles Pina
abe12806e5 Instead of always using the temporary file /tmp/libupdatergtk.so generates a new name.
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
2014-11-19 16:09:50 +00:00
Robert Knight
e2441e3e67 Remove empty directories in the installation dir after update
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
2014-09-22 12:50:26 +01:00
Robert Knight
4459e0d6c0 Fix C++11 builder under GCC
Use decltype(T) instead of typeof(T) under C++11

MD-19353
2014-07-18 19:48:34 +01:00
Robert Knight
81f80d26d2 Allow containing project to override the OS X deployment version
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
2014-07-18 13:49:53 +01:00
Robert Knight
f6ded2035f Bump deployment target from OS X 10.5 to 10.6
MD-20245
test: none
2014-05-28 17:11:36 +01:00
Robert Knight
bb9c0bbc80 Remove StlSymbolsLeopard.cpp
This commit removes support for OS X 10.5 from the updater and removes
the StlSymbolsLeopard workaround that was required with it.
2014-05-28 16:13:47 +01:00
Robert Knight
3cce9d3058 Portability fix for calculating package SHA sums
Use Digest::SHA1 from the standard library instead of shelling
out to the 'sha1sum' utility which is named shasum under OS X
2014-05-19 17:32:25 +01:00
Jacker
f201a6cd7d legacy information added 2014-05-07 20:21:47 +03:00
Robert
21dd167d8b Avoid unnecessary redefinition of atoll() under MSVC 2013
atoll() was added to the MSVC standard library under MSVC 2013
so we don't need our own definition of it.

MD-20088
test: none: Build fix
2014-04-04 12:43:36 +01:00
Robert Knight
1b0d933ad7 Fix Linux build
The variable SYSTEM_NAME does not exist, it should be
CMAKE_SYSTEM_NAME as per
http://www.cmake.org/Wiki/CMake_Useful_Variables

MD-12499
test: none
2014-03-06 17:19:03 +00:00
Robert Knight
3223bcff7a Merge pull request #6 from tru/freebsd
Add support for FreeBSD
2014-02-10 16:13:04 +00:00
Tobias Hieta
a8755f9464 Add support for FreeBSD 2014-02-10 08:03:11 -08:00
Robert Knight
373caf74a7 Fix permissions of Updater binary under Ruby 1.9.x
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
2013-09-20 14:57:30 +01:00
Robert Knight
5d2ce7e8c3 Set OS X min version for both C and C++ source files
MD-19720 #time 30m
2013-09-10 15:38:45 +01:00
Robert Knight
ddce2d6e73 Enable PDB generation for release builds
This does increase the size of the binary but enables debugging
of crash dumps from release builds of the updater on Windows.

MD-19678 #time 10m
2013-09-05 11:13:45 +01:00
Robert Knight
7335ee3eac Fix debug build on Windows
Specify static linking to VC runtime libs under both debug and release
builds

MD-19678 #time 10m
2013-09-04 18:58:40 +01:00
Robert Knight
465788b400 Remove the install target from updater
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
2013-09-04 18:31:38 +01:00
Robert Knight
4df97c84e1 On Windows, build the updater with UNICODE and _UNICODE not set
FileUtils and DirIterator currently assume that the Windows
file manipulation calls accept a char*

MD-19678 #time 10m
2013-09-04 16:37:05 +01:00
Robert Knight
6a56b5cddc Add embedded GTK UI lib as a dependency of the updater
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
2013-09-04 12:49:03 +01:00
Robert Knight
e74435e871 Specify the CMake module path using a path relative to the current source dir
This fixes a problem where the module path was not found
when the updater is incorporated into a larger CMake project

MD-19678 #time 10m
2013-09-03 16:39:23 +01:00
Robert Knight
83b2697b52 Add updater_ prefix to test target names
This avoids a conflict with CMake targets that happen to have
the same name in Mendeley's main CMake project.

MD-19678 #time 10m
2013-09-03 16:34:02 +01:00
Robert Knight
d25cfb8583 Fix formatting of zip-tool.cpp
MD-19678 #time 2m
2013-09-02 10:29:13 +01:00
Robert Knight
ec3d09000b Add usage info to zip-tool utility
MD-19678 #time 5m
2013-09-02 10:28:29 +01:00
Robert Knight
0472a4e991 Fix updater test behavior with Ruby 1.9.x
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
2013-09-02 09:56:16 +01:00
Robert Knight
b168ed69d7 Fix zip-tool build on Mac
Add the Security and Cocoa frameworks as link dependencies
of the shared updater library.

MD-19678 #time 10m
2013-08-30 15:43:25 +01:00
Robert Knight
2658f1235d Fix update installer test on Windows
* 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.
2013-08-30 15:33:46 +01:00
Robert Knight
484f8ae37b Fix Win32 build - add missing include 2013-08-30 14:09:09 +01:00
Robert Knight
1ebf62e1fa Fix Mac implementation of --auto-close option
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.
2013-08-30 12:16:22 +01:00
Robert Knight
84288ddc6c Add missing UpdateDialog.cpp file
MD-19678 #time 5m
2013-08-30 12:04:22 +01:00
Robert Knight
cbda873a70 Run the update installation test as part of the 'make test' target
* 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
2013-08-30 11:44:39 +01:00
Robert Knight
c09e5d2290 Reduce duplication between the different platform implementations of the update dialog
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
2013-08-30 10:52:05 +01:00
Robert Knight
b1bf64a671 Fix updater test on Ubuntu 13.04
Set file permissions to match those specified in
the updater script or in the case of new-dir/new-dir2
the mode hard-coded into FileUtils::mkdir()
2013-08-29 18:21:18 +01:00
Robert Knight
e55a58e4be Replace use of deprecated pkgconfig() macro with find_package()
MD-19678 #time 15m
2013-08-29 17:11:43 +01:00
Robert Knight
b6a13d3faa Fix build issues on Ubuntu 13.04
* Add missing <unistd.h> include
 * Check for presence of bzip2 library

MD-19678 #time 10m
2013-08-29 16:38:19 +01:00
Robert Knight
dab236d8de Enable customization of the tool used to sign the updater
Add a BINARY_SIGNING_TOOL CMake var which can be overridden to specify
a custom script/tool to use to sign the updater binary.
2013-08-29 15:59:19 +01:00
Robert Knight
401785786a Enable building the updater with newer SDKs on Mac
* 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.
2013-08-29 15:25:04 +01:00