1

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.

Slava Ivanov
  • 6,666
  • 2
  • 23
  • 34
santhosh kgn
  • 41
  • 1
  • 7
  • I would suggest to create the project in InstallShield, add your drivers into it, see what's working and what issues you have and come back with specific question. – Slava Ivanov Jun 08 '17 at 13:29
  • I tried to create and tested it. – santhosh kgn Jun 08 '17 at 13:36
  • Great, what specific issue you have and cannot solve? – Slava Ivanov Jun 08 '17 at 13:42
  • Unable to get the device ID. I am passing the Vendor ID of my chipset USB\VID_13BA to RetreieveHWID api. If I print the Device ID it is showing as "No matching Device Found". I tested the Installer with PCI device it is working fine. Is there dependency for PCI & USB. – santhosh kgn Jun 08 '17 at 13:43
  • Unfortunately I wouldn't be able to help, as I had experience only with installation of file system drivers, but I would again suggest to edit your question and include this specific information provided in the comment. You may also want to add details on how you currently done the installation, ex: custom action, component settings, execution time, etc. I will up vote for sure on question like this. Please consider to edit original question. – Slava Ivanov Jun 08 '17 at 13:48

1 Answers1

1

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

Slava Ivanov
  • 6,666
  • 2
  • 23
  • 34
  • What I am trying to do is I want to read the "Revision(REV_05)" from text file by passing the hardware ID as "PCI\VEN_8086&DEV_3B56&SUBSYS_304A103C&".It shows the list of hardware Id like Name: High Definition Audio Controller Hardware ID's: PCI\VEN_8086&DEV_3B56&SUBSYS_304A103C&REV_05 Can u suggest any api to read I tried to access by ListID,Strfind,StrfindEx. – santhosh kgn Jun 09 '17 at 18:01
  • @sathish The comment is meant for short messages and definitely not for code snippets. You have the options: ask one more question or edit original question by adding more description, not editing existing content. Usually ppl create one more (different) question or when edit original question which is already answered adding "EDIT:" at the end and put more comments. Please consider the first option and ask specific question, somebody will help. – Slava Ivanov Jun 09 '17 at 18:06
  • @sathish Did you get your content? Do you have the hard time with parsing? You better describe it in yet another question. Please specify tag "InstallScript". It shouldn't be difficult to get the match, just describe exactly what doesn't work for you. – Slava Ivanov Jun 09 '17 at 18:08