Restarting a Windows PC after driver installation
-
I have written a Windows device driver that updates the firmware on a certain device, via Windows Update. The sequence of operations is as follows: * The driver is downloaded from Windows Update, and scheduled for installation * The PC is rebooted (either by the user, or at the Windows idle time) * During restart, the firmware is downloaded to the device * An additional reboot is required in order to program the firmware into the device It is this last step that I cannot get working. Other than writing some sort of application that requests the user to reboot the system after the driver is installed (error-prone, and inelegant), is there a way for the device driver to tell Windows that a reboot is required?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
I have written a Windows device driver that updates the firmware on a certain device, via Windows Update. The sequence of operations is as follows: * The driver is downloaded from Windows Update, and scheduled for installation * The PC is rebooted (either by the user, or at the Windows idle time) * During restart, the firmware is downloaded to the device * An additional reboot is required in order to program the firmware into the device It is this last step that I cannot get working. Other than writing some sort of application that requests the user to reboot the system after the driver is installed (error-prone, and inelegant), is there a way for the device driver to tell Windows that a reboot is required?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
Hi Daniel, [redacted] The only technique I can think of would be using the [WUAPI](https://docs.microsoft.com/en-us/windows/desktop/api/wuapi/) to [force reinstall](https://docs.microsoft.com/en-us/windows/desktop/api/wuapi/nf-wuapi-iupdateinstaller-put\_isforced) your device driver. You didn't mention anything about your co-installer but you would probably need to add something to detect that the firmware was already present and up-to-date after the reboot. Whether or not this is more elegant is debatable. In my opinion your co-installer should be responsible for the user notification and reboot. Best Wishes, -David Delaune
-
Hi Daniel, [redacted] The only technique I can think of would be using the [WUAPI](https://docs.microsoft.com/en-us/windows/desktop/api/wuapi/) to [force reinstall](https://docs.microsoft.com/en-us/windows/desktop/api/wuapi/nf-wuapi-iupdateinstaller-put\_isforced) your device driver. You didn't mention anything about your co-installer but you would probably need to add something to detect that the firmware was already present and up-to-date after the reboot. Whether or not this is more elegant is debatable. In my opinion your co-installer should be responsible for the user notification and reboot. Best Wishes, -David Delaune
Having Windows Update handle the reboot is the ideal solution from my point of view. Thanks for the pointers.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
I have written a Windows device driver that updates the firmware on a certain device, via Windows Update. The sequence of operations is as follows: * The driver is downloaded from Windows Update, and scheduled for installation * The PC is rebooted (either by the user, or at the Windows idle time) * During restart, the firmware is downloaded to the device * An additional reboot is required in order to program the firmware into the device It is this last step that I cannot get working. Other than writing some sort of application that requests the user to reboot the system after the driver is installed (error-prone, and inelegant), is there a way for the device driver to tell Windows that a reboot is required?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.