Меню Рубрики

Install windows select the driver to install

How Windows selects a driver for a device

When a device is attached, Windows needs to find a corresponding device driver to install.

In Windows 10, this matching process happens in two phases. First, Windows 10 installs the best matching driver in the driver store, allowing the device to begin operation quickly. After that driver is installed, Windows 10 also:

  • Downloads any matching driver packages from Windows Update and puts them in the driver store.
  • Searches for driver packages that were preloaded in the locations specified by the DevicePath registry value. The DevicePath registry value is located under the following subkey: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion . By default, the DevicePath value specifies the %SystemRoot%\INF directory.

If Windows 10 finds a better matching driver package in those locations than was initially installed, Windows replaces the driver it installed from the driver store with the better match.

In Windows versions before Windows 8, the driver matching process looks only in DevicePath, if one is specified, and defaults to Windows Update otherwise.

The following table provides a quick summary of the information above:

Search phase Windows 7 match order Windows 8, Windows 10 match order
Before a driver is installed DevicePath; Windows Update; Driver store Driver store
After initial driver is selected Not applicable DevicePath; Windows Update

In Windows 10 version 1709 and greater, Windows offers the best matching driver, which is not necessarily the most recent. The driver selection process considers hardware ID, date/version, and critical/automatic/optional category. Windows prioritizes critical or automatic drivers highest. If a matching driver is not found, WU looks next for optional drivers. As a result, an older critical driver of otherwise equal value takes precedence over a newer optional driver.

Источник

Развертывание драйверов Driver deployment

Развертывание драйвера в Windows 10 IoT базовая с помощью Visual Studio. Deploy a driver on Windows 10 IoT Core with Visual Studio.

Настройте проект драйвера Visual Studio, чтобы можно было компилировать и развертывать драйвер для определенной платформы на этапе разработки драйвера. Configure your Visual Studio driver project so that you can compile and deploy a driver for a specific platform during driver development phase.

В этом упражнении вы можете использовать образец драйвера гпиокмдфдемо. For this exercise you can use the gpiokmdfdemo sample driver.

Если вы хотите добавить драйвер к образу, ознакомьтесь с инструкциями в нашем производственном руководством IOT. If you’re looking to add a driver to an image, please visit the instructions in our IoT Manufacturing Guide.

Шаг 1. Настройка Step 1: Setup

На устройстве On the device

  • Убедитесь, что на устройстве установлен образ Иоткоре, следуя инструкциям в разделе Приступая к работе. Make sure that your device has an IoTCore image installed by following the Get Started instructions.
  • Подключитесь к устройству с помощью PowerShell. Connect to your device via PowerShell.

На компьютере On the PC

Убедитесь, что установлен Visual Studio 2017. Make sure you have installed Visual Studio 2017.

Установите набор драйверов для Windows. Install the Windows Driver Kit. Вам потребуется установить пакет SDK и WDK. You will need to install the SDK and WDK.

Установите сертификаты, чтобы правильно подписать драйвер и запустить его на устройстве. Install the certificates so that the driver is signed correctly and can run on your device. В командной строке с повышенными привилегиями выполните команды, перечисленные ниже. From an elevated command prompt execute the commands listed below:

  1. cd c:\Program Files (x86)\Windows Kits\10\Tools\bin\i386
  2. set WPDKContentRoot=c:\Program Files (x86)\Windows Kits\10
  3. InstallOEMCerts.cmd

Примените исправление, чтобы включить развертывание F5 из VS. Apply fix to enable F5 deployment from VS. В командной строке с повышенными привилегиями выполните следующие команды: In the elevated command prompt, execute the following commands:

  1. cd %TEMP% (изменит каталог на c:\users\ \Appdata\Local\Temp ) cd %TEMP% ( will change directory to c:\users\ \Appdata\Local\Temp )
  2. md “WdkTempFiles” Создание каталога «Вдктемпфилес» вручную. это обходной путь для ошибки в средствах и должен выполняться на компьютере только один раз . md “WdkTempFiles” Manually create a “WdkTempFiles” directory This is a workaround for a bug in the tooling and requires to be done only once in the PC.

Шаг 2. Инициализация устройства с помощью Visual Studio Step 2: Provision device with Visual Studio

Откройте Visual Studio и выберите драйвер > тест > настроить устройства > добавить новое устройство Open Visual Studio and select Driver > Test > Configure Devices > Add New Device

  • Если пункт меню драйвер не отображается, проверьте, установлен ли пакет SDK. If the Driver Menu option is not shown, check if SDK is installed.

В диалоговом окне Конфигурация устройства In the Device Configuration dialog,

  • Введите удобное для пользователя отображаемое имя для целевого устройства Enter a user-friendly Display Name for your target device
  • Выберите тип устройства = мобильный. Select Device Type = Mobile
  • В отображаемом списке отсортируйте по IP-адресу и найдите адрес для устройства IoT и выберите. In the list displayed, sort by IP address, and find the address for the IoT device and select. Если есть две записи, выберите одну из них с ненулевым идентификатором GUID. If there are two entries, select the one with the non-zero GUID. Убедитесь, что строка выбрана — она должна выделять синим цветом. Make sure the row is selected – it should highlight blue
  • В нижней части диалогового окна находятся два переключателя. At the bottom of the dialog are two radio buttons. Выберите тот, который говорит Device подготавливать устройство, и выберите параметры отладчика. Select the one that says Provision device and choose debugger settings. Щелкните Далее. Select Next

На странице Настройка параметров отладчиказадайте соответствующие параметры. On the Configure debugger settings, set the appropriate settings. Следует отметить следующее. Note the following:

  • Минновбоардмакс может использовать сеть для отладки. The MinnowBoardMax can use the network for debugging.
    • Использовать сеть типа подключения Use connection type Network
    • Выберите порт — по умолчанию можно использовать Select some port – default can be used
    • Выберите ключ — по умолчанию можно использовать Select some key – default can be used
    • Выберите IP-адрес узла компьютера, на котором работает Visual Studio. Select the host IP of the machine running visual studio. Не используйте адрес аутонет (169.xxx). Do not use the autonet (169.xxx) address.
    • Щелкните Далее. Select Next

  • Raspberry Pi использует последовательное подключение для отладки ядра. The Raspberry Pi uses serial for kernel debugging.
    • Подключите соответствующий кабель последовательной отладки к устройству PI и ведущему компьютеру. Connect the appropriate serial debugging cable to the PI and the host machine
    • Выберите серийный номер для типа подключения. Select Serial for the connection type
    • Заполните остальные параметры, соответствующие Raspberry Pi. Fill out the rest of the parameters as appropriate for the Raspberry Pi.
    • Щелкните Далее. Select Next

WDK в Visual Studio теперь будет подготавливать устройство IoT. The WDK, through VS, will now provision the IoT device. ТАЕФ и ВДТФ будут установлены на устройстве, и устройство будет настроено для отладки ядра в соответствии с указанными выше параметрами. TAEF and WDTF will be installed on the device, and the device will be set up for kernel debugging per the settings provided above.

По завершении устройство может быть перезагружено. When complete, the device may reboot. На экране «ход выполнения» в конфигурации устройства будет отображаться состояние и указано полное, когда устройство Интернета вещей завершило установку. The progress screen on the Device Configuration will provide status, and shows complete when the IoT device has completed the installation. Нажмите кнопку Готово. Press Finish.

  • Теперь устройство подготовлено, и в нем отображается состояние конфигурации тестирования устройства , настроенное для тестирования драйверов . The device is now provisioned and the Device test configuration status shows Configured for driver testing

Шаг 3. Настройка проекта драйвера Visual Studio Step 3: Configure Visual Studio driver project

  1. Запустите Visual Studio в режиме администратора и откройте проект драйвера Visual Studio. Launch Visual Studio in the administrator mode and open the visual studio driver project.
  2. Убедитесь, что версия целевой платформы соответствует пакету SDK, установленному на компьютере разработки. Make sure the Target Platform Version matches the SDK installed on your development machine. В окне обозреватель решений выберите Свойства проекта. Select Project Properties from the Solution Explorer window. В разделе Общие свойства конфигурации убедитесь, что версия целевой платформы соответствует пакету SDK, установленному на компьютере разработчика. Under General Configuration Properties assure that the Target Platform Version matches the SDK installed on your development computer. Версию пакета SDK можно проверить с помощью панели управления > программы > программы и компоненты. You can check the version of the SDK from the Control Panel > Programs > Programs and Features.
  3. В разделе проект > добавить новый элемент > Visual C++ > драйвер Windowsвыберите манифест пакета и нажмите кнопку добавить. Under Project > Add New Item > Visual C++ > Windows Driver, select Package Manifest and Press Add.

Package.pkg.xml файл будет добавлен в проект. Package.pkg.xml file will be added to the project. В этом файле укажите Теги «владелец», «платформа», «компонент» и «подкомпоненты». In this file, specify the Owner, Platform, Component and SubComponent tags.

  1. Задайте номер версии пакета в свойствах проекта > паккажежен > версии. Set package version number at Project Properties > PackageGen > Version. Обратите внимание, что каждый раз, когда необходимо выполнить установку или переустановку драйвера, этот номер версии должен быть увеличен. Note that every time you need to perform a Install/Reinstall of the driver, this version number has to be incremented.

  1. В разделе Свойства проекта > подписывание драйвера > тестовый сертификат, выберите тестовый сертификат (сертификат изготовителя телефона для проверки). Under Project Properties > Driver Signing > Test Certificate, select test certificate (Phone OEM Test Certificate)

  1. Перейдите к разделу Установка драйвера и выберите развертывание . Go to Driver Install and select Deployment

  • В раскрывающемся списке Target Device Name (имя целевого устройства ) выберите целевой объект, созданный выше в процессе подготовки. From the Target Device Name dropdown, select the target created above in the provisioning process. Обратите внимание на два варианта установки, переустановки и быстрой переустановки. Notice the two options for Install / Reinstall and Fast Reinstall. Выберите параметр и нажмите кнопку ОК. Choose an option and Click Ok.
  • Для первоначальной установки драйвера на целевой сервер используется Установка и повторная установка. Install / Reinstall is used for the initial installation of a driver to the target. Он устанавливает пакет драйверов с помощью стека обновлений Windows и может занять несколько минут. This installs the driver package using the Windows update stack and can take several minutes. Этот параметр должен использоваться при каждом изменении INF-файла. This must be used every time the INF file is changed.

Каждый раз, когда этот параметр используется для установки драйвера после первоначальной установки, номер версии пакета должен быть увеличен. Every time this option is used to install a driver after the initial installation, the package version number must be incremented.

  • Быстрая переустановка может быть использована после установки драйвера, и в INF-файле Drivers отсутствуют последующие изменения, влияющие на реестр. Fast Reinstall can be used once a driver has been installed, and there are no subsequent changes to the drivers INF file, which affect the registry. Этот метод обходит процесс установки, завершает работу всех девнодес, связанных с драйвером, копирует драйвер и перезапускает девноде. This method bypasses the install process, shuts down all devnodes associated with the driver, copies the driver over, and restarts the devnode. Это займет несколько ( This takes a few (

Этот метод не гарантируется успешно — если по какой-либо причине девноде не может быть выключен для освобождения драйвера, операция завершится ошибкой. This method is not guaranteed to succeed – If for some reason a devnode cannot be shutdown to release the driver, the operation will fail. Это может быть вызвано сбоем оборудования или первоначальной неудачной реализацией драйвера. This can be due to faulty hardware, or an initial faulty implementation of the driver. В этом случае необходимо использовать параметр install/REINSTALL. The Install/Reinstall option must be used in this case.

Теперь проект Visual Studio готов к созданию и развертыванию драйвера на целевом устройстве. Your Visual Studio project is now ready to build and deploy a driver to your target device. Если вы используете пример драйвера гпиокмдфдемо, вам потребуется создать таблицу ACPI и скопировать ее на целевое устройство, а затем выполнить действия, описанные в разделе Создание драйвера в Visual Studio. If you are using the sample gpiokmdfdemo driver you need to generate ACPI table and copy to your target device, then follow the steps in building the driver in Visual Studio.

Шаг 4. сборка и развертывание драйвера Step 4: Build and deploy driver

Это можно сделать двумя способами: с помощью клавиши F5 и с помощью параметра deploy . This can be done in two ways, using the F5 key and using the Deploy option. В обоих случаях драйвер будет создан и развернут (т. е. установит его на устройстве), а F5 присоединит отладчик ядра Visual Studio к установленному и загруженному драйверу. In both ways, the driver will be built and deployed (i.e. installs it on device) and the F5 attaches the Visual Studio kernel debugger to the installed and loaded driver.

Некоторые пользователи предпочитают использовать функцию развертывания и присоединяют другой отладчик ядра, например WINDBG или KD. Some users prefer to use the Deploy functionality and attach a different kernel debugger, such as WinDBG or KD. Это обеспечивает большую гибкость, чем использование отладчика VS. This can provide more flexibility than using the VS debugger.

Развертывание Deploy

  1. Щелкните правой кнопкой мыши проект в обозревателе решений. Right-click on the project in the solution explorer
  2. Выбор развертывания Select Deploy

  1. Процесс развертывания должен быть продолжен. The deployment process should proceed. После развертывания устройство IoT будет перезагружено, и во время установки должен отобразиться экран «шестеренки». The IoT device will be rebooted after deployment, and should show the “Gears” screen while installation is taking place.

Выходные данные сборки находятся в окне вывода состояние развертывания. Кроме того, в окне вывода после завершения установки устройство снова перезагрузится, а на экране выходных данных VS появится сообщение об успешном или неудачном выполнении. Build output is in the Output Window Deployment status is also in the output window When Installation completes, the device will reboot again, and the VS Output screen will indicate success or failure.

F5 F5

  1. В окне сборка убедитесь, что настройки верны: Текущая сборка сборки совпадает с настройкой на целевом устройстве. From the build window, make sure that the configurations are correct – the current build arch is the same as the target device arch. Именно для этого нужно, чтобы в целевом имени была ценная дуга. This is where having the arch in the target name is valuable. Целевой объект будет отображаться в поле вид в строке меню в VS сверху вниз. The target will be displayed in the view box on the menu bar in VS on the top-middle-right.
  2. Нажмите клавишу F5. Press F5. Целевой объект будет создан, развернут и подключен к отладчику ядра VS. The target will be built, deployed, and attached to the VS Kernel Debugger.
  • После перезагрузки убедитесь, что PowerShell все еще подключен к нему, в противном случае повторно подключитесь к целевому устройству с помощью enter-pssession команды PowerShell. After the reboot, make sure PowerShell is still connected to it, otherwise, reconnect to the target device using the PowerShell enter-pssession command..

Известные проблемы Known Issues

Ошибки подготовки Provisioning Errors

Состояние гонки во время взаимодействия с Минновбоардмакс может привести к сообщению об ошибке во время подготовки. A race condition during the interaction with MinnowBoardMax can result in a reported failure during provisioning. На самом деле, подготовка, скорее всего, была успешной. In fact, the provisioning most likely succeeded.

Список ошибок: List of Errors:

  • Ошибка: не удалось успешно завершить задачу «регистрация ВДТФ». ERROR: Task «Registering WDTF» failed to complete successfully.
  • Ошибка: не удалось успешно завершить задачу «Настройка параметров отладчика ядра (возможно, перезагрузка)» ERROR: Task «Configuring kernel debugger settings (possible reboot)» failed to complete successfully

Обходной путь: Эти ошибки почти наверняка можно игнорировать. Workaround: These errors can almost certainly be ignored.

Дополнительно Details:

Следующая ошибка отобразится в диалоговом окне » ход настройки конфигурации устройства «: The following error will be displayed in the Device Configuration Configuration Progress dialog:

На этом этапе можно безопасно щелкнуть Готово , а затем Применить и ОК. At this point, you can safely click on the Finish and then the Apply and OK.

Это неопасная ошибка, сформированная состоянием гонки, приводящая к неправильной обработке журнала результатов. This is a benign error formed by a race condition causing a result log to be malformed. Это можно проверить, просмотрев файл журнала в следующей области: This can be verified by looking at the log file in the following area:

Откройте FTP-подключение к этому каталогу (как показано на экране устройства) Data/test/bin/DriverTest/Run . Open an FTP connection to the IP of the device (as shown on the device screen) to the Data/test/bin/DriverTest/Run directory. Например, ftp:// /Data/test/bin/DriverTest/Run/ e.g. ftp:// /Data/test/bin/DriverTest/Run/

Скопируйте Configuring_computer_settings_(possible_reboot)_identifier.wtl файл на локальный компьютер. copy the Configuring_computer_settings_(possible_reboot)_identifier.wtl file to your local machine. Обратите внимание, что имя файла журнала совпадает с именем невыполненной задачи. Note that the log file name matches the name of the failing task.

Откройте файл в блокноте. Open the file in notepad

Прокрутите журнал до конца. Scroll to the bottom of the log. Будет представлен следующий текст, указывающий, что подготовка выполнена успешно. The following text will be present, indicating that the provisioning is successful.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Install display languages russian windows 7
  • Install activex control windows 7 установить
  • Instagram не устанавливается на windows 10
  • Instagram beta вылетает на windows phone видео
  • Initializecriticalsectionex kernel32 dll windows xp