Skip to content
This repository

Sparkle Updater Integration #18

Closed
markcarver opened this Issue · 7 comments

3 participants

Mark Carver Mark A. Stratman Alexey Ermakov
Mark Carver
Collaborator

Should the sparkle framework be included as a feature to automatically update cocoaDialog?

Mark A. Stratman
Owner

I'm not familiar with sparkle specifically, but for what it's worth, my opinion is that self-updating apps are OK in general provided:
1) It gives you the option to opt-out of self-updates, and no network communication occurs when opted-out.
2) You can still update by downloading the app manually

But CD is in a semi-unique situation since it doesn't fire up the app icon into the dock, doesn't have (iirc) a menu, doesn't have an easy way to do preferences (e.g. a preferences dialog), and possibly most importantly often is run by users of some other app or script.
e.g. many cD users are unknowingly using it, since it's bundled with something else.

Just an idea - but maybe one way to work around this is to give it a new special runmode: upgrade
Or something to that effect.

Wherein cocoadialog upgrade fires up the self-update code.

This is just a brain-dump though, some off-the-cuff thoughts.

Mark Carver
Collaborator

Well yes, I only found out about cD because it was bundled with TextMate. However when an application does that, it's up to them to update their version. Its always been my opinion that first party apps should initiate the version upgrade so it is compatible with their software.

However, like you said, cD is unique in that it is strictly a CLI for scripting, so there's really no compatibility issues at hand. Not to mention I've been making 3.0 completely backwards compatible so it doesn't break existing features, only enhances them.

I like the cocoaDialog update runMode suggestion, but that would be the equivalent to the user clicking the "Check for updates..." menu item. Sparkle is a very well know open source solution which hits both your points mentioned above. By default it would check for an update automatically (set in cDs Info.plist) and would only ever show if an update actually exists. At that time the user can choose to uncheck the "automatically check for updates" which would save the users preference. At that point cD would only be updatable by running cocoaDialog update or being replaced when the first party app updates (assuming an app like TextMate has included the latest update).

Mark A. Stratman
Owner

Sounds like you have a good idea of what will work and what won't, so for what it's worth I'm on board. :)

Alexey Ermakov

I think that Sparkle's automatic updates would be extremely annoying. When my script fires up CD to display a progress bar or ask me some question I don't expect it to also ask me about updates, then have me babysit it through downloading and restarting (how do you even restart CD after update without the caller going WTF about it?). Besides, it's not like CD has some value on its own, so if someone needs a specific feature he can always run CocoaDialog update manually.

Mark A. Stratman
Owner

This makes me also wonder - since CD is often run for only a second or two, if the internet is slow (or not present at all) i'd hate to see this lag the dialog's return time.

Mark Carver
Collaborator

I have a fork of Sparkle. 1) It doesn't lag if there's no internet connection, it is simply ignored and moves on. 2) I agree that the presence of auto updating would be annoying for a simple script. However for a script that relies heavily on cD, it would be nice to ensure that it has the latest version.

Perhaps we can disable autoupdating all together. And for scripts that require a specific version we can include two runModes, cocoaDialog version and cocoaDialog update. The first would simply return cD's version and the later would actually run sparkle's updating process.

#!/bin/bash
if [[ $(cocoaDialog version) < 3.0.0 ]]; then
  cocoaDialog update
fi
Mark Carver markcarver referenced this issue from a commit
Mark Carver markcarver 8 changes to project
- Fixed deployment configuration
- Added Growl framework
- Added Sparkle framework
- Added CDNotifyControl to delegate growl or bubble notifications
- Restructured AppController
- Registered cocoaDialog with Growl
- Used Sparkle's relaunch tool to sub-thread notifications so scripts do not hang while waiting for them to disappear
- Created getIconWithName: and getIconFromFile: in CDControl
Commit for #9
Commit for #18
ca25075
Mark Carver markcarver referenced this issue from a commit
Mark Carver markcarver #18 - Updated Sparkle framework to latest version
Created relaunch tool for cocoaDialog
0dbcbad
Mark Carver markcarver referenced this issue from a commit
Mark Whitaker Fixes #24 CDBubbleControl does not respond to --click-path or --click…
…-arg

Updated Sparkle Framework (#18) to work with 10.7 installations
Changed version to: 3.0.0-beta4
3aad02b
Mark Carver markcarver referenced this issue from a commit
Mark Whitaker Added update and update-automatic runModes
Internalized FeedURL
Adding beta4 binary release to repository, needed for comparing future delta updates
#18
6d583f1
Mark Carver markcarver referenced this issue from a commit
Mark Whitaker #18 Added 3.0.0-beta5 as a sparkle-release 8c85382
Mark Carver markcarver closed this issue from a commit
Mark Whitaker Fixes #18 Sparkle Updater Integration 4c86752
Mark Carver
Collaborator

We finally have Sparkle Updater support!

The final run-mode is simply update with the ability to provide the option --quiet to run everything automatically (no dialog prompts). The update run-mode will return the following exit status:

0 - Update was successful
1 - Update was unsuccessful
2 - No update was found

If the update run-mode returns an error, use the --debug option to output the message to standard error.

For example, the following would update cocoaDialog (automatically) to the latest release if it is less than 3.0.1:

if [[ $(cocoaDialog version) < 3.0.1 ]]; then
  cocoaDialog update --debug --quiet; update=$?;
  if [[ update -eq 0 ]]; then
    echo "cocoaDialog was successfully updated to version: $(cocoaDialog version)";
  elif [[ update -eq 2 ]]; then
    echo "An update for cocoaDialog was not found.";
  fi
fi
exit ${update};
Mark Carver markcarver referenced this issue from a commit
Mark Whitaker #18 Fixed exit status for no updates 5985a5c
Mark Carver markcarver referenced this issue from a commit
Mark Whitaker #18 Fixed update run-mode error handling
The update run-mode now uses the --debug option to print out any errors.
Created CDUpdate class for handling the Sparkle updates, subclass of CDCommon.
Re-organized project files for more logical approach when working on a given area.
d250170
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.