Summary of the invention
In view of the above problems, the present invention has been proposed in order to provide a kind of method of a kind of drive installation that overcomes the problems referred to above or address the above problem at least in part and the device of corresponding a kind of drive installation.
According to one aspect of the present invention, a kind of method of drive installation is provided, comprising:
Installation environment for hardware device driver is detected;
When detecting when abnormal, the installation environment of described hardware device driver is carried out to corresponding reparation;
Carry out the installation of hardware device driver in completing the installation environment of reparation.
Alternatively, the described step detected for the installation environment of hardware device driver comprises:
Whether the system file that detection hardware equipment relies on lacks;
And/or,
Whether the system service that detection hardware equipment relies on works;
And/or,
Detect in operating system whether the driver of formerly installing is arranged;
And/or,
Whether the registry entry that detection hardware equipment relies on mistake.
Alternatively, described when detecting when abnormal, the step of the driver installation environment of described hardware device being carried out to corresponding reparation comprises:
When detecting the system file disappearance that hardware device relies on, from server, obtain the system file that described hardware device relies on and installed in this locality;
And/or,
When detecting system service that hardware device relies on and do not work, open corresponding system service;
And/or,
When detecting the driver of formerly installing, remove the All Files of the described driver of formerly installing;
And/or,
Exist when wrong when detecting registry entry that hardware device relies on, repair corresponding registry entry.
Alternatively, the step that the described installation environment of the driver for hardware device is detected is carried out when the user triggers the installation of hardware device driver.
According to a further aspect in the invention, provide a kind of device of drive installation, having comprised:
Driver installation environment detection module, be suitable for being detected for the installation environment of hardware device driver;
The driver installation environment is repaired module, is suitable for detecting when abnormal, and the installation environment of described hardware device driver is carried out to corresponding reparation;
The driver installation module, be suitable for carrying out the installation of hardware device driver in completing the installation environment of reparation.
Alternatively, described driver installation environment detection module comprises:
Whether the system file detection sub-module, be suitable for the system file that detection hardware equipment relies on and lack;
Whether the system service detection sub-module, be suitable for the system service that detection hardware equipment relies on and work;
Old driver detection sub-module, be suitable for detecting the driver of whether formerly installing in described operating system;
Registry entry error-detecting submodule, be suitable for detecting whether mistake of registry entry that described hardware device relies on.
Alternatively, described driver installation environment reparation module comprises:
System file is downloaded submodule, is suitable for when detecting the system file disappearance that hardware device relies on, and from server, obtains the system file that described hardware device relies on and is installed in this locality;
Submodule is opened in system service, is suitable for, when detecting system service that hardware device relies on and do not work, opening corresponding system service;
Old driver unloading submodule, be suitable for, when detecting the driver of formerly installing, removing the All Files of the described driver of formerly installing;
Registry entry errors repair submodule, be suitable for existing when wrong detecting registry entry that hardware device relies on, repairs corresponding registry entry.
Alternatively, described device also comprises:
Driver is installed trigger module, with described driver installation environment detection module, is connected, and is suitable for triggering the installation of hardware device driver.
Method and apparatus according to a kind of drive installation of the present invention, can be by before being installed to operating system at driver, driver installation environment to hardware device is detected, may cause driver that failed driver installation environment is installed and carry out corresponding reparation, then carry out the installation of driver in the driver installation environment of the hardware device of repairing, thereby reached the beneficial effect of the success ratio that improves the driver installation.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to better understand technological means of the present invention, and can be implemented according to the content of instructions, and for above and other objects of the present invention, feature and advantage can be become apparent, below especially exemplified by the specific embodiment of the present invention.
Embodiment
Exemplary embodiment of the present disclosure is described below with reference to accompanying drawings in more detail.Although shown exemplary embodiment of the present disclosure in accompanying drawing, yet should be appreciated that and can realize the disclosure and the embodiment that should do not set forth limits here with various forms.On the contrary, it is in order more thoroughly to understand the disclosure that these embodiment are provided, and can be by the scope of the present disclosure complete conveys to those skilled in the art.
Driver is the configuration file that each hardware device manufacturer writes according to operating system for one's own side's product, the driver difference that the various brands product is corresponding, same brand product is also different for the driver of different operating system adaptations, and each hardware device manufacturer is for the function that guarantees the compatible of hardware device and the strengthen equipment driver of can constantly upgrading.The installation of driver is that a little block code is added in operating system, wherein comprises relevant facility information etc. information data.These information has been arranged, and operating system just can communicate with hardware device.
In general, after hardware device completes the installation of driver when using for the first time, use afterwards no longer needs install driver, and this has just caused computer in use for some time, and the driver of installing for each hardware device on it is not up-to-date.And old driver likely can't solve some incompatible problem of this product and use and to bring inconvenience to the user.For example, driver for BIOS and video card, the driver that manufacturer upgrades likely improves the performance of hardware device with getting instant result, bring into play to greatest extent the potential of computer, the driver of hardware device does not have to upgrade for a long time can make the user can't enjoy the benefit that improves system performance.
In prior art, when hardware device driver is installed, usually be all directly to move driver, complete the hardware device driver installation process by driver, but because there is problems such as system file disappearance, registry error in driver, thereby very easily cause occurring that driver installs failed problem.
For above-mentioned technical matters, one of core idea that proposes the embodiment of the present invention is, before driver is installed, installation environment to computing machine is detected, for example, to whether lacking crucial system file, whether residual old driving is arranged, whether the registry entry mistake is arranged, system service whether not the situation such as normal operation detected; Extremely carry out repair process if exist, then in completing the installation environment of reparation, carry out the installation of hardware device driver, thereby reach the purpose of the success ratio that improves the driver installation.
With reference to Fig. 1, show the process flow diagram of the embodiment of the method for a kind of drive installation of the present invention, specifically can comprise the following steps:
Step 101, for the installation environment of hardware device driver, detected;
Step 102, when detecting when abnormal, the installation environment of described hardware device driver is carried out to corresponding reparation;
Step 103, carry out the installation of hardware device driver in completing the installation environment of reparation.
In practice, when script of every installation does not belong to the hardware device in computing machine, operating system all needs to install correct driver.In embodiments of the present invention, described operating system can be the operating systems such as Windows, Unix, Linux, Netware, Xenix, except application operating system on computers, operating system in the embodiment of the present invention can also be applied in the operating system on mobile terminal, such as: PalmOS, Symbian, Windows mobile and the operating systems such as Android, iPhoneOS, blackberry, blueberry.
Described hardware device can comprise the external hardware devices such as printer, network interface card, modulator-demodular unit, USB flash disk, can also comprise the hardware device that CD-ROM drive, video card, sound card etc. are inner, and the present invention is particularly useful for the application that the external hardware equipment driver is installed.For example, after Windows operating system is installed in computing machine, need to drive one by one CD install the hardware devices such as mainboard, CD-ROM drive, video card, sound card driver, drive in CD generally with the driver installation kit.If need external other hardware device, also corresponding driver to be installed, for example, external game hardware needs the driver of the hardware devices such as mounting handle, bearing circle, rocking bar, DDR, external printer need to be installed the driver of printer, online will be installed the driver of the hardware devices such as network interface card, modulator-demodular unit, etc.
In specific implementation, which hardware device can identify current according to facility information be.Take interventional instrument as example, the device descriptor of interventional instrument all can Portable device information, facility information comprises device type, manufacturer's information and product information (range of models and performance parameter) etc., just can be confirmed to be which interventional instrument according to described facility information, thereby also just can obtain the driver of interventional instrument.
A kind of example as the concrete application of the embodiment of the present invention, can be detected by the installation environment to hardware device driver by following several respects:
Whether the system file that 1) detection hardware equipment relies on lacks;
System file refers to the file of deposit operation system master file, generally in the installing operating system process, automatically creates and associated documents are placed in corresponding file, and the file here directly affects the normal operation of system.
Take Windows operating system as example, the system file that hardware device relies on generally includes facility information file (INF, Device INFormation File), be that Microsoft is that hardware device manufacturer issues a kind of file layout that its driver is released, the information or the script that comprise hardware device in the INF file operate with control hardware.In the INF document understands hardware driving how this to be installed to system, source file where (file that will copy), be installed to (destination path copied to) in which file, how in registration table, add self relevant information (will add the information in registration table to), the device type that will install, production firm, model etc.By reading and explain these words, how Windows just knows install driver.
In practice, the system file that different hardware devices relies on is different, and for example, the system file that printer relies on is the usbprint.inf file, by be arranged on windows under the inf catalogue.The application embodiment of the present invention, windows detect whether there is the usbprint.inf file under the inf catalogue, if there is no be considered as disappearance.In the situation that disappearance this document can be downloaded under this usbprint.inf file Xie Ru windows inf catalogue from the server of appointment.
Whether the system service that 2) detection hardware equipment relies on works;
System service is a kind of Application Type, and it is at running background.Attendant application can and provide some functions by network for the user in this locality usually, in Windows 2000/XP/2003 system, system service refers to program, routine or the process of carrying out the appointing system function, in order to support other programs, especially low layer (approaching hardware) program.
With the example that is installed as of printed driver, because the successful installation of printed driver depends on the Printing Spooler service (printing background service) of system, if this service is opened, driver installation meeting unsuccessfully.The application embodiment of the present invention, can before being installed, printed driver the Printing Spooler service to system be detected (by query service status, can judge whether this service opens), if this service is not opened, use the order of the service of unlatching to open Printing Spooler service.
3) detect in operating system whether the driver of formerly installing is arranged;
Driver operates in the kernel of operating system, and the installation of driver is that a little block code is added in operating system, wherein comprises relevant facility information etc. information data.Certain computing machine is formerly installed the words of the program of overdriving; usually have some residual information; for example; when the driver of formerly installing in unloading is failed; just have partial document can't complete discharge clean, or the driver of formerly installing is destroyed; cause this driver invalid, but its most of file still remain in computing machine.In this case, use the embodiment of the present invention, can be clean the driver complete discharge of formerly installing, remove all Stub Files, can promote the success ratio that new driver is installed.
Whether the registry entry that 4) detection hardware equipment relies on mistake.
Registration table is an important database in Windows operating system, for the configuration information of storage system and application program.Generally speaking, in system, registration table is the setting of 32 drivings of a record and the database of position.When operating system needs access hardware equipment, it uses driver, and even equipment is the equipment that a BIOS supports.Necessary demand motive while installing without the BIOS support equipment, this driving is independent of operating system, but operating system need to be known and finds wherefrom them, filename, version number, other settings and information, there is no the record of registration table to equipment, they just can not be used.
The registry entry that hardware device relies on relates generally to some registration table key assignments, because registration table is stored in the form of a hierarchical structure, be stored in all logical orders based on certain of element wherein, the registration table key assignments is appreciated that the elementary cell of organizing in registration table.When storage information in registration table, the position that the type selecting based on wanting canned data is suitable.
The example that is installed as with the webcam driver program, generally speaking, camera can be by registry entry UpperFilter of third-party driving carry, if UpperFilter the inside carry certain third party drive file, but the third party drives file not have (such as unloaded or deleted), will cause camera undesired, install driver also can be failed.The application embodiment of the present invention, can drive and be detected for the third party of carry in registry entry UpperFilter, if can't detect corresponding file can modify to the key assignments of registry entry UpperFilter.
In specific implementation, four steps that the above-mentioned installation environment to hardware device driver is detected can be selected one or its combined running according to actual demand by those skilled in the art, for example, when install driver, whether whether the detection system file lack with system service working properly in advance; Perhaps, when install driver, detect in advance the driver of formerly installing and whether unload clean etc.; Above-mentioned detection can arrange arbitrarily synchronous or asynchronous execution by those skilled in the art, the present invention to this without being limited.
In a preferred embodiment of the present invention, described step 102 can comprise following sub-step:
Sub-step S11, when detecting the system file disappearance that hardware device relies on, obtain the system file that described hardware device relies on and installed in this locality from server;
Sub-step S12, when detecting system service that hardware device relies on and not working, open corresponding system service;
Sub-step S13, when detecting the driver of formerly installing, remove the All Files of the described driver of formerly installing;
Sub-step S24, when detecting registry entry that hardware device relies on, exist when wrong, repair corresponding registry entry.
In specific implementation, if the installation environment of hardware device driver is not detected when abnormal, can directly carry out the installation of driver.
For making those skilled in the art understand better the present invention, below example by a concrete application embodiment of the present invention further illustrate.
1, the user triggers the installation of hardware device driver;
2, the triggering of User is detected the installation environment of current hardware device driver, if detect extremely, is repaired, and specifically comprises:
Whether the system file that 1) detection hardware equipment relies on lacks, if from given server, obtain the system file that described hardware device relies on and installed in this locality;
Whether the system service that 2) detection hardware equipment relies on works, if open corresponding system service;
3) detect in operating system whether the driver of formerly installing is arranged, if remove the All Files of the described driver of formerly installing;
Whether the registry entry that 4) detection hardware equipment relies on exists mistake, if repair corresponding registry entry.
3, carry out the installation of hardware device driver in the installation environment completed in reparation.
The embodiment of the present invention is by before being installed to operating system at driver, driver installation environment to hardware device is detected, may cause driver that failed driver installation environment is installed and carry out corresponding reparation, for example, to whether lacking crucial system file, whether residual old driving is arranged, whether the registry entry mistake is arranged, system service whether not the situation such as normal operation detected; Extremely carry out the corresponding crucial system file of installing if exist, remove residual old driving, the registry entry of mis repair, open the system service of not normal operation etc., then carry out the installation of driver in the driver installation environment of the hardware device of repairing, thereby effectively improved the success ratio that driver is installed.
It should be noted that, for embodiment of the method, for simple description, therefore it all is expressed as to a series of combination of actions, but those skilled in the art should know, the present invention is not subject to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
With reference to figure 2, show the structured flowchart of the device embodiment of a kind of drive installation of the present invention, specifically can comprise as lower module:
Driver installation environment detection module 201, be suitable for being detected for the installation environment of hardware device driver;
The driver installation environment is repaired module 202, is suitable for detecting when abnormal, and the installation environment of described hardware device driver is carried out to corresponding reparation;
Driver installation module 203, be suitable for carrying out the installation of hardware device driver in completing the installation environment of reparation.
In a preferred embodiment of the present invention, described driver installation environment detection module 201 specifically can comprise following submodule:
Whether the system file detection sub-module, be suitable for the system file that detection hardware equipment relies on and lack;
Whether the system service detection sub-module, be suitable for the system service that detection hardware equipment relies on and work;
Old driver detection sub-module, be suitable for detecting the driver of whether formerly installing in described operating system;
Registry entry error-detecting submodule, be suitable for detecting whether mistake of registry entry that described hardware device relies on.
In a preferred embodiment of the present invention, described driver installation environment is repaired module 202 specifically can comprise following submodule:
System file is downloaded submodule, is suitable for when detecting the system file disappearance that hardware device relies on, and from server, obtains the system file that described hardware device relies on and is installed in this locality;
Submodule is opened in system service, is suitable for, when detecting system service that hardware device relies on and do not work, opening corresponding system service;
Old driver unloading submodule, be suitable for, when detecting the driver of formerly installing, removing the All Files of the described driver of formerly installing;
Registry entry errors repair submodule, be suitable for existing when wrong detecting registry entry that hardware device relies on, repairs corresponding registry entry.
In specific implementation, the present embodiment can also comprise as lower module:
Driver is installed trigger module, with described driver installation environment detection module 201, is connected, and is suitable for triggering the installation of hardware device driver.
The embodiment of the present invention is by before being installed to operating system at driver, driver installation environment to hardware device is detected, may cause driver that failed driver installation environment is installed and carry out corresponding reparation, then carry out the installation of driver in the driver installation environment of the hardware device of repairing, thereby effectively improved the success ratio that driver is installed.
For device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part gets final product referring to the part explanation of embodiment of the method.
The present invention also shows a kind of system for drive installation, and described system comprises client and server, and described client specifically can comprise as lower module:
Driver installation environment detection module, be suitable for being detected for the installation environment of hardware device driver;
The driver installation environment is repaired module, is suitable for detecting when abnormal, and the installation environment of described hardware device driver is carried out to corresponding reparation;
The driver installation module, be suitable for carrying out the installation of hardware device driver in completing the installation environment of reparation.
In a preferred embodiment of the present invention, described driver installation environment detection module specifically can comprise following submodule:
Whether the system file detection sub-module, be suitable for the system file that detection hardware equipment relies on and lack;
Whether the system service detection sub-module, be suitable for the system service that detection hardware equipment relies on and work;
Old driver detection sub-module, be suitable for detecting the driver of whether formerly installing in described operating system;
Registry entry error-detecting submodule, be suitable for detecting whether mistake of registry entry that described hardware device relies on.
Described server can comprise the operation response module, in response to system file, obtaining request, carries out the operation of obtaining corresponding system file and returning to client; In specific implementation, database that can preset saved system file in described server, when receiving the system file that comprises system file information that client sends and obtain request, this system file information of direct basis extracts corresponding system file and returns to client again and get final product from its database.Certainly, described server also can adopt online search or alternate manner to obtain current required system file, and the present invention is not restricted this.
In this case, described driver installation environment reparation module specifically can comprise following submodule:
System file is downloaded submodule, be suitable for when detecting the system file disappearance that hardware device relies on, to the request of server transmitting system file acquisition, and the system file that the described hardware device that reception is returned from server relies on is also installed in this locality;
Submodule is opened in system service, is suitable for, when detecting system service that hardware device relies on and do not work, opening corresponding system service;
Old driver unloading submodule, be suitable for, when detecting the driver of formerly installing, removing the All Files of the described driver of formerly installing;
Registry entry errors repair submodule, be suitable for existing when wrong detecting registry entry that hardware device relies on, repairs corresponding registry entry.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is and the difference of other embodiment that between each embodiment, identical similar part is mutually referring to getting final product.
The algorithm provided at this is intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with demonstration.Various general-purpose systems also can with based on using together with this teaching.According to top description, it is apparent constructing the desired structure of this type systematic.In addition, the present invention is not also for any certain programmed language.It should be understood that and can utilize various programming languages to realize content of the present invention described here, and the top description that language-specific is done is in order to disclose preferred forms of the present invention.
In the instructions that provided herein, a large amount of details have been described.Yet, can understand, embodiments of the invention can be in the situation that do not have these details to put into practice.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand one or more in each inventive aspect, in the description to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes in the above.Yet the method for the disclosure should be construed to the following intention of reflection: the present invention for required protection requires the more feature of feature than institute clearly puts down in writing in each claim.Or rather, as following claims are reflected, inventive aspect is to be less than all features of the disclosed single embodiment in front.Therefore, claims of following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and can adaptively change and they are arranged in one or more equipment different from this embodiment the module in the equipment in embodiment.Can be combined into a module or unit or assembly to the module in embodiment or unit or assembly, and can put them into a plurality of submodules or subelement or sub-component in addition.At least some in such feature and/or process or unit are mutually repelling, and can adopt any combination to disclosed all features in this instructions (comprising claim, summary and the accompanying drawing followed) and so all processes or the unit of disclosed any method or equipment are combined.Unless clearly statement in addition, in this instructions (comprising claim, summary and the accompanying drawing followed) disclosed each feature can be by providing identical, be equal to or the alternative features of similar purpose replaces.
In addition, those skilled in the art can understand, although embodiment more described herein comprise some feature rather than further feature included in other embodiment, the combination of the feature of different embodiment means within scope of the present invention and forms different embodiment.For example, in the following claims, the one of any of embodiment required for protection can be used with array mode arbitrarily.
All parts embodiment of the present invention can realize with hardware, or realizes with the software module of moving on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that and can use in practice microprocessor or digital signal processor (DSP) to realize according to some or all some or repertoire of parts in the daily record data transmission equipment of the embodiment of the present invention.The present invention for example can also be embodied as, for carrying out part or all equipment or system program (, computer program and computer program) of method as described herein.The program of the present invention that realizes like this can be stored on computer-readable medium, or can have the form of one or more signal.Such signal can be downloaded and obtain from internet website, or provides on carrier signal, or provides with any other form.
It should be noted above-described embodiment the present invention will be described rather than limit the invention, and those skilled in the art can design alternative embodiment in the situation that do not break away from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and is not listed in element or the step in claim.Being positioned at word " " before element or " one " does not get rid of and has a plurality of such elements.The present invention can realize by means of the hardware that includes some different elements and by means of the computing machine of suitably programming.In having enumerated the unit claim of some systems, several in these systems can be to carry out imbody by same hardware branch.The use of word first, second and C grade does not mean any order.Can be title by these word explanations.