home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 March / VPR0003B.ISO / drvlibj / netcard / x86 / dlink / de650 / oemsetup.inf < prev    next >
INI File  |  1999-10-14  |  43KB  |  1,480 lines

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