how exactly do I make an SUInstaller subclass?

Asked by jakester

Hello!

We are integrating Sparkle into our existing distribution scheme, (which doesn't allow us much leeway to
re-organize how we distribute the software.)

Here's the situation:

We distribute four parts of our suite of tools:
     Aaa.app (the main GUI front-end to the daemon)
     Bbb.app (the main user tool)
     Ccc.app (an administration helper program)
     Ddd (a daemon launched by launchctl plist file)

Our distribution is like this:

We distribute a disk image that is called "Aaa-v1.2.123.dmg"
which (when mounted by the OS) looks like this:

/Volume/AaaInstaller/
                 .../Aaa.pkg (contains Aaa, Bbb, Ccc & Ddd.plist)
                 .../Extras/
                        .../Aaa.app
                        .../Bbb.app
                        .../Ccc.app

Aaa.pkg contains installs for all three of the applications, plus the launchctl
item /Library/LaunchAgents/com.myorg.Ddd.plist.

This distribution scheme allows for two types of users:

a) users who just want the GUI applications. These users "drag-install" the applications from
 the Extras folder without getting the daemon plist installed.

b) users who want to run the daemon as well as use the applications. These
users launch the Aaa.pkg file, thereby getting all the applications installed
including the daemon plist.

We have gotten our Appcast, signing and other parts of sparkle working; when I do a
build, the appcast is updated, and when I do "Check for updates" it finds the new build.

The download then works, and we get the dialog that says "Install and Relaunch".

It is working up to that point, but then the application is being updated incorrectly:

i.e. I am running the GUI application "Bbb.app" and the SUUpdater/SUInstaller seems to
find the new "Bbb.app" in the Extras folder. Sparkle seems to copy this new Bbb.app in
place of my running binary, and after relaunch the new version is shown in my "About" menu.

The problem is that I need to update the whole shebang (including Aaa and Ccc) using the pkg
file, not by blindly picking the Bbb.app and copying it into place.

Having read the Q&A posts here, I understand that I need to make a custom subclass of the SUInstaller
class, because otherwise it isn't going to install that "Aaa.pkg" ; it is expecting "Bbb.pkg'

But: how can I do that with the framework? Do I need to put the entire Sparkle codebase
inside each of my applications, or can I just override the class while only linking to
Sparkle.framework?

Also, once I have a custom subclass made, how do I invoke that so the rest of Sparkle
does the correct thing by default?

And "by the way": THANKS! I really like Sparkle.

:)

jake
*****

Question information

Language:
English Edit question
Status:
Answered
For:
Sparkle Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Andy Matuschak (andymatuschak) said :
#1

Hm. Can you really not just name the package to the name it expects?

The easiest thing for you to do would be to simply patch Sparkle a little bit to your needs rather than trying to extend SUInstaller: it's not really end-user public.

Revision history for this message
Hofman (cmhofman) said :
#2

In particular, you can should modify the logic in SUInstaller to find the .pkg file. Perhaps also add support for a new custom key in the appcast to pass the expected filename to use for installation (which would require some modification of SUBasicUpdateDriver and SUAppcastItem).

Can you help with this problem?

Provide an answer of your own, or ask jakester for more information if necessary.

To post a message you must log in.