Search code examples
.netwindows-installerdesktop-application

Auto updater strategy


I have a requirement to build auto update application to update the desktop app. So I was researching a lot on how to achieve that.

A lot of solutions in the internet are in the style: Custom console application that can check for new version, download zip file, extract and switch files in the target directory.

But what about new version of msi setup file instead?

I was thinking more in the direction of: Custom console application that will download the new msi file and execute it. The windows installer then will be responsible to switch and replace every file on the target location.

What is better from this two points or maybe a third recommendation that you have from experience it will be very helpful

I tired both approaches. The new msi style is working better because it can update thee version number of the application that is visible in Control panel -> Apps.

The approach where we replace every file on the target location is working too but I can't and is more flexible (I have the full control on the files and I can be sure that every file will be replaced no matter version number of the file or dll)


Solution

  • Delivering a ZIP is not an option for professionally deploying updates. An MSI or EXE setup should always be your option (I will leave the MSIX for another time).

    An MSI will be able to provide native rollback support in case of failure, proper logging to help your support team debug failed installations, and native support for silent deployments (very important if you have enterprise users).

    It is so easy to create an MSI today, there are plenty of free or paid professional tools that you can use. There is simply no reason not to create one.

    Back to your updater question. The recommended way is for the updater to download the msi/exe setup and launch its installation after the user has approved the update of course. If you will choose to use a paid tool to build your MSI then you will also have an auto-updater included with that tool, most setup authoring tools have one today.

    I wouldn't recommend building your own updater from scratch, there are so many things that you can get wrong and you will just waste precious developer time reinventing the wheel. But if you need your own updater, at least start from an existing open source project and customize that one to fit your needs.