10/04/2006 24909 views
Hi all!
I've got to package some printer drivers in one msi (only the drivers, no need to add any printer).
I've been searching information everywhere, but I didn't find any solution.
I've tried the Drivers Wizard in IS, but it works if there're only drivers for one printer..
I've tried different custom actions to setupapi.dll and prndrvr.vbs, and none has worked right.
Does anybody have found itself in this situation or knows how to proceed? Any help is welcomed!
0 Comments   [ + ] Show comments


Community Chosen Answer

Here's a method using the DIFx merge module - which can be found at the following location


1) locate the .INF file which the legacy installation uses to install the drivers. Inspect this file in notepad and work out all the files that the driver requires to be installed. This could be as little as a .SYS file, a .CAT file (assuming the driver is signed) and of course the .INF file itself. There may, however be more files (such as DLL's) that are mentioned in the .INF - the key thing here is to get a full list of the files the driver needs.

As you have more than one printer driver to install, you'll need to look at all the INF files involved and make a separate list for each one.

2) In the MSI package you are developing, create separate folders, one-per-driver, named (say) PrinterType1, PrinterType2 &c. If your package deploys software other than just the driver files, these should ideally be made subfolders of the main application folder

(e.g. C:\Program Files\Acme App\PrinterType1),

otherwise just create the folders where most convenient to you - the important thing is to have separate folders for each driver.

3) Next create new components named (say) DriverFilesType1, DriverFilesType2 &c. Again, the important thing is to have one component per driver to be installed Move all the files that you listed from step 1) for each driver into their appropriate component and set one of the files as the keypath for the component - I usually mark the .SYS file as the keypath. The destination of each component should be the folder for that particular driver that you created at step 2)

4) Next, include the DIFx 2.0 Merge Module into your MSI package - it's named DIFxApp.msm (see link above) - you mention you are using InstallShield, so this is done via the Redistributables view and browsing to the DIFxApp.msm file.

5) Incorporating this merge module will, among other things, have introduced a new table into your package, named MsiDriverPackages, you will need to edit this table directly (e.g. use Direct Editor in InstallShield, or use ORCA). For each driver, in the Component column, you need to enter the name of the component you created in step 3) above. If the drivers are signed (i.e. you have a .CAT file) then you can set the Flags column to 0, otherwise you could use 8 for "legacy mode". The Sequence column can be left blank unless you wish to control the order the drivers are installed in, in which case you can enter ascending sequence numbers for each row.

6) That should be all that is needed for DIFx to "do it's thing". If you are working from a legacy snapshot MSI you should now go through the rest of your snapshot package removing anything else that is printer driver-related (because DIFx will now be handling this) these include.

(i) any other instances of the .INF file, typically being deployed to the INF folder
(ii) any other instances of the .SYS file, typically being deployed to the System32\Drivers
(iii) any other instances of files you listed in step 1) other than those you have put into your new components.
(iv) any .PNF files that your capture picked up
(v) anything in the registry under HKLM\SYSTEM\CurrentControlSet\Enum\Root or HKLM\SYSTEM\CurrentControlSet\Enum\USB


Answered 10/04/2006 by: spartacus
Black Belt

  • This was very helpfull for me!! many thanks!
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

All Answers

Hi Spartacus!
Thanks! This info seems to be very complete, I'll try it right now!

Answered 10/04/2006 by: KrisBcn
Purple Belt

Lets hope this is a USB connected printer [;)]
Answered 10/04/2006 by: AngelD
Red Belt

Finally what has worked is a Custom Action to the cscript prndrvr.vbs + args
one for each driver
no need to reboot
clean and simple (not so fast)

Thanks to all!
Answered 10/17/2006 by: KrisBcn
Purple Belt


When I did the steps mentioned by you my driver gets added in the driver store but the printer driver icon is not present in printers folder and driver is not there in server properties. Please help me to solve this issue ASAP.
Answered 06/08/2007 by: RMR
Yellow Belt

Mine is not a USB printer i want to do it for a local printer. Similar to that of Add printer wizard how to do using Difx in Basic MSI.
Answered 06/08/2007 by: RMR
Yellow Belt

I'm sorry but can't help you with Difx, you'd better search this info in the Forum or add a new post.

It's been a while out of here,
Best regards to all


Answered 06/08/2007 by: KrisBcn
Purple Belt

you can also use rundll /p to add printers.

you can find comprehensive instructions here


theres a huge list of run dll commands listed in here.
Answered 06/11/2007 by: jmcfadyen
Fifth Degree Black Belt

Try this is it simple but it works in our enviornment... use dpinst.exe... download from m$oft http://msdn2.microsoft.com/en-us/library/ms790308.aspx

Create a msi that crates a drivers folder with all of the inf file and the supporting files and also copy dpinst.exe to the folder.

add a custom action to your msi to run dpinst.exe /lm /q /sw

this will preinstall the drivers lm handels unsigned driver the q is quiet an sw suppresses the wizzard.

This will not install the printer but when any user plugs in a new printer it will detect it and automaitically install it... if the printer is already attached you can use the rescan switch or devcon.
Answered 06/18/2007 by: cnorots
Yellow Belt


I have a problem with a driver, lot's of problems today...:-)

Normaly i install a driver with the dpinst tool, but this doesn't install the driver i have now (it not a signt driver) i use the /LM switch but this doens't work.
Other sollution i'm trying is using the DifXApp MergeModule as described above here, but i can't set the flag to 8 to install legacy drivers. Only flag options i have is 1-7. Setting it to 8 doesn't work...

Someone got a sollution? Using Driver Tools version 2.01
Answered 04/01/2008 by: netloony
Senior Yellow Belt

The DifXApp merge modules will only support Plug'n Play devices such as a USB connected printer.
It will only support signed drivers so if you are not willing to sign them yourself then use dpinst.exe as a custom action.
Answered 04/02/2008 by: AngelD
Red Belt

Tried the dpinst method first, this works if i run it not sillent, as i try to run it /S /LM mode then it doesn't work anymore.

And the Micorosft MSDN says that it should be possible with Difxapp to install unsigned drivers.


by default, DIFxApp does not install unsigned driver packages and driver packages that have missing files. However, DIFxApp supports a flag that configures DIFxApp to install unsigned driver packages and driver packages that have missing files. This flag is set as follows:

  • To statically set this flag, add 0x0008 to the Flags entry for the component in the MsiDriverPackages custom table that represents the driver package.
  • To dynamically set this flag, add 8 to the decimal number that is specified by the string that is supplied by the DriverFlags.component-name property for the component
    Bu i'm not be abble to set the flag to 8
  • Answered 04/02/2008 by: netloony
    Senior Yellow Belt

    In that case; my bad.
    But you will still have a problem with user-rights while the user plug in the device for the first time if they do not have local admin rights.
    Answered 04/02/2008 by: AngelD
    Red Belt

    yep i know that.

    But if an admin logs ins (device installation run as) and it finds the driver then i think it's ok so far..
    Answered 04/02/2008 by: netloony
    Senior Yellow Belt

    Open the MSI in ORCA and modify the entry manually in the MsiDriverPackages table.
    Answered 04/02/2008 by: AngelD
    Red Belt

    Don't be a Stranger!

    Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

    Sign up! or login