What is the best way to have an application update itself to a new version? Details:
- It is a standalone WPF/C# Windows application running on .NET 3.5.
- The application is automatically launched at Windows bootup.
- The application is running on a touchscreen panel PC without network/Internet access.
- The user is not allowed access to Windows and does not have a keyboard (think kiosk)
- A new version of the application can be installed from a USB drive. The user will have access to a “update software” button, which looks for new versions of software on the thumb drive and automatically updates itself.
I was thinking of having the application close itself, then launch the updater on close. I just need to avoid the case where the new installation is interrupted, the application is corrupted, and the kiosk is no longer usable. Do Windows installers have protection against this scenario?
Thanks in advance!
In this case perhaps the best way of doing it is to create a new folder, extract the new version there, and then finally rename the two folders, and after swapping them delete the old version. The renames should be atomic so that the old version won’t be touched until the upgrade is complete.