开发者

c# update updater application

I created my own updater application that connects to the web and check if my开发者_JAVA百科 application with all the files is updater or not and download and install the updated components.. and works fine and is ok! My question is this... is there any way to update the updater? I don't know how, but something that close the program, uncompress the downloaded updater and relaunch it...

thanks in advance!

Paolo


Not that I ever tried... but the updater could copy itself to a different location and then invoke itself. I'd reccomend making a backup in case something goes wrong. From the new location, the updater can happily overwrite its own executable.


I would probably do like this.

Suppose there are two files:

Updater.exe & MainProgram.exe

Updater.exe downloads all the new versions in your program folder and replaces the old files. When your updated MainProgram i.e., the application's welcome screen runs, let it connect to the Internet and update the Updater.

So this is like: First the Updates updates other files than one of the new files, when run, updates the Updater.


Why re-invent the wheel? There are quite a few libraries that will do that for you (hot swaps, cold updates), transparently. NAppUpdate, which I wrote myself, is one of them.

Checkout http://github.com/synhershko/NAppUpdate. Read more at http://www.code972.com/blog/2010/08/nappupdate-application-auto-update-framework-for-dotnet/.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜