CN-115718575-B - Method, device, medium and equipment for changing drive file
Abstract
The invention provides a method for changing a driving file, which aims to solve the defect that a user cannot normally use printing equipment after driving update is executed in some cases in the prior art, and comprises the steps of responding to a first instruction, determining a preset attribute value of at least one first equipment characteristic description file in a first path, wherein the first path is used for storing a driving installation file, changing at least one configuration parameter in a second equipment characteristic description file conforming to the preset attribute value in a second path to be identical to the corresponding first equipment characteristic description file, and storing a system setting file in the second path. The invention further comprises a drive file changing device, a computer readable storage medium and information processing equipment. The method and the device can be applied to the installation of the driving program, and can prevent the problem that a user cannot use the printing device through the device interaction component added by the driving application program.
Inventors
- CHEN LILONG
Assignees
- 珠海奔图电子有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20221118
Claims (12)
- 1. A method for changing a drive file, for changing a PPD file, the method comprising: Responding to a first instruction, and determining a preset attribute value of at least one first equipment characteristic description file in a first path, wherein the first path is used for storing a drive installation file; Changing at least one configuration parameter in a second equipment characteristic description file which accords with the preset attribute value in a second path to be the same as the corresponding first equipment characteristic description file; the first instruction is executed after a software updating command is triggered, the software updating command is used for at least updating a first equipment characteristic description file in a first path, the same change is not carried out on a second equipment characteristic description file corresponding to the first equipment characteristic description file in a second path, and the first equipment characteristic description file and the second equipment characteristic description file are PPD files.
- 2. The method for changing a drive file according to claim 1, wherein, the corresponding first equipment characteristic description file is as follows: the first profile having the same preset attribute value as the second device profile.
- 3. The method of claim 1, wherein determining the preset attribute value of at least one first device profile in the first path comprises: And reading and storing preset attribute values of all the first equipment characteristic description files in the first path.
- 4. A method of changing a driving file according to claim 1 or 3, wherein changing at least one configuration parameter in a second device profile in a second path, which meets the preset attribute value, to be the same as the corresponding first device profile includes: Traversing all second equipment feature description files in a second path, and updating configuration parameters in a first feature description file, which has the same preset attribute value as the second equipment feature description file, in the first path to the second equipment feature description file for the second equipment feature description file which accords with the preset attribute value.
- 5. The drive file changing method according to claim 1, further comprising, before responding to the first instruction: judging that the triggered command is a software update command or a software deletion command, and if the triggered command is the software deletion command, triggering the software deletion command: Responding to the second instruction, and determining a preset attribute value of at least one to-be-deleted first equipment characteristic description file in the first path; and deleting the second equipment characteristic description file which accords with the preset attribute value in the second path.
- 6. The method for changing a driving file according to claim 1, wherein changing at least one configuration parameter in a second device profile in a second path, which meets the preset attribute value, to be the same as the corresponding first device profile specifically includes: Generating a new second equipment characteristic description file based on the corresponding first equipment characteristic description file to replace the original second equipment characteristic description file; the method further comprises the steps of: And when the original second equipment characteristic description file is replaced, restoring the corresponding configuration parameters of the new second equipment characteristic description file to be the same as those of the original second equipment characteristic description file.
- 7. A drive file changing apparatus for changing a PPD file, the apparatus comprising: The first determining unit is used for responding to the first instruction and determining a preset attribute value of at least one first equipment characteristic description file in a first path, wherein the first path is used for storing a drive installation file; a changing unit, configured to change at least one configuration parameter in a second device feature description file in a second path, where the second device feature description file meets the preset attribute value, to be the same as the corresponding first device feature description file; the first instruction is executed after a software updating command is triggered, the software updating command is used for at least updating a first equipment characteristic description file in a first path, the same change is not carried out on a second equipment characteristic description file corresponding to the first equipment characteristic description file in a second path, and the first equipment characteristic description file and the second equipment characteristic description file are PPD files.
- 8. The drive file changing apparatus according to claim 7, wherein the corresponding first device characteristic description file is: the first profile having the same preset attribute value as the second device profile.
- 9. The drive file changing apparatus according to claim 8, further comprising: the software deleting command detection unit is used for executing the second instruction after detecting the software deleting command; The second determining unit is used for responding to the second instruction and determining a preset attribute value of at least one to-be-deleted first equipment characteristic description file in the first path; And the deleting unit is used for deleting the second equipment characteristic description file which accords with the preset attribute value in the second path.
- 10. The drive file changing apparatus according to claim 7, wherein the changing unit is specifically configured to: Generating a new second equipment characteristic description file based on the corresponding first equipment characteristic description file to replace the original second equipment characteristic description file; the apparatus further comprises: and the restoring unit is used for restoring the corresponding configuration parameters of the new second equipment characteristic description file to be the same as the original second equipment characteristic description file when the original second equipment characteristic description file is replaced.
- 11. A computer-readable storage medium, characterized in that the storage medium includes a stored program which, when run, controls a device in which the storage medium is located to execute the drive file changing method according to any one of claims 1 to 6.
- 12. An information processing apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the drive file changing method according to any one of claims 1 to 6 when executing the computer program.
Description
Method, device, medium and equipment for changing drive file Technical Field The present invention relates to the field of driving technologies, and in particular, to a method, an apparatus, a medium, and a device for changing a driving file. Background In a conventional Linux/Unix-based operating system, after a print driver package is installed, a driver file is installed in a first path, which includes PPD (Printer Postscript Description) files describing printing device information. The PPD file may describe, for example, vendor information, functions, a mode of starting a driver, etc., and one PPD file corresponds to one device model. When a user adds a printing device, in order to match the correct driver, the printing system searches the PPD file matched with the corresponding model under the second path to generate a device icon for user interaction, and the user can set printing parameters or issue a printing job through the device icon. And a PPD file corresponding to the PPD file in the first path is also generated in the second path, and the content of the PPD file in the first path is consistent by default. And if the user changes the print parameters in the driver interface via the device icon, the operating system will make the same change to the print parameters in the PPD file of the second path. However, the operating system may not be able to successfully keep the content of the PPD file of the second path consistent with the PPD file of the first path in any case. Disclosure of Invention An object of the present invention is to solve the drawbacks of the prior art that a user cannot normally use a printing apparatus after performing a drive update in some cases. According to a first aspect of the invention, a method for changing a driving file is provided, and the method comprises the steps of responding to a first instruction, determining a preset attribute value of at least one first equipment characteristic description file in a first path, wherein the first path is used for storing a driving installation file, changing at least one configuration parameter in a second equipment characteristic description file which accords with the preset attribute value in a second path to be identical to the corresponding first equipment characteristic description file, and storing a system setting file in the second path. Preferably, the first instruction is executed after a software update command is triggered, where the software update command is used to update at least a first device feature description file in a first path, and does not make the same change to a second device feature description file corresponding to the first device feature description file in a second path. Preferably, the corresponding first equipment characteristic description file is a first characteristic description file with the same preset attribute value as the second equipment characteristic description file. Preferably, determining the preset attribute value of at least one first device feature description file in the first path includes reading and saving the preset attribute values of all the first device feature description files in the first path. Changing at least one configuration parameter in a second equipment characteristic description file which accords with the preset attribute value in a second path to be the same as the corresponding first equipment characteristic description file comprises traversing all the second equipment characteristic description files in the second path, and updating the configuration parameter in a first characteristic description file which accords with the preset attribute value in the second equipment characteristic description file in the first path and has the same preset attribute value as the second equipment characteristic description file into the second equipment characteristic description file. Preferably, before responding to the first instruction, the method further comprises the steps of judging that the triggered command is a software update command or a software deletion command, if the triggered command is the software deletion command, after the software deletion command is triggered, responding to the second instruction, determining a preset attribute value of at least one first equipment characteristic description file to be deleted in the first path, and deleting a second equipment characteristic description file conforming to the preset attribute value in the second path. Preferably, the method further comprises the step of changing at least one configuration parameter in the second equipment characteristic description file meeting the preset attribute value in the second path to be the same as the corresponding first equipment characteristic description file, wherein the step of generating a new second equipment characteristic description file based on the corresponding first equipment characteristic description file to replace the original second equipmen