blackperl
驱动牛犊
驱动牛犊
  • 注册日期2004-09-16
  • 最后登录2005-04-19
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:2001回复:3

高分求教用InstallShield制作Passthru的方法(60)

楼主#
更多 发布于:2004-11-07 20:04
本人在Passthru基础上做流量控制驱动,想用InstallShield做安装包,Passthru的配置文件有netsf.inf,netsf_m.inf,和系统文件passthru.sys和passthru.dll
其中netsf.inf文件内容如下:
[Version]
Signature  = "$Windows NT$"
Class      = NetService
ClassGUID  = {4D36E974-E325-11CE-BFC1-08002BE10318}
Provider   = %Msft%
DriverVer  = 06/24/1999,5.00.2071.1


[Manufacturer]
%Msft% = MSFT

[ControlFlags]

;=========================================================================
;
;=========================================================================

[MSFT]
%Passthru_Desc% = Passthru.ndi, ms_passthru



[Passthru.ndi]
AddReg          = Passthru.ndi.AddReg, Passthru.AddReg
Characteristics = 0x4490 ; NCF_HAS_UI | NCF_FILTER | NCF_NO_SERVICE | NCF_NDIS_PROTOCOL !--Filter Specific--!!
CopyFiles       = Passthru.Files.Init, Passthru.Files.Sys
CopyInf         = netsf_m.inf

[Passthru.ndi.Remove]
DelFiles = Passthru.Files.Init, Passthru.Files.Sys

[Passthru.ndi.Remove.Services]
DelService = Passthru

; ----------------------------------------------------------------------
; File copy
;
[SourceDisksNames]
1=%DiskDescription%,"",,

[SourceDisksFiles]
passthru.dll=1
passthru.sys=1
netsf_m.inf=1

[DestinationDirs]
DefaultDestDir = 12
Passthru.Files.Init  = 11   ; %windir%\System32
Passthru.Files.Sys   = 12   ; %windir%\System32\drivers

; Copying of passthru.dll is required only if the filter has a Notify object
[Passthru.Files.Init]
passthru.dll,,,2

[Passthru.Files.Sys]
passthru.sys,,,2

[InfSourcePathInfo]
; Used by the notify object to figure out where the original media is
; located (so it can use SetupCopyOEMInf to install Net INF located
; there).

OriginalInfSourcePath = %1%

; ----------------------------------------------------------------------
; Filter Install
;

[Passthru.ndi.AddReg]
HKR, Ndi, HelpText, , %Passthru_HELP%

; ----------------------------------------------------------------------
; Keys required if a Notify object is present
; These keys should be omitted if the Filter does not have any Notify object
;
; Note:
; 1. Only include the following lines if your filter has configuration UI
;    that needs to be displayed.  Otherwise, you should not need a notify
;    object.
; 2. If you write your own notifyobject, use a different GUID for ClsID!!
;    (Generate this with uuidgen.exe)
;
HKR, Ndi, ClsID,        , {df2e4f67-e93a-11d1-bb14-0000f8779051}
HKR, Ndi, ComponentDll, , passthru.dll

; ----------------------------------------------------------------------
; !!--Filter Specific--!!
;
; Note:
; 1. Other components may also have UpperRange/LowerRange but for filters
;    the value of both of them must be noupper/nolower
; 2. The value FilterClass is required.
; 3. The value Service is required
; 4. FilterDeviceInfId is the InfId of the filter device (miniport) that will
;    be installed for each filtered adapter.
;    In this case this is ms_passthrump (refer to netsf_m.inf)
;
HKR, Ndi,            FilterClass,         , failover
HKR, Ndi,            FilterDeviceInfId,   , ms_passthrump
HKR, Ndi,            Service,             , Passthru
HKR, Ndi\Interfaces, UpperRange,          , noupper
HKR, Ndi\Interfaces, LowerRange,          , nolower
HKR, Ndi\Interfaces, FilterMediaTypes,    , "ethernet, tokenring, fddi, wan"

[Passthru.AddReg]
; The following key is Required
; The following key is Passthru specific
HKR, Parameters, Param1, 0, 4

; ----------------------------------------------------------------------
[Strings]
Msft = "Microsoft"
DiskDescription = "Microsoft Passthru Driver Disk"

Passthru_Desc = "Passthru Driver"
Passthru_HELP = "Passthru Driver"
blackperl
驱动牛犊
驱动牛犊
  • 注册日期2004-09-16
  • 最后登录2005-04-19
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-11-07 20:13
netsf_m内容如下:
[Version]
signature  = "$Windows NT$"
Class      = Net
ClassGUID  = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider   = %Msft%
DriverVer  = 06/24/1999,5.00.2071.1

[ControlFlags]
ExcludeFromSelect = ms_passthrump

[DestinationDirs]
DefaultDestDir=12
; No files to copy

[Manufacturer]
%Msft% = MSFT

[MSFT]
%PassthruMP_Desc% = PassthruMP.ndi, ms_passthrump

[PassthruMP.ndi]
Characteristics = 0x29 ;NCF_NOT_USER_REMOVABLE | NCF_VIRTUAL | NCF_HIDDEN
CopyFiles =

[PassthruMP.ndi.Services]
AddService = Passthru,0x2, PassthruMP.AddService


[PassthruMP.AddService]
DisplayName    = %PassthruMP_Desc%
ServiceType    = 1 ;SERVICE_KERNEL_DRIVER
StartType      = 3 ;SERVICE_DEMAND_START
ErrorControl   = 1 ;SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\passthru.sys
LoadOrderGroup = PNP_TDI
AddReg         = PassthruMP.AddService.AddReg


[PassthruMP.AddService.AddReg]
; ----------------------------------------------------------------------
; Add any miniport-specific parameters here.  These are params that your
; filter device is going to use.
;
;HKR, Parameters, ParameterName,  0x10000, "MultiSz", "Parameter", "Value"
;HKR, Parameters, ParameterName2, 0x10001, 4

[Strings]
Msft = "Microsoft"
PassthruMP_Desc = "Passthru Miniport"

[SourceDisksNames]
;None

[SourceDisksFiles]
;None
我用的工具是InstallShield X,首先建了一个InstallScript项目,我把netsf.inf,netsf_m.inf,passthru.sys,passthru.dll都加到了目标文件夹SUPPORTDIR中,然后在Setup.Rul的OnEnd函数中加入以下代码:

function OnEnd()  
  string szCmdLine,szProgram;
begin    
 szProgram = "rundll32.exe";
szCmdLine = "setupapi.dll,InstallHinfSection DefaultInstall 132" + SUPPORTDIR + "netsf.inf";

if(LaunchAppAndWait(szProgram, szCmdLine, WAIT)<0) then
  MessageBox ("Unable to launch",SEVERE);
 endif;
  MessageBox ("launch SUCCESS hehe",INFORMATION);
end;
安装最后阶段就会报错:安装失败!
实在是搞不清到底应该怎么做,哪位大侠能给指点,解决问题就一定给分!
54cndr
驱动牛犊
驱动牛犊
  • 注册日期2003-06-03
  • 最后登录2010-12-21
  • 粉丝0
  • 关注0
  • 积分3分
  • 威望20点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-12-09 11:10
将szCmdLine中的 DefaultInstall改为Passthru.ndi即可。
kevinbobo
驱动牛犊
驱动牛犊
  • 注册日期2007-06-11
  • 最后登录2010-02-23
  • 粉丝0
  • 关注0
  • 积分101分
  • 威望21点
  • 贡献值0点
  • 好评度10点
  • 原创分0分
  • 专家分0分
地板#
发布于:2007-07-08 15:26
111
游客

返回顶部