读书人

Install Shield程序中检测USB设备!该怎

发布时间: 2012-01-10 21:26:51 作者: rapoo

Install Shield程序中检测USB设备!
请教Install Shield达人:
小弟要在InstallShield程序中检测某USB device是否接上,能够做到么? 怎么做? 是否要用到Windows API,怎么用? 指点下,谢谢!
我用的是Install Shield Professional -- standard Edition Version 6.22!

[解决办法]
我打包的时候,还没有遇到这种功能,关注顶起。
[解决办法]
另外写一个程序 用于检测usb(非窗体形式) 然后在is中调用 该程序
还未用is做此功能。
[解决办法]
顶,我也想知道
[解决办法]
看看这个行不
Sub Command1_Click()
strComputer = ". "
Set objWMIService = GetObject( "winmgmts:\\ " & strComputer & "\root\cimv2 ")
Set colDevices = objWMIService.ExecQuery( "Select * From Win32_USBControllerDevice ")
For Each objDevice In colDevices
strDeviceName = objDevice.Dependent
MsgBox strDeviceName
strQuotes = Chr(34)
strDeviceName = Replace(strDeviceName, strQuotes, " ")
arrDeviceNames = Split(strDeviceName, "= ")
strDeviceName = arrDeviceNames(1)
Set colUSBDevices = objWMIService.ExecQuery _
( "Select * From Win32_PnPEntity Where DeviceID = ' " & strDeviceName & " ' ")
For Each objUSBDevice In colUSBDevices
Debug.Print objUSBDevice.Description
Next
Next
End Sub
[解决办法]
zsj1101(江南神探) 的这个行。

注意在98下需要安装WMI才行。

读书人网 >VB

热点推荐