Page 1 of 1

Update not working when autoupdater or main app running

Posted: Thu Jan 15, 2009 4:27 am
by ulrichard
Hi everyone,

when a new web update is downloaded through the automatic mechanism, everything installs fine usually. But here are are two cases when it fails:

1st case:
- The automatic updater (MyInstaller.exe /update) found a new version and sits in the system tray telling the user that a new version is available.
- The user found the new version himself by downloading it from our website, or got it from somewhere else.
- He starts the update process with the manually downloaded file while the updater still sits in the system tray.
- The uninstall of the old version fails because an instance of the old installer is running, and the update is terminated.
-> What would be the best strategy to handle that? Would it be save to ignore the error returned from the uninstall msi command? Could the instance of the old installer be terminated from within the script of the new installer?

2nd case:
- The automatic updater (MyInstaller.exe /update) found a new version and sits in the system tray telling the user that a new version is available.
- The user is working in our main application, and without closing, accepts to update.
- The uninstall of the old version fails because some files that should be removed are blocked by the running program, and the update is terminated.
- Eventhough the update failed, the updater still writes the new version to the file $EXEDIR$\\installedupdates.dat and thus will never ask again to install that version.
-> What would be the best strategy to handle that? Would it be save to ignore the error returned from the uninstall msi command?
-> I think that behaviour could be improved by using "Terminate with Exit Code" when the uninstall failed, and check that in the update script when running the update.

One thing that I don't understand is this:
With the normal procedure, the old installer (with /update) finds the new installer and runs it. This implies that the old installer is running while the new installer updates and uninstalls the old version.
During the normal procedure this doesn't seem to be a problem.
But if the new installer is run manually, and an instance of the old installer is running independently, it is in the way.

I'm grateful for any ideas or hints.

Rgds
Richard