Background technology
At present, when program updates is software metric tools usually can with a function, to ensure that user can use up-to-date program.Traditional method for updating program is that the server address for depositing recent program is written to program inside, after program starts, automatically or under the triggering of user, obtain recent program from this server address upgrade.
In above-mentioned traditional update method, what subscription client was preserved is fixing for the server address upgraded, once this server address changes, then the program on subscription client cannot realize automatic renewal.In this situation, usually needing is required efforts by application developer again develops special automatic refresh routine, to solve the problem that subscription client program can not upgrade automatically.
As can be seen here, when the server address depositing recent program occurs to change, can there is the problem that cannot automatically upgrade in traditional program automatic update method.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of program automatic update method, and the method can guarantee the automatic renewal of program.
In order to achieve the above object, the technical scheme that the present invention proposes is:
A kind of program automatic update method, comprising:
When the version of program occurs to change, in the Reconfigurations file of service end, preserve the address information of up-to-date installation procedure;
Described program place client is when needs carry out program updates detection, according to the address information of the server end Reconfigurations file that this locality is preserved, from described server end Reconfigurations file, obtain the address information of current up-to-date program version information and up-to-date installation procedure;
Described client, according to described program version information, determines whether to need to upgrade local client program, when determining to need to upgrade, according to the address information of described up-to-date installation procedure, downloading described up-to-date installation procedure and installing.
In sum, the program automatic update method that the present invention proposes, when automatically upgrading, by the address of the up-to-date installation procedure of Reconfigurations file acquisition of access services end, and then according to the address information of this address acquisition recent program version information and up-to-date installation procedure, like this, the installation procedure address of server end is changed, the program that also can not affect user side upgrades automatically, therefore, can solve the server address depositing recent program change caused by the program problem that cannot automatically upgrade.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, the present invention is described in further detail below in conjunction with the accompanying drawings and the specific embodiments.
Core concept of the present invention is: set up Reconfigurations file at server end, by the latest version information of save routine and server chained address, installation procedure place in this Reconfigurations file, when subscription client carries out program updates, to first access this Reconfigurations file, and then remove latest version information and the installation procedure of acquisition program according to the server chained address in this Reconfigurations file, to realize the renewal of program.Like this, developer is when carrying out the renewal of program version, if the server address at recent program place changes, also only need to upgrade accordingly the address information in configuration file, and do not need to spend a lot of time and energy again and write the automatic refresh routine of new program, thus can solve the server address depositing recent program change caused by the program problem that cannot automatically upgrade.
Fig. 1 is the schematic flow sheet of the embodiment of the present invention one, and as shown in Figure 1, this embodiment mainly comprises:
A kind of program automatic update method, comprising:
Step 101, when program version occur change time, in the Reconfigurations file of service end, preserve the address information of up-to-date installation procedure.
In this step, introducing one Reconfigurations file being preserved the address information of up-to-date installation procedure, like this, only needing the installation procedure of this redaction and version information to be kept at wherein when there is new program version.And do not require that the server address at the installation procedure place of each version must the identical automatic renewal that just can realize user program, correspondingly, when not needing the server address of developer at redaction installation procedure place to occur to change yet, again write automatic refresh routine with inconvenience.
Particularly, the Reconfigurations file of service end can be initialization (ini) configuration file.
Step 102, described program place client are when needs carry out program updates detection, according to the address information of the server end Reconfigurations file that this locality is preserved, from described server end Reconfigurations file, obtain the address information of current up-to-date program version information and up-to-date installation procedure.
Step 103, described client, according to described program version information, determine whether to need to upgrade local client program, when determining to need to upgrade, according to the address information of described up-to-date installation procedure, downloading described up-to-date installation procedure and installing.
Preferably, in said method, client can utilize a dynamic link library dll to upgrade plug-in unit, carry out download and installation that described program updates detects described judgement and described up-to-date installation procedure, this dll upgrades plug-in unit and will automatically run after described program starts, to realize the automatic renewal of program.
Particularly, dll file carries out the trigger mechanism of program updates detection, can be periodically to detect.
Preferably, the address information of server end Reconfigurations file can be kept in an ini configuration file.Dll upgrades plug-in unit by this ini configuration file of access, can obtain the address information of described server end Reconfigurations file.
Below by Fig. 2-Fig. 5, specific implementation of the present invention is further elaborated.
The ini configuration file of local configuration as shown in Figure 2, service end Reconfigurations file as shown in Figure 3, when being checked through new version, client can demonstrate the information as Fig. 4, after new installation procedure has been downloaded, the mount message shown in Fig. 5 can be shown, click the renewal of installing and getting final product practical programs.
In sum, these are only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.