Commit graph

296 commits

Author SHA1 Message Date
Robert Knight
29ba43be7c Update the README file.
* Re-organize the sections into a more logical order.
 * Tidy-up the wording of the introduction.
 * Add more details to the section on customizing the updater
2011-09-04 12:26:39 +01:00
Robert Knight
e9c94e99ad Add a note about the assumptions made by Log::writeToStream() with respect to multiple logging processes' clobbering each other's output. 2011-09-02 23:41:02 +01:00
Robert Knight
9c260bc114 Synchronize access to the log's output stream with a mutex and document the write() method as being thread-safe. 2011-09-02 23:32:45 +01:00
Robert Knight
e2d3acf850 Add a note about universal builds on Mac OS X 2011-09-02 14:16:47 +01:00
Robert Knight
2f89332824 Show a useful product name and description in the UAC prompt under Windows Vista/7
Add a VERSION_INFO section to the executable's resource file specifying
the product name and description.

The organization is currently set as 'Mendeley Ltd' - other projects
will want to customize this.

When the produced executable is digitally signed, the product name
and description are shown in the UAC prompt asking for admin
permissions.
2011-09-02 12:53:44 +01:00
Robert Knight
ea7fc49002 Add assert to check that the base path provided to FileUtils::makeAbsolute() is itself absolute. 2011-09-01 20:45:29 +01:00
Robert Knight
483ad4cee0 Fix UpdaterOptions test on Mac. On Mac /tmp is a symlink to /private/tmp 2011-09-01 20:39:56 +01:00
Robert Knight
6ca00a6449 If the --script argument passed to the updater is relative, interpret it as being relative to the package dir rather than the directory that the updater is run from.
Mendeley Desktop <= 1.0 clients pass a relative path for the script argument but
run the updater from the directory containing the main application binary instead
of the package dir.  The script argument, if relative, is therefore treated as
relative to the package directory.
2011-09-01 20:31:51 +01:00
Robert Knight
1fb6d03886 When a test comparison fails, print the actual and expected values that did not match instead of the expressions in the code.
This requires a specialization of TestUtils::toString() for each distinct type,
otherwise a generic message is used.
2011-09-01 19:54:58 +01:00
Robert Knight
b5edffc0b6 Interpret the CurrentDir=$DIR argument on the command line as being relative to the directory containing the main application binary
Mendeley Desktop <= 1.0 clients set CurrentDir to the directory containing the main
application binary rather than the root of the install directory.

Change the parsing in UpdaterOptions and adjust the test accordingly.
2011-09-01 19:53:15 +01:00
Robert Knight
e835036e41 Fix the package name of the original updater not being used when inserting a subtitute updater via the -u command line flag 2011-09-01 17:56:36 +01:00
Robert Knight
6c9c8696fb Fix symlinks to directories in the input directory not being included in the <install> section of the generated file_list.xml
Only exclude plain directories from update packages, not symlinks to directories.
2011-09-01 17:42:46 +01:00
Robert Knight
48084cfdb2 Special handling for the updater binary in the package creation script.
The updater binary is listed as a package on its own but is not
compressed.  The program downloading the update can then download
all packages for the new version including the updater executable
'package' (in reality, just the plain file) and then invoke that updater.

This also allows for substitution of the updater binary with a different
version via the -u parameter.
2011-09-01 17:37:50 +01:00
Robert Knight
9d088dff86 Robustness improvements to the package generator
* Abort if running the zip tool fails
 * Abort if multiple file path rules match a given file
 * Remove part of the special updater binary handling - this needs to be reworked
 * Sort the file paths before feeding them to the zip tool, so that multiple runs with
   with the same set of files will generate the same packages
2011-09-01 15:56:26 +01:00
Robert Knight
b39c71638a Add required --platform and --version arguments to the package creation script and allow the updater binary to be specified with a -u option
These specify the target version for the update and the platform and are embedded
in the <targetVersion> and <platform> elements of the generated file_list.xml file

Ordinarily the script will use the updater binary from the input files directory which
matches the path of the updater binary specified in the package config file.

However it may sometimes be necessary to use a different binary, which can be done
via a -u option.
2011-09-01 12:47:10 +01:00
Robert Knight
7cd04905df Add missing include for Windows builds 2011-08-31 15:52:14 +01:00
Robert Knight
f16b6e9933 Fix compile errors due to size_t -> int/double conversion warnings on 64bit Linux 2011-08-31 12:55:22 +01:00
Robert Knight
cc387031d7 Make the GTK development libraries a build requirement on Linux and remove the ENABLE_GTK #ifdefs in main.cpp 2011-08-31 12:44:03 +01:00
Robert Knight
cb412f4619 Change the documentation in the CMakeLists.txt file to reflect that the available Mac OS SDKs depend on the version of XCode installed as well as the version of Mac OS X
XCode 4 only ships with the 10.6 and 10.7 SDKs, so building for 10.5 requires
XCode 3.2.6, which fortunately is still available from Apple's website.
2011-08-30 18:24:48 +01:00
Robert Knight
8af95a2726 Update the documentation for the GenerateCppResourceFile module 2011-08-30 15:58:07 +01:00
Robert Knight
ea8fcb4e82 Merge branch 'master' of ssh://gitweb/git/desktop/standalone-updater 2011-08-30 15:55:29 +01:00
Robert Knight
46a32fe229 Display an icon for the updater in the dock on Mac when the update dialog is being shown
* Embed the app icon in the updater executable on Mac and
   use it as the application's icon.

 * Transform the application from a background to a foreground app when the
   Mac dialog is shown, so that the dock icon is shown.

 * Forcibly give focus to the updater application so that the progress window
   gains focus when it is shown.

There is a remaining glitch with the application where the icon briefly transforms
back from the app icon to the terminal icon as the application shuts
down.  This presumably happens because the custom icon set on the NSApplication
is reset before the dock icon disappears.
2011-08-30 15:41:58 +01:00
Robert Knight
b33170c408 Build the updater using the Mac OS X 10.5 SDK
Mendeley Desktop is currently built for Mac OS 10.5 and newer,
so the updater needs to work on the same platforms.

With this change, it will not be possible to build the updater
on Mac OS 10.7 directly.
2011-08-30 12:57:00 +01:00
Robert Knight
000eea3553 Update TODO file 2011-08-30 12:38:59 +01:00
Robert Knight
3c28b84080 Merge branch 'master' of ssh://gitweb/git/desktop/standalone-updater 2011-08-30 12:37:55 +01:00
Robert Knight
e1b0b3266d Fix test linkage on Mac.
Link the test binaries to the Security/Cocoa frameworks.
2011-08-30 12:37:26 +01:00
Robert Knight
1c3cdde4c1 Fix FileUtils::touch() build on Mac.
The utimensat/futimens system calls were introduced in relatively recent Linux
kernels and are not available on Mac.  Use utimes/futimes instead - since
microsecond precision is fine for our needs.
2011-08-30 12:36:07 +01:00
Robert Knight
50faf07f00 Write log file to correct directory on Mac
* Move class to get the app data directory to a new StandardDirs class.
 * Setup an auto-release pool at the start/end of main() to catch objects
   allocated outside of the updater dialog.
2011-08-30 12:34:37 +01:00
Robert Knight
ef4dc40b52 Merge branch 'master' of ssh://gitweb/git/desktop/standalone-updater 2011-08-30 11:22:41 +01:00
Robert Knight
1d2c02acf4 Add some documentation to the xterm update 'dialog' 2011-08-30 11:21:35 +01:00
Robert Knight
86d61fdb4a Update TODO file.
Add a note in the TODO file about binary patches.
2011-08-30 11:06:33 +01:00
Robert Knight
0fc706264a Add a note in the TODO file about preventing multiple simultaneous updates 2011-08-30 11:03:49 +01:00
Robert Knight
76f164e3c0 Fix 'Finish' button not being enabled if updater fails with an error reading the update script.
UpdateObserver::updateFinished() was not being called by UpdateInstaller.
Add a call to updateFinished() in UpdateInstaller::reportError()
2011-08-30 10:47:51 +01:00
Robert Knight
6d862cbba7 Fix Windows compile 2011-08-30 10:46:47 +01:00
Robert Knight
9d3c02e31c Store update-log.txt log file in the correct location under Windows
This is the same location that Mendeley Desktop stores its data files
($LOCAL_APPDATA/$ORGANIZATION_NAME/$APP_NAME)
2011-08-30 10:43:14 +01:00
Robert Knight
56e476b33d Add a note in the README file on how to build the updater and customize it 2011-08-29 23:08:34 +01:00
Robert Knight
faddccc763 Touch the application's bundle directory on Mac OS X after installing updates.
This is necessary so that Launch Services in OS X picks up changes
to the Info.plist file describing various aspects of the application.

See https://bugzilla.mozilla.org/show_bug.cgi?id=600098 for an example
of the kind of issue that failure to do this can lead to.
2011-08-29 22:53:19 +01:00
Robert Knight
c20c452e98 Update the access/modification times of the existing file, if there is one, in FileUtils::touch()
This changes FileUtils::touch() to match the documentation for the 'touch' tool
on Unix.
2011-08-29 22:44:52 +01:00
Robert Knight
d7e3cc8d63 Rename FileOps to FileUtils for consistency with the ProcessUtils and StringUtils classes. 2011-08-29 22:27:55 +01:00
Robert Knight
b7d999b2c8 Update TODO file 2011-08-29 21:45:02 +01:00
Robert Knight
cb1e1c612a Mark UpdateMessage::init() as private since it exists only as a helper for the constructors 2011-08-29 21:39:17 +01:00
Robert Knight
2c70cebd05 Make the GTK update dialog wider
gtk_window_set_default_size() has no effect when the dialog
is marked as non-resizable with gtk_window_set_resizable(),
so the minimum size is instead achieved by setting a minimum width
on the progress bar.
2011-08-29 20:20:42 +01:00
Robert Knight
c253cecfa6 If there is a problem installing the update, suggest that the user download a fresh copy from mendeley.com
* Centralize the error message text shown to the user in the event of a problem
   installing the update in AppInfo::updateErrorMessage() and add a section
   suggesting that the user should download a new copy from mendeley.com
2011-08-29 18:57:12 +01:00
Robert Knight
cdf2c2c6ba Update TODO file 2011-08-29 18:49:26 +01:00
Robert Knight
761a4c5d3b Move cmake code to generate a C++ source file from a binary data file into a helper module 2011-08-29 17:40:25 +01:00
Robert Knight
3c836c2d0c Minor formatting fix 2011-08-29 17:23:44 +01:00
Robert Knight
52fdee5a75 Remove duplicated code for getting the ID of the current process in Log.cpp.
Re-use the existing function from ProcessUtils
2011-08-29 17:22:06 +01:00
Robert Knight
7b29c29d85 Avoid trying to wait for the main app process to exit if no process ID for it is specified 2011-08-29 15:17:31 +01:00
Robert Knight
f9238f479b Log update installation details to update-log.txt in the correct Mendeley data directory under Linux 2011-08-29 14:44:08 +01:00
Robert Knight
0d22024b49 Add additional API documentation 2011-08-27 18:31:03 +01:00