If you have an update pending then you have to install that first before checking for new versions. After installing the old pending update, the AutomaticUdater will correctly detect your new updates.
Hi,
we're using the automatic updater to process updates in the background and then allowing the user to "apply" a given update when he chooses to. For that I'm using a service that will periodically run this line of code:
automaticUpdater.ForceCheckForUpdate(true);
having initialized the automaticUpdater as:
automaticUpdater = new AutomaticUpdaterBackend { GUID = "My product", ServiceName = this.ServiceName, // UpdateType.CheckAndDownload ensures that if found new updates // are automatically downloaded but not installed // the invocation for when to check still have to me made manually UpdateType = UpdateType.CheckAndDownload, };
private void AutomaticUpdaterOnUpdateAvailable(object sender, EventArgs eventArgs) { this.logger.DebugFormat("UpdateAvailable invoked. Status: {0} - Version {1}", automaticUpdater.UpdateStepOn.ToString(), automaticUpdater.Version);
Right now our clients are on version 1.2.1 and we've released since versions 1.3 and versions 1.4, however the automatic updater is reporting only (and consistently) version 1.3 as the last version available, even though if you manually execute wyupdate.exe ,you get the information for version 1.4...
I'm guessing this might have something to do with the DaysBetweenChecks property but I would think that the call to ForceCheckForUpdates(true) would connect and downloaded the latest version no matter what...
Is that not the case?
If you have an update pending then you have to install that first before checking for new versions. After installing the old pending update, the AutomaticUdater will correctly detect your new updates.
However when you use the wyupdate executable it correctly detects all versions between the one you have installed and the latest version.
Why is the behavior different? Isn't there a way to make autoupdater behave the same way? Are there plans to make that happen?
From what I've seen, this problem only seems to happen if you've downloaded but not installed a given previous version. In that case, the autoupdater will not recognize the new update until you install the one you already have downloaded.
However, if you never actually downloaded the previous update then it will correctly recognize the latest and present the list of changes for both updates.
I'm guessing autoupdater recognize there's already a download file present somewhere and won't recognize the new one until that file "disappears" (by being installed). Is that the case? Is there anyway to work around this without modifying the code? Could you tell me where that file is located (assuming that's what's happening)?
However when you use the wyupdate executable it correctly detects all versions between the one you have installed and the latest version.
Why is the behavior different? Isn't there a way to make autoupdater behave the same way? Are there plans to make that happen?
The AutomaticUpdater caches updates, wyUpdate does not. You don't want the AutomaticUpdater to behave like wyUpdate (or vice versa).
Is there anyway to work around this without modifying the code? Could you tell me where that file is located (assuming that's what's happening)?
I'm not quite sure why you want to work around this behavior. Why discard an update? Why not install the pending already downloaded and extracted update, then immediately check and update to the *new* latest version?
> The AutomaticUpdater caches updates, wyUpdate does not. You don't want the AutomaticUpdater> to behave like wyUpdate (or vice versa).
As a matter of fact that is exactly what I want.
> I'm not quite sure why you want to work around this behavior. Why discard an update?> Why not install the pending already downloaded and extracted update, then immediately> check and update to the *new* latest version?
What we are trying to achieve is composed of three different problems (this is just to get the context of what I'm trying to do and why I want to work around that limitation):1) We need to be able to control when the updates are installed via a web interface. Since that's not supported yet from autoupdater we are using a webpage which talks with a service which in turn uses autoupdater to determine which updates are available for installing.
2) The user has the ability to freeze updates (download is aborted when that's done) so that he is able to for example "stop downloading updates at version 1.3" in the production servers while he's testing that version, when he's satisfied and ready to move to production he doesn't want production servers to go to version 1.5, he wants them to go to version 1.3 which is the one he has tested.
2) We need to be able to perform "synchronized" installs in load balancing servers. That is, I might have 3 servers with a given software version installed and, if I approve an update, I want every server to update to the same version.
In order to do that I store the latest version that has been downloaded and only allow and install when ALL the servers have the same downloaded version (with some locking involved and stuff). However, due to the way it's working now what can happen is that:
- Server 1 checks and downloads version 1.3- Some time later I publish version 1.4- Server 2 checks and downloads version 1.4
----> I'll never allow the update because I need both servers to ALWAYS be in the same version (which by the way might not always be the latest version).
In that case what I need to do is allow server 1 to move to 1.4 AND then I will allow the user to approve the update and the update to be installed... hence the necessity I was talking about, since right now, once you have 1.3 you won't get 1.4 until you install it, but you can't install it because that will break the load balancing servers.
Any suggestions? Cheers.