Login to participate
Endpoint Management & Virtualization ArticlesRSS

Driver Implementation Tips and Tricks for Application Packaging

Harsh's picture

Do you know any "Driver Implementation" pros?

Me neither.

Maybe that's why this info from Juice contributor Harsh is particularly useful. He's has pulled together some driver/packaging wisdom we can probably all benefit from.

To Repackage

To Repackage a driver-related application, the following things need to be checked.

  1. Capture the driver related application. Analyze what are the driver related files and registries in MSI.
  2. After analyzing the driver related resources, Check the source whether driver related exe is present or not. Most of the time you will find driver related ".exe" or ".msi" in the one of the source folder.
  3. If you find such ".exe" or ".msi" then use the same file to implement Driver in your MSI Package. Write a Custom Action "Execute program from Installation" in Deffered Execution/Immediate execution with silent (-s, /quite, /silent etc.) option.
  4. If you can not find ".exe" or ".msi" from source then try to search for driver on Internet by name of company or name of driver for e.g Senitel Dongle Driver.
  5. If you can not find Driver setup from Internet.Then again look for the driver related files (.INF, .Sys, .cat, .dll) in initial capture. If original application setup is implementing the driver using the ".INF, .sys, and .Cat" then most of the time you will get these files installed by application under “application folder\Driver" or Under "Windows\System32\Drivers" folder.
  6. If you are able to find all driver related files mentioned in step 6 then use DIFx tool (Microsoft Tool having Custom Action to implement Driver). To use the DIFAx tool install the msi DriverInstallationTools.EXE
    1. To implement Driver using DIFx tool your driver should be signed Driver.
    2. To test whether driver can be implemented using DIFx, Copy the entire Driver related files and DPInst.exe, which is provided with DIFX tool in one folder. Then RUN DPInst.exe and it will show whether Driver is ready to use or Not. If you get message that Driver is “Ready to Use” then you can implement Driver with DIFx.
    3. To implement the Driver add a merge module DIFxApp.msm from the folder C:\DIFX\DIFxAPP after installing DriverInstallationTools.EXE
    4. If the table MsiDriverPackages is not present after adding merge module then add the table in the msi.In the component column of the table MsiDriverPackages set the name of the component that has the .inf file for installation of drivers. Set the flags to 0 (zero).
  7. For more Information for DIFx tool read the document provided with Tool.

Implementation of Drivers using .SYS files:

  1. Some drivers are unsigned and do not have any .inf file for installation. In this case the drivers are implemented through .sys files.
  2. These drivers can be seen in Device Manager by clicking show hidden drivers.
  3. Most of the times one can see the hidden drivers under non plug and play drivers tab.
  4. To implement these drivers within the MSI, use the registry values under
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<drivername>\*
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<drivername>\Security\*
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<drivername>\Parameters\*
    
    

    <drivername> in many cases will be the .sys file name.

Include these registries in the MSI. System needs reboot after installing the MSI. After reboot these drivers will get configured by themselves.

Example: To implement VPN-1 SecureClient Adapter, the registries that are included in the package are shown below:

riva11's picture

I have a bad experience

I have a bad experience when I removed the VPN-1 SecureClient.

Did you have the same experience adding manually in the registry these info?

Thanks
PM

Harsh's picture

When you install VPN Secure

When you install VPN Secure Client, it installs a Setup Log file in windows (I am sorry I am not able to recollect the name of file). It contains the Installation Log. In which you can find the exe name which are responsible to install drivers. The same way you can uninstall drivers using same exe with different parameter, that you can find it studying the log file.

You need to call a custom action to install as well as uninstall the application using these driver exe. Bit difficult with registry, it will be tamper your system after uninstalling.

Mail me if requires any more input.

Regards
Harsh

erikw's picture

VPN support

The best way to get VPN on a PC and especially Cisco VPN is to capture it in SVS. Even Altiris does not support it like this, you can at a reg file to reroute the keys so that it works great.

One problem. Getting SVS to startup at logon, and to get the apps start automatically on logon.

I can post the technical settings for this if anyone requires device drivers and kernel mode drivers virtually.

Regards
Erik

Regards
Erik
www.DinamiQs.com
Dinamiqs is the home of VirtualStorm (www.virtualstorm.org)

riva11's picture

Yes Ericw, I am interested

Yes Ericw, I am interested in reading more about these settings.
Thanks in advance, kind regards.
PM

Harsh's picture

But if you don't have option

But if you don't have option other than to add these registries, and if your version is not providing any executable (Which is responsible for installing drivers) then you can set your attribute for Leave install after installation for the component in which registries resides.

Regards
Harsh

riva11's picture

Thanks Harsh for your

Thanks Harsh for your replies, I remember at least two times that I had a lot of problems during unstallation and I thought about how to avoid these kind of drivers failures.

Regards
PM

zammster's picture

Ahh yes... but

But how does one install a particular section out of an INF rather than the "best matching" in WISE?

I have a perfect "for instance".

We all have plug-and-play USB keyboards at this point. The problem is that standard XP professional sees every keyboard as a standard "HID Device". Well, in Japan, when you plug in a 106 key keyboard, Windows still installs it like a 101 key. You have to go into device manager and force it to the ALPS Japanese Keyboard. This is sadly, a well-documented flaw with plenty of work-arounds, but all using manual non-scriptable methods.

I've tried to capture this driver change in a variety of ways with absolutely no luck. It doesn't appear that DiffAX will do the trick, nor will Devcon. It must have something to do with the fact that all of the DLLs already exist, as does the INF, and even the registry keys. To be honest, not much changes after the new keyboard is selected, but something important definitely changes because the extra 5 keys and their mappings work properly.

It's really irritating, do you have any suggestions?

ScoopD's picture

Few mistakes there

Sorry Harsh, but you have made a few errors/typos in the above. There is nothing called DIFFAx, I think you mean DIFx which is the Microsoft Driver Installation Framework. There is also no DIPInst.exe - you mean DPInst.exe.

I wrote a comprehensive paper on packaging drivers for my workplace. I'll see if I can find it in the archives and make myself some points.

Harsh's picture

Thanks,

ScoopD, Thanks for the same. I corrected the Typo errors.
If you have any more inputs , Please let me know. So i can update my KB. :)

Thanks Again.
Harsh

AngelD's picture

Finding related driver files

Finding the .INF file and looking at the [SourceDisksFiles] section will show which related driver files that are required for the installation. The CatalogFile entry under the [version] section will define the .CAT file to use. If it's not present or remarked (by a semicolon) you will need to generate the .CAT file , sign it with a certificate. Don't forget to add or unremark it the Catalog file to the .INF file.

To generate the .CAT file use Inf2Cat included in the Winqual Submission Tool.

The Certificate Purposes below are minimum requirements for the certificate to be used for signing Catalog files for device drivers:
Code Signing (1.3.6.1.5.5.7.3.3)
Windows Hardware Driver Verification (1.3.6.1.4.1.311.10.3.5)