xxxxx@gmail.com wrote:
- I am trying to register the Dll in Installshield based on the Hardware
Info(USB\VID_12C1).
-> I want to know the device ID of the USB device connected to PC.
Then I want to fetch the USB device info into separate file.
-> From installshield I will pass the USB vendor ID to text file
and fetch the USB info.
-> Whether it is possible to do it in Installshield.
What are you actually writing here? Is this an installer for an
application? Or is this the installer for your driver? If this is the
installer for your driver, then why don’t you have the INF copy the DLL
into place and do the registration? That way, selection by VID and PID
comes automatically.
If this is an installer for an application, then why not just do the
registration unconditionally, and make the DLL respond reasonably if the
device is not present? What happens if they run your installer, then
unplug the device? The DLL has to be able to handle a missing device
anyway.
You could, I suppose, add code in your DLL in DllRegisterServer. Use
the SetupDi APIs to enumerate the USB devices, and if you don’t find one
you like, just return without doing any registration, but that would
break the scenario where they plug the device in later.
As a final alternative, you can certainly add an additional entry point
to your DLL that searches for the device using the SetupDi APIs and
returns a value, and then call that DLL entry point from InstallShield.
That way, you have the full power of C++.
In following way trying to get the device ID.
-> While installing the Installer trying to execute “devcon.exe hwids *”
through LaunchAppandwait Api. It will list the number of devices connected
to my PC. I want to save the device list in text file.
As opposed to, say, “devcon find USB\VID_12C1*”?
szProgram = WINDIR ^ “temp” ^ “New” ^ “devcon.exe”;
szCmdLine = " hwids *";
nvResult = LaunchAppAndWait(szProgram, szCmdLine, LAAW_OPTION_WAIT);
if (nvResult = 0) then
MessageBox (“ERROR: application created successfully”, INFORMATION);
Why is having the application created successfully an ERROR?
Please provide some ideas to store the device list into file and fetch
the required device list.
InstallShield was not designed to do this kind of processing. And as
Doron said, you’re not allowed to distribute “devcon” with your package.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.