Home > Back-end >  Is it possible to autoupdate app without closing it?
Is it possible to autoupdate app without closing it?

Time:10-21

I have a Win UI 3 app that checks it here is a new update available, it dowloads the installer, but is it possible to execute such installer without closing the app?

  • How execute the installer from the code?
  • How to handle tha installation from within the app without closing?

Is it to complex? or should I just have the user do it manually?

CodePudding user response:

NO. The executable is in memory (and may have locked files or resources). In order to get an update it will have to be relaunched. If your code is modular, think plugins, these could be updated in place.

CodePudding user response:

Most applications launch a helper app then close themselves, because Windows usually blocks changes to executable files that are in use.

The app might pass its own process ID to the helper app so that it can wait for the process ID to disappear before attempting to update the file.

If not, the helper app might scan the process list for the EXE name, and pop up a message asking you to close the main app. It repeats this until there are no instances of the EXE in the process list.

  • Related