Ant is an open-source automatic update tool based on beetle. It mainly includes three parts: Network File Service, file update management, and client update components.
The server is mainly used for file management, including file upload and download. The service must generate an RSA certificate when it is enabled. It is mainly used to verify the validity when the Management Terminal updates the file.
The file management end is a file used to manage updates. The private key generated by the server must be placed in the management end directory for effective verification. ant updates allow directory structure updates. Therefore, when the client updates the directory structure file, it will automatically create it as needed if there is no local directory structure file. Ant file updates do not use version numbers as update tags. As long as the management end updates the corresponding file, a new guid value will be generated, when the client is updated, the corresponding file will be updated if the corresponding guid does not match.
Automatic updateProgramIs an EXE file, which is placed in the corresponding directory of the program. The component provides related object methods to detect the update source.
- Components used by the program
Before using it, you must add it to the configuration file of your program.
< Configuration > < Configsections > < Section Name = "Beetle" Type = "Beetle. configselection, beetle" /> < Section Name = "Antupdatesection" Type = "Ant. component. antupdatesection, Ant. component" /> </ Configsections > < Beetle Connections = "10" Pools = "1" Socketsendthreads = "1" Socketreceivethreads = "1" Socketthreadsleep = "10" Workthreads = "1" Workthreadsleep = "10" Sendbuffersize = "8048" Receivebuffersize = "8048" Packagemaxsize = "120000" Stringencodingsize = "64000" Channelmaxqueuedata = "0" Executioncontext = "False" Timeout = "30" Statistics = "True" /> < Antupdatesection Xmlns = "Urn: ant. component" Host = "127.0.0.1" Port = "9560" > </ Antupdatesection > </ Configuration >
There are two configuration items: one is beetle configuration information, and the other is configuring ant update information mainly including updating the service IP address, domain name, and port. reference ant. component. the DLL component is then used in the main form as followsCode:
Private VoidForm1_load (ObjectSender, eventargs e) {Updater update=NewUpdater ();If(Update. Detect () {close (); update. Update ("Ant.update.test.exe",True);}}
And whether to automatically close the update form.
Download complete component code