Jump to content

Compal driver installer


Tripredacus

Recommended Posts

I found a pretty neat program that detects hardware and can install the appropriate driver package. I could tell that was what it did but then I found it could pass installer switches. The only possible issue is that it runs this concurrently, which we know could be a potential problem in the making. However for the small amount of work I wanted it to do (I didn't expect it to work tbh) it works just fine.

It appears that Compal has written a setup.exe which reads data from an INI, then runs the appropriate command once it finds a HwID from the list. Your keyword here is "dedrvldr" which doesn't return much usefull in Google except a bunch of non-English lenovo websites. You can get this EXE and INI from Lenovo's Windows 7 Camera driver.

http://consumersupport.lenovo.com/us/en/DriversDownloads/drivers_list.aspx?CategoryID=35057

Extract the IN1CAM10WW5.exe with WinRar or 7zip.

Here is an example of the cmdrvldr.ini which I used to install WLAN and BT:

[DeDrvLdrInfo]
VendorCount = 2

[VendorInfo1]
Interface = USB
VenName = Motorola
VenID = Vid_0A12
PID = Pid_0001
SetupFileRootDir = \Motorola\V3.0.12.285 (Logo)
SetupFileName = BluetoothSetup.exe /VERYSILENT /SUPPRESSMSGBOXES

[VendorInfo2]
Interface = PCI
VenName = Realtek 8188CE
VenID = Ven_10EC
DevID = Dev_8176
Subsys = Subsys_917610EC
SetupFileRootDir = \Realtek RTL8188CE\V1005.8.1101.2010 (Logo)
SetupFileName = Setup.exe /S /v/qn

So using this program will let you do a wide-range of hardware detection, or use it to install multiple things like I have.

Also, I checked the actual program (CmDrvLdr.exe) real quick (honestly I didn't try too hard) and it doesn't seem to use switches. In fact, when I did a test of

CmDrvLdr.exe /?

it did install both programs but then rebooted the system.

Link to comment
Share on other sites


I haven't looked at the app but building something like this from scratch should be pretty simple using the well documented Setup API:

-Call SetupDiGetClassDevs with Flags = DIGCF_PRESENT | DIGCF_ALLCLASSES (you can also specify if you want just USB or just PCI devices or whatever, if that suits your needs better)

-if it doesn't return INVALID_HANDLE_VALUE, then use SetupDiEnumDeviceInfo with the returned handle to enumerate the devices (incrementing the index with each pass)

-if that call succeeds, use SetupDiGetDeviceRegistryProperty with Property = SPDRP_HARDWAREID to get a Hardware ID from it (or SPDRP_FRIENDLYNAME would get you names and so on)

-it would be possible to then call SetupDiGetDeviceRegistryProperty with Property = SPDRP_INSTALL_STATE to get its DEVICE_INSTALL_STATE (if drivers are already installed) and filter based on that (only install drivers for what isn't working)

Once you have these Hardware IDs (same as you'd see in device manager), it's fairly trivial to match that with a text or XML file (especially with LINQ), and if it matches, then run the command line contained in the said text or XML file.

Alternately, if someone just wanted to check for which video driver to install, then you could simply call EnumDisplayDevices to get the same info, along with some filtering (making sure DISPLAY_DEVICE_MIRRORING_DRIVER isn't set, etc)

It would take perhaps an hour to write this in C# from scratch (or about 15 mins for the video-only version). The only thing is, you're probably using this from WinPE so that wouldn't be of any help for you... And I'm not going to write that in C++ as then it's not exactly an hour long project anymore (at least not for me!)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...