home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 February / VPR9602A.ISO / drvlib / comm / chili / mips / oemsetup.inf < prev   
INI File  |  1995-10-27  |  84KB  |  2,089 lines

  1. ;-----------------------------------------------------------------------
  2. ; OPTION TYPE
  3. ; -----------
  4. ; This identifies the Option type we are dealing with.  The different
  5. ; possible types are:
  6. ;
  7. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  8. ;
  9. ;  Types specific to networking:
  10. ;
  11. ; NetAdapter,        a netcard / adapter combination or just a netcard
  12. ; NetDriver,         just a netcard driver
  13. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  14. ; NetService,        an NT networking service
  15. ; NetWork,           a complete network ensemble.
  16. ; NetProvider        a complete network which supports NT MPR protocol
  17. ;-----------------------------------------------------------------------
  18.  
  19. [Identification]
  20.     OptionType = NetAdapter
  21.  
  22. ;-----------------------------------------------------------------------
  23. ; PlatformsSupported
  24. ; ------------------
  25. ; This identifies the platforms supported by the adapter card.
  26. ; Possible types are:
  27. ;
  28. ; ISA, EISA and MCA
  29. ;-----------------------------------------------------------------------
  30.  
  31. [PlatformsSupported]
  32.     ISA
  33.     EISA
  34.     "Jazz-Internal Bus"
  35.     MCA
  36.  
  37. ;-----------------------------------------------------------------------
  38. ; LANGUAGES SUPPORTED
  39. ; -------------------
  40. ;
  41. ; The languages supported by the OEM INF, For every language supported
  42. ; we need to have a separate text section for every displayable text
  43. ; section.
  44. ;
  45. ;-----------------------------------------------------------------------
  46.  
  47. [LanguagesSupported]
  48.     ENG
  49.  
  50. ;-----------------------------------------------------------------------
  51. ; OPTION LIST
  52. ; -----------
  53. ; This section lists the OEM Option key names.  These keys are locale
  54. ; independent and used to represent the option in a locale independent
  55. ; manner.
  56. ;
  57. ;-----------------------------------------------------------------------
  58.  
  59. [Options]
  60.     ChiliPORTS4i
  61.     ChiliPORTS8i
  62.     ChiliPORTS16i
  63.  
  64. [OptionsMCA]
  65.     ChiliPORTS4m
  66.     ChiliPORTS8m
  67.     ChiliPORTS16m
  68.  
  69.  
  70. [AdapterInfo]
  71. ;                     Title      Hardware    Hardware  Hardware  EISA
  72. ;                                Name        Driver    Type      ID
  73. ;                     --------   --------    --------  --------  ------
  74.     ChiliPORTS4i    = "/4i",       cp4i,      Chili,     1,      {0}
  75.     ChiliPORTS8i    = "/8i",       cp8i,      Chili,     1,      {0}
  76.     ChiliPORTS16i   = "/16i",     cp16i,      Chili,     1,      {0}
  77.     ChiliPORTS8e    = "/8e",       cp8e,      Chili,     2,      {71330060}
  78.  
  79. [AdapterInfoMCA]
  80. ;                     Title    Hardware    Hardware  Hardware  MCA POS         MCA POS     MCA POS
  81. ;                              Name        Driver    Type        ID            Byte 1      Byte 2
  82. ;                     -------- --------    --------  --------  -------         -------     -------
  83.     ChiliPORTS4m    = "MC/4m",   cp4m,     ChiliMC,     3,     {26304},         {127},      {127}
  84.     ChiliPORTS8m    = "MC/8m",   cp8m,     ChiliMC,     3,     {26304},         {127},      {127}
  85.     ChiliPORTS16m   = "MC/16m", cp16m,     ChiliMC,     3,     {26304},         {127},      {127}
  86.  
  87. [FileConstants]
  88. ;
  89. ; Misc. variables
  90. ;
  91.     ExitState   = "Active"
  92.     OldVersionExisted = $(FALSE)
  93.     HdwDriverComponentExists = $(FALSE)
  94.  
  95.     DriverPath      = $(!STF_NTPATH)"\drivers"
  96.  
  97. ;
  98. ;  File names, etc.
  99. ;
  100.     UtilityInf     = "UTILITY.INF"
  101.     subroutninf    = "SUBROUTN.INF"
  102.     ParamInf        = "NCPARAM.INF"
  103.     HandleNull   = ""
  104.     CHILI_CONFIG_HANDLE = $(HandleNull)
  105.  
  106. ;
  107. ; Adapter information
  108. ;
  109. AdapterList = ^(AdapterInfo$(BusType),0)
  110. AdapterTitleList = ^(AdapterInfo$(BusType), 1)
  111. AdapterHardwareNameList = ^(AdapterInfo$(BusType), 2)
  112. AdapterHardwareDriverList = ^(AdapterInfo$(BusType), 3)
  113. AdapterHardwareTypeList = ^(AdapterInfo$(BusType), 4)
  114. AdapterHardwareAdapterIDList = ^(AdapterInfo$(BusType), 5)
  115. AdapterIDByte1List = ^(AdapterInfo$(BusType), 6)
  116. AdapterIDByte2List = ^(AdapterInfo$(BusType), 7)
  117. AdapterTitle = *($(AdapterTitleList), ~($(AdapterList), $(Option)))
  118. AdapterHardwareName = *($(AdapterHardwareNameList), ~($(AdapterList), $(Option)))
  119. AdapterHardwareDriver = *($(AdapterHardwareDriverList), ~($(AdapterList), $(Option)))
  120. AdapterHardwareType = *($(AdapterHardwareTypeList), ~($(AdapterList), $(Option)))
  121. AdapterHardwareAdapterID = *($(AdapterHardwareAdapterIDList), ~($(AdapterList), $(Option)))
  122. AdapterIDByte1 = *($(AdapterIDByte1List), ~($(AdapterList), $(Option)))
  123. AdapterIDByte2 = *($(AdapterIDByte2List), ~($(AdapterList), $(Option)))
  124. AdapterRule = *($(AdapterHardwareDriverList), ~($(AdapterList), $(Option)))
  125. AdapterServiceName = ""
  126. AdapterName = ""
  127.  
  128. ;
  129. ; EventLog Message File
  130. ;
  131.     NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  132.     IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  133. ;
  134. ; Product Info
  135. ;
  136.     Manufacturer    = "Consensys"
  137.     ProductMajorVersion     = "1"
  138.     ProductMinorVersion     = "0"
  139.     ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  140. ;
  141. ; Software
  142. ;
  143.     SoftwareType    = "driver"
  144.     ProductSoftwareName     = "ChiliPORTS Service"
  145.     ProductSoftwareImagePath = "%SystemRoot%\System32\ChiliSrv.exe"
  146. ;    NetRuleSoftwareType     = "ChiliSrvExe ChiliService ChiliDriver"
  147. ;    NetRuleSoftwareUse      = $(SoftwareType)
  148. ;    NetRuleSoftwareBindForm = """ChiliObsDriver"" yes no container"
  149. ;    NetRuleSoftwareClass    = {"ChiliService basic","ChiliObsDriver basic"}
  150. ;    NetRuleSoftwareHiddenDriver   = 1
  151.  
  152. ;
  153. ;   Hardware Dependent Software
  154. ;
  155.     ProductMajorVersionHdwDriver     = "1"
  156.     ProductMinorVersionHdwDriver     = "0"
  157.     ProductVersionHdwDriver  = $(ProductMajorVersionHdwDriver)"."$(ProductMinorVersionHdwDriver)
  158.  
  159.     SoftwareTypeHdwDriver     = "driver"
  160.     ProductSoftwareNameHdwDriver = $(AdapterHardwareDriver)
  161.     ProductSoftwareImagePathHdwDriver = "%SystemRoot%\System32\drivers\"$(AdapterHardwareDriver)".sys"
  162.  
  163.     NetRuleSoftwareTypeHdwDriver     = $(AdapterHardwareDriver)"sys "$(AdapterHardwareDriver)"Driver"
  164.     NetRuleSoftwareUseHdwDriver      = $(SoftwareTypeHdwDriver)
  165.     NetRuleSoftwareBindFormHdwDriver = """"$(AdapterHardwareDriver)"Driver"" yes no container"
  166.     NetRuleSoftwareClassHdwDriver    = {$(AdapterHardwareDriver)"Driver basic"}
  167.     NetRuleSoftwareHiddenHdwDriver   = 1
  168.  
  169. ;
  170. ; Hardware
  171. ;
  172.     NetRuleHardwareType     = $(AdapterRule)" "$(AdapterRule)"Adapter"
  173.     NetRuleHardwareBindForm = " yes yes container"
  174.     NetRuleHardwareClass    = {$(AdapterHardwareDriver)"Adapter basic"}
  175.     ProductHardwareName     = $(AdapterHardwareDriver)
  176.  
  177.     AdapterParameters = {}
  178.  
  179. ; Registry Key
  180. ;
  181.     ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  182.     ProductKeyNameHdwDriver  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareNameHdwDriver)"\CurrentVersion"
  183.     ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  184.  
  185.  
  186. [GeneralConstants]
  187. ;
  188. ;  Return codes; Exit_Code is set to one of these
  189. ;
  190.     ExitCodeOk     = 0
  191.     ExitCodeCancel = 1
  192.     ExitCodeFatal  = 2
  193.  
  194.     KeyNull         = ""
  195.     MAXIMUM_ALLOWED   = 33554432
  196.     RegistryErrorIndex = NO_ERROR
  197.     KeyProduct      = ""
  198.     KeyParameters   = ""
  199.  
  200.     TRUE         = 1
  201.     FALSE        = 0
  202.     NoTitle      = 0
  203.  
  204.     fRemoveChili = TRUE
  205.  
  206. [DebugOptions]
  207. ;
  208. ;   Debugging variables
  209. ;
  210.     !DebugOutputControl = 1
  211.  
  212. [UiVars]
  213. ;
  214. ;  Program flow control variables.
  215. ;
  216. from      = ""
  217. to        = ""
  218.     !STF_NTDRIVE        = ""
  219.     !STF_NTPATH         = ""
  220.     !STF_WINDOWSPATH    = "" ? $(!LIBHANDLE) GetWindowsNtDir
  221.     !STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  222.     !STF_FLOPPYLIST     = {} ? $(!LIBHANDLE) GetFloppyDriveLetters
  223.     !STF_UNUSEDDRIVES   = {} ? $(!LIBHANDLE) GetUnusedDrives
  224.     !STF_LANGUAGE       = "ENG"
  225.     !STF_DISPLAYDEBUGOUTPUT = 1
  226.     VolumeList      = {} ? $(!LIBHANDLE) GetHardDriveLetters
  227.     VolumeFreeList  = {} ? $(!LIBHANDLE) GetHardDriveFreeSpace
  228.     VolumeFSList    = {} ? $(!LIBHANDLE) GetHardDriveFileSystems
  229.     DestVolume      = ""
  230.     MinHelpID   = 25000
  231.     MaxHelpID   = 25999
  232.  
  233.  
  234. [date]
  235.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  236.     ; Minute, Second }
  237.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  238.  
  239. ;---------------------------------------------------------------------------
  240. ; 1. Identify
  241. ;
  242. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  243. ;                as we are choosing currently.
  244. ;
  245. ; INPUT:         None
  246. ;
  247. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  248. ;                $($R1): Option Type (COMPUTER ...)
  249. ;                $($R2): Diskette description
  250. ;---------------------------------------------------------------------------
  251.  
  252. [Identify]
  253.     read-syms Identification
  254.     set Status     = STATUS_SUCCESSFUL
  255.     set Identifier = $(OptionType)
  256.     set Media      = #("Source Media Descriptions", 1, 1)
  257.     Debug-Output "Identify: Identifier = "$(Identifier)" Media = "$(Media)
  258.     Return $(Status) $(Identifier) $(Media)
  259.  
  260. ;------------------------------------------------------------------------
  261. ; 2. ReturnOptions:
  262. ;
  263. ; DESCRIPTION:   To return the option list supported by this INF and the
  264. ;                localised text list representing the options.
  265. ;
  266. ;
  267. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  268. ;                $($1):  Bus Type
  269. ;
  270. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  271. ;                                STATUS_NOLANGUAGE
  272. ;                                STATUS_FAILED
  273. ;                                STATUS_NOTSUPPORTED
  274. ;
  275. ;                $($R1): Option List
  276. ;                $($R2): Option Text List
  277. ;------------------------------------------------------------------------
  278.  
  279. [ReturnOptions]
  280.     ;
  281.     ;
  282.     set Status        = STATUS_FAILED
  283.     set OptionList     = {}
  284.     set OptionTextList = {}
  285.  
  286.     ;
  287.     ; Check if the language requested is supported
  288.     ;
  289.     set LanguageList = ^(LanguagesSupported, 1)
  290.     Ifcontains(i) $($0) in $(LanguageList)
  291.         ;
  292.         ; Check if the platforms requested is supported
  293.         ;
  294.         ifstr(i) $($1) == ""
  295.             goto returnoptions
  296.         endif
  297.  
  298.         set PlatformList = ^(PlatformsSupported, 1)
  299.         Ifcontains(i) $($1) in $(PlatformList)
  300.             goto returnoptions
  301.         else
  302.             set Status = STATUS_NOTSUPPORTED
  303.             goto finish_ReturnOptions
  304.         endif
  305.     Else
  306.         set Status = STATUS_NOLANGUAGE
  307.         goto finish_ReturnOptions
  308.     Endif
  309.  
  310.     ;
  311.     ; form a list of all the options and another of the text representing
  312.     ;
  313.  
  314. returnoptions = +
  315.     ifstr(i) $($1) == "MCA"
  316.       set OptionList     = ^(OptionsMCA, 1)
  317.       set OptionTextList = ^(OptionsTextMCA$($0), 1)
  318.       set Status         = STATUS_SUCCESSFUL
  319.     else
  320.       set OptionList     = ^(Options, 1)
  321.       set OptionTextList = ^(OptionsText$($0), 1)
  322.       set Status         = STATUS_SUCCESSFUL
  323.     endif
  324. finish_ReturnOptions = +
  325.     Return $(Status) $(OptionList) $(OptionTextList)
  326.  
  327. [Shell Commands]
  328.     set-title "Serial Setup"
  329.     set-subst LF = "\n"
  330.     set Exit_Code = $(ExitCodeOk)
  331.     Debug-Output "OEMSETUP.INF: STF_CWDDIR is "$(!STF_CWDDIR)
  332.     Debug-Output "OEMSETUP.INF: STF_RANFROM is "$(!STF_RANFROM)
  333.     ifstr(i) $(!STF_RANFROM) != ""
  334.         ifstr(i) $(!STF_RANFROM) != $(!STF_CWDDIR)"SERIAL\"
  335.            set !STF_SRCDIR = $(!STF_RANFROM)
  336.         endif
  337.     endif
  338.     LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  339.     shell "" InstallOption ENG Consensys $(!STF_SRCDIR)
  340.     FreeLibrary $(!LIBHANDLE)
  341.     set Status = $($R0)
  342.     Return $(Status)
  343.  
  344. ;------------------------------------------------------------------------
  345. ;
  346. ; InstallOption:
  347. ;
  348. ;      This section is shelled to by main installation processing
  349. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  350. ;
  351. ;
  352. ; FUNCTION:  To copy files representing Options
  353. ;            To configure the installed option
  354. ;            To update the registry for the installed option
  355. ;
  356. ; INPUT:     $($0):  Language to use
  357. ;            $($1):  OptionID to install
  358. ;            $($2):  SourceDirectory
  359. ;            $($3):  AddCopy  (YES | NO)
  360. ;            $($4):  DoCopy   (YES | NO)
  361. ;            $($5):  DoConfig (YES | NO)
  362. ;
  363. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  364. ;                            STATUS_NOLANGUAGE |
  365. ;                            STATUS_USERCANCEL |
  366. ;                            STATUS_FAILED
  367. ;
  368. ;------------------------------------------------------------------------
  369.  
  370. [InstallOption]
  371.     read-syms DebugOptions
  372.     Debug-Output "OEMSETUP.INF: In [InstallOption] section"
  373.     ;
  374.     ; Set default values for
  375.     ;
  376.     set Status = STATUS_FAILED
  377.     ;
  378.     ; extract parameters
  379.     ;
  380.     set Option    = $($1)
  381.     set SrcDir    = $($2)
  382.     set AddCopy   = $($3)
  383.     set DoCopy    = $($4)
  384.     set DoConfig  = $($5)
  385.  
  386.     set !SourceDir = $($2)
  387.  
  388.     set BusType = ""
  389.     ifstr(i) $(!STF_BUSTYPE) == "MCA"
  390.       set BusType = "MCA"
  391.     endif
  392.  
  393.     ; Determine Machine Platform
  394.     shell "" SetPlatform
  395.     set !STF_PLATFORM = $($R1)
  396.     Debug-Output "OEMSETUP.INF: STF_PLATFORM = "$(!STF_PLATFORM)" $R1 = "$($R1)
  397.  
  398.     read-syms GeneralConstants
  399.     read-syms FileConstants
  400.  
  401.     Debug-Output "OEMSETUP.INF: Language = "$($0)
  402.     Debug-Output "OEMSETUP.INF: OptionID = "$($1)
  403.     Debug-Output "OEMSETUP.INF: SourceDirectory = "$($2)
  404.     Debug-Output "OEMSETUP.INF: AddCopy = "$(AddCopy)
  405.     Debug-Output "OEMSETUP.INF: DoCopy = "$(DoCopy)
  406.     Debug-Output "OEMSETUP.INF: DoConfig = "$(DoConfig)
  407. ;    shell "" DebugExternalGlobals
  408.  
  409.     set LanguageList = ^(LanguagesSupported, 1)
  410.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  411.         Debug-Output "OEMSETUP.INF: returning STATUS_NO_LANGUAGE"
  412.         return STATUS_NOLANGUAGE
  413.     Endif
  414.     set-subst LF = "\n"
  415.  
  416. ;--------------------------------------------------------------------------
  417. ;    LoadLibrary "x" chiliCui.dll CHILI_CONFIG_HANDLE
  418. ;
  419. ;               set TmpAdapterName = ntxall
  420. ;               set TmpBusNumber = 0
  421. ;               set NewIOBaseAddress = 4005
  422. ;
  423. ;               LibraryProcedure Result, $(CHILI_CONFIG_HANDLE), +
  424. ;                  DoesControllerExist, $(TmpAdapterName), +
  425. ;                                       $(TmpBusNumber),        +
  426. ;                                       $(NewIOBaseAddress)
  427. ;               Debug-Output "DoesControllerExist return: "$(Result)
  428. ;
  429. ;;               set CommonStatus = STATUS_USERCANCEL
  430. ;;               goto end
  431. ;
  432. ;--------------------------------------------------------------------------
  433.  
  434.     Debug-Output "OEMSETUP.INF: AdapterTitle = "$(AdapterTitle)
  435.     Debug-Output "OEMSETUP.INF: AdapterHardwareName = "$(AdapterHardwareName)
  436.     Debug-Output "OEMSETUP.INF: AdapterHardwareDriver = "$(AdapterHardwareDriver)
  437.  
  438. ;    read-syms BindingInfo-ChiliSrv
  439. ;    set NetRuleSoftwareBindable = $(BindingInfo)
  440.     read-syms BindingInfo-$(AdapterHardwareDriver)
  441.     set NetRuleSoftwareBindableHdwDriver = $(BindingInfo)
  442.  
  443.     read-syms DialogConstants$(!STF_LANGUAGE)
  444.     ifstr(i) $(!NTN_Origination) == "NCPA"
  445.         set Continue = "OK"
  446.     endif
  447.     read-syms FileConstants$(!STF_LANGUAGE)
  448.  
  449.     detect date
  450.     set-title  $(FunctionTitle)
  451.  
  452.     set to   = Begin
  453.     set from = Begin
  454.  
  455. ;
  456. ;  Assume all is well.
  457. ;
  458.     set CommonStatus = STATUS_SUCCESSFUL
  459.  
  460.     EndWait
  461.  
  462. ;
  463. ;   Set up the operation-mode-based variables and gaily welcome
  464. ;   the user.  If the "install mode" variable is improperly set,
  465. ;   assume this is a new installation.
  466. ;
  467.  
  468. ;    Debug-Output "OEMSETUP.INF: [InstallOption]:Begin"
  469. Begin = +
  470.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  471.         set StartLabel = removeadapter
  472.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  473.         set StartLabel = UpgradeSoftware
  474.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  475.         set StartLabel = bindingadapter
  476.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  477.         set StartLabel = getAdapterSettings
  478.         ;
  479.         ;   You cannot config the software component
  480.         ;
  481.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  482.             Debug-Output "Cannot configure the ChiliPORTS Service software."
  483.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  484.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  485.                 Debug-Output "ShellCode error: cannot get an error string."
  486.                 goto ShellCodeError
  487.             endif
  488.             set Error = $($R0)
  489.             set from = end
  490.             set to = end
  491.             goto nonfatalinfo
  492.         endif
  493.  
  494.         Ifstr(i) $(ProductKeyNameHdwDriver) == $(!NTN_RegBase)
  495.             Debug-Output "This should not have happened!  Cannot configure the "$(AdapterHardwareName)" driver software."
  496.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  497.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  498.                 Debug-Output "ShellCode error: cannot get an error string."
  499.                 goto ShellCodeError
  500.             endif
  501.             set Error = $($R0)
  502.             set from = end
  503.             set to = end
  504.             goto nonfatalinfo
  505.         endif
  506.         ;
  507.         ; If we get to this point, then we can be sure that we are being
  508.         ; asked to configure the adapter.
  509.         ;
  510.         Debug-Output "We need to determine how to find out which adapter"
  511.         Debug-Output "  we should be configuring!!!!!!"
  512.         set from = writeparameters
  513.         Debug-Output "setting from = "$(from)
  514.     else
  515.         ;
  516.         ; Assume we are installing
  517.         ;
  518.         set StartLabel = installadapter
  519.         set OEM_ABANDON_OPTIONS = {}
  520.         set OEM_ABANDON_SOFTWARE = FALSE
  521.         set OEM_ABANDON_ON = TRUE
  522.     endif
  523.  
  524.     Debug-Output "OEMSETUP.INF: =================================================="
  525.     Debug-Output "OEMSETUP.INF: STF_CWDIR is: "$(!STF_CWDIR)
  526.     Debug-Output "OEMSETUP.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  527.     Debug-Output "OEMSETUP.INF: StartLabel is: "$(StartLabel)
  528.     Debug-Output "OEMSETUP.INF: Option is: "$(Option)
  529. ;    Debug-Output "OEMSETUP.INF: !STF_NCDETECT  is: "$(!STF_NCDETECT)
  530. ;    Debug-Output "OEMSETUP.INF: !STF_NCOPTION  is: "$(!STF_NCOPTION)
  531. ;    Debug-Output "OEMSETUP.INF: !STF_NCDETCARD is: "$(!STF_NCDETCARD)
  532. ;    Debug-Output "OEMSETUP.INF: !STF_NCDETINFO is: "$(!STF_NCDETINFO)
  533.     Debug-Output "OEMSETUP.INF: =================================================="
  534.  
  535.     set to = $(fatal)
  536.     Goto $(StartLabel)
  537.  
  538. ;-----------------------------------------------
  539. ; Installation Section
  540. ;-----------------------------------------------
  541. installadapter = +
  542.     Debug-Output "******************Entering installadapter******************"
  543. ;
  544. ;   First, check whether the same version of the software exists
  545. ;
  546.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  547.  
  548.     Ifstr $(KeyProduct) != $(KeyNull)
  549.         ;
  550.         ; Same version of ChiliPORTS Service already exists on the local machine
  551.         ; Popup the dialog and ask the user whether he wants to continue
  552.         ;
  553.         Debug-Output "***"$(ProductKeyName)" already exists! ***"
  554.         CloseRegKey $(KeyProduct)
  555.  
  556.         ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
  557.            ;
  558.            ; Don't allow multiple installs of the same software again
  559.            ;
  560.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  561.                $(ProductVersion)
  562.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  563.                Debug-Output "ShellCode error: Don't allow installation of software."
  564.                goto ShellCodeError
  565.            endif
  566.  
  567.            goto end
  568.         else
  569.             OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyNameHdwDriver) +
  570.                        $(MAXIMUM_ALLOWED) KeyProductHdwDriver
  571.  
  572.             Ifstr $(KeyProductHdwDriver) != $(KeyNull)
  573.                 ;
  574.                 ; Add a new adapter card?
  575.                 ;
  576.                 CloseRegKey $(KeyProductHdwDriver)
  577.                 Shell $(UtilityInf), CardExistedDlg
  578.  
  579.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  580.                     Debug-Output "ShellCode error: --One adapter all ready exists, install another-- FAILED."
  581.                     goto ShellCodeError
  582.                 endif
  583.  
  584.                 ifstr(i) $($R1) != "OK"
  585.                     goto end
  586.                 endif
  587.                 set HdwDriverComponentExists = $(TRUE)
  588.             EndIf   ; end Ifstr $(KeyProductHdwDriver) != $(KeyNull)
  589.             set OldVersionExisted = $(TRUE)
  590.         endif
  591.     endif
  592.  
  593.     goto skipoptions
  594.  
  595. skipoptions = +
  596.     Debug-Output "******************Entering skipoptions******************"
  597.     ifint $(HdwDriverComponentExists) == $(TRUE)
  598.         ifstr(i) $(!NTN_InstallMode) == configure
  599.             ;
  600.             ; The user just wants to configure an existing adapter
  601.             ;
  602.             goto getAdapterSettings
  603.         endif
  604.     endif
  605.     StartWait
  606.     Debug-Output "HdwDriverComponentExists = "$(HdwDriverComponentExists)
  607.     ifint $(HdwDriverComponentExists) == $(FALSE)
  608.         ;
  609.         ; A version of the software does not exist yet in the registry.
  610.         ;
  611.         ifstr(i) $(!NTN_InstallMode) == "install"
  612.            shell $(UtilityInf) AssignAdapterNumber
  613.            set AdapterName = $(ProductHardwareName)$($R1)
  614.  
  615.            set DoCopy = NO
  616.            ;
  617.            ; Check for presence of existing driver components
  618.            ;   
  619.            LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"chili.sys
  620.            ifstr(i) $(STATUS) == NO
  621.                set DoCopy = YES
  622.                goto addfiles
  623.            endif
  624.            LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"chiliObs.sys
  625.            ifstr(i) $(STATUS) == NO
  626.                set DoCopy = YES
  627.                goto addfiles
  628.            endif
  629.            LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\"chiliSrv.exe
  630.            ifstr(i) $(STATUS) == NO
  631.                set DoCopy = YES
  632.                goto addfiles
  633.            endif
  634.            LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\"chiliCui.dll
  635.            ifstr(i) $(STATUS) == NO
  636.               set DoCopy = YES
  637.               goto addfiles
  638.            endif
  639.  
  640. addfiles = +
  641.            Ifstr(i) $(DoCopy) == "YES"
  642.                Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  643.                Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  644.                    Debug-Output"Shell code error: DoAskSource"
  645.                    Goto ShellCodeError
  646.                Else-Ifstr(i) $($R0) == STATUS_FAILED
  647.                    Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  648.                    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  649.                        goto ShellCodeError
  650.                    endif
  651.                    set Error = $($R0)
  652.                    Goto fatal
  653.                Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  654.                    set CommonStatus = STATUS_USERCANCEL
  655.                    Goto successful
  656.                Endif
  657.                Set SrcDir = $($R1)
  658.                ;
  659.                ; Make sure that a trailing \ is present.
  660.                ;
  661.                Split-String $(SrcDir) "\" JunkList
  662.                QueryListSize JunkSize $(JunkList)
  663.                Set JunkItem = *($(JunkList),$(JunkSize))
  664.                set JunkItem2 = "foo"
  665.                ifstr $(JunkItem2)$(JunkItem)$(JunkItem2) != $(JunkItem2)"\"$(JunkItem2)
  666.                    Debug-Output "In ifstr"
  667.                    set SrcDir = $(SrcDir)"\"
  668.                endif
  669.                Debug-Output "Reassigning SourceDirectory = "$(SrcDir)
  670.            Endif
  671.            Debug-Output "call install with Install-Option..."
  672.            install "Install-Option"
  673.            Debug-Output "STF_INSTALL_OUTCOME = "$(STF_INSTALL_OUTCOME)
  674.            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  675.               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  676.               ifint $($ShellCode) != $(!SHELL_CODE_OK)
  677.                   goto ShellCodeError
  678.               endif
  679.               set Error = $($R0)
  680.               goto fatal
  681.            endif
  682.         endif
  683.     endif
  684.  
  685.     set from = addChiliSrvComponent
  686.     goto getAdapterSettings
  687.  
  688. addChiliSrvComponent = +
  689.     Debug-Output "******************Entering addChiliSrvComponent******************"
  690.     Ifint $(OldVersionExisted) == $(TRUE)
  691.         ; The ChiliSrv driver is all ready installed.
  692.         goto addHdwDriverComponent
  693.     Endif
  694.     Debug-Output "OEMSETUP.INF: Adding ChiliSrvComponent"
  695.         ;
  696.         ; Install the Chili Service
  697.         ;
  698.         set ConsensysSpecificString = $(ProductSoftwareName)
  699.         set TypeofService = "serviceauto"
  700.         set ServiceOrderGroup = "Extended base"
  701.         set Dependencies = { $(ProductSoftwareNameHdwDriver) }
  702.         set ObjectName = ""
  703.         set TypeSupported = "7"
  704.         set EventLogLocation = "System"
  705.         set ErrorControlValue = 1
  706.         Debug-Output "OEMSETUP.INF: [InstallOption]:skipoptions: About to call AddSoftwareComponent"
  707.         Debug-Output "OEMNADID.INF:     Paramters passed in:"
  708.         Debug-Output "OEMSETUP.INF:         Manufacturer = "$(Manufacturer)
  709.         Debug-Output "OEMSETUP.INF:         Product = "$(ProductSoftwareName)
  710.         Debug-Output "OEMSETUP.INF:         Service = "$(ProductSoftwareName)
  711.         Debug-Output "OEMSETUP.INF:         Display name = "$(ProductSoftwareTitle)
  712.         Debug-Output "OEMSETUP.INF:         INFfile = "$(STF_CONTEXTINFNAME)
  713.         Debug-Output "OEMSETUP.INF:         ImagePath = "$(ProductSoftwareImagePath)
  714.         Debug-Output "OEMSETUP.INF:         TypeOfService = "$(TypeofService)
  715.         Debug-Output "OEMSETUP.INF:         Service Order group = "$(ServiceOrderGroup)
  716.         Debug-Output "OEMSETUP.INF:         Dependencies = "$(Dependencies)
  717.         Debug-Output "OEMSETUP.INF:         ObjectName = "$(ObjectName)
  718.         Debug-Output "OEMSETUP.INF:         EventMessageFile = "$(IoLogMsgDLL)";"$(ProductSoftwareImagePath)
  719.         Debug-Output "OEMSETUP.INF:         TypeSupported = "$(TypeSupported)
  720.         Debug-Output "OEMSETUP.INF:         Event log location = "$(EventLogLocation)
  721.         Debug-Output "OEMSETUP.INF:         Error control value = "$(ErrorControlValue)
  722.         Shell $(UtilityInf), AddSoftwareComponent, +
  723.                                     $(Manufacturer), +
  724.                                     $(ProductSoftwareName), +
  725.                                     $(ProductSoftwareName), +
  726.                                     $(ProductSoftwareTitle), +
  727.                                     $(STF_CONTEXTINFNAME), +
  728.                                     $(ProductSoftwareImagePath), +
  729.                                     $(TypeofService), +
  730.                                     $(ServiceOrderGroup), +
  731.                                     $(Dependencies), +
  732.                                     $(ObjectName), +
  733.                                     $(IoLogMsgDLL)";"$(ProductSoftwareImagePath), +
  734.                                     $(TypeSupported), +
  735.                                     $(EventLogLocation), +
  736.                                     $(ErrorControlValue)
  737.             ;
  738.             ; Return values from AddSoftwareComponent
  739.             ;
  740.             ; $($R0) = error code or zero if no error
  741.             ; $($R1) = Registry key variable for
  742.             ;            SOFTWARE\Manufacturer\Product\Version key
  743.             ; $($R2) = Registry key variable for
  744.             ;            SOFTWARE\...\NetRules
  745.             ; $($R3) = Registry key handle for Services key
  746.             ; $($R4) = "Parameters" key handle for Services area
  747.             ; $($R5) = "Linkage" key handle for Services area
  748.             ;
  749.  
  750.         Set OEM_ABANDON_SOFTWARE = TRUE
  751.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  752.             Debug-Output "ShellCode error: Add software component FAILED!"
  753.             goto ShellCodeError
  754.         endif
  755.         set RegistryErrorIndex = $($R0)
  756.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  757.             EndWait
  758.             Debug-Output "Registry error: add software components"
  759.             CloseRegKey $($R1)
  760.             CloseRegKey $($R2)
  761.             CloseRegKey $($R3)
  762.             CloseRegKey $($R4)
  763.             CloseRegKey $($R5)
  764.             goto fatalregistry
  765.         endif
  766.         Set SoftProductKey      = $($R1)
  767.         Set SoftNetRuleKey      = $($R2)
  768.         Set SoftServiceKey      = $($R3)
  769.         Set SoftParameterKey    = $($R4)
  770.         Set SoftLinkageKey      = $($R5)
  771.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  772.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  773.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  774.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  775.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  776.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  777.                            {hidden,$(NoTitle),$(!REG_VT_DWORD),$(NetRuleSoftwareHiddenDriver)}, +
  778.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  779.         ;
  780.         ; Add the proper values to the
  781.         ;   SOFTWARE\Consensys\ChiliPORTS Service\CurrentVersion key.
  782.         ;
  783.         Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  784.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  785.             Debug-Output "ShellCode error: AddValueList FAILED!  --"$(SoftProductKey)
  786.             goto ShellCodeError
  787.         endif
  788.         set RegistryErrorIndex = $($R0)
  789.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  790.             EndWait
  791.             Debug-Output "Registry error: add value list."
  792.             CloseRegKey $(SoftProductKey)
  793. ;            CloseRegKey $(SoftNetRuleKey)
  794.             CloseRegKey $(SoftServiceKey)
  795.             CloseRegKey $(SoftParameterKey)
  796.             CloseRegKey $(SoftLinkageKey)
  797.             goto fatalregistry
  798.         endif
  799. ;        set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  800. ;                            {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  801. ;                            {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  802. ;                            {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  803. ;                            {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  804. ;                            {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  805. ;        ;
  806. ;        ; Add the proper values to the
  807. ;        ;   SOFTWARE\Consensys\ChiliSrv\CurrentVersion\NetRules key.
  808. ;        ;
  809. ;        Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  810. ;        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  811. ;            Debug-Output "ShellCode error: AddValueList FAILED! --"$(SoftNetRuleKey)
  812. ;            goto ShellCodeError
  813. ;        endif
  814. ;        set RegistryErrorIndex = $($R0)
  815.  
  816.         FlushRegKey $(SoftProductKey)
  817. ;        FlushRegKey $(SoftNetRuleKey)
  818.         FlushRegKey $(SoftServiceKey)
  819.         FlushRegKey $(SoftParameterKey)
  820.         FlushRegKey $(SoftLinkageKey)
  821.  
  822.         CloseRegKey $(SoftProductKey)
  823. ;        CloseRegKey $(SoftNetRuleKey)
  824.         CloseRegKey $(SoftServiceKey)
  825.         CloseRegKey $(SoftParameterKey)
  826.         CloseRegKey $(SoftLinkageKey)
  827.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  828.             EndWait
  829.             Debug-Output "Registry error: add value list."
  830.             goto fatalregistry
  831.         endif
  832.         goto addHdwDriverComponent
  833.  
  834. addHdwDriverComponent = +
  835.     Debug-Output "******************Entering addHdwDriverComponent******************"
  836.     set ConsensysSpecificString = $(AdapterHardwareName)
  837.  
  838.     Ifint $(HdwDriverComponentExists) == $(TRUE)
  839.         goto addAdapterComponent
  840.     Endif
  841.     Debug-Output "OEMSETUP.INF: Adding HdwDriverComponent"
  842.         ;
  843.         ; Install the Hardware dependent driver
  844.         ;
  845.         set TypeofService = "kernelautostart"
  846.         set ServiceOrderGroup = "Extended base"
  847.         set Dependencies = {}
  848.         set ObjectName = ""
  849.         set TypeSupported = "7"
  850.         set EventLogLocation = "System"
  851.         set ErrorControlValue = 1
  852.         Debug-Output "OEMSETUP.INF: [InstallOption]:addHardwareComponent: About to call AddSoftwareComponent"
  853.         Debug-Output "OEMNADID.INF:     Paramters passed in:"
  854.         Debug-Output "OEMSETUP.INF:         Manufacturer = "$(Manufacturer)
  855.         Debug-Output "OEMSETUP.INF:         Product = "$(ProductSoftwareNameHdwDriver)
  856.         Debug-Output "OEMSETUP.INF:         Service = "$(ProductSoftwareNameHdwDriver)
  857.         Debug-Output "OEMSETUP.INF:         Display name = "$(ProductSoftwareTitleHdwDriver)
  858.         Debug-Output "OEMSETUP.INF:         INFfile = "$(STF_CONTEXTINFNAME)
  859.         Debug-Output "OEMSETUP.INF:         ImagePath = "$(ProductSoftwareImagePathHdwDriver)
  860.         Debug-Output "OEMSETUP.INF:         Type of software = "$(TypeofService)
  861.         Debug-Output "OEMSETUP.INF:         Service Order group = "$(ServiceOrderGroup)
  862.         Debug-Output "OEMSETUP.INF:         Dependencies = "$(Dependencies)
  863.         Debug-Output "OEMSETUP.INF:         ObjectName = "$(ObjectName)
  864.         Debug-Output "OEMSETUP.INF:         EventMessageFile = "$(IoLogMsgDLL)";"$(ProductSoftwareImagePath)
  865.         Debug-Output "OEMSETUP.INF:         TypeSupported = "$(TypeSupported)
  866.         Debug-Output "OEMSETUP.INF:         Event log location = "$(EventLogLocation)
  867.         Debug-Output "OEMSETUP.INF:         Error control value = "$(ErrorControlValue)
  868.         Shell $(UtilityInf), AddSoftwareComponent, +
  869.                                     $(Manufacturer), +
  870.                                     $(ProductSoftwareNameHdwDriver), +
  871.                                     $(ProductSoftwareNameHdwDriver), +
  872.                                     $(ProductSoftwareTitleHdwDriver), +
  873.                                     $(STF_CONTEXTINFNAME), +
  874.                                     $(ProductSoftwareImagePathHdwDriver), +
  875.                                     $(TypeofService), +
  876.                                     $(ServiceOrderGroup), +
  877.                                     $(Dependencies), +
  878.                                     $(ObjectName), +
  879.                                     $(IoLogMsgDLL)";"$(ProductSoftwareImagePathHdwDriver), +
  880.                                     $(TypeSupported), +
  881.                                     $(EventLogLocation), +
  882.                                     $(ErrorControlValue)
  883.             ;
  884.             ; Return values from AddSoftwareComponent
  885.             ;
  886.             ; $($R0) = error code or zero if no error
  887.             ; $($R1) = Registry key variable for
  888.             ;            SOFTWARE\Manufacturer\Product\Version key
  889.             ; $($R2) = Registry key variable for
  890.             ;            SOFTWARE\...\NetRules
  891.             ; $($R3) = Registry key handle for Services key
  892.             ; $($R4) = "Parameters" key handle for Services area
  893.             ; $($R5) = "Linkage" key handle for Services area
  894.             ;
  895.  
  896.         Set OEM_ABANDON_SOFTWARE = TRUE
  897.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  898.             Debug-Output "ShellCode error: AddSoftwareComponent FAILED! -- "$(ProductSoftwareNameHdwDriver)
  899.             goto ShellCodeError
  900.         endif
  901.         set RegistryErrorIndex = $($R0)
  902.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  903.             EndWait
  904.             Debug-Output "Registry error: add software components"
  905.             CloseRegKey $($R1)
  906.             CloseRegKey $($R2)
  907.             CloseRegKey $($R3)
  908.             CloseRegKey $($R4)
  909.             CloseRegKey $($R5)
  910.             goto fatalregistry
  911.         endif
  912.         Set SoftProductKey      = $($R1)
  913.         Set SoftNetRuleKey      = $($R2)
  914.         Set SoftServiceKey      = $($R3)
  915.         Set SoftParameterKey    = $($R4)
  916.         Set SoftLinkageKey      = $($R5)
  917.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  918.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersionHdwDriver)},+
  919.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersionHdwDriver)},+
  920.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitleHdwDriver)},+
  921.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescriptionHdwDriver)},+
  922.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareNameHdwDriver)},+
  923.                            {hidden,$(NoTitle),$(!REG_VT_DWORD),$(NetRuleSoftwareHiddenHdwDriver)}, +
  924.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  925.         ;
  926.         ; Add the proper values to the
  927.         ;   SOFTWARE\Consensys\<HdwDriver>\CurrentVersion key.
  928.         ;
  929.         Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  930.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  931.             Debug-Output "ShellCode error: AddValueList FAILED!  -- "$(SoftProductKey)
  932.             goto ShellCodeError
  933.         endif
  934.         set RegistryErrorIndex = $($R0)
  935.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  936.             EndWait
  937.             Debug-Output "Resgitry error: add value list."
  938.             CloseRegKey $(SoftProductKey)
  939.             CloseRegKey $(SoftNetRuleKey)
  940.             CloseRegKey $(SoftServiceKey)
  941.             CloseRegKey $(SoftParameterKey)
  942.             CloseRegKey $(SoftLinkageKey)
  943.             goto fatalregistry
  944.         endif
  945.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareTypeHdwDriver)},+
  946.                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUseHdwDriver)}, +
  947.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindFormHdwDriver)}, +
  948.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClassHdwDriver)}, +
  949.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindableHdwDriver)}, +
  950.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  951.         ;
  952.         ; Add the proper values to the
  953.         ;   SOFTWARE\Consensys\<HdwDriver>\CurrentVersion\NetRules key.
  954.         ;
  955.         Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  956.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  957.             Debug-Output "ShellCode error. AddValueList FAILED!  -- "$(SoftNetRuleKey)
  958.             goto ShellCodeError
  959.         endif
  960.         set RegistryErrorIndex = $($R0)
  961.  
  962.         FlushRegKey $(SoftProductKey)
  963.         FlushRegKey $(SoftNetRuleKey)
  964.         FlushRegKey $(SoftServiceKey)
  965.         FlushRegKey $(SoftParameterKey)
  966.         FlushRegKey $(SoftLinkageKey)
  967.  
  968.         CloseRegKey $(SoftProductKey)
  969.         CloseRegKey $(SoftNetRuleKey)
  970.         CloseRegKey $(SoftServiceKey)
  971.         CloseRegKey $(SoftParameterKey)
  972.         CloseRegKey $(SoftLinkageKey)
  973.  
  974.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  975.             EndWait
  976.             Debug-Output "Registry error: add value list."
  977.             goto fatalregistry
  978.         endif
  979.  
  980. addAdapterComponent = +
  981.     Debug-Output "******************Entering addAdapterComponent******************"
  982.     ;
  983.     ; Install Adapter specific information
  984.     ;
  985.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName), +
  986.                                     $(STF_CONTEXTINFNAME), $(ProductKeyNameHdwDriver)
  987.     ifint $($R4) != -1
  988.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  989.     endif
  990.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  991.         Debug-Output "Cannot add hardware component!"
  992.         goto ShellCodeError
  993.     endif
  994.     set RegistryErrorIndex = $($R0)
  995.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  996.         EndWait
  997.         Debug-Output "Registry error: add hardware component"
  998.         Debug-Output $(RegistryErrorIndex)
  999.         CloseRegKey $($R1)
  1000.         CloseRegKey $($R2)
  1001.         CloseRegKey $($R3)
  1002.         goto fatalregistry
  1003.     endif
  1004.     set KeyParameters = $($R3)
  1005.     set KeyAdapterRules = $($R2)
  1006.     set AdapterNumber = $($R4)
  1007.     set AdapterServiceName = $($R5)
  1008.     set AdapterName = $(AdapterServiceName)
  1009.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  1010.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  1011.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  1012.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  1013.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  1014.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  1015.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  1016.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1017.         Debug-Output "ShellCode error: AddValueList FAILED  -- "$($R1)
  1018.         goto ShellCodeError
  1019.     endif
  1020.     ; Increment the reference count in the ChiliSrv software component
  1021.     shell $(UtilityInf) IncrementRefCount $(ProductKeyName)
  1022.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  1023.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  1024.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  1025.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  1026.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  1027.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  1028.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  1029.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1030.         Debug-Output "ShellCode error."
  1031.         goto ShellCodeError
  1032.     endif
  1033.     set RegistryErrorIndex = $($R0)
  1034.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1035.         EndWait
  1036.         Debug-Output "Resgitry error: add value list."
  1037.         CloseRegKey $(KeyParameters)
  1038.         CloseRegKey $(KeyAdapterRules)
  1039.         goto fatalregistry
  1040.     endif
  1041.     FlushRegKey $(KeyParameters)
  1042.     FlushRegKey $(KeyAdapterRules)
  1043.  
  1044.     CloseRegKey $(KeyParameters)
  1045.     CloseRegKey $(KeyAdapterRules)
  1046.     goto writeparameters
  1047.  
  1048. ;
  1049. ;   Put up the adapter configuration dialog if necessary.
  1050. ;
  1051. configureadapter = +
  1052.     Debug-Output "******************Entering configureadapter******************"
  1053.     set !STF_DISPLAYDEBUGOUTPUT = 1
  1054.  
  1055. ;    Shell "" DebugConfiguration "before displaying dialog"
  1056.     Debug-Output "OEMSETUP.INF: PortNameList = "$(PortNameList)
  1057.  
  1058.     QueryListSize IRQRangeListSize $(IRQRangeList)
  1059.     QueryListSize IORangeListSize $(IORangeList)
  1060.     QueryListSize PortNameListSize $(PortNameList)
  1061.  
  1062.     ;
  1063.     ; Call our custom DLL for more configuration
  1064.     ;
  1065.     LibraryProcedure Result, $(CHILI_CONFIG_HANDLE), +
  1066.             ChiliConfigEntryPoint, $(!STF_HWND), $(AdapterHardwareType), +
  1067.                 $(ConfigurationTitle), +
  1068.                 $(IRQRangeList), +
  1069.                 $(IRQRangeListSize), +
  1070.                 $(IRQDefault), +
  1071.                 $(IORangeList), +
  1072.                 $(IORangeListSize), +
  1073.                 $(IODefault), +
  1074.                 $(CtrlList), +
  1075.                 $(AdapterName)
  1076.  
  1077.     Debug-Output "Result="$(Result)
  1078.  
  1079.     Ifstr $(Result) == "{}"
  1080.         ; The user cancelled the configuration request.
  1081.         set CommonStatus = STATUS_USERCANCEL
  1082.         goto successful
  1083.     Endif
  1084.  
  1085.     Split-String $(Result) ":" AdapterParametersList
  1086.     set AdapterParameters = { *($(AdapterParametersList),1) , *($(AdapterParametersList),3) }
  1087.  
  1088.     read-syms UpdatingConfiguration$(!STF_LANGUAGE)
  1089.     shell $(subroutninf) PushBillBoard NETSTATUSDLG $(UpdatingConfiguration)
  1090.  
  1091.     ; Go back to where we came from
  1092.     Debug-Output "jumping to "$(from)
  1093.     goto $(from)
  1094.  
  1095. getAdapterSettings = +
  1096.     Debug-Output "******************Entering getAdapterSettings******************"
  1097.     ;
  1098.     ; Read the registry to determine what the current adapter settings
  1099.     ; are.
  1100.     ;
  1101.     Debug-Output "from value = "$(from)
  1102.     set IRQDefault = 0
  1103.     set IODefault = 1
  1104.  
  1105.     LoadLibrary "x" chiliCui.dll CHILI_CONFIG_HANDLE
  1106.  
  1107.     read-syms AdapterSettings-$(AdapterHardwareName)
  1108.  
  1109.     ; Look for the service name
  1110.     Ifstr $(!NTN_RegBase) != $(KeyNull)
  1111.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) SoftwareKey
  1112.         Ifstr $(SoftwareKey) == $(KeyNull)
  1113.             Debug-Output "Unable to open "$(!NTN_RegBase)" key!!!!"
  1114.             goto getAdapterSettingsExit
  1115.         Else
  1116.             GetRegValue $(SoftwareKey), "ServiceName", ServiceNameList
  1117.             Debug-Output "ServiceNameList = "$ServiceNameList
  1118.             set AdapterServiceName = *($(ServiceNameList),4)
  1119.             set AdapterName = $(AdapterServiceName)
  1120.             CloseRegKey $(SoftwareKey)
  1121.         Endif
  1122.     Endif
  1123.  
  1124.     Debug-Output "AdapterServiceName = "$(AdapterServiceName)
  1125.     Debug-Output "AdapterName = "$(AdapterName)
  1126.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(AdapterServiceName) $(MAXIMUM_ALLOWED) BaseKey
  1127.  
  1128.     Ifstr $(BaseKey) == $(KeyNull)
  1129.         Debug-Output "Error opening BaseKey "$(!NTN_ServiceBase)"\"$(AdapterServiceName)
  1130.         CloseRegKey $(BaseKey)
  1131.         goto fatalregistry
  1132.     Endif
  1133.  
  1134.     ; Set the BusTypeNum default to ISA
  1135.     set BusTypeNum = 1
  1136.  
  1137.     set ParametersKey = $(KeyNull)
  1138.     OpenRegKey $(BaseKey) "" "Parameters" $(MAXIMUM_ALLOWED) ParametersKey
  1139.     Ifstr $(ParametersKey) == $(KeyNull)
  1140.         Debug-Output "Assuming Parameters key does not exist!!!"
  1141.         ifstr(i) $(BusType) == "MCA"
  1142.             ;
  1143.             ; Look for a MCA controller.
  1144.             ;
  1145.             ForListDo $(AdapterHardwareAdapterID)
  1146.                Debug-Output "Calling MCAFindBus, "*($(AdapterIDByte1),$(#))", "*($(AdapterIDByte2),$(#))
  1147.                Shell $(UtilityInf), MCAFindBus, *($(AdapterIDByte1),$(#)), *($(AdapterIDByte2),$(#))
  1148.                Debug-Output "MCAFindBus returned "$($R1)
  1149.                set CardInfo = {}
  1150.                ifstr(i) $($R1) != {}
  1151.                   set CardInfo = $($R1)
  1152.                   Debug-Output "MCA controller found!"
  1153.                   Debug-Output "CardInfo = "$(CardInfo)
  1154.  
  1155. ;--------------------------------------------------------------------------
  1156.                   ForListDo $(CardInfo)
  1157.                      Debug-Output "Current CardInfo Entry = "$($)
  1158.                      set TmpBusNumber = *($($), 1)
  1159.                      set SlotNumber = *($($), 2)
  1160.                      set MCAPosId = *($($), 3)
  1161.  
  1162.                      Debug-Output "Calling DoesControllerExist:"
  1163.                      Debug-Output "    AdapterHardwareName = "$(AdapterHardwareName)
  1164.                      Debug-Output "    BusNumber = "$(TmpBusNumber)
  1165.                      Debug-Output "    Slot # = "$(SlotNumber)
  1166.                      Debug-Output " CHILI_CONFIG_HANDLE = "$(CHILI_CONFIG_HANDLE)
  1167.                      LibraryProcedure Result, $(CHILI_CONFIG_HANDLE), +
  1168.                         DoesControllerExist, $(AdapterHardwareName), +
  1169.                                              $(TmpBusNumber),        +
  1170.                                              $(SlotNumber)
  1171.                      Debug-Output "DoesControllerExist return: "$(Result)
  1172.                      ifstr(i) $(Result) == "FALSE"
  1173.                         Debug-Output "Before resetting IORangeList for MCA: "$(IORangeList)
  1174.                         set IORangeList = {Slot$(SlotNumber)}
  1175.                         set IODefault = 0
  1176.                         Debug-Output "After resetting IORangeList for MCA: "$(IORangeList)
  1177.                         ; Reset the BusTypeNum default to MCA
  1178.                         set BusTypeNum = 3
  1179.                         goto getAdapterSettingsExit
  1180.                      endif
  1181.                   EndForListDo
  1182. ;--------------------------------------------------------------------------
  1183.                endif
  1184.             EndForListDo
  1185.         else
  1186.             ;
  1187.             ; Look for an EISA controller.
  1188.             ;
  1189.             Debug-Output "Look for an EISA controller: "$(AdapterHardwareAdapterID)
  1190.             ForListDo $(AdapterHardwareAdapterID)
  1191.               ifint $($) != 0
  1192.                   Debug-Output "Calling EISAFindBus, "$($)
  1193.                   Shell $(UtilityInf), EISAFindBus, $($)
  1194.                   set CardInfo = {}
  1195.                   ifstr(i) $($R1) != {}
  1196.                      set CardInfo = $($R1)
  1197.                      Debug-Output "EISA controller found!"
  1198.                      Debug-Output "CardInfo = "$(CardInfo)
  1199.  
  1200.                       ForListDo $(CardInfo)
  1201.                          Debug-Output "Current CardInfo Entry = "$($)
  1202.                          set TmpBusNumber = *($($), 1)
  1203.                          ;
  1204.                          ; Convert slot number to IOBaseAddress
  1205.                          ;
  1206.                          set SlotNumber = *($($), 2)
  1207.                          set-mul NewIOBaseAddress = $(SlotNumber), 4096
  1208.                          set-add NewIOBaseAddress = $(NewIOBaseAddress), 5
  1209.                          set-dectohex NewIOBaseAddress = $(NewIOBaseAddress)
  1210.  
  1211.                          Debug-Output "Calling DoesControllerExist:"
  1212.                          Debug-Output "    AdapterHardwareName = "$(AdapterHardwareName)
  1213.                          Debug-Output "    BusNumber = "$(TmpBusNumber)
  1214.                          Debug-Output "    NewIOBaseAddress = "$(NewIOBaseAddress)
  1215.                          Debug-Output " CHILI_CONFIG_HANDLE = "$(CHILI_CONFIG_HANDLE)
  1216.                          LibraryProcedure Result, $(CHILI_CONFIG_HANDLE), +
  1217.                             DoesControllerExist, $(AdapterHardwareName), +
  1218.                                                  $(TmpBusNumber),        +
  1219.                                                  $(NewIOBaseAddress)
  1220.                          Debug-Output "DoesControllerExist return: "$(Result)
  1221.                          ifstr(i) $(Result) == "FALSE"
  1222.                             Debug-Output "Before resetting IORangeList for EISA: "$(IORangeList)
  1223.                             set IORangeList = {$(NewIOBaseAddress)}
  1224.                             set IODefault = 0
  1225.                             Debug-Output "After resetting IORangeList for EISA: "$(IORangeList)
  1226.                             ; Reset the BusTypeNum default to EISA
  1227.                             set BusTypeNum = 2
  1228.                             goto getAdapterSettingsExit
  1229.                          endif
  1230.                       EndForListDo
  1231.                   endif
  1232.                endif
  1233.             EndForListDo
  1234.         endif
  1235.  
  1236.         CloseRegKey $(BaseKey)
  1237.         goto configureadapter
  1238.     Endif
  1239.  
  1240.     GetRegValue $(ParametersKey) "InterruptNumber" IRQValueList
  1241.     GetRegValue $(ParametersKey) "IOBaseAddress" IOBaseValueList
  1242.  
  1243.     ;
  1244.     ; For now, we don't support IRQ's, so don't do anything special for them.
  1245.     ;
  1246. ;    ifstr(i) $(BusType) != "MCA"
  1247.        set-dectohex TmpHex = *($(IRQValueList),4)
  1248.        Debug-Output "Current InterruptNumber = "$(TmpHex)
  1249.        ForListDo $(IRQRangeList)
  1250.            Ifstr(i) $(TmpHex) == "0x"$($)
  1251.                set-sub IRQDefault = $(#),1
  1252.            Endif
  1253.        EndForListDo
  1254. ;    else
  1255. ;       set IRQRangeList = {*($(SlotNumber),4)}
  1256. ;       set IRQDefault = 0
  1257. ;    endif
  1258.  
  1259.     ifstr(i) $(BusType) != "MCA"
  1260.        set IOFound = $(FALSE)
  1261.        set-dectohex TmpHex = *($(IOBaseValueList),4)
  1262.        Debug-Output "Current IOBaseAddress = "$(TmpHex)
  1263.        ForListDo $(IORangeList)
  1264.            Ifstr(i) $(TmpHex) == "0x"$($)
  1265.                set-sub IODefault = $(#),1
  1266.                set IOFound = $(TRUE)
  1267.            Endif
  1268.        EndForListDo
  1269.  
  1270.        ifint $(IOFound) == $(FALSE)
  1271.          ;
  1272.          ; The controller is probably an EISA
  1273.          ;
  1274.          set IORangeList = {$(TmpHex)}
  1275.          set IODefault = 0
  1276.          set BusTypeNum = 2
  1277.        endif
  1278.     else
  1279.        set IORangeList = {Slot*($(SlotNumber),4)}
  1280.        set IODefault = 0
  1281.     endif
  1282.  
  1283.     set CtrlList = {}
  1284.     set LineList = {}
  1285.     ForListDo {"1","2"}
  1286.       set CurrentLine = "Line"$($)
  1287.       Debug-Output "CurrentLine = "$(CurrentLine)
  1288.       OpenRegKey $(ParametersKey) "" $(CurrentLine) $(MAXIMUM_ALLOWED) LineKey
  1289.             Ifstr $(LineKey) != $(KeyNull)
  1290.                set ConcList = {}
  1291.                ForListDo {"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16"}
  1292.                   set CurrentConc = "Concentrator"$($)
  1293.                   ; Debug-Output "CurrentConc = "$(CurrentConc)
  1294.                   OpenRegKey $(LineKey) "" $(CurrentConc) $(MAXIMUM_ALLOWED) ConcKey
  1295.                   Ifstr $(ConcKey) != $(KeyNull)
  1296.                      ; Look for Port Keys and Conc values
  1297.                      set PortNameList = {}
  1298.                      set CurrentPort = ""
  1299.                      set PortName = {}
  1300.                      ForListDo {"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16"}
  1301.                         set CurrentPort = "Port"$($)
  1302.                         ; Debug-Output "CurrentPort = "$(CurrentPort)
  1303.                         OpenRegKey $(ConcKey) "" $(CurrentPort) $(MAXIMUM_ALLOWED) PortKey
  1304.                         Ifstr $(PortKey) != $(KeyNull)
  1305.                            ; Look for Port values
  1306.                            GetRegValue $(PortKey) "DosDevices" PortName
  1307.                            Ifstr $(PortNameList) == $(KeyNull)
  1308.                               set PortNameList = *($(PortName),4)
  1309.                            Else
  1310.                               set PortNameList = >($(PortNameList), >($(CurrentPort),*($(PortName),4)))
  1311.                            Endif
  1312.                            ; Debug-Output $(CurrentPort)"->"*($(PortName),4)
  1313.                            CloseRegKey $(PortKey)
  1314.                         EndIf
  1315.                      EndForListDo
  1316.                      CloseRegKey $(ConcKey)
  1317.                      ; Debug-Output "PortNameList = "$(PortNameList)
  1318.                      set ConcList = >($(ConcList),>($(CurrentConc),$(PortNameList)))
  1319.                      ; Debug-Output "ConcList = "$(ConcList)
  1320.                   EndIf
  1321.                EndForListDo
  1322.                CloseRegKey $(LineKey)
  1323. ;               Debug-Output "LineList = "$(LineList)
  1324. ;               Debug-Output "CurrentLine = "$(CurrentLine)
  1325. ;               Debug-Output "ConcList = "$(ConcList)
  1326. ;               Debug-Output "ConcList[1] = "*($(ConcList),1)
  1327.                set TmpLine = >($(CurrentLine),$(ConcList))
  1328. ;               Debug-Output "TmpLine = "$(TmpLine)
  1329.  
  1330.                set LineList = >($(LineList),$(TmpLine))
  1331.             Endif
  1332.             Debug-Output "LineList = "$(LineList)
  1333. ;            Ifstr(i) $(LineList) != {}
  1334. ;               set CtrlList = >($(CtrlList),>("Ctrl",$(LineList)))
  1335. ;            Endif
  1336.             set CtrlList = $(LineList)
  1337.     EndForListDo
  1338. ;    LibraryProcedure Result, $(CHILI_CONFIG_HANDLE), DumpList, $(CtrlList)
  1339.  
  1340.     CloseRegKey $(ParametersKey)
  1341.     CloseRegKey $(BaseKey)
  1342.  
  1343. getAdapterSettingsExit = +
  1344.     goto configureadapter
  1345.  
  1346.  
  1347. writeparameters = +
  1348.     Debug-Output "******************Entering writeparameters******************"
  1349.     StartWait
  1350.     Debug-Output "Trying to open: "$(!NTN_ServiceBase)"\"$(AdapterServiceName)
  1351.     Debug-Output "AdapterParameters: "$(AdapterParameters)
  1352.  
  1353.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(AdapterServiceName) $(MAXIMUM_ALLOWED) BaseKey
  1354.     Ifstr $(BaseKey) == $(KeyNull)
  1355.         Debug-Output "Error opening BaseKey "$(!NTN_ServiceBase)"\"$(AdapterServiceName)
  1356.         CloseRegKey $(BaseKey)
  1357.         goto fatal
  1358.     Endif
  1359.     OpenRegKey $(BaseKey) "" "Parameters" $(MAXIMUM_ALLOWED) ParametersKey
  1360.     Ifstr $(ParametersKey) == $(KeyNull)
  1361.         Debug-Output "Assuming Parameters key does not exist!!!"
  1362.         CloseRegKey $(BaseKey)
  1363.         goto fatal
  1364.     Endif
  1365.  
  1366. ;    Debug-Output "AdapterParameters = "
  1367. ;    LibraryProcedure Result, $(CHILI_CONFIG_HANDLE), DumpList, $(AdapterParameters)
  1368.  
  1369.     Debug-Output "AdapterParameters parsed: "
  1370.     set InterruptNumber = *($(AdapterParameters),1)
  1371.     set IOBaseAddress = *($(AdapterParameters),2)
  1372.     set HdwDeviceName = "\Device\"$(AdapterHardwareDriver)"Board0"
  1373.     Debug-Output "InterruptNumber = "$(InterruptNumber)
  1374.     Debug-Output "IOBaseAddress = "$(IOBaseAddress)
  1375.     Debug-Output "HdwDeviceName = "$(HdwDeviceName)
  1376.     SetRegValue $(ParametersKey) {IOBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddress)}
  1377.     SetRegValue $(ParametersKey) {InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(InterruptNumber)}
  1378.     SetRegValue $(ParametersKey) {HdwDeviceName,$(NoTitle),$(!REG_VT_SZ),$(HdwDeviceName)}
  1379.     SetRegValue $(ParametersKey) {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)}
  1380.  
  1381.     ifstr(i) $(BusType) == "MCA"
  1382.       SetRegValue $(ParametersKey) {MCAPosId,$(NoTitle),$(!REG_VT_DWORD),$(MCAPosId)}
  1383.       SetRegValue $(ParametersKey) {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNumber)}
  1384.     endif
  1385.     FlushRegKey $(ParametersKey)
  1386.  
  1387. ;    set LineList = *($(AdapterParameters),4)
  1388.     set LineList = {}
  1389.     Debug-Output "LineList = "$(LineList)
  1390. ;    LibraryProcedure Result, $(CHILI_CONFIG_HANDLE), DumpList, $(LineList)
  1391.  
  1392.     ForListDo $(LineList)
  1393.       set LineObject = $($)
  1394.       Debug-Output "LineObject = "
  1395. ;      LibraryProcedure Result, $(CHILI_CONFIG_HANDLE), DumpList, $(LineObject)
  1396.  
  1397.       ; SetRegValue $(BaseKey) {LineObject,$(NoTitle),$(!REG_VT_SZ),$(LineObject)}
  1398.       set LineName = *($(LineObject),1)
  1399. ;      Debug-Output "LineName = "
  1400. ;      LibraryProcedure Result, $(CHILI_CONFIG_HANDLE), DumpList, $(LineName)
  1401.  
  1402.       DeleteRegTree $(ParametersKey) $(LineName)
  1403.  
  1404.       set ConcList = *($(LineObject),2)
  1405. ;      Debug-Output "ConcList = "
  1406. ;      LibraryProcedure Result, $(CHILI_CONFIG_HANDLE), DumpList, $(ConcList)
  1407.  
  1408.       Ifstr $(ConcList) != "{}"
  1409.          shell "" ExCreateRegKey $(ParametersKey) $(LineName)
  1410.  
  1411.          Ifstr(i) $($R0) != NO_ERROR
  1412.              Debug-Output "Error creating registry key!"
  1413.              set KeyHandle = $($R1)
  1414.              CloseRegKey $(BaseKey)
  1415.              goto fatal
  1416.          Endif
  1417.          set LineKey = $($R1)
  1418.       Endif
  1419.  
  1420.       ForListDo $(ConcList)
  1421.          set ConcObject = $($)
  1422.          set ConcName = *($(ConcObject),1)
  1423.          set PortList = *($(ConcObject),2)
  1424.          ; SetRegValue $(BaseKey) {ConcObject,$(NoTitle),$(!REG_VT_SZ),$(ConcObject)}
  1425.          ; SetRegValue $(BaseKey) {ConcName,$(NoTitle),$(!REG_VT_SZ),$(ConcName)}
  1426.          ; SetRegValue $(BaseKey) {PortList,$(NoTitle),$(!REG_VT_SZ),$(PortList)}
  1427.          Debug-Output "   "$(ConcName)
  1428.          Debug-Output "   "$(PortList)
  1429.  
  1430.          shell "" ExCreateRegKey $(LineKey) $(ConcName)
  1431.  
  1432.          Ifstr(i) $($R0) != NO_ERROR
  1433.              Debug-Output "Error creating registry key!"
  1434.              set KeyHandle = $($R1)
  1435.              CloseRegKey $(LineKey)
  1436.              goto fatal
  1437.          Endif
  1438.          set ConcKey = $($R1)
  1439.  
  1440.          ForListDo $(PortList)
  1441.             set PortObject = $($)
  1442.             set PortName = *($(PortObject),1)
  1443.             set PortDosDevices = *($(PortObject),2)
  1444.             ; SetRegValue $(BaseKey) {PortName,$(NoTitle),$(!REG_VT_SZ),$(PortName)}
  1445.             ; SetRegValue $(BaseKey) {PortDosDevices,$(NoTitle),$(!REG_VT_SZ),$(PortDosDevices)}
  1446.             Debug-Output "      "$(PortName)"  -> "$(PortDosDevices)
  1447.             shell "" ExCreateRegKey $(ConcKey) $(PortName)
  1448.  
  1449.             Ifstr(i) $($R0) != NO_ERROR
  1450.                 Debug-Output "Error creating registry key!"
  1451.                 set KeyHandle = $($R1)
  1452.                 CloseRegKey $(LineKey)
  1453.                 goto fatal
  1454.             Endif
  1455.             set PortKey = $($R1)
  1456.             SetRegValue $(PortKey) {DosDevices,$(NoTitle),$(!REG_VT_SZ),$(PortDosDevices)}
  1457.          EndForListDo
  1458.       EndForListDo
  1459.     EndForListDo
  1460.  
  1461.     FlushRegKey $(ParametersKey)
  1462.     CloseRegKey $(ParametersKey)
  1463.     EndWait
  1464.     goto successful
  1465.  
  1466. bindingadapter = +
  1467.     Debug-Output "******************Entering bindingadapter******************"
  1468.     LoadLibrary "x" chiliCui.dll CHILI_CONFIG_HANDLE
  1469.     set Error = "Binding: Sorry, not yet implemented."
  1470.     goto fatal
  1471.  
  1472. removeadapter = +
  1473.     read-syms DebugOptions
  1474.     Debug-Output "******************Entering removeadapter******************"
  1475. ;    Debug-Output "OEMSETUP.INF: removeadapter"
  1476. ;    Debug-Output "OEMSETUP.INF: Removing Hardware Components"
  1477. ;    Debug-Output "OEMSETUP.INF: ProductKeyName = "$(ProductKeyName)
  1478. ;    Debug-Output "OEMSETUP.INF: ProductSoftwareName = "$(ProductSoftwareName)
  1479. ;    Debug-Output "OEMSETUP.INF: ProductSoftwareNameHdwDriver = "$(ProductSoftwareNameHdwDriver)
  1480. ;    Debug-Output "OEMSETUP.INF: NTN_RegBase = "$(!NTN_RegBase)
  1481.  
  1482.     ifstr(i) $(fRemoveChili) == FALSE
  1483.       install RemoveFiles
  1484.       goto removeadapterExit
  1485.     endif
  1486.  
  1487.     LoadLibrary "x" chiliCui.dll CHILI_CONFIG_HANDLE
  1488.  
  1489.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1490.         $(ProductSoftwareNameHdwDriver), $(!NTN_RegBase)
  1491.     Debug-Output "OEMSETUP.INF: RemoveHardwareComponent return value = "$($R0)
  1492.  
  1493.     Ifstr(i) $($R0) != NO_ERROR
  1494.         Debug-Output "OEMSETUP.INF: RemoveHardwareComponent != NO_ERROR"
  1495.     Endif
  1496.  
  1497.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1498.         Debug-Output "ShellCode error"
  1499.         goto ShellCodeError
  1500.     endif
  1501.  
  1502.     set RegistryErrorIndex = $($R0)
  1503.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1504.         Debug-Output "fatal registry error"
  1505.         goto fatalregistry
  1506.     endif
  1507.  
  1508.     ; Deinstall the primary ChiliSrv driver, if reference count
  1509.     ; goes to zero.
  1510.     shell $(UtilityInf), DecrementRefCount, $(ProductKeyName)
  1511.     Debug-Output "OEMSETUP.INF: DecrementRefCount return value = "$($R0)
  1512.     Ifstr(i) $($R0) != NO_ERROR
  1513.         Debug-Output "OEMSETUP.INF: DecrementRefCount != NO_ERROR"
  1514.     Endif
  1515.  
  1516.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1517.         $(ProductSoftwareName), TRUE
  1518.  
  1519.     Debug-Output "RemoveSoftwareComponent return value = "$($R0)
  1520.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1521.         Debug-Output "ShellCode error"
  1522.         goto ShellCodeError
  1523.     endif
  1524.  
  1525.     set RegistryErrorIndex = $($R0)
  1526.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1527.         Ifstr(i) $(RegistryErrorIndex) != REF_COUNT_NOT_ZERO
  1528.             goto fatalregistry
  1529.         endif
  1530.     endif
  1531. ;
  1532. ;    Uncomment next line if driver files are to be deleted.
  1533. ;    install RemoveFiles
  1534.  
  1535. removeadapterExit = +
  1536.     Debug-Output "OEMSETUP.INF: Exiting removeadapter"
  1537.     goto end
  1538.  
  1539. UpgradeSoftware = +
  1540.     Debug-Output "******************Entering UpgradeSoftware******************"
  1541.     LoadLibrary "x" chiliCui.dll CHILI_CONFIG_HANDLE
  1542.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1543.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  1544.         Ifstr $(KeyProduct) != $(KeyNull)
  1545.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  1546.             set Version = *($(VersionInfo), 4)
  1547.             Split-String $(!NTN_Infname), "\", FilenameList
  1548.             QueryListSize ListSize $(FilenameList)
  1549.             set !UG_Filename = *($(FilenameList), $(ListSize))
  1550.             install "Install-Update"
  1551.             ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1552.                 goto fatal
  1553.             endif
  1554.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  1555.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  1556.             ifint $(Version) != $(ProductVersion)
  1557.             endif
  1558.             CloseRegKey $(KeyProduct)
  1559.         else
  1560.             goto fatalregistry
  1561.         endif
  1562.     else
  1563.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  1564.               $(MAXIMUM_ALLOWED) NetworkCardKey
  1565.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1566.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1567.             set ServiceName = *($(ServiceNameInfo), 4)
  1568.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  1569.                 $(MAXIMUM_ALLOWED) NetRuleKey
  1570.             Ifstr $(NetRuleKey) != $(KeyNull)
  1571.             else
  1572.                 goto fatalregistry
  1573.             endif
  1574.             CloseRegKey $(NetRules)
  1575.             CloseRegKey $(NetworkCardKey)
  1576.         else
  1577.             goto fatalregistry
  1578.         endif
  1579.         OpenRegKey $(!REG_H_LOCAL) "" +
  1580.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  1581.               $(MAXIMUM_ALLOWED) ServiceKey
  1582.         Ifstr $(ServiceKey) != $(KeyNull)
  1583.             CloseRegKey $(ServiceKey)
  1584.         else
  1585.             goto fatalregistry
  1586.         endif
  1587.     endif
  1588.     goto end
  1589.  
  1590. successful = +
  1591.     Debug-Output "******************Entering successful******************"
  1592.     goto end
  1593. abandon = +
  1594.     Debug-Output "******************Entering abandon******************"
  1595.     ForListDo $(OEM_ABANDON_OPTIONS)
  1596.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1597.             $(ProductSoftwareName), $($)
  1598.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1599.             Debug-Output "ShellCode error"
  1600.             goto ShellCodeError
  1601.         endif
  1602.         set RegistryErrorIndex = $($R0)
  1603.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1604.             goto fatalregistry
  1605.         endif
  1606.     EndForListDo
  1607.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1608.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1609.             $(ProductSoftwareName), FALSE
  1610.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1611.             Debug-Output "ShellCode error"
  1612.             goto ShellCodeError
  1613.         endif
  1614.         set RegistryErrorIndex = $($R0)
  1615.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1616.             goto fatalregistry
  1617.         endif
  1618.     endif
  1619.     goto end
  1620. warning = +
  1621.     Debug-Output "******************Entering warning******************"
  1622.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1623.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1624.         goto ShellCodeError
  1625.     endif
  1626.     ifstr(i) $($R1) == "OK"
  1627.         goto $(to)
  1628.     else-ifstr(i) $($R1) == "CANCEL"
  1629.         goto $(from)
  1630.     else
  1631.         goto "end"
  1632.     endif
  1633. nonfatalinfo = +
  1634.     Debug-Output "******************Entering nonfatalinfo******************"
  1635.     Set CommonStatus = STATUS_USERCANCEL
  1636.     Set Severity = STATUS
  1637.     goto nonfatalmsg
  1638. nonfatal = +
  1639.     Debug-Output "******************Entering nonfatal******************"
  1640.     Set Severity = NONFATAL
  1641.     goto nonfatalmsg
  1642. nonfatalmsg = +
  1643.     Debug-Output "******************Entering nonfatalmsg******************"
  1644.     ifstr(i) $(Error) == ""
  1645.         Set Severity = NONFATAL
  1646.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1647.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1648.             goto ShellCodeError
  1649.         endif
  1650.         set Error = $($R0)
  1651.     endif
  1652.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1653.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1654.         goto ShellCodeError
  1655.     endif
  1656.     ifstr(i) $($R1) == "OK"
  1657.         goto $(from)
  1658.     else
  1659.         goto "end"
  1660.     endif
  1661. fatalregistry = +
  1662.     Debug-Output "******************Entering fatalregistry******************"
  1663.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1664.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1665.        Debug-Output "fatalregistry: shell to find RegistryErrorString failed."
  1666.        goto ShellCodeError
  1667.     endif
  1668.     set Error = $($R0)" - service "$(ConsensysSpecificString)"."
  1669.     ifstr(i) $(fRemoveChili) == TRUE
  1670.         read-syms AbortMessage$(!STF_LANGUAGE)
  1671.         set Error = $(Error)$(!LF)$(!LF)$(AbortText)
  1672.     endif
  1673.     goto fatal
  1674. fataldetect = +
  1675.     Debug-Output "******************Entering fataldetect******************"
  1676.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1677.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1678.         Debug-Output "ShellCode error: cannot get an error string."
  1679.         goto ShellCodeError
  1680.     endif
  1681.     set Error = $($R0)
  1682.     Goto fatal
  1683. fatal = +
  1684.     Debug-Output "******************Entering fatal******************"
  1685.     Debug-Output "OEMSETUP.INF: ---- fatal called"
  1686.     Shell $(subroutninf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1687.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1688.         Debug-Output "fatal: shell to SetupMessage failed."
  1689.         goto ShellCodeError
  1690.     endif
  1691.     goto setfailed
  1692. ShellCodeError = +
  1693.     Debug-Output "******************Entering ShellCodeError******************"
  1694.     set DlgType      = "MessageBox"
  1695.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1696.     set STF_MB_TEXT  = "Shell Code Error"
  1697.     set STF_MB_TYPE  = 1
  1698.     set STF_MB_ICON  = 3
  1699.     set STF_MB_DEF   = 1
  1700.     ui start "Error Message"
  1701.     goto setfailed
  1702. setfailed = +
  1703.     Debug-Output "******************Entering setfailed******************"
  1704.     set CommonStatus = STATUS_FAILED
  1705.     ifstr(i) $(fRemoveChili) == TRUE
  1706.         set fRemoveChili = FALSE
  1707.         goto removeadapter
  1708.     endif
  1709.     goto end
  1710. end = +
  1711.     Debug-Output "******************Entering end******************"
  1712.     goto term
  1713. term = +
  1714.     ifstr(i) $(CHILI_CONFIG_HANDLE) != $(HandleNull)
  1715.       FreeLibrary $(CHILI_CONFIG_HANDLE)
  1716.     endif
  1717.     Debug-Output "******************Entering term -- GoodBye!!!******************"
  1718.     Return $(CommonStatus)
  1719.  
  1720. [RemoveFiles]
  1721.    Debug-Output "******************Entering [RemoveFiles]******************"
  1722.    set RemoveList = {}
  1723.    set RenameList = {}
  1724.    ;
  1725.    ; First determine if the hardware component has be completely
  1726.    ; uninstalled.  If it has, then we add the components to our
  1727.    ; rename list.
  1728.    ;
  1729.  
  1730.    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyNameHdwDriver) +
  1731.               $(MAXIMUM_ALLOWED) KeyProductHdwDriver
  1732.    ifstr $(KeyProductHdwDriver) == $(KeyNull)
  1733.       CloseRegKey $(KeyProductHdwDriver)
  1734.       set RenameList = >($(RenameList), $(!STF_WINDOWSSYSPATH)"\drivers\"$(AdapterHardwareDriver)".sys")
  1735.    endif
  1736.  
  1737.    ;
  1738.    ; Determine if the ChiliPORTS Service component has been completely
  1739.    ; uninstalled.  If it has, then we add the components to our
  1740.    ; rename list, and add the config stuff to our remove list.
  1741.    ;
  1742.    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) +
  1743.               $(MAXIMUM_ALLOWED) KeyProduct
  1744.    ifstr $(KeyProduct) == $(KeyNull)
  1745.       CloseRegKey $(KeyProduct)
  1746.       set RenameList = >($(RenameList), $(!STF_WINDOWSSYSPATH)"\drivers\chiliObs.sys")
  1747.       set RenameList = >($(RenameList), $(!STF_WINDOWSSYSPATH)"\chiliCui.dll")
  1748.       set RenameList = >($(RenameList), $(!STF_WINDOWSSYSPATH)"\chiliSrv.exe")
  1749. ;      set RemoveList = >($(RemoveList), $(!STF_WINDOWSSYSPATH)"\chiliCui.hlp")
  1750.    endif
  1751.  
  1752.    Debug-Output "RemoveList = "$(RemoveList)
  1753.    Debug-Output "RenameList = "$(RenameList)
  1754.  
  1755.    ForListDo $(RemoveList)
  1756.        Debug-Output "Removing "$($)
  1757.        LibraryProcedure Status , $(!LIBHANDLE), DelFile $($)
  1758.        Debug-Output "Status is "$(Status)
  1759.    EndForListDo
  1760.  
  1761.    ForListDo $(RenameList)
  1762.        Debug-Output "RenameList entry = "$($)
  1763.        Split-String $($) "\" FilePath
  1764.        QueryListSize PathLen $(FilePath)
  1765.        Split-String *($(FilePath),$(PathLen)) "." FullFileName
  1766.        set-sub DirIndex = $(PathLen), 2
  1767.        Set Directory = *($(FilePath),$(DirIndex))"\"
  1768.        Set FileName = *($(FullFileName),1)
  1769.        ifstr(i) $(Directory) != "drivers\"
  1770.            Set Directory = ""
  1771.        endif
  1772.        LibraryProcedure STATUS, $(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\"$(Directory)$(FileName)".old"
  1773.        Debug-Output "CheckFile Status = "$(STATUS)
  1774.        ifstr(i) $(STATUS) == YES
  1775.            LibraryProcedure STATUS, $(!LIBHANDLE), DelFile $(!STF_WINDOWSSYSPATH)"\"$(Directory)$(FileName)".old"
  1776.            Debug-Output "Delfile Status = "$(STATUS)
  1777.            LibraryProcedure STATUS, $(!LIBHANDLE), DelFile $($)
  1778.            Debug-Output "Delfile Status = "$(STATUS)
  1779.        endif
  1780.        ifstr(i) $(fRemoveChili) == TRUE
  1781.          Debug-Output "Renaming from "$($)
  1782.          Debug-Output "Renaming to "$(!STF_WINDOWSSYSPATH)"\"$(Directory)$(FileName)".old"
  1783.          LibraryProcedure Status1 , $(!LIBHANDLE), RenFile $($), $(!STF_WINDOWSSYSPATH)"\"$(Directory)$(FileName)".old"
  1784.          Debug-Output "Status is "$(Status1)
  1785.          AddFileToDeleteList $(!STF_WINDOWSSYSPATH)"\"$(Directory)$(FileName)".old"
  1786.        endif
  1787.    EndForListDo
  1788.    exit
  1789.  
  1790.  
  1791. ;*************************************************************************
  1792. ;
  1793. ;     SECTION:  ExCreateRegKey
  1794. ;
  1795. ;     PURPOSE:  Opens and creates registry keys
  1796. ;
  1797. ;   ARGUMENTS:  $0   Open handle to registry key in which to create new key
  1798. ;               $1   Registry path to create
  1799. ;
  1800. ;    RETURNS:   $R0  error code or zero if no error
  1801. ;               $R1  Registry key handle of the newly created path
  1802. ;
  1803. ;  REFERENCES:  none
  1804. ;
  1805. ;    MODIFIES:  none
  1806. ;
  1807. ;*************************************************************************
  1808. [ExCreateRegKey]
  1809.     Debug-Output "******************Entering [ExCreateRegKey]******************"
  1810.     set ECR_Result          = NO_ERROR
  1811.     set ECR_BaseKeyHandle   = $($0)
  1812.     set ECR_NewPath         = $($1)
  1813.     set KeyNull         = ""
  1814.     set MAXIMUM_ALLOWED   = 33554432
  1815.  
  1816.     Debug-Output "ExCreateRegKey - ECR_BaseKeyHandle = "$(ECR_BaseKeyHandle)
  1817.     Debug-Output "                 ECR_NewPath = "$(ECR_NewPath)
  1818.     Debug-Output "                 MAXIMUM_ALLOWED = "$(MAXIMUM_ALLOWED)
  1819.     Debug-Output "                 KeyNull = "$(KeyNull)
  1820.  
  1821.     OpenRegKey $(ECR_BaseKeyHandle) "" $(ECR_NewPath) $(MAXIMUM_ALLOWED) +
  1822.                ECR_BaseKey
  1823.     Debug-Output "ECR_BaseKey = "$(ECR_BaseKey)
  1824.     Debug-Output "    OpenRegKey returned "$($R0)
  1825.     Ifstr $(ECR_BaseKey) == $(KeyNull)
  1826.         Debug-Output "ECR_BaseKey == KeyNull"
  1827.     Else
  1828.         ; The key all ready exists.
  1829.         Debug-Output "ECR_BaseKey != KeyNull"
  1830.         set ECR_KeyHandle = $(ECR_BaseKey)
  1831.         goto  ECR_Return
  1832.     Endif
  1833.  
  1834.     set ECR_TmpPath = ""
  1835.     Split-String $(ECR_NewPath) "\" ECR_PList
  1836.     Debug-Output "ECR_PList = "$(ECR_PList)
  1837.     ForListDo $(ECR_PList)
  1838.         Ifstr(i) $($) != "\"
  1839.             Ifint $(#) == 1
  1840.                 set ECR_TmpPath = $($)
  1841.             Else
  1842.                 set ECR_TmpPath = $(ECR_TmpPath)"\"$($)
  1843.             Endif
  1844.             Debug-Output "Determining if "$(ECR_TmpPath)" exists"
  1845.             OpenRegKey $(ECR_BaseKeyHandle) "" $(ECR_TmpPath) $(MAXIMUM_ALLOWED) ECR_BaseKey
  1846.             Ifstr $(ECR_BaseKey) == $(KeyNull)
  1847.                 Debug-Output "Creating "$(ECR_TmpPath)
  1848.                 CreateRegKey $(ECR_BaseKeyHandle)  {$(ECR_TmpPath),0,GenericClass} "" $(MAXIMUM_ALLOWED) "" ECR_KeyHandle
  1849.                 Ifstr(i) $(ECR_KeyHandle) == $(KeyNull)
  1850.                     set ECR_Result = $($R0)
  1851.                     goto ECR_Return
  1852.                 Endif
  1853.             Endif
  1854.         Endif
  1855.     EndForListDo
  1856.  
  1857. ECR_Return = +
  1858.     return $(ECR_Result) $(ECR_KeyHandle)
  1859.  
  1860. [DebugExternalGlobals]
  1861.     Set InfName = "OEMSETUP.INF"
  1862.     Debug-Output $(InfName)" NTN_Origination = "$(!NTN_Origination)
  1863.     Debug-Output $(InfName)" NTN_InstallMode = "$(!NTN_InstallMode)
  1864.     Debug-Output $(InfName)" NTN_RegBase = "$(!NTN_RegBase)
  1865.     Debug-Output $(InfName)" NTN_SoftwareBase = "$(!NTN_SoftwareBase)
  1866.     Debug-Output $(InfName)" NTN_ServiceBase = "$(!NTN_ServiceBase)
  1867.     Debug-Output $(InfName)" STF_NTPATH = "$(!STF_NTPATH)
  1868.     Debug-Output $(InfName)" STF_NTWINDOWSSYSPATH = "$(!STF_WINDOWSSYSPATH)
  1869.     Debug-Output $(InfName)" STF_CWDIR = "$(!STF_CWDIR)
  1870.     Debug-Output $(InfName)" STF_LANGUAGE = "$(!STF_LANGUAGE)
  1871.     Debug-Output $(InfName)" STF_NCDETECT  = "$(!STF_NCDETECT)
  1872.     Debug-Output $(InfName)" STF_NCOPTION  = "$(!STF_NCOPTION)
  1873.     Debug-Output $(InfName)" STF_NCDETCARD = "$(!STF_NCDETCARD)
  1874.     Debug-Output $(InfName)" STF_NCDETINFO = "$(!STF_NCDETINFO)
  1875.     Debug-Output $(InfName)" STF_INSTALL_MODE = "$(!STF_INSTALL_MODE)
  1876.     Debug-Output $(InfName)" STF_CONTEXTINFNAME = "$(!STF_CONTEXTINFNAME)
  1877.     return
  1878.  
  1879. [DebugConfiguration]
  1880.     Set InfName = "OEMSETUP.INF"
  1881.     Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  1882.     Debug-Output $(InfName)" IRQ_Level is "$(!p:IRQ_Level)
  1883.     Debug-Output $(InfName)" IOBaseAddrValue is "$(!p:IOBaseAddrValue)
  1884.     Debug-Output $(InfName)" TransceiverValue is "$(!p:TransceiverValue)
  1885.     Debug-Output $(InfName)" MemBaseAddrDec is "$(!p:MemBaseAddrDec)
  1886.     Debug-Output $(InfName)" MappedValue is "$(!p:MappedValue)
  1887.     return
  1888.  
  1889. ;
  1890. ; The AdapterSettings-<Hardware dependent modules> section has
  1891. ; the following entries with there corresponding definitions:
  1892. ;
  1893. ;   IRQRangeList -
  1894. ;   IORangeList -
  1895. ;
  1896.  
  1897.  
  1898. [AdapterSettings-cp4i]
  1899. ;IRQRangeList = {"3","5","7","10","11","12","15","Disabled"}
  1900. IRQRangeList = {"Disabled"}
  1901. IORangeList = {"204","208"}
  1902. IRQDefault = 0
  1903. IODefault = 2
  1904.  
  1905. [AdapterSettings-cp8i]
  1906. ;IRQRangeList = {"3","5","7","10","11","12","15","Disabled"}
  1907. IRQRangeList = {"Disabled"}
  1908. IORangeList = {"204","208"}
  1909. IRQDefault = 0
  1910. IODefault = 2
  1911.  
  1912. [AdapterSettings-cp16i]
  1913. ;IRQRangeList = {"3","5","7","10","11","12","15","Disabled"}
  1914. IRQRangeList = {"Disabled"}
  1915. IORangeList = {"204","208"}
  1916. IRQDefault = 0
  1917. IODefault = 2
  1918.  
  1919. [AdapterSettings-cp8e]
  1920. ;IRQRangeList = {"3","5","7","10","11","12","15","Disabled"}
  1921. IRQRangeList = {"Disabled"}
  1922. IORangeList = {"204","208"}
  1923. IRQDefault = 0
  1924. IODefault = 2
  1925.  
  1926.  
  1927. [BindingInfo-chili]
  1928. BindingInfo     = {+
  1929.                   $(AdapterHardwareDriver)"Driver "$(AdapterHardwareDriver)"Adapter non exclusive 100", +
  1930.                   }
  1931.  
  1932. [MyGetProcessor]
  1933.     PROCESSOR = "" ? $(!LIBHANDLE) GetProcessor
  1934.  
  1935. [SetPlatform]
  1936.     detect MyGetProcessor
  1937.     ifstr(i) $(PROCESSOR) == I386
  1938.         set Platform = I386
  1939.     else-ifstr(i) $(PROCESSOR) == I486
  1940.         set Platform = I386
  1941.     else-ifstr(i) $(PROCESSOR) == I586
  1942.         set Platform = I386
  1943.     else-ifstr(i) $(PROCESSOR) == R4000
  1944.         set Platform = Mips
  1945.     else-ifstr(i) $(PROCESSOR) == Alpha_AXP
  1946.         set Platform = Alpha
  1947.     else
  1948.         set Platform = $(PROCESSOR)
  1949.     endif
  1950.     Debug-Output "SetPlatform: PROCESSOR = "$(PROCESSOR)" Platform = "$(Platform)
  1951.     Return STATUS_SUCCESSFUL $(Platform)
  1952.  
  1953.  
  1954.  
  1955. [InstallResources]
  1956.     set STF_VITAL = ""
  1957.     Debug-Output "OEMSETUP.INF: [InstallResources]"
  1958. ;    AddSectionFilesToCopyList Files-Resource $(!SourceDir)$(!STF_PLATFORM) $(!STF_WINDOWSSYSPATH)
  1959.     AddSectionFilesToCopyList Files-Resource $(!SourceDir) $(!STF_WINDOWSSYSPATH)
  1960.     CopyFilesInCopyList
  1961.     Debug-Output "OEMSETUP.INF: [InstallResources] - Exiting"
  1962.     exit
  1963.  
  1964. [Install-Option]
  1965.     set STF_VITAL = ""
  1966.     Debug-Output "Install-Option: SrcDir = "$(SrcDir)" STF_PLATFORM = "$(!STF_PLATFORM)
  1967.     Debug-Output "Option = "$(Option)" AddCopy = "$(AddCopy)" DoCopy = "$(DoCopy)
  1968.     ifstr(i) $(AddCopy) == "YES"
  1969. ;        AddSectionFilesToCopyList Files-Resource $(SrcDir)$(!STF_PLATFORM) $(!STF_WINDOWSSYSPATH)
  1970.         AddSectionFilesToCopyList Files-Resource $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1971.         AddSectionFilesToCopyList Files-ChiliSrv $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1972. ;        AddSectionFilesToCopyList Files-$(Option) $(SrcDir)$(!STF_PLATFORM) $(!STF_WINDOWSSYSPATH)\drivers
  1973.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1974.     endif
  1975.     ifstr(i) $(DoCopy) == "YES"
  1976.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1977.        CopyFilesInCopyList
  1978.     endif
  1979.     ifstr(i) $(DoConfig) == "YES"
  1980.     endif
  1981.     Exit
  1982.  
  1983. [Source Media Descriptions]
  1984.     1  = "ChiliPORTS Setup Disk"  , TAGFILE = disk1
  1985.     2  = "Windows NT Setup CD-ROM Disk"  , TAGFILE = disk2
  1986.  
  1987. [ProductType]
  1988. STF_PRODUCT  = Winnt
  1989. ;STF_PLATFORM = I386
  1990.  
  1991. [Files-Inf]
  1992. 1,    oemsetup.inf,     SIZE=1000,    RENAME=$(!UG_Filename)
  1993.  
  1994. [Files-Resource]
  1995. 1,chiliCui.dll , SIZE=17408
  1996. 1,chiliSrv.exe , SIZE=78336
  1997.  
  1998. [Files-ChiliSrv]
  1999. 1,chiliObs.sys , SIZE=35840
  2000.  
  2001. [Files-ChiliPORTS8e]
  2002. 1,chili.sys , SIZE=133120
  2003.  
  2004. [Files-ChiliPORTS4i]
  2005. 1,chili.sys , SIZE=133120
  2006.  
  2007. [Files-ChiliPORTS8i]
  2008. 1,chili.sys , SIZE=133120
  2009.  
  2010. [Files-ChiliPORTS16i]
  2011. 1,chili.sys , SIZE=133120
  2012.  
  2013. ;-----------------------------------------------------------------------
  2014. ; OPTION TEXT SECTION
  2015. ; -------------------
  2016. ; These are text strings used to identify the option to the user.  There
  2017. ; are separate sections for each language supported.  The format of the
  2018. ; section name is "OptionsText" concatenated with the Language represented
  2019. ; by the section.
  2020. ;
  2021. ;-----------------------------------------------------------------------
  2022.  
  2023. [OptionsTextENG]
  2024.     ChiliPORTS4i     = "ChiliPORTS /4 RAS Adapter"
  2025.     ChiliPORTS8i     = "ChiliPORTS /8 RAS Adapter"
  2026.     ChiliPORTS16i    = "ChiliPORTS/16 RAS Adapter"
  2027.  
  2028. [OptionsTextMCAENG]
  2029.     ChiliPORTS4m     = "ChiliPORTS MC/4 RAS Adapter"
  2030.     ChiliPORTS8m     = "ChiliPORTS MC/8 RAS Adapter"
  2031.     ChiliPORTS16m    = "ChiliPORTS MC/16 RAS Adapter"
  2032.  
  2033. ;***********************************************************************
  2034. ; Language-Dependent Dialog Constants
  2035. ;***********************************************************************
  2036. [FileConstantsENG]
  2037. ;
  2038. ;  Variables to support thermometer gauge and error dialogs
  2039. ;
  2040.     ProCaption   = "ChiliPORTS Setup"
  2041.     ProCancel    = "Cance&l"
  2042.     ProCancelMsg = "ChiliPORTS Adapters and/or Drivers are not correctly installed. "+
  2043.                    "Are you sure you want to cancel copying files?"
  2044.     ProCancelCap = "ChiliPORTS Setup Message"
  2045.     ProText1     = "Copying:"
  2046.     ProText2     = "To:"
  2047.     Error         = "Unable to determine proper source disk location; copy cannot be performed."
  2048. ;
  2049. ; Product Info
  2050. ;
  2051.     FunctionTitle   ="ChiliPORTS Setup"
  2052. ;
  2053. ; Software
  2054. ;
  2055.     ProductSoftwareDescription          = "ChiliPORTS Service"
  2056.     ProductSoftwareDescriptionHdwDriver = "ChiliPORTS "$(AdapterTitle)" Driver"
  2057.     ProductSoftwareTitle    = "ChiliPORTS Service"
  2058.     ProductSoftwareTitleHdwDriver = "ChiliPORTS "$(AdapterTitle)" Driver"
  2059.  
  2060. ;
  2061. ; Configuration Information
  2062. ;
  2063.    ConfigurationTitle = "ChiliPORTS "$(AdapterTitle)" Adapter Setup"
  2064.  
  2065. ;
  2066. ; Hardware
  2067. ;
  2068.     ProductHardwareDescription  = "ChiliPORTS "$(AdapterTitle)" RAS Adapter"
  2069.     ProductHardwareTitle        = "ChiliPORTS "$(AdapterTitle)" RAS Adapter"
  2070.  
  2071. [DialogConstantsENG]
  2072. ;
  2073. ; Common button names, etc.
  2074. ;
  2075.     Help        = "&Help"
  2076.     Exit        = "E&xit"
  2077.     OK          = "OK"
  2078.     HelpContext = ""
  2079.     Continue    = "C&ontinue"
  2080.     Cancel      = "C&ancel"
  2081.  
  2082. [UpdatingConfigurationENG]
  2083.     UpdatingConfiguration      = "Updating new configuration..."
  2084.  
  2085. [AbortMessageENG]
  2086.   AbortText  =  "Aborting ChiliPORTS Setup. Please reboot the system "+
  2087.                 "to fix the problem."
  2088.  
  2089.