Reputation: 11
I am working on an Updater application containing two application named as Updater and MainApp. The Updater App uses web service to check for updates and update the MainApp. I am able to achieve updation when update button is clicked, for single next update.
The problem is that if multiple version of updates are available the application should be able to update itself to those versions sequentially and finally should be in latest version in a single update button click. I mean to say that user should not click update button each time for every single update, a single update click should update application to its final version
E.g if current version is 1.0.0.0, and available versions are 1.0.2.0, 2.0.0.0, 3.0.0.5. Then the application should update itself to 3.0.0.5 without missing the updates 1.0.2.0 and 2.0.0.0.
Please share your ideas,
Thanks
Sanket
Upvotes: 1
Views: 182
Reputation: 5647
well as far as i understood you have some method
public void checkForUpdates(object sender, EventArgs e){
//Check if updates are available and call Update(string version);
}
this method checks for updates and, if there are any available will update.
I suggest you make it call another function to update to next version only and recheck:
public void update(string version){
//Update to next version (and only to next version)
//and then call check again, so you will update to the next and so on,
//till you are on newest version
checkForUpdates(null, null);
}
you will need to update "each version after another" anyway, so this is the easiest way to maintain actuality and easy programming as well as readability
Upvotes: 0
Reputation: 1064
You can check the latest version on button click, and then sort available updates which is greater than your current version and lesser than or equal to latest version, and do update multiple times.
Upvotes: 0