Holy What The OMG the DriverStore FOLDER!?

ZorkLVM

Member
Messages
47
Reaction score
4
So I was putzin around with NTLite and decided to add about 8 of the most recent motherboard manufacturer's Realtek audio driver files to save me the hassle of having to manually install on customer's computers.

The resulting Win11 iso increased in size by 1 GB. That's fine.

But the DriverStore folder!!! What the!?!? It increased in size 30 friggen giga-mothafricken-bytes! What what? Is Windows making like 30 copies of each driver file? What is Windows doing?

Edit: Seems like the bulk of the size increase is coming from the legacy Realtek HDA audio drivers... Windows made 92 copies of just about every single driver file, one for each unique inf.
 
Last edited:
This is the normal behavior, and how DISM treats INF files for ridiculously large driver packages from NVIDIA or Realtek.

When DISM discovers an .INF file, it will begin copying all referenced files to a new individual instance in DriverStore. Each instance isn't shared, because the presumption is that any one driver version can be removed without disturbing its neighbors.

If your NVIDIA or Realtek folder has multiple INF files, and you don't pick a specific INF file to import then the default behavior for both NTLite & DISM is to recursively scan and process every valid INF. Suppose you have 45 different NVIDIA *.inf files in the folder, then you get 45 instances of the HW driver along with duplicate copies of every included DLL which is part of the driver set.

This could be entirely avoided if DriverStore supported the notion of hardlinks, so file duplication wouldn't result in a bloated DriverStore folder on the install disk. But for whatever reason, that's not how it works.

This can be a chicken & egg problem:

Until you first install the driver package on the target system, how do you know if you've picked the right .INF file? Licensed NTLite does allow you to import the current host's drivers into the image. But again, you needed to have first installed something to find out if you were correct.
 
I wonder what this pretty little Reuse Driver Cache checkbox in NTLite does? Edit: It didn't reduce the Driver Store size.

I'll post my script to cleanup the DriverStore folder when it's done.
 
Last edited:
From my personal experience, so take it with a grain of salt: Small drivers such as Chipset, Wifi, accelerometer and etc are better integrated on the image, but the main drivers like Graphics and Audio are better installed in post setup.

Legacy Realtek Audio can be silent installed with the following command:
Code:
[Path To Drivers]\Realtek\Setup.exe /S

Graphics Drivers can be installed as such:
NVIDIA (assumes unpacked driver file, use NVSlimmer for that):
Code:
[Path To Drivers]\Nvidia\Setup.exe /clean /noreboot /passive /noeula /nofinish
AMD:
Code:
[Path To Drivers]\AMD.exe -INSTALL
Intel Legacy
Code:
[Path To Drivers]\Intel\igxpin.exe -overwrite -s
Intel DCH
Code:
[Path To Drivers]\Intel.exe --passive --overwrite

Its especially useful to do it that way if you're making a setup for multiple systems, as you can let the setup 'choose' the appropriate driver for each computer, provided the install file supports all the machines.
 
PhsMu Thank you, this is very helpful.

Are you running those during Post-Setup/Before-Login?

I wish there were some conditionals that could be found to detect things in a batch script like is_vmware_virtualmachine(), is_amd_gpu(), is_intel_cpu(), etc.
 
PhsMu Thank you, this is very helpful.

Are you running those during Post-Setup/Before-Login?

I wish there were some conditionals that could be found to detect things in a batch script like is_vmware_virtualmachine(), is_amd_gpu(), is_intel_cpu(), etc.
First login, I use a registry tweak to run a cmd script instead of setup complete (because I use an admin account by default, and spotify refused to install on those via setupcomplete method).

The closest thing you're can get is WMIC tags.

wmic csproduct get identifyingnumber /value
wmic computersystem get model /value
wmic path softwarelicensingservice get OA3xOriginalProductKey

These get you the service tag, the model and the windows key, respectively. If you make batch variables out of them, you can have separate sections of the script that install different drivers based on model numbers, and different apps depending on the service tag (which is unique even for devices of the same model). Like this:

For /F "tokens=2 delims==" %%a in ('wmic csproduct get identifyingnumber /value') do set Tag=%%a
For /F "tokens=2 delims==" %%a in ('wmic computersystem get model /value') do set Model=%%a
Goto :%Tag% 2>nul
Goto :%Model% 2>nul
Goto :Generic 2>nul
Exit

This will run a series of 'ModelSpecific' commands then a series of 'Tag Specific Commands', then a series of 'Generic' commands, in case of failure to find model or tag. use multiple sections of that Goto, and the model/tag blcoks, and you can have pretty neat multi-machine scripts.

The Windows Key is just plain useful if you want to activate the install using SLMGR commands:

slmgr /upk - uninstall product key (if you used a generic one to install multiple machines)
slmgr /cpky - remove key from registry
slmgr /ipk - install product key
 
W11 24H2 disables WMIC at some point around the OOBE phase, so you need to remove the "OOBE – FOD Setup" component to protect any WMIC-based scripts.
 
Never use slmgr /upk because it invalidate sppsvc notify status and might cause it to install the default generic key, leading to unwanted edition switch on win 10 1607 or later
slmgr /ipk is enough
 
Back
Top