home *** CD-ROM | disk | FTP | other *** search
/ ftp.sunet.se/pub/OS2/ / 2014.11.ftp.sunet.se_pub_OS2.tar / ftp.sunet.se / pub / OS2 / hobbes / os2 / util / network / ndis / pe2225.exe / NT / OEMSETUP.INF next >
INI File  |  1995-06-01  |  44KB  |  1,413 lines

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