Some time ago made a tool released to the company's various departments after the use of feedback a lot of bugs, after each modification, you need to send a message to notify each user to replace the latest version, it is inconvenient, so later wrote a feature of automatic upgrade, so that each release of a new version only need to deploy it to the automatic upgrade server, The tool connects to an automatic upgrade server when the user runs the tool, checks for a version update, and then runs the latest version if it completes the update, otherwise runs the current tool version.
In order for this automatic upgrade module to be generic, I make it a stand-alone program, not integrated into a tool, which provides automatic upgrades for all types of software. The automatic upgrade module uses the socket method to realize the interaction between the client and the server. Version control file Autoupdate.xml to control the version of the update, the completion of Automatic Updates will be the history list history.htm also sent to the client, and automatically open the file, so that users can be updated on the specific content at a glance.
Detailed implementation:
Autoupdate.xml Specific content:
1<?xml version= "1.0" encoding= "GBK"?> 2<info> 3 <Version>1.0.3</Version> 4 <updatese Rver> 5 <Ip>122.2.14.212</Ip> 6 <Port>2110</Port> 7 </UpdateServer> 8 <fil Es> 9 <File> <Name>mftest.jar</Name> one <Path>.\bin</Path> <s ubver>1.0.0.3</subver> </File> <File> <Name>run.bat</Name> &L T path>.</path> <SubVer>1.0.0.3</SubVer> </File> <File> <nam E>eglreco.fix</name> <Path>.\config\resource</Path> <subver>1.0.0.0</subver&
Gt </File> <File> <PATH>.\CONFIG\RESOURCE&L <Name>eglrec.fix</Name> t;/path> <SubVer>1.0.0.0</SubVer> </File> <File> <name>dom4j- 1.6.1.jar</name> <Path>.\lib</Path> <fil <SubVer>1.0.0.0</SubVer> </File>-MB e> <Name>jaxen-1.1-beta-4.jar</Name> <subver>1 <Path>.\lib</Path> Notoginseng .0.0.0</subver> </File> <File> <Name>jxl.jar</Name> <Path> .\lib</path> <SubVer>1.0.0.0</SubVer> </File> </Files> 45</INFO>