# Install information for port types.
[Components]
Ports
Ports.StandardIP
Ports.ENetIP
Ports.LexIP
Ports.LocalPort
Ports.LPR
# Ports.IP9100Port
Ports.MVPPort
Ports.P2P

[Ports]
Version=$CD_VERSION$
OemCommon=1
Templates=StandardIP,LexIP,LocalPort,LPR,IP9100Port,ENetIP,MVPPort,P2P
Log=FALSE

[Defines]
NET_PREFIX=%NetPrefix%
PORT_IP_ADDRESS=<ReadISF,$CURRENT_COMP$,IPAddress>
PORT_NAME=<ReadISF,$CURRENT_COMP$,Name>
# Note, these are OEM specific!
NETWORK_PRINT_MONITOR=Lexmark Network Printer Monitor
NETWORK_PORT=Lexmark Network Port
LPR_REG_KEY=SYSTEM\CurrentControlSet\Control\Print\Monitors\LPR Port\Ports
MONITOR_NAME=%ENetMonitorName%
DLL_PATH=$SYSTEM_DIR$\$NET_PREFIX$lmpm.dll
NET_TYPE=<ReadISF,$CURRENT_COMP$,NetType>

# This is all for Lexmark IP ports - external network adapters
PORT_TYPE=<ReadISF,$CURRENT_COMP$,PortType>
NONE=<SetLabel,$PORT_TYPE$,EQ,>
SOME=<SetLabel,$PORT_TYPE$,NE,>
NONE2=<SetLabel,$PORT_TYPE$,EQ,0>
LPT=<SetLabel,$PORT_TYPE$,EQ,LPT>
COM=<SetLabel,$PORT_TYPE$,EQ,COM>
LPT1=<SetLabel,$PORT_TYPE$,EQ,LPT1>
LPT2=<SetLabel,$PORT_TYPE$,EQ,LPT2>
LPT3=<SetLabel,$PORT_TYPE$,EQ,LPT3>
LPT3=<SetLabel,$PORT_TYPE$,EQ,LPT4>
COM1=<SetLabel,$PORT_TYPE$,EQ,COM1>
COM2=<SetLabel,$PORT_TYPE$,EQ,COM2>
COM3=<SetLabel,$PORT_TYPE$,EQ,COM3>
COM3=<SetLabel,$PORT_TYPE$,EQ,COM4>

# MVP port stuff.  May need to refine this to check versions or something
USE_BIDI=<SetLabel,$NET_TYPE$,EQ,0>
BIDI_VER=<ReadFileVer,$SYSTEM_DIR$\lexip32.dll>
BIDI_EXISTS=<SetLabel,$BIDI_VER$,GT,7.3.5,VER>
uSE_ENET=<SetLabel,$NET_TYPE$,EQ,1>
ENET_EXISTS=<ExistFile,$SYSTEM_DIR$\lmabcoms.exe>
NO_BIDI=<SetLabel,$BIDI_EXISTS$,EQ,FALSE>
NO_ENET=<SetLabel,$ENET_EXISTS$,EQ,FALSE>

#ThoseVariables are for P2P port
HOST_NAME=<ReadISF,$CURRENT_COMP$,IPAddress>
SHARE_NAME=<ReadISF,$CURRENT_COMP$,ShareName>


[MVPPort]
OemCommon=1
Platform=2K_VISTA

[MVPPort_Actions]
# RunLibFunction,Debris.dll,AddMVPPort,"$PORT_NAME$,$PORT_IP_ADDRESS$,$PORT_TYPE$,$NET_TYPE$"
[$USE_BIDI$]GotoSection,UseBidi
[$USE_ENET$]GotoSection,UseEnet

[UseBidi]
[$BIDI_EXISTS$]GotoSection,LexIPCore
[$NO_BIDI$]GotoSection,StandardIP_Actions

[UseEnet]
[$ENET_EXISTS$]GotoSection,ENetIP_Actions
[$NO_ENET$]GotoSection,StandardIP_Actions


# Note: StandardIP now creates an IP9100 port on 9X/NT (where StandardIP is
# not available natively)
[StandardIP]
OemCommon=1
# Platform=2K,XP
[9X,NT]Requires=IP9100

[StandardIP_Actions]
[2K_VISTA]Wait,Service,Spooler
[2K_VISTA]Port,Create,$PORT_NAME$,Standard TCP/IP Port,IP,$PORT_IP_ADDRESS$
[9X,NT]RegistryEntry,Add,HKLM,Software\IP9100\ports,$PORT_NAME$,STR,$PORT_IP_ADDRESS$
[9X,NT]Port,CreateWithAddPort,$PORT_NAME$,IP 9100 Port Monitor

[ENetIP]
Requires=ENetwork
OemCommon=0

[ENetIP_Actions]
[NT_XP]Wait,Service,Spooler
[$NONE$,2K_VISTA]Port,Create,$PORT_NAME$,$MONITOR_NAME$,IP,$PORT_IP_ADDRESS$:Internal
[$SOME$,2K_VISTA]Port,Create,$PORT_NAME$,$MONITOR_NAME$,IP,$PORT_IP_ADDRESS$:$PORT_TYPE$
[$NONE$,9X,NT]RunLibFunction,Debris.dll,AddENetPort,"$PORT_NAME$,$PORT_IP_ADDRESS$:Internal,$DLL_PATH$"
[$SOME$,9X,NT]RunLibFunction,Debris.dll,AddENetPort,"$PORT_NAME$,$PORT_IP_ADDRESS$:$PORT_TYPE$,$DLL_PATH$"

[LexIP]
OemCommon=1
Requires=Bidi,Network.TCPIP

[LexIP_Actions]
GotoSection,LexIPCore
# RegistryEntry,Add,HKLM,software\lexmark\markvision\AutoAdd,New Port Name,STR,$PORT_NAME$
# RegistryEntry,Add,HKLM,software\lexmark\markvision\AutoAdd,New Port NetType,BINARY,02
# We need the spooler and LexBceS service running before we can call AddPort!
[2K_VISTA]Wait,Service,LexBceS
[2K_VISTA]Wait,Service,Spooler
[9X]Port,CreateWithAddPort,$PORT_NAME$,$NETWORK_PRINT_MONITOR$,,,1
[2K_VISTA]Port,CreateWithAddPort,$PORT_NAME$,$NETWORK_PORT$,,,1

[LexIPCore]
RegistryEntry,Add,HKLM,software\lexmark\markvision\IPNET\$PORT_IP_ADDRESS$,CommunityName,STR,public
[$NONE$]RegistryEntry,Add,HKLM,software\lexmark\markvision\IPNET\$PORT_IP_ADDRESS$,PortName,STR,$PORT_NAME$
[$NONE2$]RegistryEntry,Add,HKLM,software\lexmark\markvision\IPNET\$PORT_IP_ADDRESS$,PortName,STR,$PORT_NAME$
[$LPT$]RegistryEntry,Add,HKLM,software\lexmark\markvision\IPNET\$PORT_IP_ADDRESS$,PortName,STR,$PORT_NAME$
[$COM$]RegistryEntry,Add,HKLM,software\lexmark\markvision\IPNET\$PORT_IP_ADDRESS$,PortName,STR,$PORT_NAME$
[$LPT1$]RegistryEntry,Add,HKLM,software\lexmark\markvision\IPNET\$PORT_IP_ADDRESS$,PortNameP1,STR,$PORT_NAME$
[$LPT2$]RegistryEntry,Add,HKLM,software\lexmark\markvision\IPNET\$PORT_IP_ADDRESS$,PortNameP2,STR,$PORT_NAME$
[$LPT3$]RegistryEntry,Add,HKLM,software\lexmark\markvision\IPNET\$PORT_IP_ADDRESS$,PortNameP3,STR,$PORT_NAME$
[$COM1$]RegistryEntry,Add,HKLM,software\lexmark\markvision\IPNET\$PORT_IP_ADDRESS$,PortNameS1,STR,$PORT_NAME$
[$COM2$]RegistryEntry,Add,HKLM,software\lexmark\markvision\IPNET\$PORT_IP_ADDRESS$,PortNameS2,STR,$PORT_NAME$
[$COM3$]RegistryEntry,Add,HKLM,software\lexmark\markvision\IPNET\$PORT_IP_ADDRESS$,PortNameS3,STR,$PORT_NAME$

[LocalPort]
OemCommon=1

[LocalPort_Actions]
[2K,XP]Wait,Service,Spooler
[NT]RegistryEntry,Add,HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports,$PORT_NAME$,STR,
[2K_VISTA]Port,Create,$PORT_NAME$,Local Port,UNC,$PORT_NAME$
# NT requires a spooler restart to get it to recognise the new port
# Lets actually recycle the spooler. Just stopping it could cause problems down the line
# with something that needs the spooler started in order to work.
[NT]Service,Recycle,Spooler,5000

[LPR]
OemCommon=1
Platform=NT,2K_VISTA

[LPR_Actions]
# Note: we may want an external requirement here to check that the LPR
# port monitor exists!
RegistryEntry,Add,HKLM,$LPR_REG_KEY$\$PORT_NAME$,Printer Name,STR,$PORT_NAME$
RegistryEntry,Add,HKLM,$LPR_REG_KEY$\$PORT_NAME$,Server Name,STR,$PORT_IP_ADDRESS$
RegistryEntry,Add,HKLM,$LPR_REG_KEY$\$PORT_NAME$,EnableBannerPage,DWORD,0
RegistryEntry,Add,HKLM,$LPR_REG_KEY$\$PORT_NAME$,HpUxCompatibility,DWORD,0
RegistryEntry,Add,HKLM,$LPR_REG_KEY$\$PORT_NAME$,OkiSunCompatibility,DWORD,0
RegistryEntry,Add,HKLM,$LPR_REG_KEY$\$PORT_NAME$\Timeouts,CommandTimeout,DWORD,120
RegistryEntry,Add,HKLM,$LPR_REG_KEY$\$PORT_NAME$\Timeouts,DataTimeout,DWORD,300
# Unfortunately, this requires a spooler restart to get it to recognise the new port
[NT]Service,Recycle,Spooler,5000

[P2P]
OemCommon=1
Platform=2K_VISTA

[P2P_Actions]
RunLibFunction,NetSupp.dll,CreateP2PPortIP,$HOST_NAME$|$SHARE_NAME$
