Bug 306756 - [example] UI option to check for new updates in the background
Summary: [example] UI option to check for new updates in the background
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.6 RC1   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords: example
Depends on: 290973
Blocks:
  Show dependency tree
 
Reported: 2010-03-22 15:02 EDT by Lars Vogel CLA
Modified: 2010-05-06 10:54 EDT (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2010-03-22 15:02:14 EDT
It would be nice if P2Util.checkForUpdated allows the following:

1.) Check for updated in the background
2.) If updates are available ask the user if he wanted to update 
3.) If User selects yes then the update should start.

IMHO currently the P2Util only allows to block the UI thread everytime at start. This creates an overview if no update is available.
Comment 1 Susan McCourt CLA 2010-03-22 16:03:12 EDT
This probably something we'd do in the context of bug 290973
Comment 2 Ralf Ebert CLA 2010-03-22 16:15:54 EDT
Maybe the options in the preference page Install/Update > Automatic Updates could play a part in this in a non-UI fashion? It would be great if you could pre-configure "automatic updates at startup" or "automatic updates in background" in a product or by a WorkbenchConfigurerer option without adding any custom code to the application code.
Comment 3 Susan McCourt CLA 2010-03-22 16:19:03 EDT
(In reply to comment #2)
> Maybe the options in the preference page Install/Update > Automatic Updates
> could play a part in this in a non-UI fashion? It would be great if you could
> pre-configure "automatic updates at startup" or "automatic updates in
> background" in a product or by a WorkbenchConfigurerer option without adding
> any custom code to the application code.

that's kind of the idea in bug 290973.
Expose everything as a preference and then plugincustomization.ini can be used to configure the exact behavior.  We're still figuring out if we'll have time to deliver this as a bolt-on feature or just an example that RCP developers can run with.
Comment 4 Lars Vogel CLA 2010-03-23 02:08:39 EDT
@Susan: both approaches would be great. The currently behavior to lock the UI until the check is done time-consuming in situation were updates are not happening very frequently which at least is the case for my applications.
Comment 5 Lars Vogel CLA 2010-03-23 19:39:56 EDT
I'm just in a Google talk at Eclipsecon. They have added the functionality to p2 that it gives you a time-based update check (after x=90 days a popup is displayed asking the user to update). That would also be very useful in standard P2Util.
Comment 6 Pascal Rapicault CLA 2010-03-26 11:56:40 EDT
Did you suggest google to contribute that to p2 Lars?
Comment 7 Lars Vogel CLA 2010-03-26 12:19:04 EDT
Yes I suggested this to Terry Parker (verbally after the presentation). As I don't have Terry's email I will contact Robert Konigsberg via email to get his opinion on this potential contribution.
Comment 8 Robert Konigsberg CLA 2010-03-28 20:14:40 EDT
Adding Terry
Comment 9 Susan McCourt CLA 2010-03-29 18:07:23 EDT
Just so there's no confusion here.
All of this can be done today with Update Operation API.

use operation.getResolveJob() to check for updates in the background.

When the job is done, prompt the user and use
operation.getProvisioningJob() to perform the update.

What this bug is asking for is to show this in an example somewhere (we probably would not do this as an option in P2Util but as an alternative example)
Comment 10 Terry Parker CLA 2010-03-29 19:19:18 EDT
(In reply to comment #8)
Just to be clear, the version upgrade suggestion has nothing p2-specific in it, our plugin just checks today's date against its build date and makes a suggestion to the user.  We probably won't need it when bug 286141 gets fixed--the current either/or nature of checking for updates "every restart" or "at fixed intervals" causes some number of our developers to only rarely get notified of updates.
Comment 11 Lars Vogel CLA 2010-04-06 18:18:30 EDT
Example would be nice. I think this is the most common use case for automatic checking.
Comment 12 Susan McCourt CLA 2010-05-04 01:02:45 EDT
Fixed in HEAD >20100503.
I've updated the org.eclipse.equinox.p2.examples.rcp.cloud to include a plugin_customization.ini file that can be used to configure all existing options in the p2.ui Policy object.  In addition, the automatic update preferences can be set here, so one can set whether updates are checked on startup, whether they are pre-downloaded, etc. etc.  

Hopefully it's now clear that this has nothing really at all to do with the modal nature of the org.eclipse.equinox.p2.examples.prestartupdate P2Util.

(In reply to comment #2)
> Maybe the options in the preference page Install/Update > Automatic Updates
> could play a part in this in a non-UI fashion? It would be great if you could
> pre-configure "automatic updates at startup" or "automatic updates in
> background" in a product or by a WorkbenchConfigurerer option without adding
> any custom code to the application code.

Yes, this is what the example shows.