How to unistall Device Drivers via MSI with DPInst?

Posted on 2008-11-14
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 ("")
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
    LVL 7

    Accepted Solution

    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

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    A while back when OPSMGR 2012 was released we were very excited about getting it into our environment and upgrading our 2007 implementation,  we started our planning and we then proceeded with our implementation. All went as planned & our system …
    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…
    This video discusses moving either the default database or any database to a new volume.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now