oemsetup.inf Driver File Contents (7506396.exe)

;---------------------------------------------------------------------------
;
; OEMSETUP.INF
;
;----------------------------------------------------------------------------
;
;1.77
;- Basically working.  Everything installs and un-installs.  com ports can be changed, and   ;PCI cards can co-exist with isa cards.;;
;
;- baud rates cannot be selected correctly, and debug messages still come up due to both the   ;install script and the COM port dialog code.;
;
;1.78
;- no-longer can select PCI if an ISA card is being installed.
;- The modified serial driver installs, and a backup is made of the existing serial driver   ;for the un-install process.
;- debug dialogs no longer come up.
;- 230.4k can't be selected (and probably can't be selected until NT 5 is released).
;
;1.80
;- 230.4k is working and the new modem.inf files are in place (although not completely ;tested)
;- This is the last installation disks before my new driver is in place.
;
;2.0
;- new driver is in place, and I no longer make use of the serial driver.
;- still have two drivers however.
;- Don't fully make use of the 654, although better use than old serial driver.
;
;v2.1
;- The new rastel driver adds code to allow the modem to be reset
;
;v2.2 
;- started adding support for unattended setup.  This is not yest complete
;- this disk makes use of the multi-board driver.
;v2.21 8/5/98
;-now handles shared interrupts.
;
;v2.22
;
;v3.1 this has been modified to provide support for the gui installation
;
;v3.4 added support for modifying the 2 port, and the 4 port, as well as the 8 port
;
;v3.6 removed a whole heap of installation stuff which wasn't needed.
;-----------------------------------------------------------------------
; IDENTIFICATION SECTION
;
; OPTION TYPE
; -----------
; This identifies the Option type we are dealing with.  The different
; possible types are:
;
; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
;
;  Types specific to networking:
;
; NetAdapter,        a netcard / adapter combination or just a netcard
; NetDriver,         just a netcard driver
; NetTransport,      a complete NDIS-compliant TDI transport stack
; NetService,        an NT networking service
; NetWork,           a complete network ensemble.
; NetProvider        a complete network which supports NT MPR protocol
;-----------------------------------------------------------------------

[Identification]
    OptionType = NetAdapter


;-----------------------------------------------------------------------
; PLATFORMSSUPPORTED SECTION
; ------------------
; This identifies the platforms supported by the adapter card.
; Possible types are:
;
; NOW PCI ONLY!!
;-----------------------------------------------------------------------

[PlatformsSupported]
;    ISA
	PCI

;-----------------------------------------------------------------------
; OPTIONS SECTION
;
; This section lists the OEM Option key names.  These keys are locale
; independent and used to represent the option in a locale independent
; manner.
;
;-----------------------------------------------------------------------

[Options]
;    RASTEL40 = "RAStel4 Quad Modem Card"
;    RASTEL22 = "RAStel2 2 Modem + 2 Serial Card"
;	RASTEL80 = "RAStel8 8 Modem Card"
	A =  "ViVa RAS 4"
    B =  "ViVa RAS 2"
    C =  "ViVa RAS 8"



;-----------------------------------------------------------------------
; OPTIONSTEXTENG SECTION
;
; The description displayed in the list of options if the language is ENGlish
;  OptionsTextENG  element "n" is the textual description/name of
;  Options  element "n"
;-----------------------------------------------------------------------

[OptionsTextENG]
;    "RAStel4 Quad Modem Card"
;    "RAStel2 2 Modem + 2 Serial Card"
;	"RAStel8 8 Modem Card"
	"ViVa RAS 4"
	"ViVa RAS 2"
	"ViVa RAS 8"


;-----------------------------------------------------------------------
; LANGUAGESSUPPORTED SECTION
;
; This section lists the languages supported.
;
;-----------------------------------------------------------------------

[LanguagesSupported]
    ENG

;-----------------------------------------------------------------------
; SOURCE MEDIA DESCRIPTIONS
;
; The install disk info.
;-----------------------------------------------------------------------
[Source Media Descriptions]
    1 = "RAStel Disk1", TAGFILE = rastel1.TXT


;-----------------------------------------------------------------------
; FILES????
; A number of sections in which we define the files making up the component
; These are then used in installing the component
;-----------------------------------------------------------------------

[FilesConfig]
    DLL = 1, install.dll, SIZE=60000, RENAME="mbvcnfg.dll"
;    HLP = 1, mbvCnfg.hlp, SIZE=6000

[FilesDriver]
    Driver = 1, rastel.sys, SIZE=15000
	ComDrv = 1, rastela.sys, SIZE=52000, OVERWRITE="ALWAYS"

[FilesInf]
    Inf = 1, oemsetup.inf, SIZE=65000, RENAME=$(!UG_Filename)

;-----------------------------------------------------------------------
; GENERALCONSTANTS
; Stuff we use here and there
;-----------------------------------------------------------------------
[GeneralConstants]
;
;
;   ; Stuff.....
    NoTitle = 0
    KeyNull = ""
    MaskAllAccess = 33554432
;
    ErrorIndex = "NO_ERROR"
    ErrorPrefix = ""
;
;
;   ; Files we reference
    UtilityInf      = "utility.inf"
    ParamInf        = "ncparam.inf"
    SubroutineInf   = "subroutn.inf"


;-----------------------------------------------------------------------
; INSTALLCONSTANTS
; Stuff we need to do the install processing
;-----------------------------------------------------------------------
[InstallConstants]

;    ; Product Info
;    ;
    Manufacturer                = "ComputerPeripheralsInt"
	ManufacturerLong			= "Computer Peripherals International"
	CardNameLong				= "ViVa RAS 56"
    ProductSoftwareName         = "vras"
    ProductHardwareName         = $(ProductSoftwareName)
    ProductSoftwareTitle        = $(CardNameLong)" Config"
    ProductSoftwareDescription  = $(ManufacturerLong)" "$(ProductSoftwareTitle)"Serial Driver"
    ProductMajorVersion         = "3"
    ProductMinorVersion         = "70"
	DriverName					= "vras"

;;Info for second driver
	ProductSoftwareName2		= $(ProductSoftwareName)"A"
	ProductHardwareName2		= $(ProductHardwareName)"A"
    ProductSoftwareTitle2       = $(CardNameLong)" Driver"
    ProductSoftwareDescription2 = $(ProductSoftwareDescription)
	ConfigDLL					= "cpicnfg.dll"
;
    ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
;
;   No image path 'cos there isn't a driver yet...
;	this thing below is not used anyway
    ProductSoftwareImagePath = "%SystemRoot%\System32\drivers\"$(DriverName)".sys"
;   ProductSoftwareImagePath = ""
;
;   Where we keep our info for our software
;
    ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)+
        "\"$(ProductSoftwareName)"\CurrentVersion"
;
;   Where NT keeps its info
    NTKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion"
;
;   Where NT keeps network card info (seems like a weird place but thats
;   Microsoft for you)
;
    NetworkCardsKeyName = $(NTKeyName)"\NetworkCards"
;
;   Where RAS keeps its software info
    RASKeyName = $(!NTN_SoftwareBase)"\Microsoft\RAS\CurrentVersion"
;
;
;   Binding registry information.
;   The binding process uses Prolog rules to generate the resulting
;   configuration.
;   These constants are used to generate the entries under the NetRules
;   key in registry.

;   NetRule\Type
;
;   type = <product name> <class> [<lower class>]
;
;   States that viewed from the upper interface, component <product name>
;   is of class <class>.
;   If <lower class> is specified it states that viewed from the lower
;   interface the component is of class <lower class>. If <lower class>
;   is absent, it is assumed to be the same as <class>. These classes are,
;   in general, only different if the component encapsulates more than one
;   layer in the stack.

    NetRuleSoftwareType = "mbv_"$(DriverName)"_driver serialDriver "$(DriverName)"Driver"
    NetRuleHardwareType = "mbv_"$(DriverName)"_adapter "$(DriverName)"Adapter"

;   NetRule\Use
;
;   use = {service|driver|transport|adapter} {yes|no} {yes|no}
;
;   adapter is redundant as hardware is assumed to be adapter.
;   Every attempt is made to load a service and a log entry is generated if
;   this is impossible due to the lack of a suitable transport.
;   transport and driver usages are only loaded if required by the bindings.

    NetRuleSoftwareUse = "driver"
    NetRuleHardwareUse = "adapter"

;   NetRule\Class
;
;   class = <new class name> {<existing class name>|basic} [{no|yes]]
;
;   <new class name> is the name of the class being defined, which may be
;   based on <existing class name> or be a basic class. Include a "yes" if
;   this class is a logical endpoint (eg. a multiplexing/routing layer that
;   makes everything underneath it seem to be a single port).

    NetRuleSoftwareClass = {"serialDriver basic", $(DriverName)"Driver basic"}
    NetRuleHardwareClass = {$(DriverName)"Adapter basic"}


;   NetRule\Bindable
;
;   bindable = <fromClass> <toClass> {exclusive|non} <value>
;
;   defines that <fromClass> can be bound to <toClass> and that
;   the binding of <fromClass> is either exclusive (ie. cannot be bound TO
;   anything else) or non-exclusive. Similarly the <toClass> exclusivity
;   specifies whether <toClass> can be bound FROM anything else.
;   The <value> parameter resolves conflicting binding rules in favour of
;   the rule with the highest <value>.

    NetRuleSoftwareBindable = {$(DriverName)"Driver "$(DrivreName)"Adapter non exclusive 100"}

;   NetRuleHardwareBindable = {}
;   hardware doesn't bind to anything.

;   NetRule/Bindform
;
;   bindform = <objectName> {yes|no} {yes|no} {container|simple|streams}
;
;   <objectName> MUST be the same as the "service name" (I think this means
;   the <product name> field in the type declaration. Who writes MS docs?).
;   Looking at the ElinkII example the naming is inconsistent so who knows?
;   Anyway, the successive fields mean:
;   Put binding info. in <objectName>'s Linkage registry subkey? {yes|no}
;   Include the device name in the binding info? {yes|no}
;   Structure of binding string is one of: {container|simple|streams}

    NetRuleSoftwareBindForm = """mbv_"$(DriverName)"_driver"" yes no container"

;   I have no idea what the null name for the hardware does - I just copied
;   the examples and Rick...
    NetRuleHardwareBindForm = " yes yes container"

;   NetRule/Review
;   review  = { 0 | 1 }
;
;   A non-zero value causes the inf file to be called if the bindings are
;   changed.
;   I don't know what the entry point is in this case?


;   NetRule/Hidden
;   hidden  = { 0 | 1 }
;
;   A non-zero value causes the component to be hidden from the NCPA
;   interface (ie. can't be seen in list and hence can't be selected for
;   configuration, removal etc).

    NetRuleSoftwareHidden = 1
;   NetRuleHardwareHidden = 0

;   The binding engine will update the following registry entries for us.
;
;   HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\rastel\Linkage
;                                                                  Bind
;                                                                  Export
;                                                                  Route
;
;   We still need to do the rest of the registration processing.
;

;   Place hardware port names etc. in registry HARDWARE key
    SerialMapParent = "HARDWARE\DEVICEMAP"
    SerialMapKeyName = "SERIALCOMM"
    SerialMap = $(SerialMapParent)"\"$(SerialMapKeyName)

;   Info on the types of busses are in here...
    MultiAdapter = "HARDWARE\Description\System\MultifunctionAdapter"
    EISAAdapter = "HARDWARE\Description\System\EISAAdapter"


;   EventLog Message Linkage
;
    IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"

;-----------------------------------------------------------------------
; MESSAGECONSTANTSENG
;    dialog messages, in ENGlish
;-----------------------------------------------------------------------
[MessageConstantsENG]

;    ; Text to be used in the various dialogs

    FunctionTitle = $(ManufacturerLong) $(ProductSoftwareName)" Setup"

    ShellCodeErrorTitle = "Error: "$(FunctionTitle)
    ShellCodeErrorText = "Shell Code Error"

    UpdateCfgMessage = "Updating configuration"

    CardExistedText = "There are already one or more " $(ProductSoftwareName) " cards installed."+
                      "  Do you want to install another?"

;   Progress messages

    ProCaption = $(ManufacturerLong) $(ProductSoftwareName)" Adapter Setup"
    ProText1 = "Copying:"
    Protext2 = "To:"

    ProCancel  = "Cancel"

    ProCancelCap = $(ProductSoftwareName) " Adapter Setup Message"
    ProCancelMsg = "Installation is not complete."+
                   "  Are you sure you want to cancel?"



;-----------------------------------------------------------------------
; ERRORSTRINGSENG
;    error messages, in ENGlish
;-----------------------------------------------------------------------
[ErrorStringsENG]

;    ; Error messages

    MBV_NO_BIND = "Binding not implemented"
    MBV_NO_BUS_FOUND = "Can't find system bus in Registry"
    MBV_SHELLCODE_ERROR = "Shell command failed"
    MBV_OPEN_SOFTWARE_KEY = "Unable to open Software Product key in Registry"
    MBV_OPEN_PARAM_KEY = "Unable to open Netcard Parameters key in Registry"
    MBV_CREATE_SMAP_KEY = +
        "Unable to create "$(SerialMapKeyName)" key in Registry"
    MBV_OPEN_NETCARD_KEY = "Unable to open network card key in Registry"
    MBV_OPEN_NT_KEY = "Unable to open Windows NT key in Registry"

; The following are messages related to copying registry info to the
; NT standard serial driver.
    MBV_OPEN_SERIAL_KEY = +
        "Unable to open Windows NT Serial Services key in Registry"
    MBV_CREATE_SERIALP_KEY = +
        "Unable to create Windows NT Serial Parameters key in Registry"

; The following are warning re. failing to add our modem info to RAS's
; modem.inf file.
    MBV_OPEN_RAS_KEY    = "Unable to find RAS in Registry"
    MBV_APPEND_MODEMINF = "Unable to update RAS modem.inf file"

;---------------------------------------------------------------------------
; 1. Identify
;
; DESCRIPTION:   To verify that this INF deals with the same type of options
;                as we are choosing currently.
;
; INPUT:         None
;
; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
;                $($R1): Option Type (COMPUTER ...)
;                $($R2): Diskette description
;---------------------------------------------------------------------------

[Identify]
    ;
    ;
    read-syms Identification

    set Status     = STATUS_SUCCESSFUL
    set Identifier = $(OptionType)
    set Media      = #("Source Media Descriptions", 1, 1)

    Return $(Status) $(Identifier) $(Media)


;------------------------------------------------------------------------
; 2. ReturnOptions:
;
; DESCRIPTION:   To return the option list supported  by this INF and the
;                localised text list representing the options.
;
;
; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
;
; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
;                                STATUS_NOLANGUAGE
;                                STATUS_FAILED
;                                STATUS_NOTSUPPORTED
;
;                $($R1): Option List
;                $($R2): Option Text List
;------------------------------------------------------------------------

[ReturnOptions]
;    ;
;    ;
    shell "" DisplayProgress "RASTEL: [ReturnOptions] Section Entered"

    set Status        = STATUS_FAILED
    set OptionList     = {}
    set OptionTextList = {}

;    ;
;    ; Check if the language requested is supported
;    ;
    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) in $(LanguageList)
;        ;
;        ; Check if the platforms requested is supported
;        ; I'm not sure what happens on a machine with multiuple bus types?!
;        ; Also, should ISA card accept EISA as a bus type?
;        ; For now, just ignore the bus type. If someone is trying to
;        ; install our card in a machione without an ISA bus they have
;        ; more problems than this utility can deal with :-)
;        ;

        goto returnoptions

;        ifstr(i) $($1) == ""
;                        goto returnoptions
;        endif

;        set PlatformList = ^(PlatformsSupported, 1)
;        Ifcontains(i) $($1) in $(PlatformList)
;            goto returnoptions
;        else
;            set Status = STATUS_NOTSUPPORTED
;            shell "" DisplayProgress "RASTEL: Platform Not Supported"
;            goto finish_ReturnOptions
;        endif
    else
         set Status = STATUS_NOLANGUAGE
         shell "" DisplayProgress "RASTEL: Language Not Supported"
         goto finish_ReturnOptions
    endif

;    ;
;    ; form a list of all the options and another of the text representing
;    ;

returnoptions = +
    set OptionList     = ^(Options, 0)
    set OptionTextList = ^(OptionsText$($0), 1)
    set Status         = STATUS_SUCCESSFUL

finish_ReturnOptions = +
    shell "" DisplayProgress "RASTEL: Options = "$(OptionList)
    Return $(Status) $(OptionList) $(OptionTextList)

;---------------------------------------------------------------------------
; **************************************************************************
;---------------------------------------------------------------------------
[InstallOption]
    set Status   = STATUS_FAILED

;    ;
;    ; extract parameters
;    ;
    set Language = $($0)
    set Option   = $($1)
    set SrcDir   = $($2)
    set AddCopy  = $($3)
    set DoCopy   = $($4)
    set DoConfig = $($5)

    set Opt = "RASTEL: Language:"$(Language)", Option:"$(Option)", SrcDir:"$(SrcDir)+
                  ", AddCopy:"$(AddCopy)" DoCopy:"$(DoCopy)", DoConfig:"$(DoConfig)

;
;ensure that the requested language is supported
;
	set LanguageList = ^(LanguagesSupported, 1)
    ifcontains(i) $(Language) not-in $(LanguageList)
        return STATUS_NOLANGUAGE
    endif

	;
	;Init variables that we may need in the install process
	;
    read-syms GeneralConstants
    read-syms InstallConstants
    read-syms MessageConstants$(Language)


	;
	;Obtain the current date
	;
    detect date

    set OEM_ABANDON_ON = FALSE
    set CommonStatus = STATUS_SUCCESSFUL


;    ; Run the appropriate code based on requested function
;    shell "" DisplayProgress "RASTEL: NTN_InstallMode = "$(!NTN_InstallMode)

	;
	;Note that we have to support all of the following, because another card might be installed
	;After this one has been installed in unattended mode, so we continue as per the 
	;non-unattended mode installation.
	;
		ifstr(i) $(!NTN_InstallMode) == update
			goto DoUpdate
		else-ifstr(i) $(!NTN_InstallMode) == configure
			goto DoConfigure
		else-ifstr(i) $(!NTN_InstallMode) == deinstall
			goto DoRemove
		else-ifstr(i) $(!NTN_InstallMode) == bind
			goto DoBind

		else-ifstr(i) $(!NTN_InstallMode) == install
			goto DoInstall
		endif
		;
		;If we get here, then someone is playing silly buggers with us.
		;
			goto Error_message
	



DoInstall = +
    set OEM_ABANDON_ON = TRUE
    set OEM_ABANDON_OPTIONS = {}
    set OEM_ABANDON_SOFTWARE = FALSE


    shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS +
        "Please run "$(SrcDir)"\setup.exe to install."

    set CommonStatus = STATUS_FAILED

    return $(CommonStatus)


;---------------------
; DoConfigure - reconfigure a previously installed adapter
;---------------------
DoConfigure = +
;
; We dont configure the driver, only adapters (at present anyway)
; driver is hidden (not to mention non-existant!)
;
    ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
        set ErrorIndex = CANNOT_CONFIGURE_SOFTWARE
        goto fatalmessage
    endif
    shell "" DisplayProgress "RASTEL: DoConfigure"

;    ; get the system bus config info.

    shell "" GetSystemCfgData ; gets the bus info and com port names
    set ErrorIndex = $($R0)
    set ErrorPrefix = $($R1)
    set numISA = $($R2)
	set numPCI = $($R3)
    set ComPortList = $($R4)

    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto shellcode_error
    endif

    ifstr(i) $(ErrorIndex) != NO_ERROR
        goto fatalmessage
    endif

    shell "" DisplayProgress "RASTEL: DoConfigure, have system config"

;    ;
;    ; Find the service name in
;    ; SOFTWARE\Microsoft\Windows NT....\NetworkCards\<num>
;    ;

    OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MaskAllAccess) AdapterKey
    ifstr $(AdapterKey) == $(KeyNull)
        set ErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
        goto fatalmessage
    endif

    shell "" DisplayProgress "RASTEL: DoConfigure, have networkcard key"
    GetRegValue $(AdapterKey) "ServiceName" ServiceInfo
    set AdapterServiceName = *($(ServiceInfo), 4)
    CloseRegKey $(AdapterKey)
    shell "" DisplayProgress "RASTEL: Servicename="$(AdapterServiceName)

;    ; Now we have the service name, open the service\Parameters key and
;    ; get the parameters

    OpenRegKey $(!REG_H_LOCAL) "" +
        $(!NTN_ServiceBase)"\"$(AdapterServiceName)"\Parameters" +
        $(MaskAllAccess) ParametersKey
    ifstr $(ParametersKey) == $(KeyNull)
        set ErrorIndex = MBV_OPEN_PARAM_KEY
        goto fatalmessage
    endif
    shell "" DisplayProgress "RASTEL: Have parameters key"

    GetRegValue $(ParametersKey) "BusType" TmpList
    set BusType = *($(TmpList), 4)
    GetRegValue $(ParametersKey) "BusNumber" TmpList
    set BusNumber = *($(TmpList), 4)
    GetRegValue $(ParametersKey) "IoAddress" TmpList
    set IoAddress = *($(TmpList), 4)
    GetRegValue $(ParametersKey) "SecondaryIoAddress" TmpList
    set SecondaryIoAddress = *($(TmpList), 4)
    GetRegValue $(ParametersKey) "Interrupt" TmpList
    set Interrupt = *($(TmpList), 4)


    GetRegValue $(ParametersKey) "Port1" TmpList
    set PortList = {*($(TmpList), 4)}
    GetRegValue $(ParametersKey) "Port2" TmpList
    set PortList = >($(PortList), *($(TmpList), 4))
	
	;
	;Stuff for the two port card only
	;

	ifstr(i) $(Option) != "B"
		GetRegValue $(ParametersKey) "Port3" TmpList
		set PortList = >($(PortList), *($(TmpList), 4))
		GetRegValue $(ParametersKey) "Port4" TmpList
		set PortList = >($(PortList), *($(TmpList), 4))
	endif

    ifstr(i) $(Option) == "C"
        GetRegValue $(ParametersKey) "Port5" TmpList
        set PortList = >($(PortList), *($(TmpList), 4))
        GetRegValue $(ParametersKey) "Port6" TmpList
        set PortList = >($(PortList), *($(TmpList), 4))
        GetRegValue $(ParametersKey) "Port7" TmpList
        set PortList = >($(PortList), *($(TmpList), 4))
        GetRegValue $(ParametersKey) "Port8" TmpList
        set PortList = >($(PortList), *($(TmpList), 4))
	endif

;	shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS +
;		"com ports are"$(PortList)

;	shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS +
;		"bustype is"$(BusType)

;    ; Now run the DLL config routine to let user change stuff

      LoadLibrary "x" $(!STF_CWDDIR)$(ConfigDLL) MbvCfgHandle
      shell $(SubroutineInf) PopBillBoard
      LibraryProcedure Result $(MbvCfgHandle) DoMBVConfig +
          $(!STF_HWND) $(Option) $(numISA) $(numEISA) $(numMCA) $(numPCI) +
          $(ComPortList) +
          $(BusType) $(BusNumber) $(Slot) +
          $(IoAddress) $(SecondaryIoAddress) +
          $(Interrupt) +
          $(PortList)
;
      ifstr(i) $(MbvCfgHandle) != $(HandleNull)
          FreeLibrary $(MbvCfgHandle)
      endif
      set CfgParameters = $(Result)
      shell "" DisplayProgress "DLL Res:"$(CfgParameters)


;    ; The following line constructs dummy return data for testing
;    set CfgParameters = { +
;        1, ISA, 0, 0, 256, 1280, 2, +
;       {"COM9", "COM8", "COM7", "COM6"} +
;    }
    shell "" DisplayProgress "RASTEL: Have new config"

;    ;
;    ; Result is error code, followed by
;    ;  BusType, BusNumber, Slot, IoBase, Io2Base, IRQ, PortList
;    ;
    set CfgError = *($(CfgParameters),1)
    ifint $(CfgError) == 0
        CloseRegKey $(ParametersKey)
        set CommonStatus = STATUS_USERCANCEL
        goto end
    endif

    set BusType = *($(CfgParameters),2)
    set BusNumber = *($(CfgParameters),3)
    set Slot = *($(CfgParameters),4)
    set IOBase = *($(CfgParameters),5)
    set IO2Base = *($(CfgParameters),6)
    set IRQ = *($(CfgParameters),7)
    set PortList = *($(CfgParameters),8)

    shell $(SubroutineInf) PushBillBoard NETSTATUSDLG $(UpdateCfgMessage)
    StartWait
    shell "" DisplayProgress "RASTEL: About to write new config"

;    ; write new config
    shell "" WriteBoardConfig $(ParametersKey) +
        $(Option) $(BusType) $(BusNumber) $(Slot) +
        $(IOBase) $(IO2Base) $(IRQ) $(PortList)

    set ErrorIndex = $($R0)
    set ErrorPrefix = $($R1)

    ifint $($ShellCode) != $(!SHELL_CODE_OK)

		goto shellcode_error
    endif


;    ifstr(i) $(ErrorIndex) != NO_ERROR
;        CloseRegKey $(ParametersKey)
;        goto fatalmessage
;    endif


;    shell "" CopyBoardConfig $(ParametersKey) $(AdapterServiceName)
;    set ErrorIndex = $($R0)
;    set ErrorPrefix = $($R1)

;    ifint $($ShellCode) != $(!SHELL_CODE_OK)
;        goto shellcode_error
 ;   endif
    ;shell "" DisplayProgress "RASTEL: DoConfigure, CopyBoardConfig Done"

;    ifstr(i) $(ErrorIndex) != NO_ERROR
;        CloseRegKey $(ParametersKey)
;        goto fatalmessage
;    endif


    CloseRegKey $(ParametersKey)
    goto end

;------------------
; Remove Adapter. Also remove driver if the last adapter is removed.
;------------------
DoRemove = +
    ifstr(i) $(NTN_RegBase) == $(ProductKeyName)
;        ; driver is hidden (and not there!) but who cares...

    endif

;    ; remove adapter

;    ; Hmm... before we kill the registration info for this hardware,
;    ; we had better remove any entries in the standard serial driver
;    ; registry that are ports on this adapter...

;    ; NTN_RegBase should be the subscript of the adapter.
;    ; Need to find its name
    OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MaskAllAccess) AdapterKey
    ifstr $(AdapterKey) == $(KeyNull)
        set ErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
        goto fatalmessage
    endif

    shell "" DisplayProgress "RASTEL: DoRemove, have networkcard key"
    GetRegValue $(AdapterKey) "ServiceName" ServiceInfo
    set AdapterServiceName = *($(ServiceInfo), 4)
    CloseRegKey $(AdapterKey)
    shell "" DisplayProgress "RASTEL: Servicename="$(AdapterServiceName)

;    ; Kill anything that matches this in the serial registry
    shell "" DeleteBoardConfig $(AdapterServiceName)
;
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto shellcode_error
    endif

;    ; now remove hardware registry info

    shell $(UtilityInf) RemoveHardwareComponent $(Manufacturer) +
        $(ProductSoftwareName) $(!NTN_RegBase)
    set ErrorIndex = $($R0)

    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto shellcode_error
    endif

    ifstr(i) $(ErrorIndex) != NO_ERROR
        set ErrorPrefix = "RemoveHardwareComponent"
        goto fatalmessage
    endif

;    ; remove the driver if there are no adapters left

    shell $(UtilityInf) RemoveSoftwareComponent $(Manufacturer) +
        $(ProductSoftwareName) TRUE
    set ErrorIndex = $($R0)

    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto shellcode_error
    endif

    ifstr(i) $(ErrorIndex) != NO_ERROR
        ifstr(i) $(ErrorIndex) != REF_COUNT_NOT_ZERO
            set ErrorPrefix = "RemoveSoftwareComponent"
            goto fatalmessage
        endif
    endif

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase) $(MaskAllAccess) ServiceKey

	ifstr(i) $(ServiceKey) == $(!KeyNull)
		set ErrorPrefix = "Removing port driver"
		goto fatalmessage
	endif

;	OpenRegKey $(ServiceKey) "" $(ProductSoftwareName2) $(MaskAllAccess) ServiceParamKey

;	ifstr(i) $(ServiceParamKey) == $(!KeyNull)
;		set ErrorPrefix = "Removing port driver"
;		goto fatalmessage
;	endif

	;
	;Add code here to check if the serial driver key should be removed
	;
	
;	OpenRegKey $(ServiceParamKey) "" "Parameters" $(MaskAllAccess) ParamKey
 ;   EnumRegValue $(ParamKey) RastelList

;	shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL "___"$(RastelList)"____"

;	ifstr(i) $(RastelList) != "{}"			;;if the return is not empty
;		goto end						;we must have no registry entries to delete
;	endif

	;
	;Otherwise delete all of the stuff about the vras - to do
	;

;	DeleteRegKey $(ServiceParamKey) "Parameters"

;	DeleteRegKey $(ServiceParamKey) "Enum"

;	CloseRegKey $(ServiceParamKey)

;	DeleteRegKey $(ServiceKey) $(ProductSoftwareName2)

	CloseRegKey $(ServiceKey)

    goto end


;-------------------
; DoUpdate - install new driver. As there isn't one this is novel,
; but conceivably there could be one later. If so, installing it
; will be a bit tricky as we will have to kill all the serial hooks.
; Just go ahead and do it. This will install a new inf file too, which
; can hopefully sort out the mess left by this one (all it really has to
; do is to delete the serial registry info for the rastel board(s). this
; can be done when board configure is done using new .inf file).
;------------------
DoUpdate = +

;TO DO:
;Actually put code here to copy across the new drivers.
;

;
;We check that the current version is after 3.0.  If it is, then we install
;
    

	

    goto end

;-------
; DoBind - don't bother
; There is nothing to bind.
;-------
DoBind = +
    set ErrorIndex = MBV_NO_BIND
    goto fatalmessage



;-----
; fatalmessage - handles error message
;-----
fatalmessage = +
    shell "" GetErrorString $(ErrorIndex)
    set Error = $($R0)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto shellcode_error
    endif
    goto fatal


;-----
; fatal - handles exit on fatal error
;-----
fatal = +
    ifstr $(Error) == ""
        shell $(UtilityInf) RegistryErrorString SETUP_FAIL
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto shellcode_error
        endif
        set Error = $($R0)
    endif
    ifstr $(ErrorPrefix) != ""
        set Error = "("$(ErrorPrefix)"): "$(Error)
        set ErrorPrefix = ""
    endif
    shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) "FATAL" $(Error)
    ifint $(ShellCode) != $(!SHELL_CODE_OK)
        goto shellcode_error
    endif
    goto setfailed

;-----
; shellcode_error  - Shell failed
;-----
;
shellcode_error = +
    set DlgType = "MessageBox"
    set STF_MB_TITLE = $(ShellCodeErrorTile)
    set STF_MB_TEXT = $(ShellCodeErrorText)
    set STF_MB_TYPE = 1
    set STF_MB_ICON = 3
    set STF_MB_DEF = 1
    ui start "Error Message"
    goto setfailed

;-----
; setfailed - error cleanup and exit
;-----
setfailed = +
    set CommonStatus = STATUS_FAILED
    ifstr(i) $(OEM_ABANDON_ON) == TRUE
        set OEM_ABANDON_ON = FALSE
        goto abandon
    endif
    goto end

;-----
; abandon - undo registry changes
;-----
abandon = +
    ForListDo $(OEM_ABANDON_OPTIONS)
        shell $(UtilityInf) RemoveHardwareComponent $(Manufacturer) $(ProductSoftwareName) $($)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto shellcode_error
        endif
        set ErrorIndex = $($R0)
        ifstr(i) $(ErrorIndex) != "NO_ERROR"
            set ErrorPrefix = "Abandon Hardware"
            goto fatalmessage
        endif
    EndForListDo

    ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
        shell $(UtilityInf) RemoveSoftwareComponent $(Manufacturer) $(ProductSoftwareName) $($)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto shellcode_error
        endif
        set ErrorIndex = $($R0)
        ifstr(i) $(ErrorIndex) != "NO_ERROR"
            set ErrorPrefix = "Abandon Software"
            goto fatalmessage
        endif
    endif
    goto end


;------------
; end - THE END!!!
;------------
end = +
    EndWait
    Return $(CommonStatus)


;--------------------------------------------------------------------------
; Warning Dlg. Tells us something didn't work (but is't critical)
;--------------------------------------------------------------------------
[DisplayWarning]
    read-syms GeneralConstants
    shell "" GetErrorString $($0)
    set Error = $($R0)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto shellcode_error
    endif
    shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        goto shellcode_error
    endif
    return

;--------------------------------------------------------------------------
; Progress Dlg. Tells us where we are up to....
;--------------------------------------------------------------------------
[DisplayProgress]
;   read-syms GeneralConstants
;   shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL $($0)
    return



;--------------------------------------------------------------------------
; WriteBoardConfig
; Shell Section
; Called locally to update registry info re. board config.
;
; IN:
;   $0: Parameters registry key
;   $1: Board type (ie. the OPTION)
;   $2: Bus type
;   $3: Bus number
;   $4: Slot number (EISA)
;   $5: I/O base address
;   $6: status reg I/O address
;   $7: IRQ
;   $8: List of com port names
;
;
; RETURNS:
;   $0: ErrorIndex
;   $1: ErrorPrefix
;--------------------------------------------------------------------------

[WriteBoardConfig]
    read-syms GeneralConstants
    read-syms InstallConstants

	ifstr(i) $($1) == "A"
;	shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) "STATUS" +
;	"about to setup values for RASteln\Parameters"
		set VList = { +
            {Type,               $(NoTitle), $(!REG_VT_SZ), $($1)}, +
            {BusType,            $(NoTitle), $(!REG_VT_DWORD), "5"}, +
            {Port1,              $(NoTitle), $(!REG_VT_SZ), *($($8), 1)}, +
            {Port2,              $(NoTitle), $(!REG_VT_SZ), *($($8), 2)}, +
            {Port3,              $(NoTitle), $(!REG_VT_SZ), *($($8), 3)}, +
            {Port4,              $(NoTitle), $(!REG_VT_SZ), *($($8), 4)}, +
		    {ClockRate,		 $(NoTitle), $(!REG_VT_DWORD), "8000000"}, +
			{NumberOfPorts,		 $(NoTitle), $(!REG_VT_DWORD), "4"} +
        }
	    goto AddValues
	endif
	ifstr(i) $($1) == "B"
		set VList = { +
            {Type,               $(NoTitle), $(!REG_VT_SZ), $($1)}, +
            {BusType,            $(NoTitle), $(!REG_VT_DWORD), "5"}, +
            {Port1,              $(NoTitle), $(!REG_VT_SZ), *($($8), 1)}, +
            {Port2,              $(NoTitle), $(!REG_VT_SZ), *($($8), 2)}, +
		    {ClockRate,			 $(NoTitle), $(!REG_VT_DWORD), "8000000"}, +
			{NumberOfPorts,		 $(NoTitle), $(!REG_VT_DWORD), "2"} +
        }
		goto AddValues
	endif
	ifstr(i) $($1) == "C"
		set VList = { +
            {Type,               $(NoTitle), $(!REG_VT_SZ), $($1)}, +
            {BusType,            $(NoTitle), $(!REG_VT_DWORD), "5"}, +
            {Port1,              $(NoTitle), $(!REG_VT_SZ), *($($8), 1)}, +
            {Port2,              $(NoTitle), $(!REG_VT_SZ), *($($8), 2)}, +
            {Port3,              $(NoTitle), $(!REG_VT_SZ), *($($8), 3)}, +
            {Port4,              $(NoTitle), $(!REG_VT_SZ), *($($8), 4)}, +
            {Port5,              $(NoTitle), $(!REG_VT_SZ), *($($8), 5)}, +
            {Port6,              $(NoTitle), $(!REG_VT_SZ), *($($8), 6)}, +
            {Port7,              $(NoTitle), $(!REG_VT_SZ), *($($8), 7)}, +
            {Port8,              $(NoTitle), $(!REG_VT_SZ), *($($8), 8)}, +
		    {ClockRate,			 $(NoTitle), $(!REG_VT_DWORD), "8000000"}, +
			{NumberOfPorts,		 $(NoTitle), $(!REG_VT_DWORD), "8"} +
        }
		goto AddValues

	endif


AddValues = +
    shell $(UtilityInf) AddValueList $($0) $(VList)

    set ErrorIndex = $($R0)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        set ErrorIndex = MBV_SHELLCODE_ERROR

        goto WriteBoardConfig_return
    endif



WriteBoardConfig_return = +
    return $(ErrorIndex) $(ErrorPrefix)



;--------------------------------------------------------------------------
; DeleteBoardConfig
; Shell Section
; Called locally to delete all references to a Rastel board from Serial reg
;
; IN:
;   $0: Adapter Service Name
;
; RETURNS: Nothing
;--------------------------------------------------------------------------
[DeleteBoardConfig]

    read-syms GeneralConstants
    read-syms InstallConstants

;    ; look for rastel ports in serial registry info

    set AdapterName = $($0)


	;
	;We now have to delete its entry in the RAStel driver subkey
	;
	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters\PCI" $(MaskAllAccess) AdapterParamKey

	ifstr(i) $(AdapterParamKey) == $(!KeyNull)
        goto DeleteBoardConfig_return
	endif

	;
	;Enumerate the key to obtain the list of installed cards of the appropriate type
	;
    EnumRegValue $(AdapterParamKey) RastelList
;    ; scan list
    ForListDo $(RastelList)
		set TmpVal = $($)
        ifstr *($(TmpVal), 4) == $(AdapterName)
;            ; it is one of ours, delete it
            shell "" DisplayProgress "DoRemove, deleting serial port:"*($($), 1)
            DeleteRegValue $(AdapterParamKey) *($(TmpVal), 1)
        endif
    EndForListDo


DeleteBoardConfig_return = +
    return


;--------------------------------------------------------------------------
; CopyBoardConfig
; Shell Section
; Called locally to update Serial registry info from Rastel registry info
; Also updates the serial map so that subsequent installs before the machine
; is rebooted will stop the serial port duplication problem that I know exists.
;
; IN:
;   $0: Parameters registry key
;   $1: Adapter Service Name (of form rastel<x>)
;
; RETURNS:
;   $0: ErrorIndex
;   $1: ErrorPrefix
;--------------------------------------------------------------------------
[CopyBoardConfig]

    read-syms GeneralConstants
    read-syms InstallConstants

;    ; look for rastel ports in serial registry info

    set AdapterName = $($1)
    set OurParamKey = $($0)

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(AdapterName)"\Parameters" $(MaskAllAccess) AdapterParamKey
	
	ifstr(i) $(AdapterParamKey) == $(!KeyNull)
		set ErrorPrefix = "Removing port driver"
		goto fatalmessage
	endif

	GetRegValue $(AdapterParamKey) "BusType" busType

	ifstr(i) *($(busType),4) == "ISA"
	;;We have to remove an isa card
		OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\Serial" $(MaskAllAccess) SerialKey	
	else
	;;We have to remove a PCI
	    OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductSoftwareName2) $(MaskAllAccess) SerialKey
	endif

;;    OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductSoftwareName2) $(MaskAllAccess) SerialKey

    ifstr $(SerialKey) == $(KeyNull)
;        ; oops! no serial driver?
        set ErrorIndex = MBV_OPEN_SERIAL_KEY
        goto CopyBoardConfig_return
    endif

;    ; there may or may not be a parameters key in here?
    OpenRegKey $(SerialKey) "" "Parameters" $(MaskAllAccess) SerialParamKey

    ifstr $(SerialParamKey) == $(KeyNull)

;        ; No parameters. This makes it easy!

        CreateRegKey $(SerialKey) {"Parameters",$(NoTitle),GenericClass} "" +
            $(MaskAllAccess) "" SerialParamKey

        ifstr $(SerialParamKey) == $(KeyNull)
;            ; couldn't do it! Stop.
            CloseRegKey $(SerialKey)
            set ErrorIndex = MBV_CREATE_SERIALP_KEY
            goto CopyBoardConfig_return
        endif

    endif

;    ; look through Serial Parameters sub-keys (if any) for rastel ports

;    ; get a list of sub-keys
    EnumRegKey $(SerialParamKey) RastelList

;    ; scan list
    ForListDo $(RastelList)
;        ; if the key is AdapterName:<y>
        Split-String *($($), 1) ":" TmpList
        ifstr *($(TmpList), 1) == $(AdapterName)
;            ; it is one of ours, delete it
            DeleteRegKey $(SerialParamKey) *($($), 1)
        endif
    EndForListDo

;    ; there are now no entries for this rastel adapter in the serial registry.

;    ; make keys and fill them in (1 key per port)

;    ; Read the parameters that are common to all ports
    GetRegValue $(OurParamKey) "Type" TmpList
    set Option = *($(TmpList), 4)
    GetRegValue $(OurParamKey) "IoAddress" TmpList
    set IOBase = *($(TmpList), 4)
    GetRegValue $(OurParamKey) "SecondaryIoAddress" TmpList
    set IO2Base = *($(TmpList), 4)
    GetRegValue $(OurParamKey) "Interrupt" TmpList
    set IRQ = *($(TmpList), 4)

;    ; also define some fixed values
    set PortStep = 8
    set TxFIFO = 16
    set RxFIFO = 14
    set ForceFifo = 1
    set Indexed = 1

;    ; for each port, fill in the values

;    ; initialize a few things

    set PortAddr = $(IOBase)
    set Error = 0

	ifstr(i) $(Option) != "C"
	    set PortList = {Port1,Port2,Port3,Port4}
	else
	    set PortList = {Port1,Port2,Port3,Port4,Port5,Port6,Port7,Port8}
	endif

    ForListDo $(PortList)


        ifint Error == 0

;            ; board/port specific values
;            ; read these from our registry info

;            ; com port name
            GetRegValue $(OurParamKey) $($) TmpList
            set ComName = *($(TmpList), 4)

;            ; create the key
            set TempName = $(AdapterName)":"$(#)
            CreateRegKey $(SerialParamKey) {$(TempName),$(NoTitle),GenericClass} "" +
                $(MaskAllAccess) "" SerialPortKey

            ifstr $(SerialPortKey) == $(KeyNull)
;                ; couldn't do it! Stop.
                CloseRegKey $(SerialParamKey)
                set ErrorIndex = MBV_CREATE_SERIALP_KEY
                set Error = 1
            endif

            set VList = { +
                {DosDevices,      $(NoTitle), $(!REG_VT_SZ),    $(ComName)}, +
                {ForceFifoEnable, $(NoTitle), $(!REG_VT_DWORD), $(ForceFifo)}, +
                {Indexed,         $(NoTitle), $(!REG_VT_DWORD), $(Indexed)}, +
                {Interrupt,       $(NoTitle), $(!REG_VT_DWORD), $(IRQ)}, +
                {InterruptStatus, $(NoTitle), $(!REG_VT_DWORD), $(IO2Base)}, +
                {PortAddress,     $(NoTitle), $(!REG_VT_DWORD), $(PortAddr)}, +
                {PortIndex,       $(NoTitle), $(!REG_VT_DWORD), $(#)}, +
                {RxFIFO,          $(NoTitle), $(!REG_VT_DWORD), $(RxFIFO)}, +
                {TxFIFO,          $(NoTitle), $(!REG_VT_DWORD), $(TxFIFO)}, +
		{BusType,         $(NoTitle), $(!REG_VT_DWORD), "5"}, +
		{ClockRate,       $(NoTitle), $(!REG_VT_DWORD), "8000000"} +
            }

            shell $(UtilityInf) AddValueList $(SerialPortKey) $(VList)
            set ErrorIndex = $($R0)
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                set ErrorIndex = MBV_SHELLCODE_ERROR
                set Error = 1
            endif

            CloseRegKey $(SerialPortKey)

;            ; calc address of next port
            set-add PortAddr = $(PortAddr), $(PortStep)

        endif
    EndForListDo

    CloseRegKey $(SerialParamKey)

CopyBoardConfig_return = +
    return $(ErrorIndex) $(ErrorPrefix)


;--------------------------------------------------------------------------
; GetSystemCfgData
; Shell Section
; Called locally to extract relevant system config info from registry
;
; RETURNS:
;   $0: ErrorIndex
;   $1: ErrorPrefix
;   $2: Number of ISA busses
;	$3: Number of PCI busses present
;   $4: List of allocated com port names
;--------------------------------------------------------------------------
[GetSystemCfgData]
    read-syms GeneralConstants
    read-syms InstallConstants

;    ; call another local shell section to get bus info
    shell "" GetBusInfo
    set ErrorIndex = $($R0)
    set numISA = $($R1)
    set numEISA = $($R2)
	set numPCI = $($R4)

    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        set ErrorIndex = MBV_SHELLCODE_ERROR
        goto GetSystemCfgData_return
    endif

    ifstr(i) $(ErrorIndex) != NO_ERROR
        set ErrorPrefix = "GetBusInfo"
        goto GetSystemCfgData_return
    endif

;    ; ????? Does NT consider a physical EISA bus to be just an EISA bus
;    ; or an EISA + an ISA bus?

;    ; treat EISA bus as an ISA bus
    set-add numISA = $(numISA), $(numEISA)

    ifint $(numISA) <= 0
        set ErrorIndex = MBV_NO_BUS_FOUND
        goto GetSystemCfgData_return
    endif

;    ; generate list of used com port names

    set ComNameList = {}
    OpenRegKey $(!REG_H_LOCAL) "" $(SerialMap) $(MaskAllAccess) SerialMapKey
    ifstr $(SerialMapKey) != $(KeyNull)
        EnumRegValue $(SerialMapKey) SerialMapData
        CloseRegKey $(SerialMapKey)
        ForListDo $(SerialMapData)
            set ComNameList = >($(ComNameList), *($($), 4))
        EndForListDo
    endif

GetSystemCfgData_return = +
    return $(ErrorIndex) $(ErrorPrefix) $(numISA) $(numPCI) $(ComNameList)



;--------------------------------------------------------------------------
; GetBusInfo
; Shell Section
; Called locally to find out what busses are present in the machine
;
; RETURNS:
;   $0: Error indicator
;   $1: Number of ISA busses
;   $2: Number of EISA busses
;   $3: Number of PCI busses
;--------------------------------------------------------------------------
[GetBusInfo]
; Might as well get everything even though we only have an ISA board
; at present.
    set numISA = 0
    set numEISA = 0
    set numMCA = 0
    set numPCI = 0

    read-syms GeneralConstants
    read-syms InstallConstants

    OpenRegKey $(!REG_H_LOCAL) "" $(MultiAdapter) $(MaskAllAccess) +
        KeyMultiAdapter
    ifstr $(KeyMultiAdapter) == $(KeyNull)
        goto GetEISABusInfo
    endif

    EnumRegKey $(KeyMultiAdapter) BusList
    ForListDo $(BusList)
        set RegName = $(MultiAdapter)"\"*($($),1)
        OpenRegKey $(!REG_H_LOCAL) "" $(RegName) $(MaskAllAccess) KeyBus
        ifstr $(KeyBus) != $(KeyNull)
            GetRegValue $(KeyBus) Identifier IdentifierData
            set BusType = *($(IdentifierData), 4)
            shell "" DisplayProgress "RASTEL: Found bus:"$(BusType)
            ifstr(i) $(BusType) == ISA
                set-add numISA = $(numISA), 1
            else-ifstr(i) $(BusType) == MCA
                set-add numMCA = $(numMCA), 1
            else-ifstr(i) $(BusType) == PCI
                set-add numPCI = $(numPCI), 1
            endif
            CloseRegKey $(KeyBus)
        endif
    EndForListDo
    CloseRegKey $(KeyMultiAdapter)

; EISA info scan. This is the same as the others but under the EISA key

GetEISABusInfo = +
    OpenRegKey $(!REG_H_LOCAL) "" $(EISAAdapter) $(MaskAllAccess) KeyEISAAdapter
    ifstr $(KeyEISAAdapter) == $(KeyNull)
        goto GetBusInfo_return
    endif
    shell "" DisplayProgress "RASTEL: Found EISA key:"

;    ; There is an EISA key in registry
    EnumRegKey $(KeyEISAAdapter) BusList
    ForListDo $(BusList)
        set RegName = $(EISAAdapter)"\"*($($),1)
        OpenRegKey $(!REG_H_LOCAL) "" $(RegName) $(MaskAllAccess) KeyBus
        ifstr $(KeyBus) != $(KeyNull)
            GetRegValue $(KeyBus) Identifier IdentifierData
            set BusType = *($(IdentifierData), 4)
            ifstr(i) $(BusType) == EISA
                set-add numEISA = $(numEISA), 1
            endif
            CloseRegKey $(KeyBus)
        endif
    EndForListDo
    CloseRegKey $(KeyEISAAdapter)

; Exit, returning the gathered bus info
GetBusInfo_return = +
    shell "" DisplayProgress "RASTEL: ISA="$(numISA)+
        " EISA="$(numEISA)" MCA="$(numMCA)" PCI="$(numPCI)
    return $(ErrorIndex) $(numISA) $(numEISA) $(numMCA) $(numPCI)


;--------------------------------------------------------------------------
; CARDEXISTEDDLG
; Shell Section
; Called locally to ask user if they really want to add another card
;--------------------------------------------------------------------------
[CardExistedDlg]
;    ; Get the strings etc. to display
    read-syms GeneralConstants
    read-syms MessageConstants$(!STF_LANGUAGE)

;    ; Use std. subroutine to do dialog
    shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) "WARNING" $(CardExistedText)

;    ; Check for errors
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
        set ErrorIndex = MBV_SHELLCODE_ERROR
    endif

;    ; return error (if any) and result
    return $(ErrorIndex), $($R1)


;--------------------------------------------------------------------------
; INSTALL_OPTION
; Install Section
; Called when INSTALL is selected to build list of files to copy and copy them
;--------------------------------------------------------------------------

[Install_Option]
    set STF_VITAL = 1
    ifstr(i) $(AddCopy) == YES
        AddSectionFilesToCopyList FilesConfig $(SrcDir) +
            $(!STF_WINDOWSSYSPATH)
        AddSectionFilesToCopyList FilesDriver $(SrcDir) +
            $(!STF_WINDOWSSYSPATH)\drivers
    endif
    ifstr(i) $(DoCopy) == YES
        set !STF_NCPA_FLUSH_COPYLIST = TRUE
        CopyFilesInCopyList
    endif
    exit



;--------------------------------------------------------------------------
; INSTALL_UPDATE
; Install Section
; Called when UPDATE is selected to build list of files to copy and copy them
;--------------------------------------------------------------------------

[Install_Update]
    set STF_VITAL = 1
    set STF_OVERWRITE = VERIFYSOURCEOLDER
    AddSectionFilesToCopyList FilesInf $(SrcDir) +
            $(!STF_WINDOWSSYSPATH)
    AddSectionFilesToCopyList FilesConfig $(SrcDir) +
            $(!STF_WINDOWSSYSPATH)
    AddSectionFilesToCopyList FilesDriver $(SrcDir) +
        $(!STF_WINDOWSSYSPATH)\drivers
    set !STF_NCPA_FLUSH_COPYLIST = TRUE
    CopyFilesInCopyList
    exit


;---------------------------------------------------------------------------
; GETERRORSTRING
; Look up error message
;---------------------------------------------------------------------------
[GetErrorString]
    read-syms GeneralConstants
    set ErrorCodes = ^(ErrorStrings$(!STF_LANGUAGE), 0)
    set ErrorList = ^(ErrorStrings$(!STF_LANGUAGE), 1)
    set Error = *($(ErrorList), ~($(ErrorCodes), $($0)))
    ifstr $(Error) == ""
        shell $(UtilityInf) RegistryErrorString $($0)
        ifint $($ShellCode) == $(!SHELL_CODE_OK)
            set Error = $($R0)
        else
            set Error = #(ErrorStrings$(!STF_LANGUAGE), MBV_SHELLCODE_ERROR, 1)
        endif
    endif
    return $(Error)




;-----------------------------------------------------------------------
;DATE
; get the date from the system
;-----------------------------------------------------------------------
[date]
;    ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
;    ; Minute, Second }
    Now = {} ? $(!LIBHANDLE) GetSystemDate


;-----------------------------------------------------------------------
;BuildResult
;
;build the result from the dll (although the dll wasn't actually called
;
;This is used so that we don't have to change much code to support the 
;
;unattended install that has been called for.
;
; $($0) = the type of card being installed
;
; $($1) = number of ISA busses in this machine
;
; $($2) = number EISA busses in this machine
;
; $($3) = number of MCA busses on this machine
;
; $($4) = number of PCI busses on this machine
;
; R0 = Error, or noError
;
; R1 = the built result list
;
;-----------------------------------------------------------------------
[BuildResult]

;
; Assume that no error will occur (dangerous I know)
;

set Option = $($0)
set numISA = $($1)
set numEISA = $($2)
set numMCA = $($3)
set numPCI = $($4)
set Error = 0;
set returnValue = {}

;
;Set all values that may be in an unattend section to default values
;

set BaseIO =  "288"
set BusNumber = "0"
set StatusRegister =  "1312"
set IRQ = "10"
set BusType = "5"
set Slot = "0"
set Port1 = "COM3"
set Port2 = "COM4"
set Port3 = "COM5"
set Port4 = "COM6"
set Port5 = "COM7"
set Port6 = "COM8"
set Port7 = "COM9"
set Port8 = "COM10"

;*
;Temporary variable assignments for testing the unattended setup
;

;set MatCardParameterName = {"NetworkAddress", "BusNumber", "StatusRegister", "IRQ", "BusType", "Port1", "Port2", +
;	"Port3", "Port4"}

;set MatCardParameterValue = {"320", "0", "1344", "2", "5", "COM4", "COM5", "COM6", "COM7"}

;
; Ensure that this is being called from an unattended installation
;

ifstr(I) $(STF_GUI_UNATTENDED) != "YES"
	set error = 1
	goto BuildResultReturn
endif

;
;Now obtain all values that may be relavent
;

ForListDo $(!NetCardParameterName)
	set Name = $($)
	set Value = *($(!NetCardParameterValue), $(#))
	ifstr(i) $(Name) == "NetworkAddress"
		set BaseIO = $(Value)
	else-ifstr(i) $(Name) == "BusNumber"
		set BusNumber = $(Value)
	else-ifstr(i) $(Name) == "StatusRegister"
		set StatusRegister = $(Value)
	else-ifstr(i) $(Name) == "IRQ"
		set IRQ = $(Value)
	else-ifstr(i) $(Name) == "BusType"
		set BusType = $(Value)
	else-ifstr(i) $(Name) == "Port1"
		set Port1 = $(Value)
	else-ifstr(i) $(Name) == "Port2"
		set Port2 = $(Value)
	else-ifstr(i) $(Name) == "Port3"
		set Port3 = $(Value)
	else-ifstr(i) $(Name) == "Port4"
		set Port4 = $(Value)
	else-ifstr(i) $(Name) == "Port5"
		set Port5 = $(Value)
	else-ifstr(i) $(Name) == "Port6"
		set Port6 = $(Value)
	else-ifstr(i) $(Name) == "Port7"
		set Port7 = $(Value)
	else-ifstr(i) $(Name) == "Port8"
		set Port8 = $(Value)
	endif
EndForListDo

set returnValue = { 0, $(BusType), $(BusNumber), $(Slot), $(BaseIO), +
	$(StatusRegister), $(IRQ)}

set ComList = {$(Port1),  $(Port2), $(Port3), $(Port4)}
;set ComList = {"com2", "com3", "com4", "com5"}

;shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS +
;              $(ComList)


ifstr(i) $(Option) == "C"
;
;We might want to put in these extra values to the list of com ports
;
	set ComList = >($(ComList), $(Port5))
	set ComList = >($(ComList), $(Port6))
	set ComList = >($(ComList), $(Port7))
	set ComList = >($(ComList), $(Port8))
endif

;
; Now add the list of comports to the return list
;

set returnValue = >($(returnValue), $(ComList))


BuildResultReturn = +
	Return $(returnValue)

;
;End of BuildResult
;

;-----------------------------------------------------------------------
;SetComMappings
;
;Shell section to add values to the registry under the serial map.
;This is used so that if more than one card is installed the installation
;will not allow com ports that are already assigned to be re-assigned
;
; $($0) = the number of this adapter
;
; $($1) = the list of com port names to be associated with this adapter
;
; R0 = Error, or noError (0 for error, 1 for no error)
;
;-----------------------------------------------------------------------

[SetComMappings]

    read-syms GeneralConstants
    read-syms InstallConstants


	;
	;Copy the input parameters into more meaningful names
	;

	set AdapterNumber = $($0)
	set ComList = $($1)

;shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS +
 ;             "Were going to try writing the device map"


;shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS +
 ;             $(ComList)

	;
	;Try to open the serial map key
	;
	
	OpenRegKey $(!REG_H_LOCAL) "" $(SerialMap) $(MaskAllAccess) SerialMapKey

	ifstr(i) $(SerialMapKey) == $(KeyNull)
;	shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS +
;              "Unable to open serial map key"

		set Error = 1
		goto ReturnOptions
	endif

	;
	;Now write the com port list into the key (as volatile keys)
	;

	ForListDo $(ComList)

		SetRegValue $(SerialMapKey) {"RAStel"$(AdapterNumber)":"$(#), +
			0, $(!REG_VT_SZ), $($)}

		ifint $(!RegLastError) == "0"
;shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS +
 ;             "No error"

		else
;shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS +
 ;            "error"
		endif

;shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS +
 ;             $($)



	EndForListDo

	ReturnOptions = +
		return Error

;
;End of SetComMappings
;



;
;Code to determine whether the reference count is small enough to warrant removing the 
;registry information.
;
;
;
;
Download Driver Pack

How To Update Drivers Manually

After your driver has been downloaded, follow these simple steps to install it.

  • Expand the archive file (if the download file is in zip or rar format).

  • If the expanded file has an .exe extension, double click it and follow the installation instructions.

  • Otherwise, open Device Manager by right-clicking the Start menu and selecting Device Manager.

  • Find the device and model you want to update in the device list.

  • Double-click on it to open the Properties dialog box.

  • From the Properties dialog box, select the Driver tab.

  • Click the Update Driver button, then follow the instructions.

Very important: You must reboot your system to ensure that any driver updates have taken effect.

For more help, visit our Driver Support section for step-by-step videos on how to install drivers for every file type.

server: web3, load: 1.79