How to deinstall lpc device driver from the console?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to deinstall lpc device driver from the console?

跳至解决方案
1,507 次查看
palaplan
Contributor II
Hello,
I am developping a Windows application to update Nxp Microcontrollers in DFU mode. I want the application installer to contain the necessary drivers, so that the user only needs to install my application for it to work.
During my tests I installed LPCScrypt_installer_2.1.0_842.exe and found a lpc_driver_installer.exe under C:\NXP\LPCScrypt_2.1.0_842\Drivers, when I run it the drivers are getting installed and I get the .inf files under C:\Program Files\NXP\LPC Driver Installer. There are:
  • lpc313x_dfu_msc
  • lpcdevice
  • lpc-linkII-hid
  • lpc-linkII-vcom

In my Installer I call lpc_driver_installer.exe from the console in silent mode and it works well, but I also need to be able to deinstall the drivers. When I call the help page of lpc_driver_installer.exe I can see this:
Windows ® Installer. V 5.0.18362.1
Installationsoptionen
 ...
 </uninstall | /x> <Produkt.msi | Produktcode>
  Deinstalliert das Produkt.
I tried to call lpc_driver_installer.exe /uninstall, but the problem is that I am not able to find the corresponding Product code. I ran this Installer with the log option and found this:
...
Property(S): Manufacturer = NXP
Property(S): MsiLogging = v
Property(S): NewDirIcon = New
Property(S): PROMPTROLLBACKCOST = P
Property(S): ProductCode = {18BC6831-5259-4914-B09A-DE370BCF8AD1}
Property(S): ProductLanguage = 1033
Property(S): ProductName = LPC Driver Installer
Property(S): ProductVersion = 2.0.2
Property(S): Progress1 = Installing
Property(S): Progress2 = installs
...
I tried to call lpc_driver_installer.exe /uninstall {18BC6831-5259-4914-B09A-DE370BCF8AD1} but got an error window "Patch was not applied to this product" (translated from german).
Can someone tell me where to find the correct product code or if I am doing something wrong?
Many thanks,
Pierre
标签 (1)
0 项奖励
1 解答
1,391 次查看
palaplan
Contributor II

I found out, that there are 2 different help pages for lpc_driver_installer.exe, one with

lpc_driver_installer.exe /h

which seem to give a list of msiexec Parameters, and another one with

lpc_driver_installer.exe /?

which gives a list of setup parameters, like /extract for example.

I managed to extract the setup in a local directory and found out that it contains:

  • lpc_driver_installer.msi
  • lpc_driver_installer.x64.msi
  • and directories lpc313x_dfu_msc, lpcdevice, lpc-linkII-hid and lpc-linkII-vcom containing the .inf files

Installation:

msiexec /i lpc_driver_installer.x64.msi

did not work, I get an error "This package can only be run from a bootstrapper". So I still have to use lpc_driver_installer.exe, but once the programm is installed I can deinstall it with the .msi file.

Deinstallation:

msiexec /x lpc_driver_installer.x64.msi‍‍‍

or in quiet mode

msiexec /q /x lpc_driver_installer.x64.msi

So this is an acceptable solution, though I am a bit upset, that I have to use a combination of setup AND msi to install/deinstall the drivers but the result looks clean.

在原帖中查看解决方案

0 项奖励
4 回复数
1,392 次查看
palaplan
Contributor II

I found out, that there are 2 different help pages for lpc_driver_installer.exe, one with

lpc_driver_installer.exe /h

which seem to give a list of msiexec Parameters, and another one with

lpc_driver_installer.exe /?

which gives a list of setup parameters, like /extract for example.

I managed to extract the setup in a local directory and found out that it contains:

  • lpc_driver_installer.msi
  • lpc_driver_installer.x64.msi
  • and directories lpc313x_dfu_msc, lpcdevice, lpc-linkII-hid and lpc-linkII-vcom containing the .inf files

Installation:

msiexec /i lpc_driver_installer.x64.msi

did not work, I get an error "This package can only be run from a bootstrapper". So I still have to use lpc_driver_installer.exe, but once the programm is installed I can deinstall it with the .msi file.

Deinstallation:

msiexec /x lpc_driver_installer.x64.msi‍‍‍

or in quiet mode

msiexec /q /x lpc_driver_installer.x64.msi

So this is an acceptable solution, though I am a bit upset, that I have to use a combination of setup AND msi to install/deinstall the drivers but the result looks clean.

0 项奖励
1,391 次查看
converse
Senior Contributor V

In case you need it for future reference, this link gives a simple way to parse the pnputil output

Parsing pnputil - DosTips.com 

0 项奖励
1,391 次查看
converse
Senior Contributor V

You could use the command line utility

pnputil

This allows you to enumerate devices and to delete them (as well as install them etc).

try

pnputil /help

For information

0 项奖励
1,391 次查看
palaplan
Contributor II

Hello and thank you for the quick answer,

I tried your method with pnputil and it works fine, I can get the list of all installed Drivers with pnputil /enum-drivers:

C:\Users\Tester\Desktop\tmp>pnputil /enum-drivers
Microsoft-PnP-Hilfsprogramm

Veröffentlichter Name:     oem6.inf
Originalname:      lpc-linkii-hid.inf
Anbietername:      NXP
Klassenname:         Eingabegeräte (Human Interface Devices)
Klassen-GUID:         {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
Treiberversion:     11/03/2014 1.0.0.1
Name des Signaturgebers:        NXP Semiconductors USA. Inc.
...

then I can deinstall a driver with pnputil /delete-driver oem#.inf

C:\Users\Tester\Desktop\tmp>pnputil /delete-driver oem6.inf
Microsoft-PnP-Hilfsprogramm

Das Treiberpaket wurde erfolgreich gelöscht.

The problem for me is that in that case I would be forced to parse the Standard Output and find the correct oem#.inf file, which also sounds risky!

Another method I thought About is with dpinst, included in DIFX, which was part of the Windows Driver Kit (WDK). There is a 32 bits and a 64 bits Version of the tool, and for it to work you need the .inf files with the corresponding .cat files, which I got from the LPCScrypt Installation.

0 项奖励