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

  1. ;***********************************************************************
  2. ;
  3. ; OEMSETNT.INF
  4. ;
  5. ;       3COM 3C770 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. ; ISA, EISA and MCA
  37. ;-----------------------------------------------------------------------
  38.  
  39. [PlatformsSupported]
  40.     EISA
  41.     "Jazz-Internal Bus"
  42.  
  43. ;-----------------------------------------------------------------------
  44. ; LANGUAGES SUPPORTED
  45. ; -------------------
  46. ;
  47. ; The languages supported by the OEM INF, For every language supported
  48. ; we need to have a separate text section for every displayable text
  49. ; section.
  50. ;
  51. ;-----------------------------------------------------------------------
  52.  
  53. [LanguagesSupported]
  54.     ENG
  55.  
  56. ;-----------------------------------------------------------------------
  57. ; OPTION LIST
  58. ; -----------
  59. ; This section lists the OEM Option key names.  These keys are locale
  60. ; independent and used to represent the option in a locale independent
  61. ; manner.
  62. ;
  63. ;-----------------------------------------------------------------------
  64.  
  65. [Options]
  66.     flnk
  67.  
  68. ;-----------------------------------------------------------------------
  69. ; OPTION TEXT SECTION
  70. ; -------------------
  71. ; These are text strings used to identify the option to the user.  There
  72. ; are separate sections for each language supported.  The format of the
  73. ; section name is "OptionsText" concatenated with the Language represented
  74. ; by the section.
  75. ;
  76. ;-----------------------------------------------------------------------
  77.  
  78. [OptionsTextENG]
  79.     flnk = "3COM FDDILINK EISA LAN Adapter"
  80.  
  81.  
  82. [Files-Inf]
  83. 1, oemsetnt.inf, SIZE=65535, RENAME=$(!UG_Filename)
  84.  
  85.  
  86. [Files-flnk]
  87. 1, flnk.SYS, SIZE=65535
  88.  
  89. ;***********************************************************************
  90. ; CONSTANTS FOR USING DIALOGS
  91. ;***********************************************************************
  92.  
  93. [FileConstants]
  94. ;
  95. ;  File names, etc.
  96. ;
  97. UtilityInf      = "UTILITY.INF"
  98. subroutineinf   = "SUBROUTN.INF"
  99. SoftwareType    = "driver"
  100. Exit_Code       = 0
  101.  
  102. ;
  103. ; EventLog Message File
  104. ;
  105. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  106. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  107.  
  108. ; Product Info
  109. ;
  110. Manufacturer    =  "3COM"
  111. ProductMajorVersion     = "3"
  112. ProductMinorVersion     = "1"
  113. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  114. ;
  115. ; Software
  116. ;
  117. ProductSoftwareName     = "flnk"
  118. ProductSoftwareTitle    = "3COM FDDILINK LAN Adapter Driver"
  119. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\flnk.sys"
  120. NetRuleSoftwareType     = "flnkSys ndisDriver flnkDriver"
  121. NetRuleSoftwareUse      = $(SoftwareType)
  122. NetRuleSoftwareBindForm = """flnkSys"" yes no container"
  123. NetRuleSoftwareClass    = {"flnkDriver basic"}
  124. NetRuleSoftwareBindable = {"flnkDriver flnkAdapter non exclusive 100"}
  125. ;
  126. ; Hardware
  127. ;
  128. ProductHardwareName     = "flnk"
  129. ProductHardwareTitle    = "3COM FDDILINK Adapter"
  130. NetRuleHardwareType     = "flnk flnkAdapter"
  131. NetRuleHardwareBindForm = " yes yes container"
  132. NetRuleHardwareClass    = {"flnkAdapter basic"}
  133. ;
  134. ;  EISA System ID Info
  135. ;
  136. NETCARD_ID      = 7826768
  137.  
  138. ;
  139. ; Registry Key
  140. ;
  141. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  142. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  143.  
  144. [ProductType]
  145. STF_PRODUCT  = Winnt
  146. STF_PLATFORM = I386
  147.  
  148. [GeneralConstants]
  149. ;
  150. ;  Program flow control variables.
  151. ;
  152. from      = ""
  153. to        = ""
  154. ;
  155. ;  Return codes; Exit_Code is set to one of these
  156. ;
  157. ExitCodeOk     = 0
  158. ExitCodeCancel = 1
  159. ExitCodeFatal  = 2
  160.  
  161. KeyNull         = ""
  162. MAXIMUM_ALLOWED   = 33554432
  163. RegistryErrorIndex = NO_ERROR
  164. KeyProduct      = ""
  165. KeyParameters   = ""
  166.  
  167. TRUE            = 1
  168. FALSE           = 0
  169. NoTitle         = 0
  170.  
  171. ExitState   = "Active"
  172. OldVersionExisted = $(FALSE)
  173.  
  174. DriverPath      = $(!STF_NTPATH)\drivers
  175.  
  176. ;***********************************************************************
  177. ; Language-Dependent Dialog Constants
  178. ;***********************************************************************
  179.  
  180. [FileConstantsENG]
  181. ;
  182. ;  Variables to support thermometer gauge and error dialogs
  183. ;
  184. ProCaption   = "Windows NT Setup"
  185. ProCancel    = "Cancel"
  186. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  187.                "Are you sure you want to cancel copying files?"
  188.  
  189. ProCancelCap = "Network Setup Message"
  190. ProText1     = "Copying:"
  191. ProText2     = "To:"
  192.  
  193.  
  194. ;
  195. ; Product Info
  196. ;
  197. FunctionTitle = "3COM FDDILINK LAN Adapter Setup"
  198. ;
  199. ; Software
  200. ;
  201. ProductSoftwareDescription = "3COM FDDILINK LAN Adapter Driver"
  202. ;
  203. ; Hardware
  204. ;
  205. ProductHardwareDescription = "3COM FDDILINK LAN Adapter"
  206.  
  207. ;
  208. ; Dialog Message Information
  209. ;
  210. CANNOT_FIND_ANY_CARD       = "Network card is not present in the system"
  211.  
  212.  
  213.  
  214. [DialogConstantsENG]
  215. ;
  216. ; Common button names, etc.
  217. ;
  218. Help        = "&Help"
  219. Exit        = "Cancel"
  220. OK          = "OK"
  221. HelpContext = ""
  222. Continue    = "Continue"
  223. Cancel      = "Cancel"
  224.  
  225. [date]
  226.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  227.     ; Minute, Second }
  228.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  229.  
  230. [Source Media Descriptions]
  231.     1  = "3COM FDDILINK Driver Disk"  
  232. ;-----------------------------------------------
  233. ; Input DIALOGS
  234. ;-----------------------------------------------
  235. [FileDependentDlgENG]
  236.  
  237.  
  238.  
  239. ;---------------------------------------------------------------------------
  240. ; 1. Identify
  241. ;
  242. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  243. ;                as we are choosing currently.
  244. ;
  245. ; INPUT:         None
  246. ;
  247. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  248. ;                $($R1): Option Type (COMPUTER ...)
  249. ;                $($R2): Diskette description
  250. ;---------------------------------------------------------------------------
  251.  
  252. [Identify]
  253.     ;
  254.     ;
  255.     read-syms Identification
  256.  
  257.     set !G:DebugOutputControl = 1
  258.  
  259.     set Status     = STATUS_SUCCESSFUL
  260.     set Identifier = $(OptionType)
  261.     set Media      = #("Source Media Descriptions", 1, 1)
  262.  
  263.     Return $(Status) $(Identifier) $(Media)
  264.  
  265. ;------------------------------------------------------------------------
  266. ; 2. ReturnOptions:
  267. ;
  268. ; DESCRIPTION:   To return the option list supported by this INF and the
  269. ;                localised text list representing the options.
  270. ;
  271. ;
  272. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  273. ;
  274. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  275. ;                                STATUS_NOLANGUAGE
  276. ;                                STATUS_FAILED
  277. ;                                STATUS_NOTSUPPORTED
  278. ;
  279. ;                $($R1): Option List
  280. ;                $($R2): Option Text List
  281. ;------------------------------------------------------------------------
  282.  
  283. [ReturnOptions]
  284.     ;
  285.     ;
  286.     set Status        = STATUS_FAILED
  287.     set OptionList     = {}
  288.     set OptionTextList = {}
  289.  
  290.     ;
  291.     ; Check if the language requested is supported
  292.     ;
  293.     set LanguageList = ^(LanguagesSupported, 1)
  294.     Ifcontains(i) $($0) in $(LanguageList)
  295.         ;
  296.         ; Check if the platforms requested is supported
  297.         ;
  298.         ifstr(i) $($1) == ""
  299.             goto returnoptions
  300.         endif
  301.  
  302.         set PlatformList = ^(PlatformsSupported, 1)
  303.         Ifcontains(i) $($1) in $(PlatformList)
  304.             goto returnoptions
  305.         else
  306.             set Status = STATUS_NOTSUPPORTED
  307.             goto finish_ReturnOptions
  308.         endif
  309.     else
  310.         set Status = STATUS_NOLANGUAGE
  311.         goto finish_ReturnOptions
  312.     endif
  313.  
  314.     ;
  315.     ; form a list of all the options and another of the text representing
  316.     ;
  317.  
  318. returnoptions = +
  319.     set OptionList     = ^(Options, 1)
  320.     set OptionTextList = ^(OptionsText$($0), 1)
  321.     set Status         = STATUS_SUCCESSFUL
  322.  
  323. finish_ReturnOptions = +
  324.     Return $(Status) $(OptionList) $(OptionTextList)
  325.  
  326. ;------------------------------------------------------------------------
  327. ;
  328. ; InstallOption:
  329. ;
  330. ;      This section is shelled to by main installation processing
  331. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  332. ;
  333. ;
  334. ; FUNCTION:  To copy files representing Options
  335. ;            To configure the installed option
  336. ;            To update the registry for the installed option
  337. ;
  338. ; INPUT:     $($0):  Language to use
  339. ;            $($1):  OptionID to install
  340. ;            $($2):  SourceDirectory
  341. ;            $($3):  AddCopy  (YES | NO)
  342. ;            $($4):  DoCopy   (YES | NO)
  343. ;            $($5):  DoConfig (YES | NO)
  344. ;
  345. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  346. ;                            STATUS_NOLANGUAGE |
  347. ;                            STATUS_USERCANCEL |
  348. ;                            STATUS_FAILED
  349. ;
  350. ;------------------------------------------------------------------------
  351. [InstallOption]
  352.  
  353.     set !G:DebugOutputControl = 1
  354.     ;
  355.     ; Set default values for
  356.     ;
  357.     Debug-Output "At InstallOption"
  358.     set Status   = STATUS_FAILED
  359.     ;
  360.     ; extract parameters
  361.     ;
  362.     set Option   = $($1)
  363.     set SrcDir   = $($2)
  364.     set AddCopy  = $($3)
  365.     set DoCopy   = $($4)
  366.     set DoConfig = $($5)
  367.  
  368.     ;
  369.     ; Check if the language requested is supported
  370.     ;
  371.     set LanguageList = ^(LanguagesSupported, 1)
  372.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  373.         Return STATUS_NOLANGUAGE
  374.     endif
  375.  
  376.     set-subst LF = "\n"
  377.  
  378.     read-syms GeneralConstants
  379.     read-syms FileConstants
  380.  
  381.     read-syms DialogConstants$(!STF_LANGUAGE)
  382.     ifstr(i) $(!NTN_Origination) == "NCPA"
  383.         set Continue = "OK"
  384.     endif
  385.     read-syms FileConstants$(!STF_LANGUAGE)
  386.  
  387.     detect date
  388.  
  389.     set-title  $(FunctionTitle)
  390.  
  391.     set to   = Begin
  392.     set from = Begin
  393. ;
  394. ;  Assume all is well.
  395. ;
  396.     set CommonStatus = STATUS_SUCCESSFUL
  397.  
  398.     EndWait
  399.  
  400. ;
  401. ;   Set up the operation-mode-based variables and welcome
  402. ;   the user.  If the "install mode" variable is improperly set,
  403. ;   assume this is a new installation.
  404. ;
  405.  
  406. Begin = +
  407.     Debug-Output "At Begin"
  408.  
  409.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  410.         set StartLabel = removeadapter
  411.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  412.         set StartLabel = UpgradeSoftware
  413.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  414.         set StartLabel = bindingadapter
  415.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  416.         set StartLabel = configureadapter
  417.         ;
  418.         ;   You cannot config the software component
  419.         ;
  420.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  421.             Debug-Output "Cannot configure the LAN596 driver software."
  422.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  423.         else
  424.             Debug-Output "Cannot configure the LAN596 driver software."
  425.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  426.         endif
  427.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  428.             Debug-Output "ShellCode error: cannot get an error string."
  429.             goto ShellCodeError
  430.         endif
  431.         set Error = $($R0)
  432.         set from = end
  433.         set to = end
  434.         goto nonfatalinfo
  435. ;        endif
  436.     else
  437.         set StartLabel = installadapter
  438.         set OEM_ABANDON_OPTIONS = {}
  439.         set OEM_ABANDON_SOFTWARE = FALSE
  440.         set OEM_ABANDON_ON = TRUE
  441.     endif
  442.  
  443.     Set from = $(fatal)
  444.     Set to = $(fatal)
  445.     Goto $(StartLabel)
  446.  
  447. ;-----------------------------------------------
  448. ; Installation Section
  449. ;-----------------------------------------------
  450.  
  451. installadapter = +
  452.     Debug-Output "At installadapter"
  453. ;
  454. ;   First, check whether the same version of the software exists
  455. ;
  456.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  457.  
  458.     Ifstr $(KeyProduct) != $(KeyNull)
  459.         ;
  460.         ; Same version already existed in the local machine
  461.         ; Popup the dialog and ask the user whether he wants to continue
  462.         ;
  463.         CloseRegKey $(KeyProduct)
  464.  
  465.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  466.            ;
  467.            ; Cannot Install the same software again
  468.            ;
  469.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  470.                $(ProductVersion)
  471.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  472.                Debug-Output "ShellCode error: cannot get an error string."
  473.                goto ShellCodeError
  474.            endif
  475.  
  476.            goto end
  477.         else
  478.            ;
  479.            ; Add a new adapter card?
  480.            ;
  481.            set OldVersionExisted = $(TRUE)
  482.         endif
  483.     endif
  484.  
  485.  
  486.     goto adapterverify
  487.  
  488. ;-----------------------------------------------
  489. ; Configuration Section
  490. ;-----------------------------------------------
  491. ;
  492. ;   Get the current values of all the parameters
  493. ;
  494. configureadapter = +
  495.     Debug-Output "At configureadapter"
  496.  
  497.     set Error = "Configure: Sorry, not yet implemented."
  498.     goto fatal
  499.  
  500.  
  501.     
  502. adapterverify = +
  503.  
  504.     Debug-Output "At adapterverify"
  505.  
  506.     StartWait
  507.     Debug-Output $(NETCARD_ID)
  508.     Shell $(UtilityInf), EISAFindBus, $(NETCARD_ID)
  509.     ifstr(i) $($R1) != {}
  510.         Debug-Output "EISA Controller NETCARD_ID found!"
  511.         goto CardFound
  512.     endif
  513.     Debug-Output "EISA Controller Search failed!"
  514.     
  515.     set DlgType      = "MessageBox"
  516.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  517.     set STF_MB_TEXT  = "No Adapters Detected"
  518.     set STF_MB_TYPE  = 1
  519.     set STF_MB_ICON  = 3
  520.     set STF_MB_DEF   = 1
  521.     ui start "Error Message"
  522.     goto setfailed
  523.  
  524. CardFound =  +
  525.     ifstr $($R0) != "NO_ERROR"
  526.         set Error = $($R0)
  527.         goto fatal
  528.     endif
  529.     ifstr(i) $($R1) == {}
  530.         set Error = $(CANNOT_FIND_ANY_CARD)
  531.         set CommonStatus = STATUS_USERCANCEL
  532.         set from = end
  533.         goto nonfatal
  534.     endif
  535.     set AdapterList = $($R1)
  536.     ;
  537.     ; Add Software Component
  538.     ;
  539.     ifint $(OldVersionExisted) == $(FALSE)
  540.         ifstr(i) $(!NTN_InstallMode) == "install"
  541.            Ifstr(i) $(DoCopy) == "YES"
  542.  
  543.               Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  544.  
  545.               Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  546.                   Goto ShellCodeError
  547.               Else-Ifstr(i) $($R0) == STATUS_FAILED
  548.                   Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  549.                   ifint $($ShellCode) != $(!SHELL_CODE_OK)
  550.                       goto ShellCodeError
  551.                   endif
  552.                   set Error = $($R0)
  553.                   Goto fatal
  554.               Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  555.                   Goto successful
  556.               Endif
  557.  
  558.               Set SrcDir = $($R1)
  559.  
  560.            Endif
  561.  
  562.            Debug-Output "At install Install-Option"
  563.         
  564.            install "Install-Option"
  565.            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  566.               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  567.               ifint $($ShellCode) != $(!SHELL_CODE_OK)
  568.                   goto ShellCodeError
  569.               endif
  570.               set Error = $($R0)
  571.               goto fatal
  572.            endif
  573.         endif
  574.  
  575.         Debug-Output "At AddSoftwareComponent"
  576.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  577.             $(ProductSoftwareName), +
  578.             $(ProductSoftwareName), +
  579.             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  580.             $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  581.             $(NetEventDLL)
  582.  
  583.         Set OEM_ABANDON_SOFTWARE = TRUE
  584.  
  585.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  586.             Debug-Output "ShellCode error"
  587.             goto ShellCodeError
  588.         endif
  589.         ;
  590.         ;   At this point:
  591.         ;     $R1 contains the product version key handle;
  592.         ;     $R2 contains the NetRules subkey handle;
  593.         ;     $R3 contains the new Services key handle; and
  594.         ;     $R4 contains the Parameters key
  595.         ;     $R5 contains the Linkage Key
  596.         ;
  597.         set RegistryErrorIndex = $($R0)
  598.         set KeyProduct      = $($R1)
  599.         Set SoftNetRulesKey = $($R2)
  600.         CloseRegKey $($R3)
  601.         CloseRegKey $($R4)
  602.         CloseRegKey $($R5)
  603.  
  604.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  605.             EndWait
  606.             Debug-Output "Registry error: add software components"
  607.             CloseRegKey $(KeyProduct)
  608.             CloseRegKey $(SoftNetRulesKey)
  609.             goto fatalregistry
  610.         endif
  611.  
  612.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  613.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  614.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  615.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  616.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  617.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  618.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  619.  
  620.         Debug-Output "At AddValueList - SoftwareType"
  621.         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  622.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  623.             Debug-Output "ShellCode error."
  624.             goto ShellCodeError
  625.         endif
  626.  
  627.         set RegistryErrorIndex = $($R0)
  628.  
  629.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  630.             EndWait
  631.             Debug-Output "Registry error: add value list."
  632.             CloseRegKey $(KeyProduct)
  633.             CloseRegKey $(SoftNetRulesKey)
  634.             goto fatalregistry
  635.         endif
  636.  
  637.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  638.                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  639.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  640.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  641.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  642.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  643.  
  644.         Debug-Output "At AddValueList - bindform"
  645.         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  646.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  647.             Debug-Output "ShellCode error."
  648.             goto ShellCodeError
  649.         endif
  650.  
  651.         set RegistryErrorIndex = $($R0)
  652.  
  653.         CloseRegKey $(KeyProduct)
  654.         CloseRegKey $(SoftNetRulesKey)
  655.  
  656.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  657.             EndWait
  658.             Debug-Output "Resgitry error: add value list."
  659.             goto fatalregistry
  660.         endif
  661.     endif
  662. ;
  663. ;   Create the HARDWARE\Netcard region and its corresponding service
  664. ;
  665.     ForListDo $(AdapterList)
  666.         set BusNum = *($($),1)
  667.         set SlotNum = *($($),2)
  668.         Debug-Output "Adding registry parameters, BusNum $(BusNum) SlotNum $(SlotNum)"
  669.         ifstr $(SlotNum) != "0"
  670.             Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
  671.                 $(SlotNum), $(ProductHardwareDescription), $(ProductHardwareName)
  672.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  673.                 goto ShellCodeError
  674.             endif
  675.             ifstr $($R0) != "NO_ERROR"
  676.                 set Error = $($R0)
  677.                 goto fatal
  678.             endif
  679.             ifstr(i) $($R1) != "YES"
  680.                     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  681.     
  682.                     ifint $($R4) != -1
  683.                         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  684.                     endif
  685.                     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  686.                         goto ShellCodeError
  687.                     endif
  688.     
  689.                     set RegistryErrorIndex = $($R0)
  690.                     Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  691.                         EndWait
  692.                         CloseRegKey $($R1)
  693.                         CloseRegKey $($R2)
  694.                         CloseRegKey $($R3)
  695.                         goto fatalregistry
  696.                     endif
  697.                    ;
  698.                    ;   At this point:
  699.                    ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  700.                    ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  701.                    ;     $R3  Registry key handle for <service>\Parameters key
  702.                    ;     $R4  Adapter number assigned to adapter
  703.                    ;     $R5  Service name generated by combining svc name with adapter number
  704.                    ;
  705.                     Set HardNetCardKey      = $($R1)
  706.                     Set HardNetRuleKey      = $($R2)
  707.                     Set HardParameterKey    = $($R3)
  708.                     set AdapterNumber       = $($R4)
  709.     
  710.                     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  711.                                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  712.                                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  713.                                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  714.                                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  715.                                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  716.     
  717.                     Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  718.                     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  719.                         goto ShellCodeError
  720.                     endif
  721.                     set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
  722.                                        {BusType,$(NoTitle),$(!REG_VT_DWORD),2},+
  723.                                        {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  724.                                        {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)},+
  725.                                        {DualHoming,$(NoTitle),$(!REG_VT_DWORD),0},+
  726.                                        {DebugFlags,$(NoTitle),$(!REG_VT_DWORD),34820},+
  727.                                        {RcvBuffSize,$(NoTitle),$(!REG_VT_DWORD),1024},+
  728.                                        {NumRcvDesc,$(NoTitle),$(!REG_VT_DWORD),128},+
  729.                                        {NumXmitDesc,$(NoTitle),$(!REG_VT_DWORD),128},+
  730.                                        {NumXmitFsiDesc,$(NoTitle),$(!REG_VT_DWORD),1024},+
  731.                                        {RxIndicateLimit,$(NoTitle),$(!REG_VT_DWORD),10},+
  732.                                        {TxCompleteLimit,$(NoTitle),$(!REG_VT_DWORD),10},+
  733.                                        {InterruptsSerialized,$(NoTitle),$(!REG_VT_DWORD),1},+
  734.                                        {treq,$(NoTitle),$(!REG_VT_DWORD),165000},+
  735.                                        {tmax,$(NoTitle),$(!REG_VT_DWORD),167772},+
  736.                                        {tvx,$(NoTitle),$(!REG_VT_DWORD),2611},+
  737.                                        {mode,$(NoTitle),$(!REG_VT_DWORD),0}}
  738.                     Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  739.                     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  740.                         goto ShellCodeError
  741.                     endif
  742.                      set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  743.                      set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  744.                      set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  745.                                          {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  746.                                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  747.                                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)} }
  748.                     Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  749.                     CloseRegKey $(HardNetCardKey)
  750.                     CloseRegKey $(HardNetRuleKey)
  751.                     CloseRegKey $(HardParameterKey)
  752.                     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  753.                         goto ShellCodeError
  754.                     endif
  755.             endif
  756.         endif
  757.     EndForListDo
  758. ;
  759. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  760. ;
  761. writeparameters = +
  762.     Debug-Output "At writeparameters"
  763.     EndWait
  764.     goto successful
  765.  
  766. ;-----------------------------------------------
  767. ; Binding section
  768. ;-----------------------------------------------
  769. bindingadapter =+
  770.     Debug-Output "At bindingadapter"
  771.     set Error = "Binding: Sorry, not yet implemented."
  772.     goto fatal
  773.  
  774. ;-----------------------------------------------
  775. ; Removeadapter section
  776. ;-----------------------------------------------
  777.  
  778. removeadapter = +
  779.     Debug-Output "At removeadapter"
  780.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  781.         ; Remove Software Component
  782.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  783.             $(ProductSoftwareName)
  784.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  785.             Debug-Output "ShellCode error"
  786.             goto ShellCodeError
  787.         endif
  788.  
  789.         set RegistryErrorIndex = $($R0)
  790.  
  791.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  792.             goto fatalregistry
  793.         endif
  794.     else
  795.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  796.             $(ProductSoftwareName), $(!NTN_RegBase)
  797.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  798.             Debug-Output "ShellCode error"
  799.             goto ShellCodeError
  800.         endif
  801.  
  802.         set RegistryErrorIndex = $($R0)
  803.  
  804.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  805.             goto fatalregistry
  806.         endif
  807.     endif
  808.  
  809.     goto end
  810.  
  811. ;-----------------------------------------------
  812. ; Upgrade Software section
  813. ;-----------------------------------------------
  814.  
  815. UpgradeSoftware = +
  816.     Debug-Output "At UpgradeSoftware"
  817.     ;
  818.     ; First determine whether we want to do upgrade or update for software
  819.     ; or hardware component. Then we will determine whether the Mode is
  820.     ; update or upgrade.
  821.     ;
  822.     ; If the same version of the product existed in the registry, we do
  823.     ; update. Otherwise, we will do a upgrade
  824.     ;
  825.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  826.         ; Upgrade software component
  827.         ;
  828.         ; see whether the same version exist or not
  829.         ;
  830.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  831.  
  832.         Ifstr $(KeyProduct) != $(KeyNull)
  833.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  834.             set Version = *($(VersionInfo), 4)
  835.  
  836.             ;
  837.             ; Update the binaries
  838.             ;
  839.             Split-String $(!NTN_Infname), "\", FilenameList
  840.             QueryListSize ListSize $(FilenameList)
  841.             set !UG_Filename = *($(FilenameList), $(ListSize))
  842.  
  843.             install "Install-Update"
  844.             ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  845.                 goto fatal
  846.             endif
  847.  
  848.             ; Upgrade the version number
  849.             ;
  850.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  851.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  852.  
  853.             ;
  854.             ; do nothing for update
  855.             ;
  856.             ifint $(Version) != $(ProductVersion)
  857.                ;
  858.                ; If the major version number is not the same,
  859.                ; it is major upgrade. So let Upgrade the product
  860.                ;
  861.                ;
  862.                ; make other upgrade change if necessary
  863.                ;
  864.             endif
  865.             CloseRegKey $(KeyProduct)
  866.         else
  867.             ;
  868.             ; Cannot Open software key, goto ERROR
  869.             ;
  870.             goto fatalregistry
  871.         endif
  872.     else
  873.         ;
  874.         ; upgrade/update hardware component
  875.         ; There is no different between upgrade and update for hardware
  876.         ; component
  877.         ;
  878.         ; 1. Get the Service Name
  879.         ; 2. Change the NetRule section if necessary
  880.         ;
  881.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  882.               $(MAXIMUM_ALLOWED) NetworkCardKey
  883.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  884.             ;
  885.             ; Get Service name
  886.             ;
  887.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  888.             set ServiceName = *($(ServiceNameInfo), 4)
  889.  
  890.             ;
  891.             ; Change the NetRule if necessary
  892.             ;
  893.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  894.                 $(MAXIMUM_ALLOWED) NetRuleKey
  895.             Ifstr(i) $(NetRuleKey) != $(KeyNull)
  896.                 ;
  897.                 ; Make the change....
  898.                 ;
  899.             else
  900.                 ;
  901.                 ; Error, cannot open net rules key
  902.                 ;
  903.                 goto fatalregistry
  904.             endif
  905.  
  906.             CloseRegKey $(NetRules)
  907.             CloseRegKey $(NetworkCardKey)
  908.         else
  909.             ;
  910.             ; Error, cannot open network card key
  911.             ;
  912.             goto fatalregistry
  913.         endif
  914.         ;
  915.         ; 3. Change the service section of the hardware. i.e.,
  916.         ;    ParameterName change, value change, etc.
  917.         ;
  918.         OpenRegKey $(!REG_H_LOCAL) "" +
  919.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  920.               $(MAXIMUM_ALLOWED) ServiceKey
  921.  
  922.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  923.             ;
  924.             ; Get the ServiceKey to change the Start value
  925.             ; or Type value. Or open Parameters key to
  926.             ; change the hardware parameters if necessary.
  927.             ;
  928.             CloseRegKey $(ServiceKey)
  929.         else
  930.             ;
  931.             ; Error, cannot open network card key
  932.             ;
  933.             goto fatalregistry
  934.         endif
  935.     endif
  936.  
  937.     goto end
  938.     ;
  939.     ; End of Upgrade Software
  940.     ;
  941.  
  942. ;
  943. ;  Escape hatches
  944. ;
  945. successful = +
  946.     Debug-Output "At successful"
  947.     goto end
  948.  
  949. abandon = +
  950.     Debug-Output "At abandon"
  951.     ForListDo $(OEM_ABANDON_OPTIONS)
  952.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  953.             $(ProductSoftwareName), $($)
  954.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  955.             Debug-Output "ShellCode error"
  956.             goto ShellCodeError
  957.         endif
  958.  
  959.         set RegistryErrorIndex = $($R0)
  960.  
  961.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  962.             goto fatalregistry
  963.         endif
  964.     EndForListDo
  965.  
  966.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  967.         ; Remove Software Component
  968.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  969.             $(ProductSoftwareName), FALSE
  970.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  971.             Debug-Output "ShellCode error"
  972.             goto ShellCodeError
  973.         endif
  974.  
  975.         set RegistryErrorIndex = $($R0)
  976.  
  977.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  978.             goto fatalregistry
  979.         endif
  980.     endif
  981.  
  982.     goto end
  983.  
  984. ;
  985. ; warning display
  986. ;
  987. warning = +
  988.     Debug-Output "At warning"
  989.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  990.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  991.         goto ShellCodeError
  992.     endif
  993.     ifstr(i) $($R1) == "OK"
  994.         goto $(to)
  995.     else-ifstr(i) $($R1) == "CANCEL"
  996.         goto $(from)
  997.     else
  998.         goto "end"
  999.     endif
  1000. ;
  1001. ; non fatal error display
  1002. ;
  1003. nonfatalinfo = +
  1004.     Debug-Output "At nonfatalinfo"
  1005.     Set Severity = STATUS
  1006.     Set CommonStatus = STATUS_USERCANCEL
  1007.     goto nonfatalmsg
  1008. nonfatal = +
  1009.     Debug-Output "At nonfatal"
  1010.     Set Severity = NONFATAL
  1011.     goto nonfatalmsg
  1012. nonfatalmsg = +
  1013.     Debug-Output "At nonfatalmsg"
  1014.     ifstr(i) $(Error) == ""
  1015.         Set Severity = NONFATAL
  1016.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1017.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1018.             goto ShellCodeError
  1019.         endif
  1020.         set Error = $($R0)
  1021.     endif
  1022.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1023.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1024.         goto ShellCodeError
  1025.     endif
  1026.     ifstr(i) $($R1) == "OK"
  1027.         goto $(from)
  1028.     else
  1029.         goto "end"
  1030.     endif
  1031.  
  1032. ;
  1033. ;  Registry is broken
  1034. ;
  1035. fatalregistry = +
  1036.     Debug-Output "At fatalregistry"
  1037.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1038.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1039.         goto ShellCodeError
  1040.     endif
  1041.     set Error = $($R0)
  1042.     goto fatal
  1043. ;
  1044. ; fatal error display
  1045. ;
  1046. fatal = +
  1047.     Debug-Output "At fatal"
  1048.     ifstr(i) $(Error) == ""
  1049.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1050.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1051.             goto ShellCodeError
  1052.         endif
  1053.         set Error = $($R0)
  1054.     endif
  1055.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1056.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1057.         goto ShellCodeError
  1058.     endif
  1059.  
  1060.     goto setfailed
  1061.  
  1062. ;
  1063. ;  Shelling error
  1064. ;
  1065. ShellCodeError = +
  1066.     Debug-Output "At ShellCodeError"
  1067.     set DlgType      = "MessageBox"
  1068.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1069.     set STF_MB_TEXT  = "Shell Code Error"
  1070.     set STF_MB_TYPE  = 1
  1071.     set STF_MB_ICON  = 3
  1072.     set STF_MB_DEF   = 1
  1073.     ui start "Error Message"
  1074.     goto setfailed
  1075.  
  1076. setfailed = +
  1077.     Debug-Output "At setfailed"
  1078.     set CommonStatus = STATUS_FAILED
  1079.     ;
  1080.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1081.     ;
  1082.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1083.         set OEM_ABANDON_ON = FALSE
  1084.         goto abandon
  1085.     endif
  1086.     goto end
  1087.  
  1088. end = +
  1089.     Debug-Output "At end"
  1090.     goto term
  1091.  
  1092. term = +
  1093.     Debug-Output "At term"
  1094.     Return $(CommonStatus)
  1095.  
  1096.  
  1097. [DebugConfiguration]
  1098.     return
  1099.  
  1100.  
  1101. ;***************************************************************
  1102. ;  INSTALL SECTIONS
  1103. ;***************************************************************
  1104. [Install-Option]
  1105.     Debug-Output "At Install-Option"
  1106.     set STF_VITAL = ""
  1107.  
  1108.     ifstr(i) $(AddCopy) == "YES"
  1109.  
  1110.         Debug-Output "AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers"
  1111.         
  1112.         ;
  1113.         ; Add the files to the copy list
  1114.         ;
  1115.         ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1116.         ;      the other INF files
  1117.         ;
  1118.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1119.  
  1120.     endif
  1121.  
  1122.     ifstr(i) $(DoCopy) == "YES"
  1123.  
  1124.        Debug-Output "CopyFilesInCopyList"
  1125.        
  1126.        ;
  1127.        ; Copy files in the copy list
  1128.        ;
  1129.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1130.        CopyFilesInCopyList
  1131.  
  1132.     endif
  1133.  
  1134.     Exit
  1135.  
  1136. [Install-Update]
  1137.     Debug-Output "At Install-Update"
  1138.    set STF_VITAL        = ""
  1139.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1140.    ;set STF_VERSION     = "YES"
  1141.  
  1142.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1143.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1144.  
  1145.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1146.    CopyFilesInCopyList
  1147.  
  1148.    exit
  1149.  
  1150.