How to Install a Test-signed Driver Package Required for Windows Setup and Boot
This page describes how to install a test-signed driver package on a computer running Windows Server 2019 (or Windows Server 2016), or on a computer starting for the first time after Windows Setup. You should only use a test-signed driver package in a test environment.
For more info, see Introduction to Test-Signing.
Before you begin, ensure that you have:
- Windows Assessment and Deployment Kit (ADK) and Windows PE add-on for the ADK
- Windows Server 2019 or 2016 Installation Media ISO file
Creating the ISO file
Use the following steps to create an ISO file and install Windows from it:
- In the ADK Start Menu options, choose Deployment and Imaging Tools Environment, right-click, and select Run as administrator.
- Run copype to create a working copy of the Windows PE files:
copype amd64 C:\WinPE_amd64
- Enable testsigning. On a non-UEFI (legacy) computer, use:
cd C:\WinPE_amd64\media\Boot
bcdedit /store .\BCD /enum all
bcdedit /store .\BCD /set {default} testsigning on
On a UEFI platform, use:
cd C:\WinPE_amd64\media\EFI\Microsoft\Boot
bcdedit /store .\BCD /enum all
bcdedit /store .\BCD /set {default} testsigning on
To verify that
testsigning Yes
now appears for the {default} identifier, under Windows Boot Loader, runbcdedit /store .\BCD /enum all
a second time.Mount the Windows Server 2016 Installation Media ISO file to a drive, for example,
G
, and manually copy all files under the sources folder, for exampleG:\sources
, to the sources folder of the WinPE system files, for exampleC:\WinPE_amd64\media\sources
.
Note
Do not overwrite the existing boot.wim
file in the folder C:\WinPE_amd64\media\sources
. We'll use the original WinPE environment later.
Now we have all the files including WinPE and Windows Server 2016.
- Optionally copy a test-signed driver package to the folder
C:\WinPE_amd64\media
. Files copied might include the driver package's .cat, .cer, .inf, and .sys files. Use the following commands to import the test-signed driver package to the WIM file:
Dism /Get-WimInfo /wimfile:C:\WinPE_amd64\media\sources\install.wim
Dism /Mount-Image /imagefile:C:\WinPE_amd64\media\sources\install.wim /index:4 /mountdir:C:\WinPE_amd64\mount
Dism /image:C:\WinPE_amd64\mount /Add-Driver /driver:C:\WinPE_amd64\media\DriverSample
Dism /unmount-image /mountdir:C:\WinPE_amd64\mount /commit
Create a new ISO file:
Makewinpemedia /iso C:\winpe_amd64 C:\WS2016_amd64.iso
. While the default application in the ISO file is the cmd.exe, you'll launch the setup.exe manually to configure boot settings after installation.Install Windows Server 2016 from
WS2016_amd64.iso
. Optionally, customize the installation source to import more driver packages.
Installing the driver package
Use these steps to install the driver package:
- Turn off Secure Boot on the test computer and then start the WinPE system.
- After the machine boots with the ISO file, a command prompt appears.
- To identify the letter of the drive with the mounted ISO file, use
diskpart
, thenlist volume
. Find the volume with Type ofDVD-ROM
. Typeexit
. - Navigate to the ISO drive and switch to the driver package sample directory, for example
D:\DriverSample
. - Use the following commands to install the test driver package:
certmgr.exe -add DriverSample.cer -s -r localmachine root
certmgr.exe -add DriverSample.cer -s -r localmachine trustedpublisher
pnputil.exe /add-driver DriverSample.inf /install
- Optionally, confirm the installation by reviewing the
%windir%\inf\setupapi.dev.log
log. - Run
setup.exe /NoReboot
, for example fromD:\sources
. - After installation, a message appears indicating that the setup application can be closed. Exit the application to return to the WinPE command prompt.
- Type
diskpart
. Identify the OS boot partition and the drive letter for that boot partition (The only FAT32 partition and the size is about 100MB) - Navigate to the boot partition drive and switch directory to the location of the BCD file, for example
E:\EFI\Microsoft\Boot
. - Turn on testsigning:
bcdedit /store BCD /set {default} testsigning on
and reboot the computer. - To confirm that the computer is in test mode, look for a Test Mode watermark in the lower right of the desktop.
The computer must be in Test Mode to load a test-signed driver package. If there is a boot device requiring the test-signed driver package, the test-signed driver package must be imported to the WIM file (use the optional Dism steps above) to avoid PnP installation later. If you turn off the testsigning setting, the machine may fail to boot.