What is the best way of installing multiple drivers in an atomic way. I have a set of drivers that I need to install - if user cancels or if power goes away in between install/uninstall I want to make sure that either all drivers get installed/uninstalled or none. Any suggestions?
I looked at what james suggested using WIX in the following links but I’m not sure if it is atomic. Thanks.
http://www.osronline.com/showThread.cfm?link=168822
http://xenbits.xensource.com/ext/win-pvdrivers.hg?file/c548d9eb5107/installer.wxs
It is never going to be ‘atomic’. At best you can have ‘compensation’ on error. And with respect to catestrophic failure, you might not ever get to run your compensation (not that it would matter, unless your driver is the reason the system cannot boot).
The DIFxAPP does a reasonable job of implementing compensation (rollback) on install failure. But if your prepair/commit/rollback requirements for *your* driver-set are more involved then you are probably stuck rolling your own scheme.
As for the case of user-cancel the easiest way to avoid that scenario is to take away the ability to cancel once the ‘prepare’ phase has completed. Basically, if the user does not cancel before starting to install the first driver, don’t let them muck up the problem by giving them the chance to cancel during the third of seven drivers.
For the crash case, the system should run the MSI rollback script after MSI is ‘triggered’ to do so after reboot.
Good Luck,
Dave Cattley
Thank you. my drivers are part of boot stack and if a power loss happened and some of the drivers are installed while some not, the system may not boot the next time. Is there any precendence/recommendation for handling this kind of scenario.
Ever heard of a UPS, un-interrupt-able power supply? Make sure the batteries are charged on the laptop and your working off of wall power? Of course, pay the power bill?
Is this the miniport driver for SCSI/STORPORT or the ATA/IDE port? How are your drivers part of the boot stack? How many drivers, and what are their functionality, are you adding to the “boot stack”? What the heck are you installing?
Gary G. Little
----- Original Message -----
From: “cool 2k7”
To: “Windows System Software Devs Interest List”
Sent: Thursday, December 16, 2010 8:29:26 PM
Subject: RE:[ntdev] installing multiple drivers atomically
Thank you. my drivers are part of boot stack and if a power loss happened and some of the drivers are installed while some not, the system may not boot the next time. Is there any precendence/recommendation for handling this kind of scenario.
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Hmm. I guess your only recourse is “Last Known Good Configuraiton” which austensibly will not have your drivers installed/enabled.
Short of that, I would carefully consider how to install your drivers such that the ‘last’ driver you install is the one that will cause the system not to boot. Unless they all have that property, that might minimize the window for failure.
You probably are going to have to tell use quite a bit more about what sort of driver stack you are building up before much more direct suggestions can be made.
Good Luck,
Dave Cattley
xxxxx@gmail.com skrev 2010-12-17 01:10:
What is the best way of installing multiple drivers in an atomic way. I have a set of drivers that I need to install - if user cancels or if power goes away in between install/uninstall I want to make sure that either all drivers get installed/uninstalled or none. Any suggestions?
I looked at what james suggested using WIX in the following links but I’m not sure if it is atomic. Thanks.
Just an idea, if you can’t guarantee atomicness, you might be able to at least detect it by having a registry item with bits
set for each successfully installed driver. Then at boot time, each driver checks that the registry item is “good” in order to
return success from DriverEntry. Would that work ?
/R
> Thank you. my drivers are part of boot stack and if a power loss happened and some of the drivers
are installed while some not, the system may not boot the next time
Write your drivers in a way they are defunct (dumb pass-through filters) if some magic registry value is not set.
Set this value as the last step of the install.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com