What versions of wyUpdate / AutomaticUpdater are you using?
Hi,
I'm using the AutomaticUpdaterBackend class to update my app from a local directory. When I run InstallNow() It hangs at ExtractingUpdate step.
At this point if I check for the update again it doesn't return.
If I exit and re-launch the app it comes up temporarily with a "Files in use dialog" but then runs the update fine.
If instead after hanging at ExtractingUpdate I just run InstallNow() again it runs the update successfully the second time around (with the filesn in use dialog again).
What's stopping it running correctly the first time?
Here's the relevant code:
public void Init(String appDataLocation) { LocalAppDataDirectory = appDataLocation; _updater.Initialize(); _updater.UpdateType = UpdateType.DoNothing; _updater.wyUpdateCommandline = "--updatepath=\"" + UpdatesFolder + "\""; _updater.wyUpdateLocation = UpdaterFolder + Path.DirectorySeparatorChar + "wyUpdate.exe";
_updater.ProgressChanged += (s, e) => { MessengerService.Instance.TextMessage(_updater.UpdateStepOn.ToString()); }; _updater.CheckingFailed += (s, e) => { MessengerService.Instance.TextMessage(e.ErrorMessage); }; _updater.UpdateAvailable += (s, e) => { MessengerService.Instance.TextMessage("Update to version " + _updater.Version + " available."); }; _updater.UpToDate += (s, e) => { MessengerService.Instance.TextMessage("No update available."); }; }
public void CheckForUpdate() { MessengerService.Instance.TextMessage("Checking for update..."); _updater.ForceCheckForUpdate(); }
public void ApplyUpdate() { try { _updater.InstallNow(); } catch (Exception ex) { MessengerService.Instance.TextMessage(ex.Message); } }
What versions of wyUpdate / AutomaticUpdater are you using?
I've found that if I have the application running and run wyUpdate from the command line manually instead of via the AutomaticUpdaterBackend object I get the following error:
Access to the path 'C:\Users\[me]\AppData\Local\Temp\w5366\backup\lappdata\[My App]\BitFactory.Logging.dll' is denied.
If I run again I get a files in use dialog that halts the update. This says that:
"The following files are in use. These files must be closed before the update can continue."
It then says the file that's in use is BitFactory.Logging.dll (this time the installed library in the same folder as my app, not the one in the temp directory above).
So I'm wondering why wyUpdate is getting access denied to files it creates and also why it can't shut dwn the processes necessary to run the update itself.
I've also found that the inability to check updates multiple times has nothing to do with the InstallNow(). If I run the CheckForUpdate method above the first time it correctly reports an update is available (i.e. the UpdateAvailable event handler is called). However, the second call just fails silently and I get nothing from the event handlers I've attached to.