Disclosure of Invention
In view of the above, the present invention has been made to provide a method of installing a patch and a corresponding apparatus for installing a patch that overcome or at least partially solve the above problems.
According to an aspect of the present invention, there is provided a method of installing a patch, including:
acquiring a to-be-installed patch compression package which accords with preset rules;
establishing a folder according to the related information of the patch compression package to be installed;
a decompression program in the system is called to decompress the patch compression packet to be installed into the folder;
and calling a package manager program in the system to execute installation operation on the folder so as to realize the installation of the patch.
Optionally, the invoking of the decompression program to decompress the to-be-installed patch compressed package to the folder further includes:
acquiring the number of Cab packages contained in the folder;
the calling of the package manager program and the pointing of the package manager program to the folder to realize the installation of the patch includes:
and if the number of Cab packages contained in the folder is only one, calling the program package manager program, and pointing the program package manager program to the folder to realize the installation of the patch.
Optionally, the method further comprises:
and if the number of Cab packages contained in the folder is at least two, calling a Windows updating independent installation program to execute installation operation on the compressed patch package to be installed so as to realize the installation of the patch.
Optionally, the method further comprises:
and if the process of decompressing the patch compression package to be installed into the folder by calling the decompressing program fails, calling a Windows updating independent installation program to execute installation operation on the patch compression package to be installed so as to realize the installation of the patch.
Optionally, the method further comprises:
and if the process of executing the installation operation on the folder by the calling program package manager program fails, calling a Windows updating independent installation program to execute the installation operation on the compressed package of the patch to be installed so as to realize the installation of the patch.
Optionally, the creating a folder according to the related information of the patch compression package to be installed includes:
and establishing a folder according to the storage position and the file name of the patch compression package to be installed.
Optionally, the obtaining of the compressed package of the patch to be installed that meets the preset rule includes:
acquiring a compressed package of a patch to be installed with a specific suffix name;
or,
and acquiring a compressed package of the patch to be installed, which needs to execute a searching step in the current computer in the conventional installation process.
According to another aspect of the present invention, there is provided an apparatus for installing a patch, including:
the compressed packet acquisition unit is used for acquiring a to-be-installed patch compressed packet which accords with a preset rule;
the file folder establishing unit is used for establishing a file folder according to the related information of the patch compression package to be installed;
the first program calling unit is used for calling a decompression program in the system to decompress the patch compression packet to be installed into the folder;
and the second program calling unit is used for calling a package manager program in the system to execute installation operation on the folder so as to realize the installation of the patch.
Optionally, the method further comprises:
the number acquisition unit is used for acquiring the number of Cab packets contained in the folder after the decompression program is called to decompress the patch compression packet to be installed into the folder;
the second program calling unit is specifically configured to:
and if the number of Cab packages contained in the folder is only one, calling the program package manager program, and pointing the program package manager program to the folder to realize the installation of the patch.
Optionally, the method further comprises:
and the third program calling unit is used for calling a Windows updating independent installation program to execute installation operation on the compressed patch package to be installed if the number of Cab packages contained in the folder is at least two, so as to realize the installation of the patch.
Optionally, the method further comprises:
and the fourth program calling unit is used for calling the Windows updating independent installation program to execute installation operation on the patch compression package to be installed to realize the installation of the patch if the process of decompressing the patch compression package to be installed into the folder by calling the decompressing program fails.
Optionally, the method further comprises:
and the fifth program calling unit is used for calling a Windows updating independent installation program to execute installation operation on the compressed patch package to be installed if the process of executing the installation operation on the folder by the calling program package manager program fails, so as to realize the installation of the patch.
Optionally, the folder establishing unit is specifically configured to:
and establishing a folder according to the storage position and the file name of the patch compression package to be installed.
Optionally, the compressed packet obtaining unit includes:
the first obtaining subunit is used for obtaining a compressed patch package to be installed with a specific suffix name;
or,
and the second acquisition subunit is used for acquiring the compressed patch package to be installed, which needs to perform the searching step in the current computer in the conventional installation process.
According to the patch installation method and device, when the installation operation is carried out on a patch package such as msu, the installation of the patch package can be realized by executing the procedures of creating a folder, calling a decompression program in a system for decompression and calling a package manager program in the system for installation instead of calling the program of wusa. Moreover, practice tests prove that unnecessary processes such as 'searching for updates on the current computer' and the like are not skipped, so that the performance of the function of the operating system or the patch package is not affected.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Referring to fig. 1, a method for installing a patch according to an embodiment of the present invention may include the following steps:
s101: acquiring a to-be-installed patch compression package which accords with preset rules;
in practical applications, only some special types of patches generally have the problem of being time-consuming to install. For example, when installing a patch package with a suffix name of msu is performed, a dedicated program wusa.exe is called to perform an installation operation on the patch package in a conventional installation manner; however, in this conventional installation, there is a "searching for updates on this computer" process in the early stages of installation, which typically takes a long time, possibly depending on the current network and system environment, resulting in a long time for the entire installation process of the patch. Wherein, wusa.exe is an important file stored in a folder of a Windows system, and is usually automatically created in the process of installing an operating system, so in a conventional manner, it is general to use wusa.exe to install an msu patch package, and the process of "searching for updates on this computer" is initiated by wusa.exe to be executed, and it uses Windows Update metadata in msu package to search for available updates, and aims to verify whether a patch can be or needs to be installed, and so on, and therefore, the time consumed in the installation process of the msu patch package is relatively long.
However, in the case of a normal patch, the time required for the conventional installation process may not be too long, and it may be handled in a conventional manner. Therefore, in the embodiment of the present invention, some rules may be preset for selecting patches that need to be installed according to the method provided by the embodiment of the present invention. The specific rule may be to determine whether the patch to be installed has a preset suffix name, for example, msu, etc. In specific implementation, a suffix name list may be preset, and it is determined whether a suffix name of a patch to be currently installed appears in the list. Or, the specific rule may be that whether the patch to be installed needs to perform the search step in the current computer in the conventional installation process is determined, and when the specific rule is implemented, such a patch package list that the search step needs to be performed in the current computer in the conventional installation process may be preset, and whether the patch to be installed appears in the list may be determined, and so on.
S102: establishing a folder according to the related information of the patch compression package to be installed;
after determining the patch packages that need to be installed according to the method of the embodiment of the present invention, specific installation work may be performed. In the installation process, the patch package to be installed needs to be decompressed, and for this purpose, a folder needs to be created first, so that the decompressed result is stored in the folder. Specifically, when the folder is created, the folder may be created according to the storage location and the file name of the patch compression package to be installed. For example, in the Windows7 operating system, the patch package to be installed is "Windows 6.1-KB2564958-x86. msu", and the location of the patch package file is: c \ Windows6.1-KB2564958-x86.msu, then the following folders can be created: "C: \ Windows6.1-KB2564958-x 86". As can be seen, the newly created folder is in the same directory as the file of the patch package to be installed, and the name of the folder is the same as the file name (not including the suffix name) of the patch package to be installed. Of course, in practical applications, the folder may also be created in other manners, and the name of the folder is not necessarily the same as the file name of the patch package, and thus, detailed description is omitted here.
S103: a decompression program in the system is called to decompress the patch compression packet to be installed into the folder;
after the folder is created, the decompression operation may be performed on the patch package to be installed, and the decompression result is stored in the folder created in the previous step. When decompressing, it can directly call the decompressing program in the system. When the decompression program is specifically implemented, the decompression program may be expanded. The decompression program may be invoked by means of a cmd command line, for example, when decompressing the patch package in the previous example, then cmd.
expand-F:*“C:\Windows 6.1-KB2564958-x86.msu”“C:\Windows6.1-KB2564958-x86”
Executing the above commands, the "C: \ Windows6.1-KB2564958-x86. msu" compressed package can be decompressed under the "C: \ Windows6.1-KB2564958-x 86" folder.
S104: and calling a package manager program in the system to execute installation operation on the folder so as to realize the installation of the patch.
After the patch package is decompressed into a folder, a package manager program in the system may be invoked to perform an installation operation on the folder, which may complete the installation operation on the patch. In the embodiment of the present invention, the package manager program may refer to pkgmgr. An operating system (e.g., Windows Vista) feature package may be installed or updated on an offline target computer using a package manager and an unattended install reply file. Thus, in an embodiment of the present invention, it is possible to perform an install operation on a folder that has saved the decompression result using the pkgmgr. In particular implementations, the pkgmgr. Still taking the foregoing example as an example, when performing an install operation on the folder "C: \ Windows6.1-KB2564958-x 86", cmd.exe can be opened and then the following commands are entered and executed:
pkgmgr.exe/ip/m:“C:\Windows6.1-KB2564958-x86”
after executing the above commands, the installation of the patch "C: \ Windows6.1-KB2564958-x86. msu" can be completed.
It can be seen that, in the embodiment of the present invention, when a patch package such as msu is installed, the installation may be performed by executing creating a folder, calling a decompressed program in the system for decompression, and calling a package manager program in the system for installation instead of calling the program of wusa. Moreover, practice tests prove that unnecessary processes such as 'searching for updates on the current computer' and the like are not skipped, so that the performance of the function of the operating system or the patch package is not affected.
It should be noted that the patch installation method provided by the embodiment of the present invention may be combined with products with functions of bug fixing, and the like, where the bug fixing products generally have their own bug base files, basically include all patches required by a user, and each patch in the bug base is also configured with a scanning judgment condition, and when the user runs the bug fixing product, the product may judge whether the current user system environment needs to install the patch according to the conditions. Thus, it is equivalent to verifying whether a patch can be or needs to be installed before a particular installation operation is performed.
Corresponding to the method for installing the patch provided by the embodiment of the present invention, the embodiment of the present invention further provides a device for installing the patch, and referring to fig. 2, the device may include:
a compressed packet obtaining unit 201, configured to obtain a to-be-installed patch compressed packet that meets a preset rule;
a folder establishing unit 202, configured to establish a folder according to the relevant information of the patch compression package to be installed;
the first program calling unit 203 is configured to call a decompression program in the system to decompress the to-be-installed patch compression package into the folder;
and a second program calling unit 204, configured to call a package manager program in the system to perform an installation operation on the folder, so as to implement installation of the patch.
In a specific implementation, the apparatus may further include:
the number acquisition unit is used for acquiring the number of Cab packets contained in the folder after the decompression program is called to decompress the patch compression packet to be installed into the folder;
the second program calling unit 204 is specifically configured to:
and if the number of Cab packages contained in the folder is only one, calling the program package manager program, and pointing the program package manager program to the folder to realize the installation of the patch.
In practical applications, the apparatus may further include:
and the third program calling unit is used for calling a Windows updating independent installation program to execute installation operation on the compressed patch package to be installed if the number of Cab packages contained in the folder is at least two, so as to realize the installation of the patch.
Optionally, the apparatus may further include:
and the fourth program calling unit is used for calling the Windows updating independent installation program to execute installation operation on the patch compression package to be installed to realize the installation of the patch if the process of decompressing the patch compression package to be installed into the folder by calling the decompressing program fails.
In addition, the apparatus may further include:
and the fifth program calling unit is used for calling a Windows updating independent installation program to execute installation operation on the compressed patch package to be installed if the process of executing the installation operation on the folder by the calling program package manager program fails, so as to realize the installation of the patch.
The folder establishing unit 201 may specifically be configured to:
and establishing a folder according to the storage position and the file name of the patch compression package to be installed.
The compressed packet acquisition unit may include:
the first obtaining subunit is used for obtaining a compressed patch package to be installed with a specific suffix name;
or,
and the second acquisition subunit is used for acquiring the compressed patch package to be installed, which needs to perform the searching step in the current computer in the conventional installation process.
In the embodiment of the invention, when the installation operation is performed on the patch package such as msu, the installation of the patch package can be realized by executing the procedures of creating a folder, calling a decompression program in the system for decompression and calling a package manager program in the system for installation instead of calling the program of wusa. Moreover, practice tests prove that unnecessary processes such as 'searching for updates on the current computer' and the like are not skipped, so that the performance of the function of the operating system or the patch package is not affected.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in a patch installation device according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The application is operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the computer system/server include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set top boxes, programmable consumer electronics, network pcs, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above systems, and the like. The computer system/server may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.