简体   繁体   中英

autoupdate c# program

Suppose i have a program.. how can i accomplish this?

i want the program to have an update feature. so its like,, when i posted a new version in the ftp server, the old program searches the ftp server and if theres a new version, it will download the new program and delete the old ones.

thank you

PS: it can be the user presses the update button, then the program will download the contents to one temp directory, then deletes itself and transferring the new files to the current folder

or it can be an auto update, like the program checks every 12 hours.

You can achieve this using ClickOnce .

You could end up using a pre-executable that performs the update. Starting the application not with the main exe, but with one that performs the update and then launches the main app. The main app checks for update and downloads it, but actually is not doing anything more than that.

Your options are either ClickOnce, which is the superior option of the two, or create a windows service that does the updating for you. The service runs all the time and pols for updates, downloads any and installs them. The reason this is superior to a preloader as suggested by Sascha is that in an environment where users log on with low level privileges the service will have admin privileges and be able to update the application.

Having said this, ClickOnce is the way to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM