home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 February / VPR9602A.ISO / drvlib / netcard / x86 / octk32 / oemsetup.inf < prev    next >
INI File  |  1995-10-27  |  51KB  |  1,622 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMSETUP.INF
  4. ;
  5. ;       Olicom network card and driver SETUP INF file.
  6. ;
  7. ;***********************************************************************
  8.  
  9. ;-----------------------------------------------------------------------
  10. ; OPTION TYPE
  11. ; -----------
  12. ; This identifies the Option type we are dealing with.  The different
  13. ; possible types are:
  14. ;
  15. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  16. ;
  17. ;  Types specific to networking:
  18. ;
  19. ; NetAdapter,        a netcard / adapter combination or just a netcard
  20. ; NetDriver,         just a netcard driver
  21. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  22. ; NetService,        an NT networking service
  23. ; NetWork,           a complete network ensemble.
  24. ; NetProvider        a complete network which supports NT MPR protocol
  25. ;-----------------------------------------------------------------------
  26.  
  27. [Identification]
  28.     OptionType = NetAdapter
  29.  
  30. ;-----------------------------------------------------------------------
  31. ; PlatformsSupported
  32. ; ------------------
  33. ; This identifies the platforms supported by the adapter card.
  34. ; Possible types are:
  35. ;
  36. ; EISA
  37. ;-----------------------------------------------------------------------
  38.  
  39. [PlatformsSupported]
  40.     EISA
  41.     "Jazz-Internal Bus"
  42.  
  43. [LanguagesSupported]
  44.     ENG
  45.  
  46. ;-----------------------------------------------------------------------
  47. ; OPTION LIST
  48. ; -----------
  49. ; This section lists the OEM Option key names.  These keys are locale
  50. ; independent and used to represent the option in a locale independent
  51. ; manner.
  52. ;
  53. ;-----------------------------------------------------------------------
  54.  
  55. [Options]
  56.     OCTK32
  57.  
  58. [OptionsTextENG]
  59.     OCTK32     = "Olicom Token-Ring EISA 16/4 Server Adapter"
  60.  
  61. [IOBaseAddrChoices]
  62. IOBase_1  = "0a18-0a23,0a30-0a3f",0
  63. IOBase_2  = "0a24-0a2f,0a40-0a4f",1
  64. IOBase_3  = "0a50-0a53,0a58-0a6f",2
  65. IOBase_4  = "0a54-0a57,0a70-0a87",3
  66. IOBase_5  = "1a18-1a23,1a30-1a3f",4
  67. IOBase_6  = "1a24-1a2f,1a40-1a4f",5
  68. IOBase_7  = "1a50-1a53,1a58-1a6f",6
  69. IOBase_8  = "1a54-1a57,1a70-1a87",7
  70. [BusNumberChoices]
  71. BusNo_1 = "0",0
  72. BusNo_2 = "1",1
  73. BusNo_3 = "2",2
  74. BusNo_4 = "3",3
  75. BusNo_5 = "4",4
  76. BusNo_6 = "5",5
  77. BusNo_7 = "6",6
  78. BusNo_8 = "7",7
  79.  
  80. ;***********************************************************************
  81. ; CONSTANTS FOR USING DIALOGS
  82. ;***********************************************************************
  83. [FileConstants]
  84. ;
  85. ;  File names, etc.
  86. ;
  87. UtilityInf      = "UTILITY.INF"
  88. ParamInf        = "NCPARAM.INF"
  89. subroutineinf   = "SUBROUTN.INF"
  90. SoftwareType    = "driver"
  91. Exit_Code       = 0
  92.  
  93. DialogDllName   = "octk32.dll"
  94.  
  95. ;
  96. ; EventLog Message File
  97. ;
  98. NetEventDLL     = "%SystemRoot%\System32\netevent.dll;%SystemRoot%\System32\Drivers\Octk32.sys"
  99. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  100.  
  101. ; Product Info
  102. ;
  103. Manufacturer    = "Microsoft"
  104. ProductMajorVersion     = "2"
  105. ProductMinorVersion     = "0"
  106. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  107. ;
  108. ; Software
  109. ;
  110. ProductSoftwareName     = "octk32"
  111. ProductSoftwareTitle    = "Olicom Token-Ring EISA 16/4 Server Adapter Driver"
  112. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\octk32.sys"
  113. NetRuleSoftwareType     = "octk32Sys ndisDriver octk32Driver"
  114. NetRuleSoftwareUse      = $(SoftwareType)
  115. NetRuleSoftwareBindForm = """Octk32Sys"" yes no container"
  116. NetRuleSoftwareClass    = {"octk32Driver basic"}
  117. NetRuleSoftwareBindable = {"octk32Driver octk32Adapter non exclusive 100"}
  118. ;
  119. ; Hardware
  120. ;
  121. ProductHardwareName     = "octk32"
  122. ProductHardwareTitle    = "Olicom Token-Ring EISA 16/4 Server Adapter"
  123. NetRuleHardwareType     = "octk32 octk32Adapter"
  124. NetRuleHardwareBindForm = " yes yes container"
  125. NetRuleHardwareClass    = {"octk32Adapter basic"}
  126. ;
  127. ; Registry Key
  128. ;
  129. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  130. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  131.  
  132.  
  133. [GeneralConstants]
  134. ;
  135. ;  Program flow control variables.
  136. ;
  137. from      = ""
  138. to        = ""
  139. ;
  140. ;  Return codes; Exit_Code is set to one of these
  141. ;
  142. ExitCodeOk     = 0
  143. ExitCodeCancel = 1
  144. ExitCodeFatal  = 2
  145.  
  146. KeyNull         = ""
  147. MAXIMUM_ALLOWED   = 33554432
  148. RegistryErrorIndex = NO_ERROR
  149. KeyProduct      = ""
  150. KeyParameters   = ""
  151.  
  152. TRUE            = 1
  153. FALSE           = 0
  154. NoTitle         = 0
  155.  
  156. ExitState       = "Active"
  157. OldVersionExisted = $(FALSE)
  158.  
  159. DriverPath      = $(!STF_NTPATH)\drivers
  160.  
  161. [FileConstantsENG]
  162. ProCaption   = "Windows NT Setup"
  163. ProCancel    = "Cancel"
  164. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  165.                "Are you sure you want to cancel copying files?"
  166. ProCancelCap = "Network Setup Message"
  167. ProText1     = "Copying:"
  168. ProText2     = "To:"
  169. FunctionTitle   = "Olicom Token-Ring EISA 16/4 Server Adapter Card Setup"
  170. ProductSoftwareDescription = "Olicom Token-Ring EISA 16/4 Server Adapter Driver"
  171. ProductHardwareDescription = "Olicom Token-Ring EISA 16/4 Server Adapter"
  172. IOBaseAddrList = ^(IOBaseAddrChoices, 1)
  173. IOBaseAddrValues = ^(IOBaseAddrChoices, 2)
  174. BusNoList = ^(BusNumberChoices, 1)
  175. BusNoValues = ^(BusNumberChoices, 2)
  176. [DialogConstantsENG]
  177. Help        = "&Help"
  178. Exit        = "Cancel"
  179. OK          = "OK"
  180. HelpContext = ""
  181. Continue    = "Continue"
  182. Cancel      = "Cancel"
  183. [date]
  184.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  185. [AskSourceDlgText]
  186.     DlgText        = "Please enter the full path of the Olicom EISA 16/4 Server driver "+
  187.              "setup files. Then choose Continue."
  188. [FileDependentDlgENG]
  189. DlgType = "RadioCombination"
  190. DlgTemplate = "NETDLG"
  191. Caption = $(FunctionTitle)
  192. DlgText = "Please select values for the following fields:"
  193. Combo1Label = "&I/O Base Address:"
  194. Combo2Label = "&Bus Number:"
  195. Label1 = "&Early Token Release:"
  196. Radio1 = "Yes"
  197. Radio2 = "No"
  198. Label2 = "&Full Transmit Status:"
  199. Radio3 = "Yes"
  200. Radio4 = "No"
  201. Edit1Label = "&Network Address:"
  202. Combo1List = $(IOBaseAddrList)
  203. Combo1Out  = $(IOBaseAddrValue)
  204. Combo2List = $(BusNoList)
  205. Combo2Out  = $(BusNoValue)
  206. ComboListItemsIn  = {Combo1List, Combo2List}
  207. ComboListItemsOut = {Combo1Out, Combo2Out}
  208. EditTextLim = 17
  209. EditTextIn = $(NetworkAddress)
  210. RadioOptionGreyed = {}
  211. CBOptionsGreyed = {}
  212. NotifyFields = {NO, NO}
  213. HelpContext = 6000
  214.  
  215. [date]
  216.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  217.     ; Minute, Second }
  218.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  219.  
  220.  
  221. ;---------------------------------------------------------------------------
  222. ; 1. Identify
  223. ;
  224. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  225. ;                as we are choosing currently.
  226. ;
  227. ; INPUT:         None
  228. ;
  229. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  230. ;                $($R1): Option Type (COMPUTER ...)
  231. ;                $($R2): Diskette description
  232. ;---------------------------------------------------------------------------
  233.  
  234. [Identify]
  235.     ;
  236.     ;
  237.     read-syms Identification
  238.  
  239.     set Status     = STATUS_SUCCESSFUL
  240.     set Identifier = $(OptionType)
  241.     set Media      = #("Source Media Descriptions", 1, 1)
  242.  
  243.     Return $(Status) $(Identifier) $(Media)
  244.  
  245. ;------------------------------------------------------------------------
  246. ; 2. ReturnOptions:
  247. ;
  248. ; DESCRIPTION:   To return the option list supported by this INF and the
  249. ;                localised text list representing the options.
  250. ;
  251. ;
  252. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  253. ;
  254. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  255. ;                                STATUS_NOLANGUAGE
  256. ;                                STATUS_FAILED
  257. ;                                STATUS_NOTSUPPORTED
  258. ;
  259. ;                $($R1): Option List
  260. ;                $($R2): Option Text List
  261. ;------------------------------------------------------------------------
  262.  
  263. [ReturnOptions]
  264.     ;
  265.     ;
  266.     set Status        = STATUS_FAILED
  267.     set OptionList     = {}
  268.     set OptionTextList = {}
  269.  
  270.     ;
  271.     ; Check if the language requested is supported
  272.     ;
  273.     set LanguageList = ^(LanguagesSupported, 1)
  274.     Ifcontains(i) $($0) in $(LanguageList)
  275.         ;
  276.         ; Check if the platforms requested is supported
  277.         ;
  278.         ifstr(i) $($1) == ""
  279.                         goto returnoptions
  280.         endif
  281.  
  282.         set PlatformList = ^(PlatformsSupported, 1)
  283.         Ifcontains(i) $($1) in $(PlatformList)
  284.                         goto returnoptions
  285.         else
  286.                         set Status = STATUS_NOTSUPPORTED
  287.                         goto finish_ReturnOptions
  288.         endif
  289.     else
  290.                 set Status = STATUS_NOLANGUAGE
  291.                 goto finish_ReturnOptions
  292.     endif
  293.  
  294.     ;
  295.     ; form a list of all the options and another of the text representing
  296.     ;
  297.  
  298. returnoptions = +
  299.     set OptionList     = ^(Options, 1)
  300.     set OptionTextList = ^(OptionsText$($0), 1)
  301.     set Status         = STATUS_SUCCESSFUL
  302.  
  303. finish_ReturnOptions = +
  304.     Return $(Status) $(OptionList) $(OptionTextList)
  305.  
  306. ;------------------------------------------------------------------------
  307. ;
  308. ; InstallOption:
  309. ;
  310. ;      This section is shelled to by main installation processing
  311. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  312. ;
  313. ;
  314. ; FUNCTION:  To copy files representing Options
  315. ;            To configure the installed option
  316. ;            To update the registry for the installed option
  317. ;
  318. ; INPUT:     $($0):  Language to use
  319. ;            $($1):  OptionID to install
  320. ;            $($2):  SourceDirectory
  321. ;            $($3):  AddCopy  (YES | NO)
  322. ;            $($4):  DoCopy   (YES | NO)
  323. ;            $($5):  DoConfig (YES | NO)
  324. ;
  325. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  326. ;                            STATUS_NOLANGUAGE |
  327. ;                            STATUS_USERCANCEL |
  328. ;                            STATUS_FAILED
  329. ;
  330. ;------------------------------------------------------------------------
  331. [InstallOption]
  332.     Debug-Output "Olicom: InstallOption"
  333.     ;
  334.     ; Set default values for
  335.     ;
  336.     set Status   = STATUS_FAILED
  337.     ;
  338.     ; extract parameters
  339.     ;
  340.     set Option   = $($1)
  341.     set SrcDir   = $($2)
  342.     set AddCopy  = $($3)
  343.     set DoCopy   = $($4)
  344.     set DoConfig = $($5)
  345.  
  346.     ;
  347.     ; Check if the language requested is supported
  348.     ;
  349.     set LanguageList = ^(LanguagesSupported, 1)
  350.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  351.         Return STATUS_NOLANGUAGE
  352.     endif
  353.  
  354.     set-subst LF = "\n"
  355.  
  356.     read-syms GeneralConstants
  357.     read-syms FileConstants
  358.  
  359.     read-syms DialogConstants$(!STF_LANGUAGE)
  360.     ifstr(i) $(!NTN_Origination) == "NCPA"
  361.         set Continue = $(OK)
  362.     endif
  363.     read-syms FileConstants$(!STF_LANGUAGE)
  364.  
  365.     detect date
  366.  
  367.     set-title  $(FunctionTitle)
  368.  
  369.     set to   = Begin
  370.     set from = Begin
  371. ;
  372. ;  Assume all is well.
  373. ;
  374.     set CommonStatus = STATUS_SUCCESSFUL
  375.  
  376.     SetHelpFile "octk32.hlp" 6000 6000
  377.  
  378.     EndWait
  379.  
  380. ;
  381. ;   Set up the operation-mode-based variables and gaily welcome
  382. ;   the user.  If the "install mode" variable is improperly set,
  383. ;   assume this is a new installation.
  384. ;
  385.  
  386. Begin = +
  387.     Debug-Output "Olicom: Begin"
  388.     Set ActivateDetection = FALSE
  389.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  390.         set StartLabel = removeadapter
  391.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  392.         set StartLabel = UpgradeSoftware
  393.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  394.         set StartLabel = bindingadapter
  395.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  396.     Debug-Output "Olicom: Configure"
  397.         set CommonStatus = STATUS_REBOOT
  398.         set ActivateDetection = TRUE
  399.         set StartLabel = configureadapter
  400.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  401.             Debug-Output "Cannot configure the Olicom driver software."
  402.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  403.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  404.                 Debug-Output "ShellCode error: cannot get an error string."
  405.                 goto ShellCodeError
  406.             endif
  407.             set Error = $($R0)
  408.             set from = end
  409.             set to = end
  410.             goto nonfatalinfo
  411.         endif
  412.     else
  413.         Debug-Output "Olicom: PrepareDetection start"
  414.         Shell "" PrepareDetectionDll "OLINCDET.DLL"
  415.         Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  416.             ifstr(i) $(DoCopy) == "YES"
  417.                 Install Install-Detection-Dll
  418.             endif
  419.             Shell "NCPARAM.INF" Param_ControlDetection DTEND
  420.             Shell "NCPARAM.INF" Param_ControlDetection DTSTART
  421.         Endif
  422.         Debug-Output "Olicom: PrepareDetection end"
  423.         set ActivateDetection = TRUE
  424.     set StartLabel = installadapter
  425.     set OEM_ABANDON_OPTIONS = {}
  426.     set OEM_ABANDON_SOFTWARE = FALSE
  427.     set OEM_ABANDON_ON = TRUE
  428.     endif
  429.  
  430.     ;===================================================
  431.     ;  Netcard Detection logic
  432.     ;
  433.     ;  Initialize use of netcard detection;
  434.     ;  Construct require global parameter variables
  435.     ;
  436.     Debug-Output "Olicom: =================================================="
  437.     Debug-Output "Olicom: STF_CWDIR is: "$(!STF_CWDIR)
  438.     Debug-Output "Olicom: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  439.     Debug-Output "Olicom: Option is: "$(Option)
  440.     Debug-Output "Olicom: !STF_NCDETECT  is: "$(!STF_NCDETECT)
  441.     Debug-Output "Olicom: !STF_NCOPTION  is: "$(!STF_NCOPTION)
  442.     Debug-Output "Olicom: !STF_NCDETCARD is: "$(!STF_NCDETCARD)
  443.     Debug-Output "Olicom: !STF_NCDETINFO is: "$(!STF_NCDETINFO)
  444.     Debug-Output "Olicom: =================================================="
  445.  
  446.     Set DetectedCard = FALSE
  447.  
  448.     Ifstr(i) $(ActivateDetection) != TRUE
  449.         Goto $(StartLabel)
  450.     Endif
  451.     ;
  452.     ;  Set !STF_NC_PARAMS and !STF_NC_PNAMES by calling
  453.     ;    PARAM.INF!Param_BuildTypeLists.
  454.     ;   Pass it a list of the form:
  455.     ;
  456.     ;   {  { <param name>,
  457.     ;        <name of choice list var>,
  458.     ;        <name of default var> },
  459.     ;      ...
  460.     ;   }
  461.     ;
  462.     Set TypeList = {{IRQ, IRQ_List, IRQ_Level},+
  463.                     {IOADDR, IOADDR_Addr_List, IOBaseRead}}
  464.  
  465.     Debug-Output "Olicom: Calling Param_BuildTypeLists"
  466.     Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
  467.     Set Status = $($R0)
  468.     ifstr(i) $(Status) != STATUS_SUCCESSFUL
  469.         Goto fataldetect
  470.     Endif
  471.  
  472.     Debug-Output "Olicom: Calling Param_SetDefaults"
  473.     Shell $(ParamInf) Param_SetDefaults {}
  474.  
  475.     ;  Establish presentation versions of choice lists.
  476.  
  477.     Shell $(ParamInf) HexListFromDecList $(IOADDR_Addr_List)
  478.     Set IOADDR_Hex_List = $($R0)
  479.  
  480.     Shell $(UtilityInf) SortList $(IRQ_List) TRUE FALSE
  481.     Set IRQ_List = $($R0)
  482.  
  483.     ;  If this is a detected card, set the flag.
  484.  
  485.     Ifstr(i) $(!STF_NCDETECT) == YES
  486.         Ifstr(i) $(!STF_NCOPTION) == $(Option)
  487.            Set DetectedCard = TRUE
  488.            Debug-Output "Olicom: Setting DetectedCard to TRUE"
  489.         Endif
  490.     Endif
  491.     ;
  492.     ;  End Netcard Detection logic
  493.     ;===================================================
  494.  
  495.     Shell "" DebugConfiguration "After parameter querying"
  496.  
  497.     set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  498.     set BusNoValue = *($(BusNoList), 1)
  499.     set NetworkAddress = *($(EditTextOut), 1)
  500.     set RadioIn = { 1, 3 }
  501.     set EarlyTokenRelease = 1
  502.     set FullXmitStatus = 0
  503.  
  504.     Set from = $(fatal)
  505.     Set to = $(fatal)
  506.     Goto $(StartLabel)
  507.  
  508. ;-----------------------------------------------
  509. ; Installation Section
  510. ;-----------------------------------------------
  511.  
  512. installadapter = +
  513. ;
  514. ;   First, check whether the same version of the software exists
  515. ;
  516.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  517.  
  518.     Ifstr $(KeyProduct) != $(KeyNull)
  519.         ;
  520.         ; Same version already existed in the local machine
  521.         ; Popup the dialog and ask the user whether he wants to continue
  522.         ;
  523.         CloseRegKey $(KeyProduct)
  524.  
  525.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  526.            ;
  527.            ; Cannot Install the same software again
  528.            ;
  529.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  530.                $(ProductVersion)
  531.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  532.                Debug-Output "ShellCode error: cannot get an error string."
  533.                goto ShellCodeError
  534.            endif
  535.  
  536.            goto end
  537.         else
  538.            ;
  539.            ; Add a new adapter card?
  540.            ;
  541.            Shell $(UtilityInf), CardExistedDlg
  542.  
  543.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  544.                Debug-Output "ShellCode error: cannot get an error string."
  545.                goto ShellCodeError
  546.            endif
  547.  
  548.            ifstr(i) $($R1) != "OK"
  549.                set CommonStatus = STATUS_USERCANCEL
  550.                goto end
  551.            endif
  552.            set OldVersionExisted = $(TRUE)
  553.         endif
  554.     endif
  555.     ifint $(OldVersionExisted) == $(FALSE)
  556.     ifstr(i) $(!NTN_InstallMode) == "install"
  557.        Ifstr(i) $(DoCopy) == "YES"
  558.           Ifstr(i) $(SrcDir) == ""
  559.                  read-syms AskSourceDlgText
  560.                  Shell $(subroutineinf) DoAskSourceEx $(SrcDir) $(DlgText)
  561.                  Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  562.                     Goto ShellCodeError
  563.                  Else-Ifstr(i) $($R0) == STATUS_FAILED
  564.                      Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  565.                      ifint $($ShellCode) != $(!SHELL_CODE_OK)
  566.                          goto ShellCodeError
  567.                      endif
  568.                      set Error = $($R0)
  569.                      Goto fatal
  570.                  Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  571.                      Goto successful
  572.                  Endif
  573.                  Set SrcDir = $($R1)
  574.               Endif
  575.           install "Install-Dll"
  576.               ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  577.                  Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  578.                  ifint $($ShellCode) != $(!SHELL_CODE_OK)
  579.                      goto ShellCodeError
  580.                  endif
  581.                  set Error = $($R0)
  582.                  goto fatal
  583.               endif
  584.           endif
  585.        endif
  586.     endif
  587.  
  588.     ;===================================================
  589.     ;  Netcard Detection logic
  590.     ;
  591.     ;   If this is a detected card, query its parameters
  592.     ;   and merge them into the default list.
  593.     ;
  594.  
  595.     ;  Indicate that there are no old parameter settings.
  596.  
  597.     Set CurrParamSettings = {}
  598.  
  599.     Ifstr(i) $(DetectedCard) != TRUE
  600.         Goto adaptersetup
  601.     Endif
  602.     ;
  603.     ;   Get the detected parameters
  604.     ;
  605.     StartWait
  606.     Debug-Output "Olicom: Calling Param_QueryCard"
  607.     Shell $(ParamInf) Param_QueryCard $(!STF_NCDETCARD)
  608.     EndWait
  609.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  610.         Goto adaptersetup
  611.     Endif
  612.     ;
  613.     ;   Merge the detected values in.
  614.     ;
  615.     Set DetectedParams = $($R1)
  616.     Debug-Output "Olicom: Calling Param_SetDefaults to merge detected params"
  617.     Shell $(ParamInf) Param_SetDefaults $(DetectedParams)
  618.     ;
  619.     ;  End Netcard Detection logic
  620.     ;===================================================
  621.  
  622.     goto adaptersetup
  623.  
  624. ;-----------------------------------------------
  625. ; Configuration Section
  626. ;-----------------------------------------------
  627. ;
  628. ;   Get the current values of all the parameters
  629. ;
  630. configureadapter = +
  631.     Ifstr $(KeyProduct) == $(KeyNull)
  632.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  633.         Ifstr $(KeyProduct) == $(KeyNull)
  634.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  635.             Debug-Output "Cannot find component product key"
  636.             goto fatalregistry
  637.         Endif
  638.     Endif
  639.  
  640.     ;
  641.     ; Get the other parameters;  they're attached to the service parameters key
  642.     ;
  643.     Debug-Output "INF: Shelling to FindService"
  644.     Shell $(UtilityInf) FindService, $(KeyProduct)
  645.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  646.         Debug-Output "INF: FindService shell failure"
  647.         Goto ShellCodeError
  648.     Endif
  649.     Ifstr(i) $($R0) != NO_ERROR
  650.         Debug-Output "INF: FindService Shell error: "$($R0)
  651.         Goto fatalregistry
  652.     endif
  653.  
  654.     Set KeyParameters = $($R2)
  655.  
  656.     ;
  657.     ;  We don't need the services key, so close it.
  658.     ;
  659.     CloseRegKey $($R1)
  660.  
  661.     Ifstr $(KeyParameters) == $(KeyNull)
  662.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  663.         Debug-Output "Cannot find component service"
  664.         goto fatalregistry
  665.     endif
  666.  
  667.     set OldVersionExisted = $(TRUE)
  668.  
  669.     set ValueName = ""
  670.     set ValueData = ""
  671.     set ValueStr  = ""
  672.     set ValueList = {}
  673.  
  674.     ;
  675.     ; Get the old values
  676.     ;
  677.     EnumRegValue $(KeyParameters) ValueList
  678.  
  679.     ForListDo $(ValueList)
  680.         set ValueItem = $($)
  681.         set ValueName = *($(ValueItem),1)
  682.         set ValueData = *($(ValueItem),4)
  683.     ifstr(i) $(ValueName) == "IoBase"
  684.         set IOBaseAddrIndex = $(ValueData)
  685.     else-ifstr(i) $(ValueName) == "BusNumber"
  686.         set BusNoIndex = $(ValueData)
  687.     else-ifstr(i) $(ValueName) == "EarlyTokenRelease"
  688.         set EarlyTokenRelease = $(ValueData)
  689.     else-ifstr(i) $(ValueName) == "FullXmitStatus"
  690.         set FullXmitStatus = $(ValueData)
  691.     else-Ifstr(i) $(ValueName) == "NetworkAddress"
  692.         set NetworkAddress = $(ValueData)
  693.     endif
  694.     EndForListDo
  695.  
  696.     ;  Save the settings as they were read from the Registry.
  697.  
  698.     Shell $(ParamInf) Param_SaveValues
  699.     Set CurrParamSettings = $($R0)
  700. ;
  701. ;   Put up the adapter configuration dialog if necessary.
  702. ;
  703. ;   Note that $(CurrParamSettings) has the old known parameter values.
  704. ;
  705. adaptersetup = +
  706.  
  707.     Shell "" DebugConfiguration "before displaying dialog"
  708.  
  709.     Set from = adapteroptions
  710.  
  711.     set OldNetAddress = $(NetworkAddress)
  712.  
  713.     set IOBaseAddrValue = ""
  714.  
  715. ;
  716. ;   If the card isn't detected during primary installation, we use the 
  717. ;   values from the registry.
  718. ;   
  719.     Ifstr(i) $(!STF_NCDETECT) == YES
  720.         Ifint $(IOBaseRead) == 2592
  721.         set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  722.         endif
  723.         Ifint $(IOBaseRead) == 2596
  724.         set IOBaseAddrValue = *($(IOBaseAddrList), 2)
  725.         endif
  726.         Ifint $(IOBaseRead) == 2640
  727.         set IOBaseAddrValue = *($(IOBaseAddrList), 3)
  728.         endif
  729.         Ifint $(IOBaseRead) == 2644
  730.         set IOBaseAddrValue = *($(IOBaseAddrList), 4)
  731.         endif
  732.         Ifint $(IOBaseRead) == 6688
  733.         set IOBaseAddrValue = *($(IOBaseAddrList), 5)
  734.         endif
  735.         Ifint $(IOBaseRead) == 6692
  736.         set IOBaseAddrValue = *($(IOBaseAddrList), 6)
  737.         endif
  738.         Ifint $(IOBaseRead) == 6736
  739.         set IOBaseAddrValue = *($(IOBaseAddrList), 7)
  740.         endif
  741.         Ifint $(IOBaseRead) == 6740
  742.         set IOBaseAddrValue = *($(IOBaseAddrList), 8)
  743.         endif
  744.     endif
  745.     ifstr(i) $(IOBaseAddrValue) == ""
  746.         set IOBaseAddrValue = *($(IOBaseAddrList), ~($(IOBaseAddrValues),$(IOBaseAddrIndex)))
  747.     endif
  748.     ifstr(i) $(IOBaseAddrValue) == ""
  749.     set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  750.     endif
  751.     set BusNoValue = *($(BusNoList), ~($(BusNoValues),$(BusNoIndex)))
  752.     ifstr(i) $(BusNoValue) == ""
  753.     set BusNoValue = *($(BusNoList), 1)
  754.     endif
  755.     Ifint $(EarlyTokenRelease) == 1
  756.         set Rad1 = 1
  757.     else
  758.         set Rad1 = 2
  759.     endif
  760.     Ifint $(FullXmitStatus) == 1
  761.         set Rad2 = 3
  762.     else
  763.         set Rad2 = 4
  764.     endif
  765.     set RadioIn = {$(Rad1), $(Rad2) }
  766.  
  767.     ;===================================================
  768.     ;  Netcard Detection logic
  769.     ;
  770.     ;   Check that this card's parameters can be
  771.     ;   fully detected.
  772.     ;
  773.     Shell $(ParamInf) Param_ParameterConfidence
  774.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  775.         Debug-Output "Olicom: parameter confidence too low to bypass configuration"
  776.         Goto adapteroptions
  777.     Endif
  778.     ;
  779.     ;   If this is a detected card and we're in EXPRESS mode,
  780.     ;   see if the parameters as they currently exist are
  781.     ;   verifiably correct.
  782.     ;
  783.     Ifstr(i) $(DetectedCard) == TRUE
  784.         Ifstr(i) $(!STF_INSTALL_MODE) != CUSTOM
  785.             Goto adapterverify
  786.         Endif
  787.     Endif
  788.     ;
  789.     ;  End Netcard Detection logic
  790.     ;===================================================
  791.  
  792. adapteroptions = +
  793.  
  794.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  795.  
  796.     LoadLibrary "OC-3804 Driver Disk" $(DialogDllName) DialogHandle
  797.     ui start "InputDlg"  $(DialogHandle)
  798.  
  799.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  800.     set IOBaseAddrIndex = $(Combo1Out)
  801.     set BusNoIndex = $(Combo2Out)
  802.         IfContains "1" IN $(RadioOut)
  803.             set EarlyTokenRelease = 1
  804.         else-IfContains "2" IN $(RadioOut)
  805.             set EarlyTokenRelease = 0
  806.         endif
  807.         IfContains "3" IN $(RadioOut)
  808.             set FullXmitStatus = 1
  809.         else-IfContains "4" IN $(RadioOut)
  810.             set FullXmitStatus = 0
  811.         endif
  812.         set NetworkAddress = *($(EditTextOut),1)
  813.         ui pop 1
  814.     else-ifstr(i) $(DLGEVENT) == "BACK"
  815.         set CommonStatus = STATUS_USERCANCEL
  816.         Debug-Output "Action: exit. Bye."
  817.         ui pop 1
  818.     FreeLibrary $(DialogHandle)
  819.         goto end
  820.     else
  821.         Debug-Output "Action: unknown. Bye."
  822.         ui pop 1
  823.     FreeLibrary $(DialogHandle)
  824.         goto end
  825.     endif
  826.  
  827. adapterverify = +
  828.  
  829.     ifstr $(NetworkAddress) != ""
  830.     set FLibraryErrCtl = 1
  831.     LibraryProcedure DlgResult $(DialogHandle) VerifyAddress $(NetworkAddress)
  832.     set FLibraryErrCtl = 0
  833.     ifstr $(DlgResult) != "STATUS_SUCCESS"
  834.         FreeLibrary $(DialogHandle)
  835.         set Error = $(DlgResult)
  836.         goto nonfatal
  837.     endif
  838.     endif
  839.  
  840.     Shell "" DebugConfiguration "after running dialog"
  841.  
  842.     ;===================================================
  843.     ;  Netcard Detection logic
  844.     ;
  845.     ;   If this is a detected card, attempt to validate the options
  846.     ;   If just a normal card, try to claim the resources which have
  847.     ;     changed.
  848.     ;
  849.     Ifstr(i) $(DetectedCard) != TRUE
  850.  
  851.         ;  Build the current parameter list.  If this is an installation,
  852.         ;  (indicated by the fact that the current settings list is empty)
  853.         ;  claim all the parameters; otherwise, just claim those which
  854.         ;  have changed.
  855.  
  856.         Shell $(ParamInf) Param_SaveValues
  857.         Set NewParamSettings = $($R0)
  858.         Ifstr(i) $(CurrParamSettings) == {}
  859.             Set DiffParamSettings = $(NewParamSettings)
  860.         Else
  861.             Shell $(ParamInf) Param_DiffValues $(CurrParamSettings)
  862.             Set DiffParamSettings = $($R0)
  863.         Endif
  864.  
  865.         Debug-Output "Olicom: Calling Param_VerifyResources"
  866.         Shell $(ParamInf) Param_VerifyResources $(DiffParamSettings)
  867.         Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  868.             Debug-Output "Olicom: Param_VerifyResources succeeded"
  869.             Goto skipoptions
  870.         Endif
  871.     Else
  872.         Set CardVerifyIndex = $(!STF_NCDETCARD)
  873.         Debug-Output "Olicom: Calling Param_VerifyCard"
  874.         Shell $(ParamInf) Param_VerifyCard $(!STF_NCDETCARD)
  875.         Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  876.             Debug-Output "Olicom: Param_VerifyCard succeeded"
  877.             Goto skipoptions
  878.         Endif
  879.     Endif
  880.     ;
  881.     ;   Give the user a chance to retry or force the options given.
  882.     ;
  883.     Set from = adapteroptions
  884.     Set to = skipoptions
  885.     Shell $(UtilityInf),RegistryErrorString,VERIFY_WARNING
  886.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  887.         Debug-Output "ShellCode error: cannot get an error string."
  888.         goto ShellCodeError
  889.     endif
  890.     set Error = $($R0)
  891.     Goto Warning
  892.     ;
  893.     ;  End Netcard Detection logic
  894.     ;===================================================
  895.  
  896. ;
  897. ;   If installing, go create the necessary keys;
  898. ;   if configuring, they're already open.
  899. ;
  900. skipoptions =+
  901.  
  902.     ifint $(OldVersionExisted) == $(TRUE)
  903.         ifstr(i) $(!NTN_InstallMode) == configure
  904.             goto writeparameters
  905.         endif
  906.     endif
  907.     StartWait
  908.     ;
  909.     ; Add Software Component
  910.     ;
  911.     ifint $(OldVersionExisted) == $(FALSE)
  912.         ifstr(i) $(!NTN_InstallMode) == "install"
  913.            Ifstr(i) $(DoCopy) == "YES"
  914.  
  915.               Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  916.  
  917.               Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  918.                   Goto ShellCodeError
  919.               Else-Ifstr(i) $($R0) == STATUS_FAILED
  920.                   Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  921.                   ifint $($ShellCode) != $(!SHELL_CODE_OK)
  922.                       goto ShellCodeError
  923.                   endif
  924.                   set Error = $($R0)
  925.                   Goto fatal
  926.               Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  927.                   Goto successful
  928.               Endif
  929.  
  930.               Set SrcDir = $($R1)
  931.  
  932.            Endif
  933.  
  934.            install "Install-Option"
  935.            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  936.               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  937.               ifint $($ShellCode) != $(!SHELL_CODE_OK)
  938.                   goto ShellCodeError
  939.               endif
  940.               set Error = $($R0)
  941.               goto fatal
  942.            endif
  943.         endif
  944.  
  945.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  946.             $(ProductSoftwareName), +
  947.             $(ProductSoftwareName), +
  948.             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  949.             $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  950.             $(NetEventDLL)
  951.  
  952.         Set OEM_ABANDON_SOFTWARE = TRUE
  953.  
  954.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  955.             Debug-Output "ShellCode error"
  956.             goto ShellCodeError
  957.         endif
  958.         ;
  959.         ;   At this point:
  960.         ;     $R1 contains the product version key handle;
  961.         ;     $R2 contains the NetRules subkey handle;
  962.         ;     $R3 contains the new Services key handle; and
  963.         ;     $R4 contains the Parameters key
  964.         ;     $R5 contains the Linkage Key
  965.         ;
  966.         set RegistryErrorIndex = $($R0)
  967.         set KeyProduct      = $($R1)
  968.         Set SoftNetRulesKey = $($R2)
  969.         CloseRegKey $($R3)
  970.         CloseRegKey $($R4)
  971.         CloseRegKey $($R5)
  972.  
  973.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  974.             EndWait
  975.             Debug-Output "Registry error: add software components"
  976.             CloseRegKey $(KeyProduct)
  977.             CloseRegKey $(SoftNetRulesKey)
  978.             goto fatalregistry
  979.         endif
  980.  
  981.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  982.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  983.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  984.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  985.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  986.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  987.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  988.  
  989.         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  990.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  991.             Debug-Output "ShellCode error."
  992.             goto ShellCodeError
  993.         endif
  994.  
  995.         set RegistryErrorIndex = $($R0)
  996.  
  997.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  998.             EndWait
  999.             Debug-Output "Registry error: add value list."
  1000.             CloseRegKey $(KeyProduct)
  1001.             CloseRegKey $(SoftNetRulesKey)
  1002.             goto fatalregistry
  1003.         endif
  1004.  
  1005.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  1006.                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  1007.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  1008.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  1009.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  1010.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  1011.  
  1012.         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  1013.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1014.             Debug-Output "ShellCode error."
  1015.             goto ShellCodeError
  1016.         endif
  1017.  
  1018.         set RegistryErrorIndex = $($R0)
  1019.  
  1020.         CloseRegKey $(KeyProduct)
  1021.         CloseRegKey $(SoftNetRulesKey)
  1022.  
  1023.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1024.             EndWait
  1025.             Debug-Output "Resgitry error: add value list."
  1026.             goto fatalregistry
  1027.         endif
  1028.     endif
  1029. ;
  1030. ;   Create the HARDWARE\Netcard region and its corresponding service
  1031. ;
  1032.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  1033.  
  1034.     ifint $($R4) != -1
  1035.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  1036.     endif
  1037.  
  1038.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1039.         Debug-Output "Cannot add hardware component"
  1040.         goto ShellCodeError
  1041.     endif
  1042.  
  1043.     set RegistryErrorIndex = $($R0)
  1044.  
  1045.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1046.         EndWait
  1047.         Debug-Output "Registry error: add hardware component"
  1048.         CloseRegKey $($R1)
  1049.         CloseRegKey $($R2)
  1050.         CloseRegKey $($R3)
  1051.         goto fatalregistry
  1052.     endif
  1053.  
  1054. ;
  1055. ;   At this point:
  1056. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  1057. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  1058. ;     $R3  Registry key handle for <service>\Parameters key
  1059. ;     $R4  Adapter number assigned to adapter
  1060. ;     $R5  Service name generated by combining svc name with adapter number
  1061. ;
  1062.     set KeyParameters = $($R3)
  1063.     set KeyAdapterRules = $($R2)
  1064.     set AdapterNumber = $($R4)
  1065.  
  1066.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  1067.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  1068.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  1069.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  1070.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  1071.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  1072.  
  1073.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  1074.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1075.         Debug-Output "ShellCode error"
  1076.         goto ShellCodeError
  1077.     endif
  1078.  
  1079.     CloseRegKey $($R1)
  1080.  
  1081.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  1082.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  1083.  
  1084.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  1085.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  1086.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  1087.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  1088.  
  1089.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  1090.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1091.         Debug-Output "ShellCode error."
  1092.         goto ShellCodeError
  1093.     endif
  1094.  
  1095.     set RegistryErrorIndex = $($R0)
  1096.  
  1097.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1098.         EndWait
  1099.         Debug-Output "Resgitry error: add value list."
  1100.         CloseRegKey $(KeyParameters)
  1101.         CloseRegKey $(KeyAdapterRules)
  1102.         goto fatalregistry
  1103.     endif
  1104.  
  1105.     CloseRegKey $(KeyAdapterRules)
  1106.  
  1107.     goto writeparameters
  1108. ;
  1109. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  1110. ;
  1111. writeparameters = +
  1112.     Shell $(UtilityInf), GetBusTypeNum
  1113.     set BusTypeNum = $($R1)
  1114.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1115.         Debug-Output "ShellCode error."
  1116.         goto ShellCodeError
  1117.     endif
  1118. ;
  1119. ;   Add the rest of the parameters to the Services area
  1120. ;
  1121.     set IOBaseAddrValue = *($(IOBaseAddrValues), ~($(IOBaseAddrList),$(IOBaseAddrIndex)))
  1122.     set BusNoValue = *($(BusNoValues), ~($(BusNoList),$(BusNoIndex)))
  1123.     Set NewValueList = {{IoBase,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+
  1124.             {MediaType,$(NoTitle),$(!REG_VT_DWORD),2},+
  1125.                         {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  1126.             {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNoValue)},+
  1127.             {EarlyTokenRelease,$(NoTitle),$(!REG_VT_DWORD),$(EarlyTokenRelease)},+
  1128.             {FullXmitStatus,$(NoTitle),$(!REG_VT_DWORD),$(FullXmitStatus)}}
  1129.     ifstr $(NetworkAddress) != ""
  1130.        set NewValueList = >($(NewValueList),{NetworkAddress,$(NoTitle),$(!REG_VT_SZ),$(NetworkAddress)})
  1131.     endif
  1132.  
  1133.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  1134.  
  1135.     ifstr $(OldNetAddress) != ""
  1136.        ifstr $(NetworkAddress) == ""
  1137.           DeleteRegValue $(KeyParameters) NetworkAddress
  1138.        endif
  1139.     endif
  1140.  
  1141.     CloseRegKey $(KeyParameters)
  1142.  
  1143.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1144.         Debug-Output "ShellCode error."
  1145.         goto ShellCodeError
  1146.     endif
  1147.  
  1148.     set RegistryErrorIndex = $($R0)
  1149.  
  1150.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1151.         Debug-Output "Registry error: Add value list"
  1152.         goto fatalregistry
  1153.     endif
  1154.  
  1155.     EndWait
  1156.  
  1157.     goto successful
  1158.  
  1159. ;-----------------------------------------------
  1160. ; Binding section
  1161. ;-----------------------------------------------
  1162. bindingadapter =+
  1163.     set Error = "Binding: Sorry, not yet implemented."
  1164.     goto fatal
  1165.  
  1166. ;-----------------------------------------------
  1167. ; Removeadapter section
  1168. ;-----------------------------------------------
  1169.  
  1170. removeadapter = +
  1171.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1172.         ; Remove Software Component
  1173.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1174.             $(ProductSoftwareName)
  1175.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1176.             Debug-Output "ShellCode error"
  1177.             goto ShellCodeError
  1178.         endif
  1179.  
  1180.         set RegistryErrorIndex = $($R0)
  1181.  
  1182.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1183.             goto fatalregistry
  1184.         endif
  1185.     else
  1186.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1187.             $(ProductSoftwareName), $(!NTN_RegBase)
  1188.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1189.             Debug-Output "ShellCode error"
  1190.             goto ShellCodeError
  1191.         endif
  1192.  
  1193.         set RegistryErrorIndex = $($R0)
  1194.  
  1195.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1196.             goto fatalregistry
  1197.         endif
  1198.     endif
  1199.  
  1200.     goto end
  1201.  
  1202. ;-----------------------------------------------
  1203. ; Upgrade Software section
  1204. ;-----------------------------------------------
  1205.  
  1206. UpgradeSoftware = +
  1207.     ;
  1208.     ; First determine whether we want to do upgrade or update for software
  1209.     ; or hardware component. Then we will determine whether the Mode is
  1210.     ; update or upgrade.
  1211.     ;
  1212.     ; If the same version of the product existed in the registry, we do
  1213.     ; update. Otherwise, we will do a upgrade
  1214.     ;
  1215.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1216.         ; Upgrade software component
  1217.         ;
  1218.         ; see whether the same version exist or not
  1219.         ;
  1220.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  1221.  
  1222.         Ifstr $(KeyProduct) != $(KeyNull)
  1223.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  1224.             set Version = *($(VersionInfo), 4)
  1225.  
  1226.             ;
  1227.             ; Update the binaries
  1228.             ;
  1229.             Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  1230.  
  1231.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1232.                 Debug-Output "ShellCode error"
  1233.                 goto ShellCodeError
  1234.             endif
  1235.  
  1236.             set !UG_Filename = $($R0)
  1237.  
  1238.             ifstr(i) $(!UG_Filename) != ""
  1239.                 install "Install-Update"
  1240.                 ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1241.                     goto fatal
  1242.                 endif
  1243.             endif
  1244.  
  1245.             ; Upgrade the version number
  1246.             ;
  1247.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  1248.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  1249.  
  1250.             ;
  1251.             ; do nothing for update
  1252.             ;
  1253.             ifint $(Version) != $(ProductVersion)
  1254.                ;
  1255.                ; If the major version number is not the same,
  1256.                ; it is major upgrade. So let Upgrade the product
  1257.                ;
  1258.                ;
  1259.                ; make other upgrade change if necessary
  1260.                ;
  1261.             endif
  1262.             CloseRegKey $(KeyProduct)
  1263.         else
  1264.             ;
  1265.             ; Cannot Open software key, goto ERROR
  1266.             ;
  1267.             goto fatalregistry
  1268.         endif
  1269.     else
  1270.         ;
  1271.         ; upgrade/update hardware component
  1272.         ; There is no different between upgrade and update for hardware
  1273.         ; component
  1274.         ;
  1275.         ; 1. Get the Service Name
  1276.         ; 2. Change the NetRule section if necessary
  1277.         ;
  1278.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  1279.               $(MAXIMUM_ALLOWED) NetworkCardKey
  1280.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1281.             ;
  1282.             ; Get Service name
  1283.             ;
  1284.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1285.             set ServiceName = *($(ServiceNameInfo), 4)
  1286.  
  1287.             ;
  1288.             ; Change the NetRule if necessary
  1289.             ;
  1290.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  1291.                 $(MAXIMUM_ALLOWED) NetRuleKey
  1292.             Ifstr(i) $(NetRuleKey) != $(KeyNull)
  1293.                 ;
  1294.                 ; Make the change....
  1295.                 ;
  1296.             else
  1297.                 ;
  1298.                 ; Error, cannot open net rules key
  1299.                 ;
  1300.                 goto fatalregistry
  1301.             endif
  1302.  
  1303.             CloseRegKey $(NetRules)
  1304.             CloseRegKey $(NetworkCardKey)
  1305.         else
  1306.             ;
  1307.             ; Error, cannot open network card key
  1308.             ;
  1309.             goto fatalregistry
  1310.         endif
  1311.         ;
  1312.         ; 3. Change the service section of the hardware. i.e.,
  1313.         ;    ParameterName change, value change, etc.
  1314.         ;
  1315.         OpenRegKey $(!REG_H_LOCAL) "" +
  1316.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  1317.               $(MAXIMUM_ALLOWED) ServiceKey
  1318.  
  1319.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  1320.             ;
  1321.             ; Get the ServiceKey to change the Start value
  1322.             ; or Type value. Or open Parameters key to
  1323.             ; change the hardware parameters if necessary.
  1324.             ;
  1325.             CloseRegKey $(ServiceKey)
  1326.         else
  1327.             ;
  1328.             ; Error, cannot open network card key
  1329.             ;
  1330.             goto fatalregistry
  1331.         endif
  1332.     endif
  1333.  
  1334.     goto end
  1335.     ;
  1336.     ; End of Upgrade Software
  1337.     ;
  1338.  
  1339. ;
  1340. ;  Escape hatches
  1341. ;
  1342. successful = +
  1343.     goto end
  1344.  
  1345. abandon = +
  1346.     ForListDo $(OEM_ABANDON_OPTIONS)
  1347.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1348.             $(ProductSoftwareName), $($)
  1349.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1350.             Debug-Output "ShellCode error"
  1351.             goto ShellCodeError
  1352.         endif
  1353.  
  1354.         set RegistryErrorIndex = $($R0)
  1355.  
  1356.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1357.             goto fatalregistry
  1358.         endif
  1359.     EndForListDo
  1360.  
  1361.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1362.         ; Remove Software Component
  1363.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1364.             $(ProductSoftwareName), FALSE
  1365.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1366.             Debug-Output "ShellCode error"
  1367.             goto ShellCodeError
  1368.         endif
  1369.  
  1370.         set RegistryErrorIndex = $($R0)
  1371.  
  1372.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1373.             goto fatalregistry
  1374.         endif
  1375.     endif
  1376.  
  1377.     goto end
  1378.  
  1379. ;
  1380. ; warning display
  1381. ;
  1382. warning = +
  1383.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1384.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1385.         goto ShellCodeError
  1386.     endif
  1387.     ifstr(i) $($R1) == "OK"
  1388.         goto $(to)
  1389.     else-ifstr(i) $($R1) == "CANCEL"
  1390.         goto $(from)
  1391.     else
  1392.         goto "end"
  1393.     endif
  1394. ;
  1395. ; non fatal error display
  1396. ;
  1397. nonfatalinfo = +
  1398.     Set Severity = STATUS
  1399.     Set CommonStatus = STATUS_USERCANCEL
  1400.     goto nonfatalmsg
  1401. nonfatal = +
  1402.     Set Severity = NONFATAL
  1403.     goto nonfatalmsg
  1404. nonfatalmsg = +
  1405.     ifstr(i) $(Error) == ""
  1406.         Set Severity = NONFATAL
  1407.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1408.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1409.             goto ShellCodeError
  1410.         endif
  1411.         set Error = $($R0)
  1412.     endif
  1413.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1414.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1415.         goto ShellCodeError
  1416.     endif
  1417.     ifstr(i) $($R1) == "OK"
  1418.         goto $(from)
  1419.     else
  1420.         goto "end"
  1421.     endif
  1422.  
  1423. ;
  1424. ;  Registry is broken
  1425. ;
  1426. fatalregistry = +
  1427.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1428.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1429.         goto ShellCodeError
  1430.     endif
  1431.     set Error = $($R0)
  1432.     goto fatal
  1433. ;
  1434. ;  Netcard detection failure
  1435. ;
  1436. fataldetect = +
  1437.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1438.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1439.         Debug-Output "ShellCode error: cannot get an error string."
  1440.         goto ShellCodeError
  1441.     endif
  1442.     set Error = $($R0)
  1443.     Goto fatal
  1444. ;
  1445. ; fatal error display
  1446. ;
  1447. fatal = +
  1448.     ifstr(i) $(Error) == ""
  1449.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1450.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1451.             goto ShellCodeError
  1452.         endif
  1453.         set Error = $($R0)
  1454.     endif
  1455.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1456.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1457.         goto ShellCodeError
  1458.     endif
  1459.  
  1460.     goto setfailed
  1461.  
  1462. ;
  1463. ;  Shelling error
  1464. ;
  1465. ShellCodeError = +
  1466.     set DlgType      = "MessageBox"
  1467.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1468.     set STF_MB_TEXT  = $(ShellCodeErrorText)
  1469.     set STF_MB_TYPE  = 1
  1470.     set STF_MB_ICON  = 3
  1471.     set STF_MB_DEF   = 1
  1472.     ui start "Error Message"
  1473.     goto setfailed
  1474.  
  1475. setfailed = +
  1476.     set CommonStatus = STATUS_FAILED
  1477.     ;
  1478.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1479.     ;
  1480.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1481.         set OEM_ABANDON_ON = FALSE
  1482.         goto abandon
  1483.     endif
  1484.     goto end
  1485.  
  1486. end = +
  1487.     goto term
  1488.  
  1489. term = +
  1490.  
  1491.     Return $(CommonStatus)
  1492.  
  1493. [DebugConfiguration]
  1494.  
  1495.     Set InfName = "Olicom"
  1496.     Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  1497.     Debug-Output $(InfName)" IRQ_Level is "$(!p:IRQ_Level)
  1498.     Debug-Output $(InfName)" IOBaseRead is "$(!p:IOBaseRead)
  1499.  
  1500.     return
  1501.  
  1502. [PrepareDetectionDll]
  1503.     Set NewDllName = $($0)
  1504.     Set Status = STATUS_FAILED
  1505.     read-syms GeneralConstants
  1506.     Set DllValueName = "NetcardDlls"
  1507.     OpenRegKey $(!REG_H_LOCAL) "" "System\Setup" $(MAXIMUM_ALLOWED) KeySetup
  1508.     Ifstr(i) $(KeySetup) == $(KeyNull)
  1509.         Debug-Output "Olicom: cant open System\Setup key"
  1510.         Goto PDD_Return
  1511.     Endif
  1512.     Set DllFound = 0
  1513.     GetRegValue $(KeySetup) $(DllValueName) DllNamesValue
  1514.     Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1515.         Debug-Output "Olicom: cant query NetcardDLLs value"
  1516.         Goto PDD_Return
  1517.     Endif
  1518.     Debug-Output "Olicom: DllNamesValue = "$(DllNamesValue)
  1519.     Set DllNames = *($(DllNamesValue),4)
  1520.     Debug-Output "Olicom: DllNames = "$(DllNames)
  1521.     ForListDo $(DllNames)
  1522.         Ifstr(i) $($) == $(NewDllName)
  1523.             Set DllFound = 1
  1524.         Endif
  1525.     EndForListDo
  1526.     Ifint $(DllFound) == 0
  1527.         Set DllNames = >($(DllNames),$(NewDllName))
  1528.         Debug-Output "Olicom: new DllNames = "$(DllNames)
  1529.         Set ValueInfo = {$(DllValueName), $(NoTitle), $(!REG_VT_MULTI_SZ), $(DllNames)}
  1530.         SetRegValue $(KeySetup) $(ValueInfo)
  1531.         Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  1532.             Set Status = STATUS_SUCCESSFUL
  1533.         Endif
  1534.     Else
  1535.         Set Status = STATUS_USERCANCEL
  1536.     Endif
  1537.     CloseRegKey $(KeySetup)
  1538. PDD_Return = +
  1539.     Return $(Status)
  1540.  
  1541. ;***************************************************************
  1542. ;  INSTALL SECTIONS
  1543. ;***************************************************************
  1544. [Install-Option]
  1545.     set STF_VITAL = ""
  1546.  
  1547.     ifstr(i) $(AddCopy) == "YES"
  1548.  
  1549.         ;
  1550.         ; Add the files to the copy list
  1551.         ;
  1552.         ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1553.         ;      the other INF files
  1554.         ;
  1555.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1556.         AddSectionFilesToCopyList Files-Stat $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1557.  
  1558.     endif
  1559.  
  1560.     ifstr(i) $(DoCopy) == "YES"
  1561.  
  1562.        ;
  1563.        ; Copy files in the copy list
  1564.        ;
  1565.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1566.        CopyFilesInCopyList
  1567.  
  1568.     endif
  1569.  
  1570.     Exit
  1571.  
  1572. [Install-Update]
  1573.    set STF_VITAL        = ""
  1574.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1575.    ;set STF_VERSION     = "YES"
  1576.  
  1577.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1578.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1579.    AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1580.    AddSectionFilesToCopyList Files-Stat $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1581.  
  1582.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1583.    CopyFilesInCopyList
  1584.  
  1585.    exit
  1586. [Install-Detection-Dll]
  1587.    set STF_VITAL        = ""
  1588.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1589.    AddSectionFilesToCopyList Files-OLINCDET $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1590.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1591.    CopyFilesInCopyList
  1592.    exit
  1593. [Install-Dll]
  1594.    set STF_VITAL     = ""
  1595.    ifstr(i) $(AddCopy) == "YES"
  1596.       AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1597.    endif
  1598.    ifstr(i) $(DoCopy) == "YES"
  1599.       set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1600.       CopyFilesInCopyList
  1601.    endif
  1602.    exit
  1603. [Source Media Descriptions]
  1604.     1  = "OC-3865 Driver Disk"
  1605.     99    = "LMHOST disk"
  1606. [ProductType]
  1607. STF_PRODUCT  = Winnt
  1608. STF_PLATFORM = I386
  1609. [Files-Inf]
  1610. 1,    oemsetup.inf,    SIZE=999,    RENAME=$(!UG_Filename)
  1611. [Files-OcTk32]
  1612. 1,     octk32.sys,     SIZE=999
  1613. [Files-Dll]
  1614. 1,     octk32.dll,    SIZE=999
  1615. 1,     octk32.hlp,    SIZE=999
  1616. [Files-OLINCDET]
  1617. 1,    olincdet.dll,    SIZE=999
  1618. [Files-Stat]
  1619. 1,     octkstat.exe,     SIZE=999
  1620. [Files-dummy]
  1621.  
  1622.