1) 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.
The following is the way I am trying to get the device ID:
szProgram = WINDIR ^ "temp" ^ "New" ^ "devcon.exe";
szCmdLine = " hwids *";
nvResult = LaunchAppAndWait(szProgram, szCmdLine, LAAW_OPTION_WAIT);
if (nvResult = 0) then
MessageBox ("ERROR: application created sucfuly", INFORMATION);
else
MessageBox ("ERROR: application", INFORMATION);
endif;
-> 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.
ISSUE: -> Unable to store the result in text file.
Please provide some ideas to store the device list into file and fetch the required device list.
As far as I understand correctly you would like to know if certain device available on the system. For this purpose I would suggest to have a look on DevCon Find command, instead of getting entire list of devices. For example:
devcon find *USB\VID_046D*
If you insist to get the entire list of devices, and want to get it into the file you may look at this answer: Capturing stdOutput and stdError from LaunchApplication. Basically the simplest way is reditecting output into file. For example:
szProgram = WINDIR ^ "temp" ^ "New" ^ "devcon.exe";
szCmdLine = " hwids * > c:\temp\New\hardware.txt";
And in order to parse the file content you would need to get the file content. You may use GetLine
or ListReadFromFile
functions. The following would be example: OpenFile Example