Updating apps on Windows is usually a painful experience. First your work is disrupted by an annoying prompt, then you have to wait while the update downloads, quit the application, click through the installer, and possibly restart the computer, all before finally getting back to where you left off.
However, Visual Studio Code manages to do most of this silently in the background, so from the user’s perspective it’s almost instaneous.
You still get a UAC prompt when it needs to install the files, but you can carry on working while this happens. Then there’s a final prompt to restart the app, but that takes about 1 second on my machine and I’m right back where I left off. Other than these 2 clicks (UAC prompt, restart app), the entire process is automatic and happens in the background.
It’s clearly doing an atomic update here (i.e. installs files to a temporary location, then renames it to the proper location as the final step). It also benefits by being an Electron app (although not all Electron apps update this seemlessly), and it probably uses a separate process to do the update. There may be other tricks here I’m not aware of.
Are any of these methods transferable to native or Qt-based apps with EXE, MSI, or MSIX installers? Is there a standard way or would you have to “roll your own” update mechanism to make it happen?