|
|
;=================================================================== ; ; Installation file for MCS XNS Stack ; ;=================================================================== [Identification] OptionType = NetTransport
;------------------------------------------------------------------- ; OPTION LIST ; ----------- ; ; This is an internal name for the options we can install. ;------------------------------------------------------------------- [Options] MCSXNS
;******************************************************************** ; CONSTANTS FOR USING DIALOGS ;******************************************************************** [FileConstants] ; ;----- Product Info ; Manufacturer = "Microsoft" ProductMajorVersion = "4" ProductMinorVersion = "0" ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion) McsXnsEventDLL = "%SystemRoot%\System32\xnsmsg.dll" UbnbEventDLL = "%SystemRoot%\System32\ubnbmsg.dll" IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
ProductMCSXNSWshDllPath = "%SystemRoot%\System32\wshxns.dll" ; ;----- This is the entry for the service controller daemon ; ProductMCSXNSName = "McsXns" ProductMCSXNSImagePath = "%SystemRoot%\System32\mcsxnsvc.exe" ProductMCSXNSSvcType = "serviceshare"
NetRuleMCSXNSType = "mcsxns mcsxnsTransport streamsStack" NetRuleMCSXNSUse = $(SoftwareType)" yes yes" NetRuleMCSXNSBindForm = """McsXns"" yes yes container" NetRuleMCSXNSClass = "mcsxnsTransport basic yes" ; ;----- This is the entry for the ipx/spx kernel driver ; ProductMCSXNSSYSName = "McsXnssys" ProductMCSXNSSYSImagePath= "\SystemRoot\System32\drivers\mcsxns.sys" ProductMCSXNSSYSSvcType = "kernel" ; ;----- This is the entry for the NetBIOS daemon ; ProductUBNBName = "Ubnb" ProductUBNBImagePath = "%SystemRoot%\System32\ubnbsvc.exe" ProductUBNBSvcType = "serviceshare"
NetRuleUBNBType = "ubnb ubnbNbTransport streamsStack" NetRuleUBNBUse = $(SoftwareType) NetRuleUBNBBindForm = """Ubnb"" yes yes container" NetRuleUBNBClassList = {"ubnbNbTransport netBiosTransport yes"} ; ;----- This is the entry for the Nvl NetBIOS kernel driver ; ProductUBNBSYSName = "Ubnbsys" ProductUBNBSYSImagePath = "\SystemRoot\System32\drivers\ubnb.sys" ProductUBNBSYSSvcType = "kernel"
;-------------------------------------------------------------------- ; Entries for the registry ;-------------------------------------------------------------------- ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(Product$(Option)Name)"\CurrentVersion" LinkageKeyName = $(!NTN_ServiceBase)"\McsXns\Linkage" ServiceMCSXNSKeyName = $(!NTN_ServiceBase)"\McsXns" ServiceKeyName = $(!NTN_ServiceBase) DosDevices = "SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices"
;-------------------------------------------------------------------- ; Some nice general constants to have around ;-------------------------------------------------------------------- [GeneralConstants] UtilityInf = "UTILITY.INF" subroutineinf = "SUBROUTN.INF" SoftwareType = "transport" Exit_Code = 0 BillboardVisible = 0 Sockminlength = 14 Sockmaxlength = 16 from = "" to = "" ExitCodeOk = 0 ExitCodeCancel = 1 ExitCodeFatal = 2 KeyNull = "" MAXIMUM_ALLOWED = 33554432 RegistryErrorIndex = NO_ERROR KeyProduct = "" KeyParameters = "" TRUE = 1 FALSE = 0 NoTitle = 0 ExitState = "Active" OldVersionExisted = $(FALSE) DriverPath = $(!STF_NTPATH)\drivers
;-------------------------------------------------------------------- ; 1. date ; ; This routine sets the variable "Now" to be: ; ; 1. Sec from 1-1-1970 ; 2. Year ; 3. Month ; 4. Day ; 5. Hour ; 6. Minute ; 7. Second ;-------------------------------------------------------------------- [date] Now = {} ? $(!LIBHANDLE) GetSystemDate
;-------------------------------------------------------------------- ; Identify ; -------- ; ; This is called to verify that this INF is used to install ; the kind of program that the setup program wants. ; (net transport, driver, ....). ; ; INPUT: None ; ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL ; $($R1): Option Type ; $($R2): Diskette Descriptor ;-------------------------------------------------------------------- [Identify] read-syms Identification set Status = STATUS_SUCCESSFUL set Identifier = $(OptionType) set Media = #("Source Media Descriptions", 1, 1) Return $(Status) $(Identifier) $(Media)
;-------------------------------------------------------------------- ; ReturnOptions ; ------------- ; ; This is called to return the option list supported by this ; INF and the localized text list representing the options. ; This is called from the setup program. ; ; INPUT: $($0): Language used (ENG, FRN, ...) ; ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL ; STATUS_NOLANGUAGE ; STATUS_FAILED ; $($R1): Option List ; $($R2): Option Text List ;-------------------------------------------------------------------- [ReturnOptions] set Status = STATUS_FAILED set OptionList = {} set OptionTextList = {} ; ;----- Make sure the language passed is in our list ; set LanguageList = ^(LanguagesSupported, 1) Ifcontains(i) $($0) in $(LanguageList) goto returnoptions else set Status = STATUS_NOLANGUAGE goto finish_ReturnOptions endif ; ;----- Build the list of options and the text for the options ; returnoptions = + set OptionList = ^(Options, 1) set OptionTextList = ^(OptionsText$($0), 1) set Status = STATUS_SUCCESSFUL ; ;----- Return the status ; finish_ReturnOptions = + Return $(Status) $(OptionList) $(OptionTextList)
;----------InstallOption------------------------------------------------- ; ; InstallOption: ; ; This section is shelled to by main installation processing ; or by NCPASHEL.INF during reconfig, removal, update, etc. ; ; ; FUNCTION: To copy files representing Options ; To configure the installed option ; To update the registry for the installed option ; ; INPUT: $($0): Language to use ; $($1): OptionID to install ; $($2): SourceDirectory ; $($3): AddCopy (YES | NO) ; $($4): DoCopy (YES | NO) ; $($5): DoConfig (YES | NO) ; ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL | ; STATUS_NOLANGUAGE | ; STATUS_USERCANCEL | ; STATUS_FAILED ; ;------------------------------------------------------------------------ [InstallOption] ; ; extract parameters ; set Option = $($1) set SrcDir = $($2) set AddCopy = $($3) set DoCopy = $($4) set DoConfig = $($5)
; ; Check if the language requested is supported ; set LanguageList = ^(LanguagesSupported, 1) Ifcontains(i) $($0) NOT-IN $(LanguageList) Return STATUS_NOLANGUAGE endif
Debug-Output "OEMNXPXN.INF: STF_CWDIR is: "$(!STF_CWDIR) Debug-Output "OEMNXPXN.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE) ; ;----- Define all constants we need ; set-subst LF = "\n" read-syms GeneralConstants read-syms FileConstants read-syms DialogConstants$(!STF_LANGUAGE) read-syms FileConstants$(!STF_LANGUAGE) detect date set-title $(FunctionTitle) set to = Begin set from = Begin set CommonStatus = STATUS_SUCCESSFUL ; ;----- Take down the hourglass ; EndWait ; ;----- Set the label to jump to according to what the user ; wants done. ; Begin = + Ifstr(i) $(!NTN_InstallMode) == deinstall set StartLabel = removeadapter set OEM_ABANDON_OPTIONS = {+ $(ProductMCSXNSSYSName),+ $(ProductUBNBSYSName)} set OEM_ABANDON_SOFTWARE = {+ $(ProductMCSXNSName),+ $(ProductUBNBName), "Streams"} else-Ifstr(i) $(!NTN_InstallMode) == Update set StartLabel = UpgradeSoftware else-Ifstr(i) $(!NTN_InstallMode) == configure set StartLabel = configureadapter else-Ifstr(i) $(!NTN_InstallMode) == bind set StartLabel = bindingadapter else set StartLabel = installadapter set OEM_ABANDON_SOFTWARE = {} set OEM_ABANDON_OPTIONS = {} endif ; ;----- Jump to the label to execute the function needed ; set from = $(fatal) set to = $(fatal) goto $(StartLabel)
;--------------------------------------------------------------------- ; This section handles the installation and setup of the driver ;--------------------------------------------------------------------- installadapter = + Debug-Output "OEMNXPXN.INF: At installadapter" ; ;----- Open the key for the product ; Debug-Output "OEMNXPXN.INF: Opening key for the product"
OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct Debug-Output "OEMNXPXN.INF: Back from opening key for the product" ; ;----- If the key is already there, then tell the user that the ; product is already installed. ; Ifstr $(KeyProduct) != $(KeyNull) CloseRegKey $(KeyProduct) Shell $(UtilityInf), VerExistedDlg, $(Product$(Option)Title),+ $(ProductVersion) ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPXN.INF: ShellCode error: cannot get an error string." goto ShellCodeError endif goto end endif ; ;----- If we are to copy - then set it here ; Ifstr(i) $(!NTN_InstallMode) == "install" Ifstr(i) $(DoCopy) == "YES"
Debug-Output "OEMNXPXN.INF: Calling DoAskSource 1"
Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) Ifint $($ShellCode) != $(!SHELL_CODE_OK) Goto ShellCodeError Else-Ifstr(i) $($R0) == STATUS_FAILED Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL" ifint $($ShellCode) != $(!SHELL_CODE_OK) goto ShellCodeError endif set Error = $($R0) Goto fatal Else-Ifstr(i) $($R0) == STATUS_USERCANCEL Goto successful Endif Set SrcDir = $($R1) Endif install "Install-Option" ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE" ifint $($ShellCode) != $(!SHELL_CODE_OK) goto ShellCodeError endif set Error = $($R0) goto fatal endif endif ; ;----- Get the string to use and put up a box that we are installing ; Debug-Output "OEMNXPXN.INF: Put up box that we are installing" set OEM_ABANDON_ON = TRUE read-syms Billboard1$(!STF_LANGUAGE) Shell "subroutn.inf" PushBillboard NETSTATUSDLG $(Status) Set BillboardVisible = 1 ; ;----- Set the options that we are going to install ; Set DoMcsXns = FALSE Set DoMcsXnsSys = FALSE Set DoUbnb = FALSE Set DoUbnbSys = FALSE Set DoStreams = FALSE Ifstr(i) $(Option) == MCSXNS Set DoMcsXns = TRUE Set DoMcsXnsSys = TRUE Set DoUbnb = TRUE Set DoUbnbSys = TRUE Set DoStreams = TRUE Else-ifstr(i) $(Option) == UBNB Set DoUbnb = TRUE Set DoUbnbSys = TRUE Else Debug-Output "OEMNXPXN.INF: Unrecognized option" Endif ; ;----- Put up the hourglass ; Debug-Output "OEMNXPXN.INF: Start the install" StartWait ; ;----- Option to install McsXns Service Controller Daemon ; ifstr(i) $(DoMcsXns) == TRUE Set ThisOption = MCSXNS Set OEM_ABANDON_SOFTWARE = >($(OEM_ABANDON_SOFTWARE), $(Product$(ThisOption)Name)) Debug-Output "OEMNXPXN.INF: installing McsXns."
Shell $(UtilityInf), AddSoftwareComponent,+ $(Manufacturer),+ $(Product$(ThisOption)Name),+ $(Product$(ThisOption)Name),+ $(Product$(ThisOption)DisplayName),+ $(STF_CONTEXTINFNAME),+ $(Product$(ThisOption)ImagePath),+ $(Product$(ThisOption)SvcType),+ "",+ {"McsXnssys"},+ ""
ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPXN.INF: ShellCode error, add software component" goto ShellCodeError endif set RegistryErrorIndex = $($R0) Ifstr(i) $(RegistryErrorIndex) != NO_ERROR EndWait Debug-Output "OEMNXPXN.INF: Registry error: add software components" CloseRegKey $($R1) CloseRegKey $($R2) CloseRegKey $($R3) CloseRegKey $($R4) CloseRegKey $($R5) goto fatalregistry endif ; ;----- Set the return values to local vars ; Set McsXnsVersKeyHandle = $($R1) Set McsXnsRulesKeyHandle = $($R2) Set McsXnsSvcKeyHandle = $($R3) Set McsXnsParmKeyHandle = $($R4) Set McsXnsLinkageHandle = $($R5) ; ;----- Set the Version entry ; set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+ {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+ {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+ {Title,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Title)},+ {Description,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Description)},+ {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Name)},+ {Review,$(NoTitle),$(!REG_VT_DWORD),1},+ {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}} Shell $(UtilityInf), AddValueList, $(McsXnsVersKeyHandle), $(NewValueList) ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPXN.INF: ShellCode error, add value list" goto ShellCodeError endif set RegistryErrorIndex = $($R0) Ifstr(i) $(RegistryErrorIndex) != NO_ERROR EndWait Debug-Output "OEMNXPXN.INF: Registry error: add value list." CloseRegKey $(McsXnsVersKeyHandle) CloseRegKey $(McsXnsRulesKeyHandle) CloseRegKey $(McsXnsSvcKeyHandle) CloseRegKey $(McsXnsParmKeyHandle) CloseRegkey $(McsXnsLinkageHandle) goto fatalregistry Endif ; ;----- Set the NetRules entry ; set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(ThisOption)Type)},+ {use,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(ThisOption)Use)},+ {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(ThisOption)BindForm)},+ {class,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(ThisOption)Class)},+ {InfOption,$(NoTitle),$(!REG_VT_SZ),$(ThisOption)} } Shell $(UtilityInf), AddValueList, $(McsXnsRulesKeyHandle), $(NewValueList) ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPXN.INF: ShellCode error." goto ShellCodeError endif ; ;----- Close up some of the handles ; set RegistryErrorIndex = $($R0) CloseRegKey $(McsXnsVersKeyHandle) CloseRegKey $(McsXnsRulesKeyHandle) CloseRegKey $(McsXnsParmKeyHandle) ; ;----- If we got an error - get out ; Ifstr(i) $(RegistryErrorIndex) != NO_ERROR CloseRegKey $(McsXnsLinkageHandle) CloseRegKey $(McsXnsSvcKeyHandle) EndWait Debug-Output "OEMNXPXN.INF: Registry error: add value list." goto fatalregistry endif ; ;----- Set the OtherDependencies List ; Set NewValueList = {{OtherDependencies,$(NoTitle),$(!REG_VT_MULTI_SZ),{"McsXnssys"}}} Shell $(UtilityInf), AddValueList, $(McsXnsLinkageHandle), $(NewValueList) CloseRegKey $(McsXnsLinkageHandle) ifint $($ShellCode) != $(!SHELL_CODE_OK) CloseRegKey $(McsXnsSvcKeyHandle) Debug-Output "OEMNXPXN.INF: ShellCode error." goto ShellCodeError endif ; ;----- Go create all the subkey stuff ; Shell "" CreateMcsXnsConfiguration $(McsXnsSvcKeyHandle) ; ;----- Close up and check for error ; CloseRegKey $(McsXnsSvcKeyHandle) Set RegistryErrorIndex = $($R0) Ifstr(i) $(RegistryErrorIndex) != NO_ERROR EndWait Debug-Output "OEMNXPXN.INF: Registry error: Create MCSXNS configuration." goto fatalregistry endif ; ;----- Add info to the Winsock entry ; This is now done in the service controller daemon
Debug-Output "OEMNXPXN.INF: Adding winsock data"
Shell $(UtilityInf), AddWinsockInfo, + $(Product$(ThisOption)Name), + $(Product$(ThisOption)WshDllPath), + $(Sockmaxlength),$(Sockminlength)
set RegistryErrorIndex = $($R0)
Ifstr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output "OEMNXPXN.INF: Registry error: Add Winsock Info." Endif Endif ; ;----- Option to install McsXns Kernel Driver ; Ifstr(i) $(DoMcsXnsSys) == TRUE Set ThisOption = MCSXNSSYS Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(Product$(ThisOption)Name)) Debug-Output "OEMNXPXN.INF: installing MCSXNSSYS..." ; ;----- Create the service ; Shell $(UtilityInf), CreateService,+ $(Product$(ThisOption)Name),+ $(Product$(ThisOption)DisplayName),+ $(Product$(ThisOption)ImagePath),+ $(Product$(ThisOption)SvcType) "",+ {"Streams"}, "", $(McsXnsEventDLL)
ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPXN.INF: ShellCode error" goto ShellCodeError endif set RegistryErrorIndex = $($R0) CloseRegKey $($R2) CloseRegKey $($R3) Set McsXnsSysSvcKeyHandle = $($R1) Ifstr(i) $(RegistryErrorIndex) != NO_ERROR EndWait CloseRegKey $(McsXnsSysSvcKeyHandle) CloseRegKey $($R2) CloseRegKey $($R3) Debug-Output "OEMNXPXN.INF: Registry error: add software components" goto fatalregistry endif ;; CreateRegKey $(McsXnsSysSvcKeyHandle) {"Performance",$(NoTitle),GenericClass} "" + ;; $(MAXIMUM_ALLOWED) "" KeyPerformance ;; set NewValueList = {{Library,$(NoTitle),$(!REG_VT_SZ),"Perfctrs.dll"},+ ;; {Open,$(NoTitle),$(!REG_VT_SZ),"OpenTcpIpPerformanceData"},+ ;; {Collect,$(NoTitle),$(!REG_VT_SZ),"CollectTcpIpPerformanceData"},+ ;; {Close,$(NoTitle),$(!REG_VT_SZ),"CloseTcpIpPerformanceData"}} ;; Shell $(UtilityInf), AddValueList, $(KeyPerformance), $(NewValueList) ;; set RegistryErrorIndex = $($R0) ;; CloseRegKey $(KeyPerformance) CloseRegKey $(McsXnsSysSvcKeyHandle) Ifstr $(RegistryErrorIndex) != NO_ERROR goto fatalRegistry Endif Endif ; ;----- Option to install Ungermann-Bass NetBIOS ; Ifstr(i) $(DoUbnb) == TRUE Set ThisOption = UBNB Set OEM_ABANDON_SOFTWARE = >($(OEM_ABANDON_SOFTWARE), $(Product$(ThisOption)Name)) Debug-Output "OEMNXPXN.INF: installing UBNB..." Shell $(UtilityInf), AddSoftwareComponent,+ $(Manufacturer),+ $(Product$(ThisOption)Name),+ $(Product$(ThisOption)Name),+ $(Product$(ThisOption)DisplayName),+ $(STF_CONTEXTINFNAME),+ $(Product$(ThisOption)ImagePath),+ $(Product$(ThisOption)SvcType),+ "TDI",+ {},+ "" ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPXN.INF: ShellCode error" goto ShellCodeError endif set RegistryErrorIndex = $($R0) Ifstr(i) $(RegistryErrorIndex) != NO_ERROR EndWait Debug-Output "OEMNXPXN.INF: Registry error: add software components" CloseRegKey $($R1) CloseRegKey $($R2) CloseRegKey $($R3) CloseRegKey $($R4) CloseRegKey $($R5) goto fatalregistry endif Set UBNBProductKey = $($R1) Set UBNBNetRuleKey = $($R2) Set UBNBServiceKey = $($R3) Set UBNBParameterKey = $($R4) Set UBNBLinkageKey = $($R5) ; ;----- Set the version info ; set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+ {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+ {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+ {Title,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Title)},+ {Description,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Description)},+ {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Name)},+ {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}} Shell $(UtilityInf), AddValueList, $(UBNBProductKey), $(NewValueList) ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPXN.INF: ShellCode error." goto ShellCodeError endif set RegistryErrorIndex = $($R0) Ifstr(i) $(RegistryErrorIndex) != NO_ERROR EndWait Debug-Output "OEMNXPXN.INF: Registry error: add value list." CloseRegKey $(UBNBProductKey) CloseRegKey $(UBNBNetRuleKey) CloseRegKey $(UBNBServiceKey) CloseRegKey $(UBNBParameterKey) CloseRegKey $(UBNBLinkageKey) goto fatalregistry endif ; ;----- Set the other dependencies ; set NewValueList = {{OtherDependencies,$(NoTitle),$(!REG_VT_MULTI_SZ),{"McsXns","Ubnbsys"}}} Shell $(UtilityInf), AddValueList, $(UBNBLinkageKey), $(NewValueList) ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPXN.INF: ShellCode error." goto ShellCodeError endif set RegistryErrorIndex = $($R0) Ifstr(i) $(RegistryErrorIndex) != NO_ERROR EndWait Debug-Output "OEMNXPXN.INF: Registry error: add value list." CloseRegKey $(UBNBProductKey) CloseRegKey $(UBNBNetRuleKey) CloseRegKey $(UBNBServiceKey) CloseRegKey $(UBNBParameterKey) CloseRegKey $(UBNBLinkageKey) goto fatalregistry endif ; ;----- Set the NetRules entry ; set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(ThisOption)Type)},+ {use,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(ThisOption)Use)},+ {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(ThisOption)BindForm)},+ {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRule$(ThisOption)ClassList)},+ {InfOption,$(NoTitle),$(!REG_VT_SZ),$(ThisOption)}} Shell $(UtilityInf), AddValueList, $(UBNBNetRuleKey), $(NewValueList) ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPXN.INF: ShellCode error." goto ShellCodeError endif
set RegistryErrorIndex = $($R0)
Ifstr(i) $(RegistryErrorIndex) != NO_ERROR EndWait Debug-Output "OEMNXPXN.INF: Registry error: add value list." CloseRegKey $(UBNBProductKey) CloseRegKey $(UBNBNetRuleKey) CloseRegKey $(UBNBServiceKey) CloseRegKey $(UBNBParameterKey) CloseRegKey $(UBNBLinkageKey) goto fatalregistry endif
Set NewValueList = {{NbProvider,$(NoTitle),$(!REG_VT_SZ),"_xns"},+ {EndPoint,$(NoTitle),$(!REG_VT_DWORD),1}}
Shell $(UtilityInf), AddValueList, $(UBNBParameterKey), $(NewValueList) Ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPXN.INF: ShellCode error." goto ShellCodeError Endif
set RegistryErrorIndex = $($R0) CloseRegKey $(UBNBProductKey) CloseRegKey $(UBNBNetRuleKey) CloseRegKey $(UBNBServiceKey) CloseRegKey $(UBNBParameterKey) CloseRegKey $(UBNBLinkageKey) Ifstr(i) $(RegistryErrorIndex) != NO_ERROR EndWait Debug-Output "OEMNXPXN.INF: Registry error: add value list." goto fatalregistry endif
;Shell $(UtilityInf) AddMixRpcProtocol "Netbios" "mcsxns" "ncacn_nb_xns" "rpclt1.dll" "rpclt1.dll" ;Ifint $($ShellCode) != $(!SHELL_CODE_OK) ; Debug-Output "OEMNXPXN.INF: ShellCode error adding RPC procotol" ; goto ShellCodeError ;endif ;Set RegistryErrorIndex = $($R0) ;Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR" ; Debug-Output "OEMNXPXN.INF: ERROR adding RPC protocol data" ; EndWait ; goto fatalregistry ;Endif
Endif ; ;----- Option to install Ungermann-Bass NetBIOS kernel driver ; Ifstr(i) $(DoUbnbSys) == TRUE Set ThisOption = UBNBSYS Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(Product$(ThisOption)Name)) Debug-Output "OEMNXPXN.INF: installing UBNBSYS..." Shell $(UtilityInf), CreateService,+ $(Product$(ThisOption)Name),+ $(Product$(ThisOption)DisplayName),+ $(Product$(ThisOption)ImagePath),+ $(Product$(ThisOption)SvcType), "", {"Streams"}, "",+ $(UbnbEventDLL) ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPXN.INF: ShellCode error" goto ShellCodeError endif set RegistryErrorIndex = $($R0) CloseRegKey $($R1) CloseRegKey $($R2) CloseRegKey $($R3) Ifstr(i) $(RegistryErrorIndex) != NO_ERROR EndWait Debug-Output "OEMNXPXN.INF: Registry error: add software components" goto fatalregistry endif Endif ; ;----- Take down the hourglass ; EndWait ; ;----- If the billboard is up - take it down ; Ifint $(BillboardVisible) != 0 Shell "subroutn.inf" PopBillboard Set BillboardVisible = 0 Endif
; ; Install Streams ; Ifstr(i) $(DoStreams) == TRUE
Set ThisOption = STREAMS
Set OEM_ABANDON_SOFTWARE = >($(OEM_ABANDON_SOFTWARE), "Streams")
Debug-Output "OEMNXPXN.INF: installing STREAMS..."
Set !STF_SRCDIR_OVERRIDE = $(SrcDir)
Shell $(UtilityInf) AddStreams
Set !STF_SRCDIR_OVERRIDE = ""
set RegistryErrorIndex = $($R0)
Ifstr(i) $(RegistryErrorIndex) != NO_ERROR EndWait goto fatalregistry endif
Endif
; ;----- Exit OK ; goto successful
;--------------------------------------------------------------------- ; This section handles the configuration of the driver ;--------------------------------------------------------------------- configureadapter = + Debug-Output "OEMNXPXN.INF: At ConfigureAdapter"
ifstr(i) $(Option) == "MCSXNS" ; ; Read the active and disabled bindings into a single list ; Set BindList = {} Set DisabledList = {}
OpenRegKey $(!REG_H_LOCAL) "" $(LinkageKeyName) $(MAXIMUM_ALLOWED) LinkageKey
ifint $(RegLastError) == $(!REG_ERROR_SUCCESS) GetRegValue $(LinkageKey) "Bind" BindList ifint $(RegLastError) == $(!REG_ERROR_SUCCESS) set BindList = *($(BindList),4) else Set BindList = {} endif OpenRegKey $(LinkageKey) "" Disabled $(MAXIMUM_ALLOWED) DisabledKey ifint $(RegLastError) == $(!REG_ERROR_SUCCESS) GetRegValue $(DisabledKey) "Bind" DisabledList ifint $(RegLastError) == $(!REG_ERROR_SUCCESS) Set DisabledList = *($(DisabledList),4) else Set DisabledList = {} endif CloseRegKey $(DisabledKey) endif CloseRegKey $(LinkageKey) endif
; Merge the two lists
ForListDo $(DisabledList) Set BindList = >($(BindList),$($)) EndForListDo
; Check that we're bound to something
ifstr(i) $(BindList) == {} debug-output "OEMNXPXN.INF: no binding info; warning user" read-syms InfoDlgCantConfigure goto infomsg endif
; Extract and validate the card names from the binding strings.
Debug-Output "OEMNXPXN.INF: configureadapter, BindList = "$(BindList)
set OldVersionExisted = $(TRUE) set CardList = ""
ForListDo $(BindList)
; Adapter name is the last element in binding string; ; extract it.
Split-String $($), "\", BindInfo QueryListSize BindElem $(BindInfo) Set BindName = *($(BindInfo),$(BindElem))
; Validate it; append to string if OK
OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(BindName) $(MAXIMUM_ALLOWED) CardServiceKey ifstr(i) $(CardServiceKey) != "" CloseRegKey $(CardServiceKey) Set CardList = $(CardList)"@"$(BindName) endif EndForListDo
ifstr(i) $(CardList) != ""
Debug-Output "OEMNXPXN.INF: configureadapter, CardList = "$(CardList)
set FLibraryErrCtl = 1 LoadLibrary "x", $(!STF_WINDOWSSYSPATH)\xnscfg.dll MCSXNSLIB_HANDLE
LibraryProcedure ResultList, $(MCSXNSLIB_HANDLE), nlink_setup_dialog, $(!STF_HWND), + $(CardList), $(!STF_COMPUTERNAME), $(!STF_WINDOWSSYSPATH)\xnscfg.dll
FreeLibrary $(MCSXNSLIB_HANDLE) set FLibraryErrCtl = 0
; Result list is of the form {<0|1>,"name of active adapter"}
Debug-Output "OEMNXPXN.INF: configureadapter, ResultList = "$(ResultList) Set Result = *($(ResultList),1) Set AdapterChosen = *($(ResultList),2)
Ifint $(Result) == 0 set CommonStatus = STATUS_NO_EFFECT Else set CommonStatus = STATUS_REBOOT
Ifstr(i) $(AdapterChosen) != ""
Set BindingChosen = "" ForListDo $(BindList) Split-String $($), "\", BindInfo QueryListSize BindElem $(BindInfo) Set AdapterName = *($(BindInfo),$(BindElem)) Ifstr(i) $(AdapterName) == $(AdapterChosen) Set BindingChosen = $($) Endif EndForListDo
; Change the bindings on both the primary transport ; and the NetBIOS daemon.
Ifstr(i) $(BindingChosen) != "" Debug-Output "OEMNXPXN.INF: configureadapter, BindingChosen = "$(BindingChosen) set FLibraryErrCtl = 1 LibraryProcedure ResultList $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), + ACTIVBIND, $(ProductMCSXNSName) {$(BindingChosen)} set FLibraryErrCtl = 0 Set Result = *($(ResultList),1) Debug-Output "OEMNXPXN.INF: configureadapter, ACTIVBIND returned error: "$(Result) Else Debug-Output "OEMNXPXN.INF: configureadapter, ERROR: AdapterChosen not found in bindings list!" Endif Endif Endif else set CommonStatus = STATUS_USERCANCEL endif else Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE ifint $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output "OEMNXPIP.INF: ShellCode error: cannot get an error string." goto ShellCodeError endif set Error = $($R0) set from = end set to = end set CommonStatus = STATUS_NO_EFFECT goto nonfatalinfo endif goto end
;--------------------------------------------------------------------- ; This section handles the configuration of the driver ;--------------------------------------------------------------------- bindingadapter =+ set FLibraryErrCtl = 1 LibraryProcedure ResultList, $(!NCPA_HANDLE), CPlSetup, $(!STF_HWND), MCSCFGCHK "MCSXNS" set FLibraryErrCtl = 0 Set Result = *($(ResultList),1) ifint $(Result) == 0 Debug-Output "OEMNXPXN.INF: reconfiguration not required" set CommonStatus = STATUS_USERCANCEL goto successful else Debug-Output "OEMNXPXN.INF: reconfiguration required" endif
goto configureadapter
;--------------------------------------------------------------------- ; This section handles the removal of the driver ;--------------------------------------------------------------------- removeadapter = + Debug-Output "OEMNXPXN.INF: At removeadapter" ; ; Remove XNS RPC info ; Shell $(UtilityInf) RemoveRpcProtocol "ncacn_nb_xns" ;Ifstr(i) $($0) != NO_ERROR ; Debug-Output "OEMNXPXN.INF: ERROR deleting RPC protocol data" ;Endif
ForListDo $(OEM_ABANDON_SOFTWARE) debug-output "Remove component: "$($) ifstr(i) $($) == "Streams" Shell $(UtilityInf), RemoveStreams else Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), $($) endif EndForListDo ForListDo $(OEM_ABANDON_OPTIONS) DEBUG-OUTPUT "Remove component: "$($) Ifstr(i) $($) == $(ProductLOOPName) Set UseSvcctrl = "NO" Else Set UseSvcctrl = "YES" Endif Shell $(UtilityInf), RemoveService, $($), $(UseSvcctrl) EndForListDo ; ;----- Remove info from the Winsock entry ; Shell $(UtilityInf), RemoveWinsockInfo,+ $(Product$(Option)Name) ; ;----- ; goto end
;--------------------------------------------------------------------- ; This section handles the removal of the driver ;--------------------------------------------------------------------- UpgradeSoftware = + ; Upgrade software component ; OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
Ifstr $(KeyProduct) != $(KeyNull)
install "Install-Update" ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS goto fatal endif
; Upgrade the version number ; SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)} SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
Shell $(UtilityInf), UpdateWinsockMappings, $(Product$(ThisOption)Name), $(Product$(ThisOption)WshDllPath)
ifstr(i) $($R0) != NO_ERROR goto fatal endif
; ; do nothing for update ; CloseRegKey $(KeyProduct) else ; ; Cannot Open software key, goto ERROR ; goto fatalregistry endif
goto end ; ;----- Everything was OK ; successful = + goto end ; ;----- ; infomsg =+ read-syms InfoDlg ui start "Warning" set CommonStatus = STATUS_USERCANCEL goto end ; ;----- ; warning = + Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error) ifint $($ShellCode) != $(!SHELL_CODE_OK) goto ShellCodeError endif ifstr(i) $($R1) == "OK" goto $(to) else-ifstr(i) $($R1) == "CANCEL" goto $(from) else goto "end" endif ; ;----- ; nonfatalinfo = + Set CommonStatus = STATUS_USERCANCEL Set Severity = STATUS goto nonfatalmsg nonfatal = + Set Severity = NONFATAL goto nonfatalmsg nonfatalmsg = + ifstr(i) $(Error) == "" Set Severity = NONFATAL Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL" ifint $($ShellCode) != $(!SHELL_CODE_OK) goto ShellCodeError endif set Error = $($R0) endif Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error) ifint $($ShellCode) != $(!SHELL_CODE_OK) goto ShellCodeError endif ifstr(i) $($R1) == "OK" goto $(from) else goto "end" endif ; ;----- ; fatalregistry = + Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex) ifint $($ShellCode) != $(!SHELL_CODE_OK) goto ShellCodeError endif set Error = $($R0) goto fatal ; ;----- ; fatal = + ifstr(i) $(Error) == "" Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL" ifint $($ShellCode) != $(!SHELL_CODE_OK) goto ShellCodeError endif set Error = $($R0) endif Ifint $(BillboardVisible) != 0 Shell "subroutn.inf" PopBillboard Set BillboardVisible = 0 Endif Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error) ifint $($ShellCode) != $(!SHELL_CODE_OK) goto ShellCodeError endif goto setfailed ; ;----- ; ShellCodeError = + set DlgType = "MessageBox" set STF_MB_TITLE = $(ShellCodeErrorTitle) set STF_MB_TEXT = $(ShellCodeErrorText) set STF_MB_TYPE = 1 set STF_MB_ICON = 3 set STF_MB_DEF = 1 ui start "Error Message" goto setfailed ; ;----- ; setfailed = + set CommonStatus = STATUS_FAILED ifstr(i) $(OEM_ABANDON_ON) == TRUE set OEM_ABANDON_ON = FALSE goto removeadapter endif goto end ; ;----- ; end = + goto term ; ;----- ; term = + Return $(CommonStatus)
;********************************************************************** ; Create the configuration ;********************************************************************** [CreateMcsXnsConfiguration] read-syms GeneralConstants Set McsXnsSvcKeyHandle = $($0) Debug-Output "OEMNXPXN.INF: installing McsXns configuration:" ; ;----- Create the NetConfig Entry ; CreateRegKey $(McsXnsSvcKeyHandle) {"NetConfig",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyNetConfig ; ;----- Create the driver entries (1) ; CreateRegKey $(KeyNetConfig) {"Driver01",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyDriver
Shell $(UtilityInf) AddValueList, $(KeyDriver),+ {{"AdapterName", $(NoTitle), $(!REG_VT_SZ), ""} + {"NetworkNumber", $(NoTitle), $(!REG_VT_DWORD), 1} + {"WindowSize", $(NoTitle), $(!REG_VT_DWORD), 0} + {"MaxPktSize", $(NoTitle), $(!REG_VT_DWORD), 0}}
CloseRegKey $(KeyDriver) ; ;----- Create the driver entries (2) ; CreateRegKey $(KeyNetConfig) {"Driver02",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyDriver
Shell $(UtilityInf) AddValueList, $(KeyDriver),+ {{"AdapterName", $(NoTitle), $(!REG_VT_SZ), ""} + {"NetworkNumber", $(NoTitle), $(!REG_VT_DWORD), 0} + {"WindowSize", $(NoTitle), $(!REG_VT_DWORD), 0} + {"MaxPktSize", $(NoTitle), $(!REG_VT_DWORD), 0}}
CloseRegKey $(KeyDriver) ; ;----- Create the driver entries (3) ; CreateRegKey $(KeyNetConfig) {"Driver03",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyDriver
Shell $(UtilityInf) AddValueList, $(KeyDriver),+ {{"AdapterName", $(NoTitle), $(!REG_VT_SZ), ""} + {"NetworkNumber", $(NoTitle), $(!REG_VT_DWORD), 0} + {"WindowSize", $(NoTitle), $(!REG_VT_DWORD), 0} + {"MaxPktSize", $(NoTitle), $(!REG_VT_DWORD), 0}}
CloseRegKey $(KeyDriver) ; ;----- Create the driver entries (4) ; CreateRegKey $(KeyNetConfig) {"Driver04",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyDriver
Shell $(UtilityInf) AddValueList, $(KeyDriver),+ {{"AdapterName", $(NoTitle), $(!REG_VT_SZ), ""} + {"NetworkNumber", $(NoTitle), $(!REG_VT_DWORD), 0} + {"WindowSize", $(NoTitle), $(!REG_VT_DWORD), 0} + {"MaxPktSize", $(NoTitle), $(!REG_VT_DWORD), 0}}
CloseRegKey $(KeyDriver) ; ;----- Create the driver entries (5) ; CreateRegKey $(KeyNetConfig) {"Driver05",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyDriver
Shell $(UtilityInf) AddValueList, $(KeyDriver),+ {{"AdapterName", $(NoTitle), $(!REG_VT_SZ), ""} + {"NetworkNumber", $(NoTitle), $(!REG_VT_DWORD), 0} + {"WindowSize", $(NoTitle), $(!REG_VT_DWORD), 0} + {"MaxPktSize", $(NoTitle), $(!REG_VT_DWORD), 0}}
CloseRegKey $(KeyDriver) ; ;----- Close the NetConfig key ; CloseRegKey $(KeyNetConfig) ; ;----- All Done ; CreateMcsXnsConfigDone = + Debug-Output "OEMNXPXN.INF: installing McsXns.....done." Return NO_ERROR
;******************************************************************** ;******************************************************************** [Install-Option] set STF_VITAL = "" ; ;----- Add files to the copy list ; ifstr(i) $(AddCopy) == "YES" Debug-Output "OEMNXPXN.INF: Adding files to copy list" AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers AddSectionFilesToCopyList Files-MCSXNSEXE $(SrcDir) $(!STF_WINDOWSSYSPATH) endif ; ;----- Copy the files over ; ifstr(i) $(DoCopy) == "YES" Debug-Output "OEMNXPXN.INF: Copying Files" set !STF_NCPA_FLUSH_COPYLIST = TRUE CopyFilesInCopyList endif
ifstr(i) $(DoConfig) == "YES" endif
Exit ;******************************************************************** ;******************************************************************** [Install-Update] set STF_VITAL = "" set STF_OVERWRITE = "VERIFYSOURCEOLDER" ; ;----- ; AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers AddSectionFilesToCopyList Files-MCSXNSEXE $(SrcDir) $(!STF_WINDOWSSYSPATH) ; ;----- ; Exit
;******************************************************************** ;******************************************************************** [Source Media Descriptions] 1 = "MCS XNS/UB Installation Disk" , TAGFILE = mcsxnsvc.exe ;******************************************************************** ;******************************************************************** [Files-Inf] 1, oemsetup.inf, SIZE=1000, RENAME=$(!UG_Filename) [Files-MCSXNS] 1, mcsxns.sys, SIZE=42496 1, ubnb.sys, SIZE=33792 [Files-MCSXNSEXE] 1, mcsxnsvc.exe, SIZE=19456 1, ubnbsvc.exe, SIZE=14848 1, xnscfg.dll, SIZE=14848 1, wshxns.dll, SIZE=14848 1, xnsmsg.dll, SIZE=10000 1, ubnbmsg.dll, SIZE=10000
|