Vs2008, C #
I. Basic Ideas
I have been developing web forms. Recently I tried win form and made a small system. After the first available version was released, the automatic update function was implemented by the way. I have no experience in this area and have not read the relevant materials. I have thought of a simple idea. If you have any jokes, I 'd like to criticize and correct them.
This is basically the case:
The client has two sub-accountsProgramIn short, there are two EXE files, one main application and one Automatic Live Update Program. on the server side, there is a WCF, which provides the program version update information and updates files.
When a program is started (or click "detect Update" manually), the main program calls the server-side WCF detection update. If a new version is detected, the live update program is started and the system is closed.
After Live Update is started, call the server-side WCF to obtain the file list, and then download the Update file directly and overwrite the local file. After the completion, start the main program and close itself. In this way, an automatic update is complete.
Ii. System Architecture
Iii. Sequence Diagram
4. Others
1. Check the new version
In WCF, an xml configuration file is generated for the customer to check the version and update the file.
2. Download and overwrite old files
Live Update files are saved in the Temporary Folder. After the files are downloaded, They overwrite the old files of the main application from the Temporary Folder. Prevent the primary application from being unavailable because automatic update fails.
3. WCF contract (for reference only)
Using System;
Using System. Collections. Generic;
Using System. LINQ;
Using System. text;
Using System. servicemodel;
Namespace Wendyfinance. updatecenter. Contract {
[Servicecontract]
Public Interface Iautoupdate {
[Operationcontract]
Bool Checkupdate ( String Clientversion );
[Operationcontract]
String Getcurrentversion ();
[Operationcontract]
String Getupdatedescription ();
[Operationcontract]
List < String > Getfilelist ();
[Operationcontract]
String GetFile ( String Filename );
}
}