home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 March / VPR0003B.ISO / drvlibj / netcard / nec98 / atkk / lapci / oemsetup.inf < prev    next >
INI File  |  1999-10-14  |  45KB  |  1,691 lines

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