SUEnableSystemProfiling Doesn't start sending profiling information.

Asked by MacRae Linton

I have an app that has been using Sparkle for some time and have just now gotten around to taking advantage of the System Profiling part of it. However, I am a bit confused as to what Sparkle provides and what I am expected to roll on my own.

From reading the wiki: http://sparkle.andymatuschak.org/documentation/pmwiki.php/Documentation/SystemProfiling It seems that after setting SUEnableSystemProfiling in Info.plist everything should just start to work. However, in my case it does not. Is there supposed to be a dialog asking the user if they want to send their information? If so, when does that launch itself? Am I supposed to make my own? From looking around launchpad, it looks like the right way to set it programmatically is through the Updater object, is that the case?

Thanks,

-MacRae

Question information

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

Sparkle just accesses your appcast and sends a bunch of information via GET.

Setting that key in Info.plist will cause the permissions dialog which appears on second launch to include an option to send profiling information. Erase your preferences .plist or at least the appropriate keys to see this.

You shouldn't need to set anything programmatically on the Updater object.

Revision history for this message
MacRae Linton (wmacrae) said :
#2

I think I've figured this out. The issue is that I am adding system profiling information late in the game. Many people are already using the app and using Sparkle to get updates. So, if they get a new version of the app that has SUEnableSystemProfiling set to yes, nothing ever gets sent because they never encounter the permissions dialog a second time. I've fixed this by ginning up my own dialog that gets launched if they have already been using the app and then using the SUUpdater method to set the preference.

I used a couple of updater delegate methods to make it work, it was pretty easy. This is probably a pretty infrequent use case, so I imagine there is no need to build support into the framework.

Thanks!

-MacRae

Revision history for this message
Grant (gerickson) said :
#3

I am having the same problem as MacRae. I've set SUEnableSystemProfiling in the bundle's Info.plist:

    % defaults read ~/Library/PreferencePanes/MyPref.prefPane/Contents/Info | grep SU
        SUEnableSystemProfiling = 1;
        SUFeedURL = "http://192.168.1.2/software/updates";
        SUPublicDSAKeyFile = "Software Update Public Key.pem";
        SUScheduledCheckInterval = 604800;

and I've cleared/reset the bundle's preferences and see the following when re-running the application:

    % defaults read MyPref | grep SU
        SUEnableAutomaticChecks = 1;
        SULastCheckTime = 2010-03-02 12:16:00 -0800;
        SUScheduledCheckInterval = 604800;

and I see my delegate get called:

    --> NSArray* -[MyPref feedParametersForUpdater:sendingSystemProfile:](MyPref *, objc_selector*, SUUpdater*, BOOL)
     Send Profile? 0
    <-- NSArray* -[MyPref feedParametersForUpdater:sendingSystemProfile:](MyPref *, objc_selector*, SUUpdater*, BOOL)
    Comparing version `1.0.0d50' to version `1.0.0d51'

However, despite this I never see the sendingProfile argument set to true. Any tips?

Revision history for this message
Grant (gerickson) said :
#4

Digging in with the debugger, it would appear that since this is a preference pane rather than a standalone application, the applicationDidFinishLaunching notification never fires and consequently, the profile prompt logic never fires and SUSendProfileInfoKey is never set.

So, to address this, I use the didSelect preference pane method (you might also use mainViewDidLoad) and proxy the applicationDidFinishLaunching method to the SUUpdater (or in this case my derived version thereof):

    - (void) didSelect
    {
     // Proxy an application did finish launching notification to Sparkle.
     //
     // We have to do this because we are a preference pane and the
     // updater object is not instantiated until our pane is loaded and
     // because that happens well after the System Preferences
     // application itself gets the same notification.

     [mUpdater applicationDidFinishLaunching: NULL];
    }

with that change, the prompt correctly appears along with the default profile information.

Revision history for this message
Chris Swekel (psychicpuppy) said :
#5

I'm a bit of a newb here but SUUpdater does not have an applicationDidFinishLaunching method. If I send the message to my instance of SUUpdater it throws an exception. Any help would be appreciated.