1. Field of the Invention
The present invention relates to an information processing apparatus and a device driver deletion method.
2. Description of the Related Art
When a device such as a scanner, a printer, or a multifunction peripheral (MFP) is operated, a user connects such a device to a computer and installs a device driver corresponding to the device. When the user purchases a new device or no longer uses an old device, a device driver corresponding to the old device is no longer necessary. Then, the user generally uninstalls the device driver to make effective use of a capacity of a hard disk of the computer (Japanese Patent Application Laid-open No. 2005-115440).
When the user uninstalls the device driver, whether or not the device is connected to the computer depends on the user. For this reason, an uninstaller of the device driver needs to function without a problem regardless of whether or not the device is connected to the computer.
Most uninstallers of a printer driver, a scanner driver, or a MFP driver use a plurality of application program interfaces (hereinafter referred to as APIs) provided by an operating system (OS). Using the API, the uninstaller acquires a hardware ID from an information file (INF) of a device driver. Then, based on the hardware ID, the uninstaller specifies the device to be deleted and deletes the driver of the device.
Such a driver deletion process is properly carried out on most OSs regardless whether or not the device is connected to a personal computer (PC). However, depending on a type of the OS, at a timing of an API call for deleting a device information set which is made at the end of a driver deletion process, an entire device tree can be re-enumerated. As a result, when the entire device tree is re-enumerated, the device connected to the PC is detected owing to a plug-and-play function of the OS. Consequently, reinstallation of the driver which is to be deleted is started.
Conventionally, in order to prevent such a problem, the user has to turn off in advance power supplied to the device or otherwise disconnect the device from the PC.
The present invention is directed to a method and apparatus for deleting a device driver without starting a driver reinstallation process even when the device is connected to an apparatus.
According to an aspect of the present invention, an information processing apparatus includes a storage unit configured to store a device driver and an operating system, and a deletion unit configured to delete the device driver. The deletion unit issues a command before deleting the device driver to deactivate a software instance associated with a device corresponding to the device driver.
Further features and aspects of the present invention will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the invention and, together with the description, serve to explain the principles of the invention.
Various exemplary embodiments, features, and aspects of the invention will be described in detail below with reference to the drawings. Among the functions (information) cited and described below, those that are not specially and in detail described, are information publicly disclosed in a site of Microsoft Developer Network (MSDN) as of Apr. 27, 2006. The URL of the site of MSDN is http://msdn.microsoft.com/library/default.asp. In the following description, USB is an abbreviation for Universal Serial Bus which enables bidirectional communication. Since the USB is a publicly known interface, detailed description of the USB shall be omitted.
An MFP 3 includes a color scanner and a color inkjet printer. The MFP 3 as described is an example of a peripheral apparatus according to the present embodiment. It is to be noted that a printer, a copier, a fax machine, a scanner, a digital camera, or any apparatus comprising such functions can also be used as the peripheral apparatus of the present embodiment. The MFP 3 includes a hardware configuration described later with reference to
An application 30 and an application 60 include a file in an executable file format (*.EXE, etc.). The application 30 is an example of an application according to the present embodiment and serves as an uninstaller configured to delete a driver such as a printer driver or a scanner driver. The application 60 is an updater configured to upgrade such a driver.
A printer driver 50 is described later in detail referring to
A portable compact disc read-only memory (CD-ROM) or an internal read-only memory (ROM) can also be used as the storage unit. Modules of the PC 1 illustrated in
The ROM 16 stores a program configured to allow the MFP 3 to perform a recording (printing) process or transmit a recording (printing) status to the PC 1 under control of the printer driver 50. The RAM 17 temporarily stores print data which is sent from the PC 1 to be printed by the recording unit 19.
The communication unit 18 controls communication via USB and includes a connection port for the USB interface 9. The recording unit 19 includes a recording unit comprising an inkjet-type recording head, color ink tanks, a carriage, and a recording paper feeding mechanism, and also an electric circuit comprising an application specific integrated circuit (ASIC) which generates a print pulse on the recording head based on the print data.
According to a printing operation regarding an application which enables printing, a content (image data) of a file opened by the application is temporarily stored in the HDD 1202 of the PC 1 as a spool file in an enhanced metafile (EMF) format. The content is converted into print data including a command for controlling the MFP 3 by the printer driver 50, and then sent to the MFP 3 via the USB interface 9. The print data is received by the MFP 3, converted into a print pulse by the recording unit 19, and printed on recording paper.
The scanning unit 20 includes a scanning unit including a charge-coupled device (CCD) and a scanning light source, and also an electric circuit including an ASIC configured to process image data scanned by the CCD. The image data controlled by a control command sent from the PC 1 and scanned by the scanning unit 20 is sent to the PC 1 via the USB interface 9.
A Graphics Device Interface (GDI) 31 is a part of the OS 2. A printer queue 32 is a part of a spooler 40 and used when queuing a print job. The print job in a queue is displayed on a printer queue folder.
The print processor 33 changes a print layout or executes a special processing of a print image. The graphics driver 34 is a core of an image processing performed by the printer driver. Based on a rendering instruction sent from the GDI 31, the graphics driver 34 performs image processing for printing and creates a print control command.
The UI module 35 provides and controls a user interface of the printer driver. The language monitor 36 controls transmission and reception of data as a communication interface. The port monitor 37 transmits data sent from the language monitor 36 to an appropriate port and receives data sent from the MFP 3 via the class driver 38.
The class driver 38 is a low level module which is the closest to the port. According to the present embodiment, the class driver 38 is a USB printer class driver and controls a USB port.
Although a scanner driver of the MFP 3 has a different architecture from the printer driver 50, a basic concept of the scanner driver is similar to that of the printer driver 50 in that it includes an OS module and an independent hardware vendor (IHV) module. For this reason, detailed description of the scanner driver of the MFP 3 is omitted.
Next, in step S53, the uninstaller 30 confirms that the printer driver 50 is to be deleted. Then, in step S54, the uninstaller 30 determines whether the printer driver 50 is being used. If the uninstaller 30 determines that the printer driver 50 is being used (YES in step S54), the process proceeds to step S55. In step S55, an error message is displayed informing the user that the printer driver 50 is being used and the process ends.
On the other hand, if it is determined that the printer driver 50 is not being used (NO in step S54), the process proceeds to step S56. In step S56, the uninstaller 30 makes an API call by which the MFP 3 is removed from a device manager in terms of software. In other words, a device eject API is called and the device manager inactivates an instance of the MFP 3. In this way, plug and play is not enabled by the OS 2 even if a signal for the plug and play is sent from the MFP 3. Until an API for activating the instance is called, the plug and play signal from the MFP 3 is not detected. In other words, when the MFP 3 is removed by the API call in terms of software, plug and play does not occur.
Next, in step S57, the uninstaller 30 deletes the printer driver 50. In step S58, the uninstaller 30 makes an API call to delete a device information set created in step S52. Although the OS 2 re-enumerates the entire device tree when this API is called, since the MFP 3 is already removed by an eject process in terms of software from the device manager of the OS 2 in step S56, the MFP 3 is not detected by the plug and play function of the OS 2 even if the MFP 3 is connected to the PC 1. And S52, device information set is created.
If the printer driver 50 is not detected (NO in step S62), the process ends. On the other hand, if the printer driver 50 is detected (YES in step S62), the process proceeds to step S63. In step S63, the updater 60 compares a version of a printer driver in an updater package and a version of the printer driver 50 which is already installed.
If it is determined that the version of the installed printer driver 50 is new (NO in step S63), the process ends. On the other hand, if it is determined that the version of the installed printer driver 50 is old (YES in step S63), the process proceeds to step S64. In step S64, the updater 60 displays a dialog asking the user whether the user wishes to update the printer driver.
Next, in step S65, the updater 60 determines whether the user has determined to update the printer driver. If the user has determined not to update the printer driver (NO in step S65), the process ends. On the other hand, if the user has determined to update the printer driver (YES in step S65), the process proceeds to step S66. In step S66, the updater 60 searches the INF 70 which contains a hardware ID of the MFP 3 from the all driver INFs installed in the OS 2 using a plurality of APIs provided by the OS 2. In addition, a device information set is created.
Next, in step S67, the updater 60 confirms that the printer driver 50 is to be deleted. Then, in step S68, the updater 60 determines whether the printer driver 50 is being used. If the updater 60 determines that the printer driver 50 is being used (YES in step S68), the process proceeds to step S69. In step S69, an error message will be displayed informing the user that the printer driver 50 is being used and the process ends.
On the other hand, if it is determined that the printer driver 50 is not in use (NO in step S68), the process proceeds to step S70. In step S70, the updater 60 makes an API call by which the MFP 3 is removed from a device manager in terms of software.
Next, in step S71, the updater 60 deletes the printer driver 50. In step S72, the updater 60 makes an API call to delete a device information set created in step S66.
Although the OS 2 re-enumerates the entire device tree when this API is called, since the MFP 3 is already removed by an eject process in terms of software from the device manager of the OS 2 in step S70, the MFP 3 is not detected by the plug and play function of the OS 2 even if the MFP 3 is connected to the PC 1.
Next, in step S73, a new printer driver is set up by the updater 60. Then, in step S74, the updater 60 displays a dialog message requesting the user to connect the MFP 3 and the PC 1. If the MFP 3 is already connected to the PC 1, the updater 60 displays a dialog message requesting the user to unplug the USB cable and plug it back in.
Next, when the user reconnects the USB cable, the OS 2 puts the MFP 3 which has been removed in terms of software, back to the device manager and installs the printer driver by the plug-and-play function.
In step S54, if it is determined that the printer driver 50 is not in use (NO in step S54), the process proceeds to step S80. In step S80, the uninstaller 30 deletes the driver by turning off power supplied to the device, as described below with respect to
In step S1001, power to the device is turned off and the driver is deleted. Then, the installer 30 performs a following process.
In step S1002, the uninstaller 30 checks a printer queue 32 to see if a print job is in a queue. Then, in step S1003, the uninstaller 30 determines whether the print job is available.
If it is determined that a print job is available (YES in step S1003), the process proceeds to step S1013. In step S1013, the uninstaller 30 displays a message on the display unit that, for example, a print job is present. An example of the message displayed in step S1013 is described below with respect to
In step S1005, the uninstaller 30 determines whether the MFP 3 is in the printing process based on the status confirmed in step S1004. If it is determined that the MFP is in the printing process (YES in step S1004), the process proceeds to step S1013. In step S1013, the uninstaller 30 displays a message on the display unit indicating that, for example, the MFP 3 is the printing process. On the other hand, if it is determined that the MFP is not in the printing process (NO in step S1005), the process proceeds to step S1006. In step S1006, the uninstaller 30 determines whether an error has occurred in the MFP 3 based on the status confirmed in step S1004.
If the uninstaller 30 determines that an error has occurred in the MFP 3, (YES in step S1006), the process proceeds to step S1013. In step S1013, the uninstaller 30 displays, for example, a message informing the user that an error has occurred. On the other hand, if the uninstaller 30 determines that an error has not occurred in the MFP 3 (NO in step S1006), the process proceeds to step S1007. In step S1007, the uninstaller 30 determines whether the MFP 3 is on-line and on standby based on the status confirmed in step S1004.
If the uninstaller 30 determines that the MFP 3 is not on-line and on standby (NO in step S1007), the process proceeds to step S1013. In step S1013, the uninstaller 30 displays a message informing the user, for example, that the MFP 3 is not on-line and on standby. On the other hand, if the uninstaller 30 determines that the MFP 3 is on-line and on standby (YES in step S1007), the process proceeds to step S1008. In step S1008, the uninstaller 30 issues and transmits a power-off command to the MFP 3 as described below with respect to
Then in step S1009, the uninstaller 30 confirms a status of an USB port of the PC 1 to which the USB interface 9 is connected. Next, in step S1010, the uninstaller 30 determines whether the MFP 3 is in a power-off state.
If it is determined that the MFP 3 is in a power-off state (YES in step S1010), the process proceeds to step S1014. In step S1014, the uninstaller 30 deletes the printer driver 50 and the process ends. On the other hand, if it is determined that the MFP 3 is in a power-on state (NO in step S1010), the process proceeds to step S1011. In step S1011, the uninstaller 30 waits for a certain period of time (e.g., 1 second). After that, in step S1012, the uninstaller 30 determines whether a time-out has occurred (e.g., 1 minute has passed).
If the uninstaller 30 determines that the time-out has occurred (YES in step S1012), the process proceeds to step S1013. In step S1013, the uninstaller 30 displays a message on the display unit informing the user, for example, that power is not turned off. On the other hand, if the uninstaller 30 determines that the time-out has not occurred (NO in step S1012), the process returns to step S1009.
When an OK button 89, which is displayed together with the message displayed in step S1013, is selected by the user, the process of deleting the driver by the power-off of the device ends.
The uninstaller 30 performs the process of determining an error of MFP 3 in step S1006, which is described below with respect to
The paper-jam error 93 (STS:PaperJamError) is issued when a paper jam occurs in the MFP 3. The ink low warning 94 (STS:InkLowWarning) is issued when ink is running low. The ink-out error 95 (STS:InkOutError) is issued when little ink is left in the MFP 3. A scanning status 96 (STS:Scanning) is issued when the MFP 3 is in a process of scanning. An on-line status 97 (STS:Online) is issued when the MFP 3 is on-line and on a standby state.
When the MFP 3 is in a plurality of statuses, for example, a STS:Printing,PaperOutWarning,InkLowWarning 98 is issued. This command is issued when the MFP 3 is in a process of printing but recording paper is not set, and ink is running low.
Next, in step S1502, the MFP 3 confirms the data sent from the PC 1. Then, in step S1503, the MFP 3 determines whether the data is the status request command 90. If it is determined that the data is the status request command 90 (YES in step S1503), the process proceeds to step S1504. In step S1504, the MFP 3 confirms the status of the MFP 3.
Next, in step S1505, the MFP 3 generates and stores a status reply command indicating the state. Then, the process of receiving the data ends.
On the other hand, if it is determined that the data is not the status request command 90 in step S1503, (NO in step S1503), the process proceeds to step S1506. In step S1506, the MFP 3 determines whether the data is the power-off command 99.
If it is determined that the data is the power-off command 99 (YES in step S1506), the process proceeds to step S1507. In step S1507, the power to the MFP 3 is turned off. Then, the MFP 3 ends the process of receiving the data and remains in a power-off state. In step S1506, if it is determined that the data is not the power-off command 99 (NO in step S1506), the process proceeds to step S1508. In step S1508, the MFP 3 performs a process according to the received data and the process of receiving the data ends.
In step S1602, the MFP 3 sets the status reply command which is stored in step S1505 of
In step S81, the updater 60 deletes the driver by turning off power to the device, as described with respect to
Although the OS 2 re-enumerates the entire device tree when this API is called, since the MFP 3 is already removed from the device manager of the OS 2 by an eject process in terms of software in step S70, the MFP 3 is not detected by the plug and play function of the OS 2 even if the MFP 3 is connected to the PC 1.
Next, in step S73, a new printer driver is set up by the updater 60. Then, in step S74, a dialog message is displayed by the updater 60 requesting the user to connect the MFP 3 and the PC 1. If the MFP 3 is already connected to the PC 1, the updater 60 displays a dialog message requesting the user to unplug the USB cable and plug it back in.
Referring now to a memory map illustrated in
In
Also, each function realized by an execution of a process of each flowchart illustrated in
As described above, a storage medium storing a software program code which realizes a function of the above-described embodiments is supplied to the peripheral apparatus control system or the information processing apparatus, or the peripheral apparatus. Thus, the object of the above-described embodiments can be also achieved when a computer (or a CPU or a MPU) of the peripheral apparatus control system or the information processing apparatus, or the peripheral apparatus reads and executes the program code stored in such a storage medium.
In this case, the program code itself read out from the storage medium realizes the novel functions described in the above-described embodiments. Thus, the storage medium which stores the program code constitutes the above-described embodiments. As a storage medium which provides the program code, a floppy disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a CD-R, a magnetic tape, a non-volatile memory card, a ROM, or an EEPROM, etc. may be used.
A function of the above-described embodiments is realized not only when the computer executes the program code. For example, an OS or the like, which runs on a computer, can execute a part or whole of the actual processing based on an instruction of the program code so that a function of the above-described embodiments can be achieved.
Further, the uninstaller and the updater (driver updater) were described in the above-described embodiments as an example, but the application 30 according to the embodiments is not limited to such examples. That is, the application 30 can be an arbitrary application configured to delete a driver of an installer or the like adapted to update or install a driver of a peripheral apparatus.
Furthermore, according to the above-described embodiments, a PC was described as an example of the information processing apparatus, however, the information processing apparatus can be also a DVD video player, a game console, a set-top box, or an Internet appliance.
Further, according to the above-described embodiments, an MFP was selected as an example of the peripheral apparatus, however a peripheral apparatus such as a printer, a copier, a facsimile machine, a scanner, a digital camera, or a multifunction apparatus having these functions can also be used.
Furthermore, according to the above-described embodiments, USB interface was used to interface the PC and the MFP. However, the PC and the MFP can also be connected via Ethernet, wireless Local Area Network (wireless LAN), Institute of Electrical and Electronics Engineers (IEEE) 1394, Bluetooth, Infrared Data Association (IrDA), parallel, or serial interface.
Thus, according to the above-described embodiments, the user can delete the device driver without being disturbed by the driver reinstall processing even when the device is connected to the apparatus.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all modifications, equivalent structures, and functions.
This application claims priority from Japanese Patent Application No. 2006-188242 filed Jul. 7, 2006, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2006-188242 | Jul 2006 | JP | national |