How to unistall Device Drivers via MSI with DPInst?

Posted on 2008-11-14
Medium Priority
Last Modified: 2013-12-01
Hi all. I have a doubt a bout how to unistall device drivers via MSI.

We are now install the drivers via MSI using as custom action a VBScript and when we plug the device in it works perfectly but now we have a new problem. The problem is unistall those drivers.

When uninstalling we use a very similar VBScript as when installing, somethin like this:

Dim oShell
Dim source Set
oShell = CreateObject ("WSCript.shell")
dir = oShell.ExpandEnvironmentStrings("%Temp%")
dir2 = oShell.ExpandEnvironmentStrings("%windir%")
source = dir + "\Device Drivers\"
dir2=  dir2 + "\system32\DRVSTORE\"
oShell.Run "cmd /k"+" cd"+" "+source+"DPInst_x86 & DPInst.exe /s /u "+" "+dir2+"toaster_4644C6CF04F87E5745CAF63D887EAACCF779346F\hpzid413.inf", vbhide

If we run this script manualy, it unistalls correclty  the Driver but when we try to run it from a CustomAction from the MSI when Removing the application.

We are not pretty sure of what sequence number set for that action on InstallExecuteSequence Table.

Well that´s our problem.  I hope some of you could help us.

Bye bye...
Question by:AlexIraMty
1 Comment

Accepted Solution

Hubasan earned 1600 total points
ID: 22975441
Hi, AlexIraMty

Any removal, uninstall, or deletion of files and registry keys as a custom action within an MSI, should always go just before "Install Finalize". Install finalize should always be your last marker for your custom actions, as custom actions will most likely not execute after install finalize action. If this script you wrote works when you execute it manually, just place it before install finalize and it should work.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question