Don't lock files of application while running

前端 未结 4 1676
慢半拍i
慢半拍i 2021-01-20 13:36

I am creating a software application that is able to update itself. After the start, the application checks if there are updates avaiable, download those files (assemblies),

4条回答
  •  萌比男神i
    2021-01-20 14:41

    Most of updater have a bootstrapper executable that performs the update of the main application.

    The idea is to run the bootstrapper instead of your application. Then the bootstrapper apply any update if required, before launching the actual application.

    Another technique (I never tried, it's only a clue) is to use shadow assemblies. The concept is to "duplicate" the assembly on the file in order to avoid file in use locking.

    Finally, you can take a look at clickonce which can easily create self updating applications, if you accepts the drawbacks of this mechanism.

提交回复
热议问题