OEMSETUP.INF Driver File Contents (SCM-ISDN.EXE)

;***************************************************************************
; 1. Identifikation
;
; Beschreibung:   überprüfe ob der OptionType der Inf-Datei der gleiche ist
;                 wie der im ControlPanelApplet ausgewählte.
;
; Input:          keine
; 
; 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:
;
; Beschreibung:   To return the option list supported by this INF and the
;                 localised text list representing the options.
;
;
; Input:          $($0):  Language used. ( ENG | FRN | ... )
;                 $($1):  Platform used. ( ISA | PCI | ... )
;
; Output:         $($R0): STATUS: STATUS_SUCCESSFUL |
;                                 STATUS_NOLANGUAGE
;                                 STATUS_FAILED
;                                 STATUS_NOTSUPPORTED
; 
;                 $($R1): Option List
;                 $($R2): Option Text List
;------------------------------------------------------------------------

[ReturnOptions]
   Set !DebugOutputControl = 1
   Debug-Output "ReturnOptions >"
   Set Status        = STATUS_FAILED

   Set Language = $($0)
   Set PlatForm = $($1)
   Set OptionList     = {}
   Set OptionTextList = {}

   Set LanguageList = ^(LanguagesSupported, 1)
   Set PlatformList = ^(PlatformsSupported, 1)
   
   Debug-Output "ReturnOptions Language "$(Language)
   Debug-Output "ReturnOptions PlatForm "$(PlatForm)

   ; get current InstallLanguage
   Shell "" InstallLanguageSupported
   Set Language = $($R1)
   Debug-Output "ReturnOptions Language   "$(Language)

   Read-Syms GeneralConstants
   Read-Syms ProductConstants

    ; teste ob die Installationssprache unterstützt wird
    ; --------------------------------------------------

    Ifcontains(i) $(Language) in $(LanguageList)
       ; teste ob keine Platform gefordert wurde  
       ; ---------------------------------------
       ifstr(i) $(PlatForm) == ""
          ; Sprache und Platform o.k.
          ; stelle OptionListe und OptionTextListe zusammen
          ; -----------------------------------------------
          Set OptionList     = ^(Options, 1)
          Set OptionTextList = ^(OptionsText, 1)
          Set Status         = STATUS_SUCCESSFUL
       else
          Ifcontains(i) $(PlatForm) in $(PlatformList)
             ; Sprache und Platform o.k.
             ; stelle OptionListe und OptionTextListe zusammen
             ; -----------------------------------------------
             Set Status         = STATUS_SUCCESSFUL
             Set OptionList     = ^(Options, 1)
             Set OptionTextList = ^(OptionsText, 1)
          else
             ; *** ERROR **** Platform nicht unterstützt
             ; -----------------------------------------
             Set Status = STATUS_NOTSUPPORTED
          endif
       endif
    else
       ; *** ERROR *** Sprache nicht unterstützt
       ; ---------------------------------------
       set Status = STATUS_NOLANGUAGE
    endif

   Debug-Output "ReturnOptions * Status "$(Status)
   Return $(Status) $(OptionList) $(OptionTextList)


;***************************************************************************
;
; InstallOption:
;
;      This section is shelled to by main installation processing
;      or by NCPASHEL.INF during reconfig, removal, update, etc.
;
;
; FUNCTION:  To copy files representing Options
;            To configure the installed option
;            To update the registry for the installed option
;
; INPUT:     $($0):  Language to use
;            $($1):  OptionID to install
;            $($2):  SourceDirectory
;            $($3):  AddCopy              (YES | NO)
;            $($4):  DoCopy               (YES | NO)
;            $($5):  DoConfig             (YES | NO)
;
; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
;                            STATUS_NOLANGUAGE |
;                            STATUS_USERCANCEL |
;                            STATUS_FAILED
;
;------------------------------------------------------------------------
[InstallOption]

   Set !DebugOutputControl = 1

   Set Language = $($0)
   Set Option   = $($1)
   Set SrcDir   = $($2)
   Set RasDir   = $($2)
   Set AddCopy  = $($3)
   Set DoCopy   = $($4)
   Set DoConfig = $($5)

Debug-Output "InstallOption >"

   ; get current InstallLanguage
   Shell "" InstallLanguageSupported
   Set Language = $($R1)
   Debug-Output "InstallOption Language   "$(Language)

   ; wähle die aktuelle SetupProzedur aus
   ; ------------------------------------
   IfStr(i) $(!NTN_InstallMode) == install
      ; Adapter hinzufügen
      ; ------------------
      shell "" AddAdapter $(Language) $(Option) $(SrcDir) $(RasDir) $(AddCopy) $(DoCopy) $(DoConfig) 

   Else-IfStr(i) $(!NTN_InstallMode) == deinstall
      ; Adapter entfernen
      ; -----------------
      shell "" RemoveAdapter $(Language) $(Option) $(SrcDir) $(RasDir) $(AddCopy) $(DoCopy) $(DoConfig) 

   Else-IfStr(i) $(!NTN_InstallMode) == Update
      ; Adapter aktualisieren
      ; ---------------------
      shell "" UpdateAdapter $(Language) $(Option) $(SrcDir) $(RasDir) $(AddCopy) $(DoCopy) $(DoConfig) 

   Else-IfStr(i) $(!NTN_InstallMode) == bind
      ; Adapter neu binden
      ; ------------------
      shell "" BindAdapter $(Language) $(Option) $(SrcDir) $(RasDir) $(AddCopy) $(DoCopy) $(DoConfig) 

   Else-IfStr(i) $(!NTN_InstallMode) == configure
      ; Adapter konfigurieren
      ; ---------------------
      shell "" ConfigureAdapter $(Language) $(Option)

   Else
      ; *** ERROR ***
      ; -------------
      Debug-Output " nicht unterstützter Installmode"

   EndIf

   Set Status = $($R0)

   Debug-Output "InstallOption Status: "$(Status)
   Debug-Output "InstallOption *"

   Return $(Status)
   Exit


;***************************************************************************
;
;            A d d A d a p t e r
;
;      This section is shelled to by main installation processing
;      or by NCPASHEL.INF during reconfig, removal, update, etc.
;
;
; FUNCTION:  To copy files representing Options
;            To configure the installed option
;            To update the registry for the installed option
;
; INPUT:     $($0):  Language to use
;            $($1):  OptionID to install
;            $($2):  SourceDirectory
;            $($3):  SourceDirectory
;            $($4):  AddCopy              (YES | NO)
;            $($5):  DoCopy               (YES | NO)
;            $($6):  DoConfig             (YES | NO)
;
; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
;                            STATUS_NOLANGUAGE |
;                            STATUS_USERCANCEL |
;                            STATUS_FAILED
;
;------------------------------------------------------------------------
[AddAdapter]

   Set !DebugOutputControl = 1
   Set Status = STATUS_SUCCESSFUL
Debug-Output "AddAdapter >"

   ; Aufrufparameter
   Set Language = $($0)
   Set Option   = $($1)
   Set SrcDir   = $($2)
   Set RasDir   = $($3)
   Set AddCopy  = $($4)
   Set DoCopy   = $($5)
   Set DoConfig = $($6)

   ; print callerparams
   Debug-Output "AddAdapter Language   "$(Language)
   Debug-Output "AddAdapter Option     "$(Option)
   Debug-Output "AddAdapter SrcDir     "$(SrcDir)
   Debug-Output "AddAdapter RasDir     "$(RasDir)
   Debug-Output "AddAdapter AddCopy    "$(AddCopy)
   Debug-Output "AddAdapter DoCopy     "$(DoCopy)
   Debug-Output "AddAdapter DoConfig   "$(DoConfig)


   ; read first GeneralConstants
   Read-Syms GeneralConstants
   Read-Syms ProductConstants

   ; then get the real Option
   Set OptionList = *(^($(OEM),$(OtNeO)),~(^($(OEM),$(OtO)),$(Option)))

   Debug-Output "####### AddAdapter OptionList     "$(OptionList)
   ForListDo $(OptionList)
      Debug-Output "Item "$($)
      Debug-Output "Item "$(#)
      IfStr(i) $(#) == 1
	     Set Option = $($) 
      Else-IfStr(i) $(#) == 2
	     Set NextOption = $($) 
      EndIf
   EndForListDo

   ; ???
   Set OptionList = {}

   Debug-Output "####### AddAdapter RealOption     "$(Option)
   Debug-Output "####### AddAdapter NextOption     "$(NextOption)

   ; and now read the ProductConstants again
   Read-Syms ProductConstants

   ; start wait
   StartWait

   ; wurde diese ProductOption bereits installiert
   ; ---------------------------------------------
   OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) hKeyProduct 
   IfStr $(hKeyProduct) != $(KeyNull)
      ; noch unklar
      ; -----------
      Debug-Output "AddAdapter die ProduktOption ist bereits installiert"
      Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", +
                           #(SetupMessage$(Language), OptionAlreadyInstalled, 1)
      CloseRegKey $(hKeyProduct)
      Set Status = STATUS_FAILED
      EndWait
      Return $(Status)
      Exit      
   EndIf

   ; diese ProductOption wurde noch nicht installiert
   ; ------------------------------------------------

   ; initialisiere die CleanUpList
   Set !CleanUpList = "{}"

   Shell "subroutn.inf" PushBillboard NETSTATUSDLG #(SetupMessage$(Language),SetServiceGroupOrder,1)
   ; 1. setze die ServiceGroupOrderList für den zu installierenden Adapter
   ; =====================================================================
   Shell "" SetServiceGroupOrder, $(Language), $(Option)
   Set Status = $($R0)
   Debug-Output "AddAdapter RegistryErrorIndex "$(Status)
   Debug-Output "AddAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** ServiceGroup konnte nicht eingerichtet werden
      ; ----------------------------------------------------------
      Debug-Output "AddAdapter *Error* SetServiceGroupOrder"
      Shell "" CleanUpInstalledComponents $(Language)
      Set Status = STATUS_FAILED
      EndWait
	  Return $(Status)
      Exit
   EndIf


   Shell "subroutn.inf" PushBillboard NETSTATUSDLG #(SetupMessage$(Language),SetNewCapiDevice,1)
   ; 2. erzeuge einen neunen CapiController im Capi20Key
   ; ===================================================
   Shell "" SetNewCapiDevice, $(Language), $(Option)
   Set Status = $($R0)
   Debug-Output "AddAdapter RegistryErrorIndex "$(Status)
   Debug-Output "AddAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** CapiController konnte nicht eingerichtet werden
      ; ------------------------------------------------------------
      Debug-Output "AddAdapter *Error* SetNewCapiDevice"
      Shell "" CleanUpInstalledComponents $(Language)
      Set Status = STATUS_FAILED
      EndWait
      Return $(Status)
      Exit
   EndIf
   Set CapiDevice = $($R1)

   ; dump the result
   ; ---------------
   Debug-Output "AddAdapter CapiDevice "$(CapiDevice)


   Shell "subroutn.inf" PushBillboard NETSTATUSDLG #(SetupMessage$(Language),AddNewSoftware,1)
   ; 3. installiere die neue Software
   ; ================================
   Shell "" NewSoftwareComponent, $(Language), $(Option)
   Set Status = $($R0)
   Set NewService = $($R1)
   Debug-Output "AddAdapter RegistryErrorIndex "$(Status)
   Debug-Output "AddAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** die neue Software konnte nicht installiert werden
      ; --------------------------------------------------------------
      Debug-Output "AddAdapter *Error* NewSoftwareComponent"
      Shell "" CleanUpInstalledComponents $(Language)
      Set Status = STATUS_FAILED
      EndWait
      Return $(Status)
      Exit
   EndIf

   ; dump the result
   ; ---------------
   Debug-Output "AddAdapter NewService "$(NewService)


   Shell "subroutn.inf" PushBillboard NETSTATUSDLG #(SetupMessage$(Language),AddNewNetworkCard,1)
   ; 4. installiere die neue Netwerkkarte
   ; ====================================
   Shell "" NewNetworkCard, $(Language), $(Option), $(CapiDevice)
   Set Status = $($R0)
   Set NetCardService = $($R1)
   Set NetCardNumber = $($R2)
   Debug-Output "AddAdapter RegistryErrorIndex "$(Status)
   Debug-Output "AddAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** der Service füer die neue Netwerkkarte konnte nicht installiert werden
      ; -----------------------------------------------------------------------------------
      Debug-Output "AddAdapter *Error* NewNetCard"
      Shell "" CleanUpInstalledComponents $(Language)
      EndWait
      Return $(Status)
      Exit
   EndIf

   Shell "subroutn.inf" PushBillboard NETSTATUSDLG #(SetupMessage$(Language),InitNetworkCard,1)
   ; 5. initialisiere den ParametersKey des Driver
   ; =============================================
   Shell "" InitParametersKey, $(Language), $(Option), $(NetCardService), $(NetCardNumber), $(CapiDevice)
   Set Status = $($R0)
   Debug-Output "AddAdapter InitParametersKey RegistryErrorIndex "$(Status)
   Debug-Output "AddAdapter InitParametersKey ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** der ParametersKey des Treibers konnte nicht initialisiert werden
      ; -----------------------------------------------------------------------------------
      Debug-Output "AddAdapter *Error* InitParametersKey"
      Shell "" CleanUpInstalledComponents $(Language)
      EndWait
      Return $(Status)
      Exit
   EndIf


   Shell "subroutn.inf" PushBillboard NETSTATUSDLG #(SetupMessage$(Language),CopyFiles,1)
   ; 6. kopiere alle Dateien
   ; =======================
   Install CopyFiles
   StartWait


   ; 7. erzeuge verschiedene Optionsabhängige RegistrierungsEinträge
   ; ===============================================================
   ; --> Pcmcia-Cards
   Set IsPcmcia = *(^(HardWare,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
   IfStr(i) $(IsPcmcia) == "Pcmcia"
      Shell "subroutn.inf" PushBillboard NETSTATUSDLG #(SetupMessage$(Language),PcmciaSupport,1)
      Shell "" PcmciaSupport, $(Language), $(Option), $(NetCardService)
      Set Status = $($R0)
      Debug-Output "AddAdapter RegistryErrorIndex "$(Status)
      Debug-Output "AddAdapter ShellCode          "$($ShellCode)

      IfStr(i) $(Status) != STATUS_SUCCESSFUL
         ; ***ERROR *** die neue Software konnte nicht installiert werden
         ; --------------------------------------------------------------
         Debug-Output "AddAdapter *Error* PcmciaSupport"
         Shell "" CleanUpInstalledComponents $(Language)
         EndWait
         Return $(Status)
         Exit
      EndIf
   EndIf

   ; --> Box
   Set IsBox = *(^(HardWare,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
   IfStr(i) $(IsBox) == "ParallelPort"
      Shell "subroutn.inf" PushBillboard NETSTATUSDLG #(SetupMessage$(Language),ParallelPortSupport,1)
      Shell "" ParallelPortSupport, $(Language), $(Option), $(NetCardService)
      Set Status = $($R0)
      Debug-Output "AddAdapter RegistryErrorIndex "$(Status)
      Debug-Output "AddAdapter ShellCode          "$($ShellCode)

      IfStr(i) $(Status) != STATUS_SUCCESSFUL
         ; ***ERROR *** die neue Software konnte nicht installiert werden
         ; --------------------------------------------------------------
         Debug-Output "AddAdapter *Error* BoxSupport"
         Shell "" CleanUpInstalledComponents $(Language)
         EndWait
         Return $(Status)
         Exit
      EndIf
   EndIf

   ; --> PnpSupport
   Set IsPnp = *(^(Hardware,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
   IfStr(i) $(IsPnp) == "Pnp"
      Shell "subroutn.inf" PushBillboard NETSTATUSDLG #(SetupMessage$(Language),PnpSupport,1)
      Shell "" SetPnpSupport, $(Language), $(Option), $(NetCardService)
      Set Status = $($R0)
      Debug-Output "AddAdapter RegistryErrorIndex "$(Status)
      Debug-Output "AddAdapter ShellCode          "$($ShellCode)

      IfStr(i) $(Status) != STATUS_SUCCESSFUL
         ; ***ERROR *** die neue Software konnte nicht installiert werden
         ; --------------------------------------------------------------
         Debug-Output "AddAdapter *Error* SetPnpSupport"
         Shell "" CleanUpInstalledComponents $(Language)
         EndWait
         Return $(Status)
         Exit
      EndIf
   EndIf

   ; --> NdisSupport
   IfStr(i) $(Option) == "Ndis"
      Shell "subroutn.inf" PushBillboard NETSTATUSDLG #(SetupMessage$(Language),NdisSupport,1)
      Shell "" SetNdisSupport, $(Language), $(Option), $(NetCardService), $(NetCardNumber)
      Set Status = $($R0)
      Debug-Output "AddAdapter RegistryErrorIndex "$(Status)
      Debug-Output "AddAdapter ShellCode          "$($ShellCode)

      IfStr(i) $(Status) != STATUS_SUCCESSFUL
         ; ***ERROR *** die neue Software konnte nicht installiert werden
         ; --------------------------------------------------------------
         Debug-Output "AddAdapter *Error* SetNdisSupport"
         Shell "" CleanUpInstalledComponents $(Language)
         EndWait
         Return $(Status)
         Exit
      EndIf
   EndIf


   ; ---> set Type of ConfigDialog
   ; =============================
   IfStr(i) $(Option) == "Ndis"
      Set DialogType = "Ndis"
   Else
      Set DialogType = "Card"
   Endif

   Shell "" ConfigDialogType, $(Option), $(NetCardService), $(DialogType), $(NetCardService)
   Set Status = $($R0)
   Debug-Output "AddAdapter RegistryErrorIndex "$(Status)
   Debug-Output "AddAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** der KonfigurationsDialogType konnte nicht aktualisiert werden
      ; --------------------------------------------------------------------------
      Debug-Output "AddAdapter *Error* ConfigDialogType"
      Shell "" CleanUpInstalledComponents $(Language)
      EndWait
      Return $(Status)
      Exit
   EndIf


Debug-Output "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
   IfStr(i) $(NextOption) != ""

      
      Shell $(STF_CONTEXTINFNAME) InstallOption $(!STF_LANGUAGE), $(NextOption), $(SrcDir), "YES", "YES", "YES" 
      Debug-Output "SetNdisSupport ReturnValue "$($R0)


      ; korrigiere ValueKey CapiDevice in SEDLWAN\Parameters



   EndIf
Debug-Output "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"

   ; xx. konfiguriere den Adapter
   ; ===========================
   Shell "" "SetDefaultParams", $(Option)
   Set Status = $($R0)
   Debug-Output "AddAdapter RegistryErrorIndex SetDefaultParams "$(Status)
   Debug-Output "AddAdapter ShellCode          SetDefaultParams "$($ShellCode)

   IfStr(i) $(Status) == "yes"
      Shell "subroutn.inf" PushBillboard NETSTATUSDLG #(SetupMessage$(Language),ConfigureAdapter,1)
      Shell "" ConfigureAdapterParameter, $(Language), $(Option), $(NetCardService)
      Set Status = $($R0)
      Debug-Output "AddAdapter RegistryErrorIndex "$(Status)
      Debug-Output "AddAdapter ShellCode          "$($ShellCode)
   EndIf
   Set Status = STATUS_SUCCESSFUL
   Return $(Status)
   Exit

;***************************************************************************
;
;            R e m o v e A d a p t e r
;
;      This section is shelled to by main installation processing
;      or by NCPASHEL.INF during reconfig, removal, update, etc.
;
;
; FUNCTION:  To copy files representing Options
;            To configure the installed option
;            To update the registry for the installed option
;
; INPUT:     $($0):  Language to use
;            $($1):  OptionID to install
;            $($2):  SourceDirectory
;            $($3):  SourceDirectory
;            $($4):  AddCopy              (YES | NO)
;            $($5):  DoCopy               (YES | NO)
;            $($6):  DoConfig             (YES | NO)
;
; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
;                            STATUS_NOLANGUAGE |
;                            STATUS_USERCANCEL |
;                            STATUS_FAILED
;
;------------------------------------------------------------------------
[RemoveAdapter]
   Set !DebugOutputControl = 1
   Set Status = STATUS_SUCCESSFUL
Debug-Output "RemoveAdapter >"

   ; save the callerparameter
   Set Language = $($0)
   Set Option   = $($1)
   Set SrcDir   = $($2)
   Set RasDir   = $($3)
   Set AddCopy  = $($4)
   Set DoCopy   = $($5)
   Set DoConfig = $($6)

   ; print the callerparameter
   Debug-Output "RemoveAdapter Language "$(Language)
   Debug-Output "RemoveAdapter Option   "$(Option)
   Debug-Output "RemoveAdapter SrcDir   "$(SrcDir)
   Debug-Output "RemoveAdapter RasDir   "$(RasDir)
   Debug-Output "RemoveAdapter AddCopy  "$(AddCopy)
   Debug-Output "RemoveAdapter DoCopy   "$(DoCopy)
   Debug-Output "RemoveAdapter DoConfig "$(DoConfig)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants


   StartWait


   ; 1. finde den ServiceName des Adapters
   ; =====================================
   Shell "" GetNetCardServiceName
   Set Status = $($R0)
   Debug-Output "RemoveAdapter RegistryErrorIndex "$(Status)
   Debug-Output "RemoveAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** 
      ; -------------
      Debug-Output "RemoveAdapter *Error* GetNetCardServiceName"
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   Set CardServiceName = $($R1)

   ; print the result
   Debug-Output "RemoveAdapter CardServiceName "$(CardServiceName)


   ; 2. finde den aktuellen CAPIController des Adapters
   ; ==================================================
   Shell "" GetCurrentCapiDevice $(CardServiceName)
   Set Status = $($R0)
   Debug-Output "RemoveAdapter RegistryErrorIndex "$(Status)
   Debug-Output "RemoveAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** 
      ; -------------
      Debug-Output "RemoveAdapter *Error* GetCurrentCapiDevice"
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf
   Set CapiDevice = $($R1)

   ; print the result
   Debug-Output "RemoveAdapter CapiDevice "$(CapiDevice)


   ; 3. finde den ServiceName des Adapters
   ; =====================================
   Shell "" GetCurrentServiceName, $(Language), $(Option)
   Set Status = $($R0)
   Debug-Output "RemoveAdapter RegistryErrorIndex "$(Status)
   Debug-Output "RemoveAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** 
      ; -------------
      Debug-Output "RemoveAdapter *Error* GetCurrentServiceName"
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf
   Set ServiceName = $($R1)

   ; print the result
   Debug-Output "RemoveAdapter ServiceName "$(ServiceName)


   ; 4. entferne die Netzwerkkarte aus der ControllerList
   ; ====================================================
   Shell "" UpdateControllerList, $(Language), $(Option), "remove", $(CardServiceName)
   Set RegistryErrorIndex = $($R0)
   Debug-Output "RemoveAdapter RegistryErrorIndex  "$(RegistryErrorIndex)
   Debug-Output "RemoveAdapter ShellCode           "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != STATUS_SUCCESSFUL
	  Set Status = STATUS_FAILED
      Debug-Output "RemoveNetworkCard *Error* UpdateControllerList"
      Return $(Status)
      Exit
   EndIf
   Set ControllerList = $($R1)


   ; 5. entferne die Netzwerkkarte
   ; =============================
   Shell "" RemoveNetworkCard, $(Language), $(Option)
   Set Status = $($R0)
   Debug-Output "RemoveAdapter RegistryErrorIndex "$(Status)
   Debug-Output "RemoveAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** 
      ; -------------
      Debug-Output "RemoveAdapter *Error* RemoveNetworkCard"
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf


   ; 6. entferne den CapiController aus dem Capi20Key
   ; ================================================
   Shell "" SetCapiDevice "remove", $(CapiDevice)
   Set Status = $($R0)
   Debug-Output "RemoveAdapter RegistryErrorIndex "$(Status)
   Debug-Output "RemoveAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** ServiceGroup konnte nicht etabliert werden
      ; -------------------------------------------------------
      Debug-Output "RemoveAdapter *Error* SetCapiDevice modus remove"
      Shell "" CleanUpInstalledComponents $(Language)
      Return $(Status)
      Exit
   EndIf
   Set AvailableCapiDevice = $($R1)
   Debug-Output "RemoveAdapter AvailableCapiDevice "$(AvailableCapiDevice)

   ; die folgenden schritte nur wenn der PnpSupport installiert wurde
   ; ----------------------------------------------------------------
   Set IsPnp = *(^(HardWare,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
   IfStr(i) $(IsPnp) == "Pnp"
      
      IfStr(i) $(ControllerList) == {}
         
         ; 7. ProductServiceName aus der AdapterListe entfernen 
         ; ====================================================
         Shell "" UpdateAdapterList, $(Language), $(Option), "remove", $(ServiceName)
         Set RegistryErrorIndex = $($R0)
         Debug-Output "RemoveAdapter RegistryErrorIndex  "$(RegistryErrorIndex)
         Debug-Output "RemoveAdapter ShellCode           "$($ShellCode)
         
         IfStr(i) $(RegistryErrorIndex) != STATUS_SUCCESSFUL
            Set Status = STATUS_FAILED
            Debug-Output "RemoveNetworkCard *Error* UpdateAdapterList"
            Return $(Status)
            Exit
         EndIf
         Set AdapterList = $($R1)
         Debug-Output "RemoveAdapter AdapterList  "$(AdapterList)
         
         ; 7. PnpService und PnpServiceGroup entfernen
         ; ===========================================
         IfStr(i) $(AdapterList) == {}
            ; PnpService entfernen wenn keine PnpAdapter mehr im system sind 
            ; --------------------------------------------------------------
            Shell "utility.inf", RemoveService, $(PnpServiceName), "YES"
            Set RegistryErrorIndex = $($R0)
            Debug-Output "RemoveAdapter RegistryErrorIndex  "$(RegistryErrorIndex)
            Debug-Output "RemoveAdapter ShellCode           "$($ShellCode)
            
            ; ServiceGroupOrder entfernen wenn keine PnpAdapter mehr im system sind 
            ; ---------------------------------------------------------------------
            Shell "", ServiceGroupOrderList, "remove", {$(PnpServiceGroup),""}
            Set RegistryErrorIndex = $($R0)
            Debug-Output "RemoveAdapter RegistryErrorIndex  "$(RegistryErrorIndex)
            Debug-Output "RemoveAdapter ShellCode           "$($ShellCode)
         EndIf
      EndIf
   EndIf

   ; 8. bereinige die ServiceGroupOrder für ParallelPortUnterstützung
   ; ================================================================
   Set IsBox = *(^(HardWare,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
   IfStr(i) $(IsBox) == "ParallelPort"
      IfStr(i) $(ControllerList) == {}
         ; ServiceGroupOrder entfernen wenn keine PnpAdapter mehr im system sind 
         ; ---------------------------------------------------------------------
         Shell "", ServiceGroupOrderList, "set", {"Parallel arbitrator", "Extended base"}
         Set RegistryErrorIndex = $($R0)
         Debug-Output "RemoveAdapter RegistryErrorIndex  "$(RegistryErrorIndex)
         Debug-Output "RemoveAdapter ShellCode           "$($ShellCode)
      EndIf
   EndIf

   ; 9. bereinige die ServiceGroupOrder für CAPI20
   ; ===========================================
   IfStr(i) $(AvailableCapiDevice) == "no"
      IfStr(i) $(ControllerList) == {}
         ; ServiceGroupOrder entfernen wenn keine PnpAdapter mehr im system sind 
         ; ---------------------------------------------------------------------
         Shell "", ServiceGroupOrderList, "remove", {"CAPI20",""}
         Set RegistryErrorIndex = $($R0)
         Debug-Output "RemoveAdapter RegistryErrorIndex  "$(RegistryErrorIndex)
         Debug-Output "RemoveAdapter ShellCode           "$($ShellCode)
      EndIf
   EndIf


   ; --> lösche die nicht mehr benötigten Dateien

   Debug-Output "RemoveAdapter *"
   EndWait
   Return $(Status)
   Exit


;***************************************************************************
;
;            C o n f i g u r e A d a p t e r
;
;      This section is shelled to by main installation processing
;      or by NCPASHEL.INF during reconfig, removal, update, etc.
;
;
; FUNCTION:  To copy files representing Options
;            To configure the installed option
;            To update the registry for the installed option
;
; INPUT:     $($0):  Language to use
;            $($1):  OptionID to install
;
; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
;                            STATUS_NOLANGUAGE |
;                            STATUS_USERCANCEL |
;                            STATUS_FAILED
;
;------------------------------------------------------------------------
[ConfigureAdapter]

   Set !DebugOutputControl = 1
   Set Status = STATUS_SUCCESSFUL
   Debug-Output "ConfigureAdapter >"

   ; Aufrufparameter
   Set Language = $($0)
   Set Option   = $($1)

   ; print callerparams
   Debug-Output "AddAdapter Language   "$(Language)
   Debug-Output "AddAdapter Option     "$(Option)

   ; 1. finde den ServiceName des Adapters
   ; =====================================
   Shell "" GetNetCardServiceName
   Set Status = $($R0)
   Debug-Output "ConfigureAdapter RegistryErrorIndex "$(Status)
   Debug-Output "ConfigureAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      ; ***ERROR *** 
      ; -------------
      Debug-Output "ConfigureAdapter *Error* GetNetCardServiceName"
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   Set NetCardService = $($R1)


   ; 2. konfiguriere den Adapter
   ; ===========================
   Shell "" ConfigureAdapterParameter, $(Language), $(Option), $(NetCardService)
   Set Status = $($R0)
   Debug-Output "ConfigureAdapter RegistryErrorIndex "$(Status)
   Debug-Output "ConfigureAdapter ShellCode          "$($ShellCode)

   IfStr(i) $(Status) != STATUS_SUCCESSFUL
      IfStr(i) $(Status) != STATUS_USERCANCEL
         ; ***ERROR *** die neue Software konnte nicht installiert werden
         ; --------------------------------------------------------------
         Debug-Output "ConfigureAdapter *Error* ConfigureAdapter"
         Set Status = STATUS_FAILED
      EndIf
   EndIf

   Debug-Output "ConfigureAdapter *"
   Return $(Status)
   Exit

;***************************************************************************
;
;            U p d a t e A d a p t e r
;
;      This section is shelled to by main installation processing
;      or by NCPASHEL.INF during reconfig, removal, update, etc.
;
;
; FUNCTION:  To copy files representing Options
;            To configure the installed option
;            To update the registry for the installed option
;
; INPUT:     $($0):  Language to use
;            $($1):  OptionID to install
;            $($2):  SourceDirectory
;            $($3):  SourceDirectory
;            $($4):  AddCopy              (YES | NO)
;            $($5):  DoCopy               (YES | NO)
;            $($6):  DoConfig             (YES | NO)
;
; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
;                            STATUS_NOLANGUAGE |
;                            STATUS_USERCANCEL |
;                            STATUS_FAILED
;
;------------------------------------------------------------------------
[UpdateAdapter]

   Set !DebugOutputControl = 1
   Set Status = STATUS_SUCCESSFUL
   Debug-Output "UpdateAdapter >"

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)

   ; print the callerparameters
   Debug-Output "UpdateAdapter Language "$(Language)
   Debug-Output "UpdateAdapter Option   "$(Option)

   Debug-Output "UpdateAdapter *"
   Return $(Status)
   Exit



;#######################################################################################################
;
;                       S U B R O U T I N E N 
;
;***************************************************************************
;
;                C l e a n U p I n s t a l l e d C o m p o n e n t s
;
;   Input:       $($0)     Language
;
;   Output:      $($R0)    Status
;                
;------------------------------------------------------------------------
[CleanUpInstalledComponents]
   Debug-Output "CleanUpInstalledComponents >"
   Set Status = STATUS_SUCCESSFUL
   
   Set Language = $($0)

   ; print the CleanUpList
   Debug-Output "CleanUpInstalledComponents CleanUpList "$(!CleanUpList)

   ; die Installation ist fehlgeschlagen
   Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "FATAL", +
   ;Shell "subroutn.inf" PushBillboard NETSTATUSDLG, +
                        #(SetupMessage$(Language), InstallationFailed, 1)

   ; scann the CleanUpList

   ForListDo $(!CleanUpList)
      Set p1 = *($($),1)
      Set p2 = *($($),2)
      Set p3 = *($($),3)
      Set p4 = *($($),4)
      Set p5 = *($($),5)
      Debug-Output "CleanUpInstalledComponents p1 "$(p1) 
      Debug-Output "CleanUpInstalledComponents p2 "$(p2)
      Debug-Output "CleanUpInstalledComponents p3 "$(p3)
      Debug-Output "CleanUpInstalledComponents p4 "$(p4) 
      Debug-Output "CleanUpInstalledComponents p5 "$(p5) 
      Shell $(p1), $(p2), $(p3), $(p4), $(p5)
   EndForListDo
   Debug-Output "CleanUpInstalledComponents *"
   Return $(Status)
   Exit


;***************************************************************************
;
;                AddCleanUpList
;
;   Input:       $($0)     CleanUpElement     // e.g. {"x","y","z", ...}
;
;   Output:      $($R0)    Status
;                
;------------------------------------------------------------------------
[AddCleanUpList]
   Debug-Output "AddCleanUpList >"
   Set Status = STATUS_SUCCESSFUL
   
   ; save the callerparameter
   Set CleanUpElement = {$($0)}

   ; print callerparameter
   Debug-Output "AddCleanUpList CleanUpElement "$(CleanUpElement)

   ; cat CleanUpElement, CleanUpList
   ForListDo $(!CleanUpList)
      Set CleanUpElement = >($(CleanUpElement),$($))
   EndForListDo

   ; restore the CleanUpList
   Set !CleanUpList = $(CleanUpElement)


   Debug-Output "AddCleanUpList *"
   Return $(Status)
   Exit


;***************************************************************************
;
;                S e t S e r v i c e G r o u p O r d e r
;
;   Input:       $($0)     Language
;                $($1)     Option
;
;   Output:      $($R0)    Status
;                
;------------------------------------------------------------------------
[SetServiceGroupOrder]
   Debug-Output "SetServiceGroupOrder >"
   Set Status = STATUS_SUCCESSFUL
   
   Set Language = $($0)
   Set Option = $($1)

   ; Print the Parameters
   Debug-Output "SetServiceGroupOrder Language "$(Language)
   Debug-Output "SetServiceGroupOrder Option   "$(Option)

   Read-Syms GeneralConstants
   Read-Syms ProductConstants

   IfStr(i) $(ServiceGroup) != "NDIS"
      ; lese die aktuelle ServiceGroupOrder für den CapiService
      ; -------------------------------------------------------
      Set ServiceGroupOrder = {$(ServiceGroup),"NDIS"}
      Shell "" ServiceGroupOrderList, "get", $(ServiceGroupOrder)
      Set Status = $($R0)

      IfStr(i) $(Status) != STATUS_SUCCESSFUL
         Debug-Output "SetServiceGroupOrder can't set ServiceGroupOrder for '"$(ServiceGroupName)"'"
         Return $(Status)
         Exit
      EndIf

      Set CurrentServiceGroupOrder = $($R1)
      Debug-Output "SetServiceGroupOrder CurrentServiceGroupOrder "$(CurrentServiceGroupOrder)

      IfStr(i) $(ServiceGroupOrder) != $(CurrentServiceGroupOrder)
         ; Setze die ServiceGroupOrder für den CapiService wenn diese GroupOrder nicht eingst. ist
         ; ---------------------------------------------------------------------------------------
         Shell "" ServiceGroupOrderList, "set", $(ServiceGroupOrder)
         Set Status = $($R0)

         IfStr(i) $(Status) != STATUS_SUCCESSFUL
            Debug-Output "SetServiceGroupOrder can't set ServiceGroupOrder for '"$(ServiceGroupName)"'"
            Return $(Status)
            Exit
         EndIf

         ; Aufbau CleanUpList
         ; ------------------
         Shell "" AddCleanUpList {"","ServiceGroupOrderList","remove",{$(ServiceGroup),""}}
      EndIf
   EndIf

   Debug-Output "SetServiceGroupOrder *"
   Return $(Status)
   Exit

;***************************************************************************
;
;                S e t N d i s S u p p o r t
;
;   Input:       $($0)     Language
;                $($1)     Option
;                $($2)     NetCardServiceName
;                $($3)     NetCardNumber
;
;   Output:      $($R0)    Status
;
;------------------------------------------------------------------------
[SetNdisSupport]
   Debug-Output "SetNdisSupport >"
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)
   Set NetCardServiceName = $($2)
   Set NetCardNumber = $($3)

   ; print the callerparameter
   Debug-Output "SetNdisSupport > Option             "$(Option)
   Debug-Output "SetNdisSupport > NetCardServiceName "$(NetCardServiceName)
   Debug-Output "SetNdisSupport > NetCardNumber      "$(NetCardNumber)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants


   ; Create the TapiDevices
   ; ----------------------
   ; open Hardware\DeviceMap
   OpenRegKey $(!REG_H_LOCAL) "" $(DeviceMapPath) $(MAXIMUM_ALLOWED) hDeviceMap
   IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)
      Shell "utility.inf" RegistryErrorString $(RegLastError)
      Debug-Output "SetNdisSupport RegLastError "$(RegLastError)" "$($R0)

      Debug-Output "SetNdisSupport *Error* can't open RegistryKey "$(DeviceMapPath)
      Set Status = STATUS_FAILED
	  Return $(Status)
      Exit
   EndIf

   ;##############################################
   ; to close:
   ; hDeviceMap
   ;##############################################

   ; erzeuge den Schlüssel TapiDevices
   OpenRegKey $(hDeviceMap) "" $(TapiDevicesPath) $(MAXIMUM_ALLOWED) hTapiDevices
   Debug-Output "SetNdisSupport hTapiDevices "$(hTapiDevices)
   IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)
      ; der schlüssel existiert noch nicht
      Shell "utility.inf" RegistryErrorString $(RegLastError)
      Debug-Output "SetNdisSupport RegLastError "$(RegLastError)" "$($R0)

      CreateRegKey $(hDeviceMap) {$(TapiDevicesPath), 0, GenericClass} "" $(MAXIMUM_ALLOWED) "" hTapiDevices
      IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)
         Debug-Output "SetNdisSupport *Error* can't create RegistryKey "$(TapiDevicesPath)
         CloseRegKey $(hDeviceMap)
         Set Status = STATUS_FAILED
         Return $(Status)
         Exit
      EndIf
   EndIf

   CloseRegKey $(hDeviceMap)
   ;##############################################
   ; to close:
   ; hTapiDevices
   ;##############################################

   ; erzeuge den Schlüssel TapiDevices
   OpenRegKey $(hTapiDevices) "" $(ServiceName) $(MAXIMUM_ALLOWED) hCurrentTapiDevice
   IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)
      ; der schlüssel existiert noch nicht
      CreateRegKey $(hTapiDevices) {$(ServiceName), 0, GenericClass} "" $(MAXIMUM_ALLOWED) "" hCurrentTapiDevice
      IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)
         Debug-Output "SetNdisSupport *Error* can't create RegistryKey "$(ServiceName)" in "$(DeviceMapPath)
         CloseRegKey $(hTapiDevices)
         CloseRegKey $(hDeviceMap)
         Set Status = STATUS_FAILED
         Return $(Status)
         Exit
      EndIf
   EndIf

   CloseRegKey $(hTapiDevices)
   ;##############################################
   ; to close:
   ; hCurrentTapiDevice
   ;##############################################
   
   Set TapiAddressList = {$(NetCardNumber)*($(AddressList),1)}
   Set TapiAddressList = >($(TapiAddressList),$(NetCardNumber)*($(AddressList),2))

   Set NewValueList = {{Address,      0, $(!REG_VT_MULTI_SZ), $(TapiAddressList)},+
                       {"Media Type", 0, $(!REG_VT_SZ),       $(MediaType)}}

   Shell "utility.inf", AddValueList, $(hCurrentTapiDevice), $(NewValueList)
   Set RegistryErrorIndex = $($R0)
   CloseRegKey $(hCurrentTapiDevice)

   Debug-Output "InitParametersKey Update CardServiceParameters RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "InitParametersKey Update CardServiceParameters ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
      ; 
      EndIf
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   ;##############################################
   ; to close:
   ; nothing
   ;##############################################


   ; Create OtherDependencies in ..\Service\Linkage
   ; ----------------------------------------------

   ; open Hardware\DeviceMap
   Set LinkagePath = $(ServicesPath)"\"$(ServiceName)"\Linkage"
   OpenRegKey $(!REG_H_LOCAL) "" $(LinkagePath) $(MAXIMUM_ALLOWED) hLinkage
   IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)
      Shell "utility.inf" RegistryErrorString $(RegLastError)
      Debug-Output "SetNdisSupport RegLastError "$(RegLastError)" "$($R0)

      Debug-Output "SetNdisSupport *Error* can't open RegistryKey "$(LinkagePath)
      Set Status = STATUS_FAILED
	  Return $(Status)
      Exit
   EndIf

   SetRegValue $(hLinkage) {OtherDependencies, 0, $(!REG_VT_MULTI_SZ), {""}}
   IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)
      Shell "utility.inf" RegistryErrorString $(RegLastError)
      Debug-Output "SetNdisSupport RegLastError "$(RegLastError)" "$($R0)

      Debug-Output "SetNdisSupport *Error* can't write ValueKey OtherDependencies in RegistryKey "$(LinkagePath)
      Set Status = STATUS_FAILED
	  Return $(Status)
      Exit
   EndIf


   ; Installiere den Ras-Service wenn erforderlich
   ; ---------------------------------------------
   Debug-Output "#############################################"
   Debug-Output "#############################################"
   Debug-Output "#############################################"
   Debug-Output "#############################################"
   Shell "oemnsvra.inf" CheckRasInstalled
   Set RasInstalled = $($R0)
   Debug-Output "AddAdapter RasInstalled   "$(RasInstalled)
   Debug-Output "AddAdapter ShellCode      "$($ShellCode)


;   Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", +
;                        "Jetzt wird der RasService installiert"

   ; wenn ohne dialog installiert/konfiguriert werden soll
;   Set !STF_UNATTENDED = $(SrcDir)"unattended.inf"
;   Set !STF_GUI_UNATTENDED = "YES"
;   Set !STF_UNATTENDED_SECTION = "Config"
   ; ... etc
	        
;   Set SrcRasDir = "d:\I386"
   Set SrcRasDir = ""
   Set Save1 = $(!STF_SRCDIR_OVERRIDE)
   Set !STF_SRCDIR_OVERRIDE = ""

   IfStr(i) $(RasInstalled) == FALSE
      Debug-Output "AddAdapter der RasService wird installiert"
      Debug-Output " **** STF_CWDDIR          "$(!STF_CWDDIR)
      Debug-Output " **** STF_SRCDIR          "$(!STF_SRCDIR)
      Debug-Output " **** STF_SRCDIR_OVERRIDE "$(!STF_SRCDIR_OVERRIDE)

      Shell "oemnsvra.inf" InstallOption $(!STF_LANGUAGE), "RAS", $(SrcRasDir), "YES", "YES", "YES" 
      Debug-Output "SetNdisSupport ReturnValue "$($R0)

   Else
      Set OldMode = $(!NTN_InstallMode)
	  Set !NTN_InstallMode = configure
      Shell "oemnsvra.inf" InstallOption $(!STF_LANGUAGE), "RAS", $(SrcRasDir), "YES", "YES", "YES" 
	  Set !NTN_InstallMode = $(OldMode)
   EndIf

   Set !STF_SRCDIR_OVERRIDE = $(Save1)

   ; wenn ohne dialog installiert/konfiguriert wurde
;   Set !STF_UNATTENDED = ""
;   Set !STF_GUI_UNATTENDED = ""
;   Set !STF_UNATTENDED_SECTION = ""

   Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", +
                        "Jetzt ist der RasService installiert"

   ; wenn der RasService unbeobachtet istalliert wurde, muß die TapiAddressListe
   ; korrigiert werden. ( Fehler in 'setupdll.dll' ist auch in SP3 )

   ; Software\Microsoft\Ras\TAPI DEVICES\$(ServiceName) --> Address
   ; analog zu ValueKey 'Friendly Name'

   Debug-Output "SetNdisSupport ServiceName "$(ServiceName)
   OpenRegKey $(!REG_H_LOCAL) "" $(RasTapiDevicesPath)"\"$(ServiceName) $(MAXIMUM_ALLOWED) hRasTapiDevices 
   IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)

   EndIf

   GetRegValue $(hRasTapiDevices) "Friendly Name" , FriendlyName
   Set FriendlyName = *($(FriendlyName),4)
   Debug-Output "SetNdisSupport FriendlyName "$(FriendlyName)


   CloseRegKey $(hRasTapiDevices)
   Debug-Output "SetNdisSupport *"
   Return $(Status)
   Exit

;***************************************************************************
;
;                PcmciaSupport
;
;   Input:       $($0)     Language
;                $($1)     Option
;                $($2)     NetCardServiceName
;
;   Output:      $($R0)    Status
;
;------------------------------------------------------------------------
[PcmciaSupport]
   Debug-Output "PcmciaSupport >"
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)
   Set NetCardServiceName = $($2)

   ; print the callerparameter
   Debug-Output "PcmciaSupport > Language           "$(Language)
   Debug-Output "PcmciaSupport > Option             "$(Option)
   Debug-Output "PcmciaSupport > NetCardServiceName "$(NetCardServiceName)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants

   Debug-Output "PcmciaSupport ServiceName "$(ServiceName)

   Set IsPcmcia = *(^(HardWare,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
   Debug-Output "PcmciaSupport PcmciaSupport "$(IsPcmcia)
   IfStr(i) $(IsPcmcia) == "Pcmcia"
      ; aktualisiere die ValueKey's in ..\Services\$(NetCardServiceName)\Parameters
      OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(NetCardServiceName)"\Parameters", +
                                    $(MAXIMUM_ALLOWED), hParameters
      Debug-Output "PcmciaSupport RegLastError "$(RegLastError)

      Set NewValueList = {{Pcmcia,   0, $(!REG_VT_DWORD), $(Pcmcia)},+
                          {IoLength, 0, $(!REG_VT_DWORD), $(IoLength)}}

      Shell  "utility.inf", AddValueList, $(hParameters), $(NewValueList)
      Set RegistryErrorIndex = $($R0)
      Debug-Output "PcmciaSupport RegistryErrorIndex "$(RegistryErrorIndex)
      Debug-Output "PcmciaSupport ShellCode          "$($ShellCode)

      CloseRegKey $(hParameters)

      ; aktualisiere die PcmciaDatabase
      Shell "" PcmciaUpdateDataBase $(Option), $(ServiceName), $(Manufacturer), $(PcmciaAdapterNames)
   EndIf

   Debug-Output "PcmciaSupport *"
   Return $(Status)
   Exit


;***************************************************************************
;
;                P a r a l l e l P o r t S u p p o r t
;
;   Input:       $($0)     Language
;                $($1)     Option
;                $($2)     NetCardServiceName
;
;   Output:      $($R0)    Status
;
;------------------------------------------------------------------------
[ParallelPortSupport]
   Debug-Output "ParallelPortSupport >"
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)
   Set NetCardServiceName = $($2)

   ; print the callerparameter
   Debug-Output "ParallelPortSupport Language "$(Language)
   Debug-Output "ParallelPortSupport Option   "$(Option)
   Debug-Output "ParallelPortSupport NetCardServiceName "$(NetCardServiceName)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants

   ; wenn die box installiert wird dann verschiebe 'Parallel arbitrator' vor 'CAPI20'
   ; --------------------------------------------------------------------------------
   Shell "" ServiceGroupOrderList, "set", {"Parallel arbitrator", $(ServiceGroup)}
   Set Status = $($R0)

   IfStr(i) $(Status) == STATUS_FAILED
      Debug-Output "ParallelPortSupport *Error* ServiceGroupOrderList"
      Return $(Status)
      Exit
   EndIf


   Debug-Output "ParallelPortSupport *"
   Return $(Status)
   Exit


;***************************************************************************
;
;                S e t N e w C a p i D e v i c e
;
;   Input:       $($0)     Language
;                $($1)     Option
;
;   Output:      $($R0)    Status
;                $($R1)    CapiDevice
;------------------------------------------------------------------------
[SetNewCapiDevice]
   Debug-Output "SetNewCapiDevice >"
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants

   ; neuer CapiControler oder DefaultCapiDevice
   IfStr(i) $(Option) == "Ndis"
      ; default CapiDevice
      Set CapiDevice = "1"
   Else
      ; ask for valid CapiDevice
      ; ------------------------
      Shell "" GetValidCapiController
      Set Status = $($R0)

      IfStr(i) $(Status) != STATUS_SUCCESSFUL
         ; ***ERROR *** kein gültiges CapiDevice gefunden
         ; ----------------------------------------------
         ; ---> Fehlerbehandlung
         Debug-Output "SetNewCapiDevice *Error* can't get the CapiDevice"
         Set Status = STATUS_FAILED
         Set CapiDevice = 0
         Return $(Status) $(CapiDevice)
         Exit
      EndIf

      ; CapiDevice is valid
      ; -------------------
      Set CapiDevice = $($R1)

      ; create the new CapiDevice
      ; -------------------------
      Shell "" SetCapiDevice "set", $(CapiDevice), $(Option), $(Manufacturer)
      Set Status = $($R0)
      IfStr(i) $(Status) != STATUS_SUCCESSFUL
         ; ***ERROR *** CapiDevice konnte nicht etabliert werden
         ; -----------------------------------------------------
         Debug-Output "SetNewCapiDevice *Error* can't create new CapiDevice"

         Set Status = STATUS_FAILED
         Set CapiDevice = 0
         Return $(Status) $(CapiDevice)
         Exit
      EndIf

      ; Aufbau CleanUpList
      ; ------------------
      ; entferne das CapiDevice
      Shell "" AddCleanUpList {"","SetCapiDevice","remove",$(CapiDevice)}
   EndIf

   Debug-Output "SetNewCapiDevice *"
   Return $(Status) $(CapiDevice)
   Exit


;***************************************************************************
;
;                N e w S o f t w a r e C o m p o n e n t
;
;   Input:       $($0)     Language
;                $($1)     Option
;
;   Output:      $($R0)    Status
;                $($R1)    NewService
;------------------------------------------------------------------------
[NewSoftwareComponent]
   Debug-Output "NewSoftwareComponent >"
   Set Status = STATUS_SUCCESSFUL
   Set NewService = ""

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)

   ; print the callerparameters
   Debug-Output "NewSoftwareComponent Language  "$(Language)
   Debug-Output "NewSoftwareComponent Option    "$(Option)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants

   ; erzeuge den eintrag in der SoftwareSection

   Debug-Output "NewSoftwareComponent Manufacturer        "$(Manufacturer)
   Debug-Output "NewSoftwareComponent ProductSoftwareName "$(ProductSoftwareName)
   Debug-Output "NewSoftwareComponent ServiceName         "$(ServiceName)
   Debug-Output "NewSoftwareComponent ServiceDisplayName  "$(ServiceDisplayName)
   Debug-Output "NewSoftwareComponent STF_CONTEXTINFNAME  "$(STF_CONTEXTINFNAME)
   Debug-Output "NewSoftwareComponent DriverImagePath     "$(DriverImagePath)
   Debug-Output "NewSoftwareComponent ServiceGroup        "$(ServiceGroup)
   Debug-Output "NewSoftwareComponent ErrorLogging        "$(ErrorLogging)
   Shell "utility.inf", AddSoftwareComponent,    $(Manufacturer), +
                        $(ProductSoftwareName),  $(ServiceName), +
						$(ServiceDisplayName),   $(STF_CONTEXTINFNAME), +
						$(DriverImagePath),      "kernelautostart", +
						$(ServiceGroup),         {""}, +
						"",                      $(ErrorLogging)
   Set RegistryErrorIndex = $($R0)
   Debug-Output "NewSoftwareComponent AddSoftwareComponent RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "NewSoftwareComponent AddSoftwareComponent ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_ACCESS_CONFIGURE_SERVICE
         Set Status = STATUS_FAILED
      Else-IfStr(i) $(RegistryErrorIndex) == REBOOT_MACHINE_BEFORE_ADD_ADAPTER
         ; --> Msg for RebootMachineBeforeAddAdapter
         Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "FATAL", +
                              #(SetupMessage$(Language), RecentlyRemoved, 1)
         Set Status = STATUS_FAILED

      Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_CREATE_CONFIGURE_SERVICE
         ; --> Msg for ServiceAlreadyExists
         Set Status = STATUS_FAILED

      Else-IfStr(i) $(RegistryErrorIndex) == SERVICE_ALREADY_EXISTS
         Set Status = STATUS_FAILED

      Else-IfStr(i) $(RegistryErrorIndex) == SERVICE_MARKED_FOR_DELETE
         Set Status = STATUS_FAILED

      Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_CREATE_SERVICE_SUBKEY
         Set Status = STATUS_FAILED

      Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_OPEN_EVENTLOG_SUBKEY
         Set Status = STATUS_FAILED

      Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
         Set Status = STATUS_FAILED
      EndIf

      Return $(Status)
      Exit
   Else
      ; update the CleanUpList
      ; ------------------
      Shell "" AddCleanUpList {"utility.inf","RemoveSoftwareComponent",$(Manufacturer),$(ProductSoftwareName),"FALSE"}
   EndIf

   ; setze die ReturnValues
   Set hKeyProduct        = $($R1)
   Set hSoftNetRulesKey   = $($R2)
   Set hService           = $($R3)
   Set hServiceParameters = $($R4)
   Set hServiceLinkage    = $($R5)


;##############################################
; to close:
;   hKeyProduct
;   hSoftNetRulesKey
;   hService
;   hServiceParameters
;   hServiceLinkage
;##############################################




   ; vervollständige Software\ProductSoftwareName\CurrentVersion
   Detect Date
   Set NewValueList = {{Description,  0, $(!REG_VT_SZ),    $(ProductSoftwareDescription)},+
                       {InstallDate,  0, $(!REG_VT_DWORD), *($(Now),1)}, +
                       {MajorVersion, 0, $(!REG_VT_DWORD), *($(ProductVersion),1)},+
                       {MinorVersion, 0, $(!REG_VT_DWORD), *($(ProductVersion),2)},+
                       {ServiceName,  0, $(!REG_VT_SZ),    $(ServiceName)},+
                       {SoftwareType, 0, $(!REG_VT_SZ),    $(SoftwareType)},+
                       {Title,        0, $(!REG_VT_SZ),    $(ProductSoftwareTitle)}}

   Shell  "utility.inf", AddValueList, $(hKeyProduct), $(NewValueList)
   CloseRegKey $(hKeyProduct)

   Set RegistryErrorIndex = $($R0)
   Debug-Output "NewSoftwareComponent Update KeyProduct RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "NewSoftwareComponent Update KeyProduct ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
      ; 
      EndIf
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

;##############################################
; to close:
;   Set hSoftNetRulesKey   = $($R2)
;   Set hService           = $($R3)
;   Set hServiceParameters = $($R4)
;   Set hServiceLinkage    = $($R5)
;##############################################

   ; vervollständige Software\ProductSoftwareName\CurrentVersion\Netrules
   Set NewValueList = {{bindable,  0, $(!REG_VT_MULTI_SZ), $(BindableTxt)}, +
                       {bindform,  0, $(!REG_VT_SZ),       $(NetRuleSoftwareBindForm)}, +
                       {class,     0, $(!REG_VT_MULTI_SZ), $(NetRuleSoftwareClass)}, +
                       {InfOption, 0, $(!REG_VT_SZ),       $(Option)}, +
                       {type,      0, $(!REG_VT_SZ),       $(NetRuleSoftwareType)}, +
                       {use,       0, $(!REG_VT_SZ),       $(NetRuleSoftwareUse)}}

   Shell  "utility.inf", AddValueList, $(hSoftNetRulesKey), $(NewValueList)
   CloseRegKey $(hSoftNetRulesKey)

   Set RegistryErrorIndex = $($R0)
   Debug-Output "NewSoftwareComponent Update SoftNetRulesKey RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "NewSoftwareComponent Update SoftNetRulesKey ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
      ; 
      EndIf
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

;##############################################
; to close:
;   Set hService           = $($R3)
;   Set hServiceParameters = $($R4)
;   Set hServiceLinkage    = $($R5)
;##############################################


   ; initial ValueKey Controllers in Services\ServiceName\Parameters
   Set NewValueList = {{Controllers, $(NoTitle), $(!REG_VT_MULTI_SZ), {}}}

   Shell "utility.inf", AddValueList, $(hServiceParameters), $(NewValueList)
   CloseRegKey $(hServiceParameters)

   Set RegistryErrorIndex = $($R0)
   Debug-Output "NewSoftwareComponent Update ServiceParameters RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "NewSoftwareComponent Update ServiceParameters ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
      ; 
      EndIf
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

;##############################################
; to close:
;   Set hService           = $($R3)
;   Set hServiceLinkage    = $($R5)
;##############################################






   CloseRegKey $(hService)
   CloseRegKey $(hServiceLinkage)

   Debug-Output "NewSoftwareComponent *"
   Set Status = STATUS_SUCCESSFUL
   Return $(Status) $(NewService)
   Exit



;***************************************************************************
;
;                R e m o v e N e t w o r k C a r d
;
;   Input:       $($0)     Language
;                $($1)     Option
;                $($2)     NetCardService
;
;   Output:      $($R0)    Status
;
;------------------------------------------------------------------------
[RemoveNetworkCard]
   Debug-Output "RemoveNetworkCard >"
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)
   Set NetCardService = $($2)

   ; print the callerparameters
   Debug-Output "RemoveNetworkCard Language    "$(Language)
   Debug-Output "RemoveNetworkCard Option      "$(Option)
   Debug-Output "RemoveNetworkCard NTN_RegBase "$(!NTN_RegBase)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants


   ; Hardware entfernen
   Shell "utility.inf", RemoveHardwareComponent, $(Manufacturer), +
                                                 $(ProductSoftwareName), +
												 $(!NTN_RegBase)
   Set RegistryErrorIndex = $($R0)
   Debug-Output "RemoveNetworkCard RegistryErrorIndex  "$(RegistryErrorIndex)
   Debug-Output "RemoveNetworkCard ShellCode           "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_ACCESS_CONFIGURE_SERVICE
      Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_REMOVE_CONFIGURE_SERVICE

      EndIf
	  Set Status = STATUS_FAILED
      Debug-Output "RemoveNetworkCard *Error* RemoveHardwareComponent"
      Return $(Status)
      Exit
   EndIf


   ; return
   Debug-Output "RemoveNetworkCard *"
   Return $(Status)
   Exit

;***************************************************************************
;
;                N e w N e t w o r k C a r d
;
;   Input:       $($0)     Language
;                $($1)     Option
;                $($2)     CapiDevice
;
;   Output:      $($R0)    Status
;                $($R1)    NetCardService
;                $($R2)    NetCardNumber
;------------------------------------------------------------------------
[NewNetworkCard]
   Debug-Output "NewNetworkCard >"
   Set Status = STATUS_SUCCESSFUL
   Set NetCardService = ""

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)
   Set CapiDevice = $($2)

   ; print the callerparameters
   Debug-Output "NewNetworkCard Language   "$(Language)
   Debug-Output "NewNetworkCard Option     "$(Option)
   Debug-Output "NewNetworkCard CapiDevice "$(CapiDevice)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants

   ; erzeuge den Eintrag in der ....\NetworkCards\(n) Sektion
   Shell "utility.inf", AddHardwareComponent, +
                        $(ServiceName), +				; Service name to use
                        $(STF_CONTEXTINFNAME), +		; inf-file name for this adapter
                        $(ProductSoftwareNamePath)      ; drivername in softwaresection

   Set RegistryErrorIndex = $($R0)
   Debug-Output "NewNetworkCard AddHardwareComponent RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "NewNetworkCard AddHardwareComponent ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_CREATE_NETCARD_CONFIGURATION
      Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_CREATE_NETRULES_KEY
      Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_OPEN_NETWORKCARD_SECTION
      Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_ACCESS_CONFIGURE_SERVICE
      Else-IfStr(i) $(RegistryErrorIndex) == REBOOT_MACHINE_BEFORE_ADD_ADAPTER
      Else-IfStr(i) $(RegistryErrorIndex) == SERVICE_ALREADY_EXISTS
      Else-IfStr(i) $(RegistryErrorIndex) == SERVICE_MARKED_FOR_DELETE
      Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_CREATE_CONFIGURE_SERVICE
      Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_CREATE_SERVICE_SUBKEY
      EndIf
	  Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   Else
      ; update CleanUpList
      Set Path = $(NetworkCardsPath)"\"$($R4)
	  Shell "" AddCleanUpList {"utility.inf","RemoveHardwareComponent",$(Manufacturer),$(ProductSoftwareName),$(Path)}
   EndIf


   Set hNetCard = $($R1)
   Set hNetCardNetRules = $($R2)
   Set hCardServiceParameters = $($R3)
   Set NetCardNumber = $($R4)
   Set NetCardServiceName = $($R5)

;##############################################
; to close:
;   hNetCard
;   hNetCardNetRules
;   hCardServiceParameters
;##############################################

   Debug-Output "hNetCard  "$(hNetCard)
   Debug-Output "hNetCardNetRules  "$(hNetCardNetRules)
   Debug-Output "hCardServiceParameters  "$(hCardServiceParameters)
   Debug-Output "NetCardNumber  "$(NetCardNumber)
   Debug-Output "NetCardServiceName  "$(NetCardServiceName)


   ; vervollstandige die ValueKey's in ..\NetCards\n\ ein
   Detect Date
   Set NewValueList = {{Description,  0, $(!REG_VT_SZ),    $(ProductHardwareDescription)}, +
                       {InstallDate,  0, $(!REG_VT_DWORD), *($(Now),1)}, +
                       {Manufacturer, 0, $(!REG_VT_SZ),    $(Manufacturer)}, +
                       {ProductName,  0, $(!REG_VT_SZ),    $(ProductHardwareName)}, +
                       {ServiceName,  0, $(!REG_VT_SZ),    $(NetCardServiceName)}, +
                       {Title,        0, $(!REG_VT_SZ),    "["$(NetCardNumber)"] "$(ProductHardwareTitle)}}

   Shell "utility.inf", AddValueList, $(hNetCard), $(NewValueList)
   Set RegistryErrorIndex = $($R0)
   CloseRegKey $(hNetCard)

   Debug-Output "NewNetworkCard Update NetCard RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "NewNetworkCard Update NetCard ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
      ; 
      EndIf
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

;##############################################
; to close:
;   hNetCardNetRules
;   hCardServiceParameters
;##############################################


   ; vervollständige die ValueKey's in ..\NetCards\n\NetRules\
   Set TempProdName = """"$(NetCardServiceName)""""
   Set BindForm = """"$(NetCardServiceName)""""$(NetRuleHardwareBindForm)
   Set NewValueList = {{bindform,  0, $(!REG_VT_SZ),       $(BindForm)}, +
                       {class,     0, $(!REG_VT_MULTI_SZ), $(NetRuleHardwareClass)}, +
                       {InfOption, 0, $(!REG_VT_SZ),       $(Option)}, +
                       {type,      0, $(!REG_VT_SZ),       $(NetRuleHardwareType)}}

   Shell "utility.inf", AddValueList, $(hNetCardNetRules), $(NewValueList)
   Set RegistryErrorIndex = $($R0)
   CloseRegKey $(hNetCardNetRules)

   Debug-Output "NewNetworkCard Update NetCardNetRules RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "NewNetworkCard Update NetCardNetRules ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
      ; 
      EndIf
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

;##############################################
; to close:
;   hCardServiceParameters
;##############################################
   CloseRegKey $(hCardServiceParameters)

;##############################################
; to close:
;   nothing
;##############################################

   ; aktualisiere in ..\Services\$()\Parameters die ControlerListe
   Shell "" UpdateControllerList, $(Language), $(Option), "append", $(NetCardServiceName)
   Set RegistryErrorIndex = $($R0)
   Debug-Output "NewNetworkCard RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "NewNetworkCard ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != status_successful
      ; ***ERROR *** die ControllerList konnte nicht erweitert werden
      Debug-Output "NewNetworkCard *Error* UpdateControllerList"
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   ; append CleanupList
   Shell "" AddCleanUpList {"","UpdateControllerList",$(Language),$(Option),"remove",$(NetCardServiceName)}   

   Debug-Output "NewNetworkCard *"
   Set Status = STATUS_SUCCESSFUL
   Return $(Status) $(NetCardServiceName) $(NetCardNumber)
   Exit


;***************************************************************************
;
;                I n i t P a r a m e t e r s K e y
;
;   Input:       $($0)     Language
;                $($1)     Option
;                $($2)     NetCardServiceName
;                $($3)     NetCardNumber
;                $($4)     CapiDevice
;
;   Output:      $($R0)    Status
;------------------------------------------------------------------------
[InitParametersKey]
   Debug-Output "InitParametersKey >"
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)
   Set NetCardServiceName = $($2)
   Set NetCardNumber = $($3)
   Set CapiDevice = $($4)

   ; print the callerparameters
   Debug-Output "InitParametersKey Language            "$(Language)
   Debug-Output "InitParametersKey Option              "$(Option)
   Debug-Output "InitParametersKey NetCardServiceName  "$(NetCardServiceName)
   Debug-Output "InitParametersKey NetCardNumber       "$(NetCardNumber)
   Debug-Output "InitParametersKey CapiDevice          "$(CapiDevice)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants


   OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(NetCardServiceName)"\Parameters", +
                                 $(MAXIMUM_ALLOWED), hCardServiceParameters

   ; initialisiere die ValueKey's in ..\Services\$(NetCardServiceName)\Parameters
   ; ----------------------------------------------------------------------------   
   IfStr(i) $(Option) == "Ndis"
      ; Parameter für alle Driver
      ; -------------------------
	  Set TapiAddressList = {$(NetCardNumber)*($(AddressList),1)}
	  Set TapiAddressList = >($(TapiAddressList),$(NetCardNumber)*($(AddressList),2))
      Set TapiController = 1
	  Set CapiDeviceName = "CAPI20"$(CapiDevice)
      Set NewValueList = {{AddressList, 0, $(!REG_VT_MULTI_SZ), $(TapiAddressList)}, +
                          {CapiDevice,  0, $(!REG_VT_SZ),       $(CapiDeviceName)}, +
                          {Controller,  0, $(!REG_VT_DWORD),    $(TapiController)}, +
                          {DeviceName,  0, $(!REG_VT_SZ),       $(ServiceName)}, +
                          {LineType,    0, $(!REG_VT_DWORD),    $(LineType)}, +
                          {MediaType,   0, $(!REG_VT_SZ),       $(MediaType)}, +
                          {MiscParam0,  0, $(!REG_VT_SZ),       $(MiscParam0_Value)}, +
                          {MiscParam1,  0, $(!REG_VT_SZ),       $(MiscParam1_Value)}, +
                          {MSNL0,       0, $(!REG_VT_SZ),       $(MSNL0_Value)}, +
                          {MSNL1,       0, $(!REG_VT_SZ),       $(MSNL1_Value)}}

   Else
      ; Parameter für alle Adapter
      ; --------------------------
      Set Interrupt = *(^(InterruptStrings, 2),~(^(InterruptStrings, 1), $(InterruptNumber)))
      Set IsBox = *(^(HardWare,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
      IfStr(i) $(IsBox) == "ParallelPort"
         IfStr(i) $(IoBaseAddress) == "LPT1"
            Set Port = 0
         Else-IfStr(i) $(IoBaseAddress) == "LPT2"
            Set Port = 1
         Else-IfStr(i) $(IoBaseAddress) == "LPT3"
            Set Port = 2
         Else-IfStr(i) $(IoBaseAddress) == "LPT4"
            Set Port = 3
         Else
            Set Port = 0
         EndIf
      Else
         Set-HexToDec Port = $(IoBaseAddress)
      Endif
      Set NewValueList = {{AdapterId,       0, $(!REG_VT_DWORD),    $(AdapterId)}, +
                          {ADP_Number,      0, $(!REG_VT_DWORD),    $(NetCardNumber)}, +
                          {BusNumber,       0, $(!REG_VT_DWORD),    $(BusNumber)}, +
                          {BusType,         0, $(!REG_VT_DWORD),    $(BusType)}, +
                          {CapiDevice,      0, $(!REG_VT_SZ),       $(CapiDevice)}, +
                          {DeviceName,      0, $(!REG_VT_SZ),       $(ServiceName)}, +
                          {DialogType,      0, $(!REG_VT_MULTI_SZ), {""}}, +
                          {InterruptNumber, 0, $(!REG_VT_DWORD),    $(Interrupt)}, +
                          {IoBaseAddress,   0, $(!REG_VT_DWORD),    $(Port)}, +
                          {MediaType,       0, $(!REG_VT_SZ),       $(MediaType)}}
   Endif

   Shell "utility.inf", AddValueList, $(hCardServiceParameters), $(NewValueList)
   Set RegistryErrorIndex = $($R0)
   CloseRegKey $(hCardServiceParameters)

   Debug-Output "InitParametersKey Update CardServiceParameters RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "InitParametersKey Update CardServiceParameters ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
      ; 
      EndIf
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   Debug-Output "InitParametersKey *"
   Set Status = STATUS_SUCCESSFUL
   Return $(Status) $(NetCardServiceName)
   Exit

;***************************************************************************
;
;                N e w C o n t r o l l e r
;
;   Input:       $($0)     Language
;                $($1)     Option
;                $($2)     modus                    // append      -    remove
;                $($3)     NetCardServiceName
;
;   Output:      $($R0)    Status
;                $($R1)    ControllerList
;
;------------------------------------------------------------------------
[UpdateControllerList]
   Debug-Output "UpdateControllerList >"
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)
   Set modus = $($2)
   Set NetCardServiceName = $($3)

   ; print the callerparameters
   Debug-Output "UpdateControllerList Language            "$(Language)
   Debug-Output "UpdateControllerList Option              "$(Option)
   Debug-Output "UpdateControllerList modus               "$(modus)
   Debug-Output "UpdateControllerList NetCardServiceName  "$(NetCardServiceName)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants

   ; open the ..\Services\$(ServiceName)\Parameters
   OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) hParameters
   IfStr(i) $(hParameters) == $(KeyNull)
      Debug-Output "UpdateControllerList *Error* can't open the ..\Services\"$(ServiceName)"\Parameters Key"
      Set Status = REG_UNABLE_OPEN_KEY
      Return $(Status)
      Exit
   EndIf

;##############################################
; to close:
;   hParameters
;##############################################


   ; aktualisiere den Controllers ValueKey's im hParameters
   GetRegValue $(hParameters) "Controllers" , ControllerList
   Set ControllerList = *($(ControllerList),4)
   Debug-Output "UpdateControllerList ControllerList "$(ControllerList)

   ; prüfen ob der Controller bereits vorhanden ist
   Set TempList = {}
   ForListDo $(ControllerList)
      IfStr(i) $($) == $(NetCardServiceName)
         ; streiche den alten Controller
      Else-IfStr(i) $($) == ""
         ; kopiere nicht
	  Else
         ; kopiere den alten Controller
	     Set TempList = >($(TempList),$($))
      Endif
   EndForListDo

   IfStr(i) $(modus) == "append"
      ; setze den neuen Controller an das ende der ContollerList
      Set ControllerList = >($(TempList), $(NetCardServiceName))
   Else-IfStr(i) $(modus) == "remove"
      ; ohne den NetCardServiceName 
      Set ControllerList = $(TempList)
   EndIf

   Debug-Output "UpdateControllerList ControllerList "$(ControllerList)

   Set NewValueList = {{Controllers, $(NoTitle), $(!REG_VT_MULTI_SZ), $(ControllerList)}}

   Shell "utility.inf", AddValueList, $(hParameters), $(NewValueList)
   Set RegistryErrorIndex = $($R0)
   CloseRegKey $(hParameters)

   Debug-Output "UpdateControllerList RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "UpdateControllerList ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
         Debug-Output "UpdateControllerList *Error* can't write back the Controllers ValueKey"
      EndIf
      Set Status = REG_UNABLE_WRITE_REGISTRY
      Return $(Status)
      Exit
   EndIf

;##############################################
; to close:
;   nothing
;##############################################
      
   Debug-Output "UpdateControllerList *"
   Set Status = STATUS_SUCCESSFUL
   Return $(Status) $(ControllerList)
   Exit


;***************************************************************************
;
;                U p d a t e A d a p t e r L i s t 
;
;   Input:       $($0)     Language
;                $($1)     Option
;                $($2)     modus                    // append      -    remove
;                $($3)     ServiceName
;
;   Output:      $($R0)    Status
;                $($R1)    AdapterList
;
;------------------------------------------------------------------------
[UpdateAdapterList]
   Debug-Output "UpdateAdapterList >"
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)
   Set modus = $($2)
   Set ServiceName = $($3)

   ; print the callerparameters
   Debug-Output "UpdateAdapterList Language     "$(Language)
   Debug-Output "UpdateAdapterList Option       "$(Option)
   Debug-Output "UpdateAdapterList modus        "$(modus)
   Debug-Output "UpdateAdapterList ServiceName  "$(ServiceName)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants

   ; open the ..\Services\$(ServiceName)\Parameters
   OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(PnpServiceName) $(MAXIMUM_ALLOWED) hParameters
   IfStr(i) $(hParameters) == $(KeyNull)
      Debug-Output "UpdateAdapterList *Error* can't open the ..\Services\"$(PnpServiceName)" Key"
      Set Status = REG_UNABLE_OPEN_KEY
      Return $(Status)
      Exit
   EndIf

;##############################################
; to close:
;   hParameters
;##############################################


   ; aktualisiere den DetectKey ValueKey's im hParameters
   GetRegValue $(hParameters) "DetectKey" , AdapterList
   Set AdapterList = *($(AdapterList),4)
   Debug-Output "UpdateAdapterList AdapterList "$(AdapterList)

   ; prüfen ob der Adapter bereits vorhanden ist
   Set TempList = {}
   ForListDo $(AdapterList)
      IfStr(i) $($) == $(ServiceName)
         ; streiche den alten Controller
      Else-IfStr(i) $($) == ""
         ; kopiere nicht
	  Else
         ; kopiere den alten Controller
	     Set TempList = >($(TempList),$($))
      Endif
   EndForListDo

   IfStr(i) $(modus) == "append"
      ; setze den neuen Adapter an das ende der ContollerList
      Set AdapterList = >($(TempList), $(ServiceName))
   Else-IfStr(i) $(modus) == "remove"
      ; ohne den ServiceName 
      Set AdapterList = $(TempList)
   EndIf

   Debug-Output "UpdateAdapterList AdapterList "$(AdapterList)

   Set NewValueList = {{DetectKey, $(NoTitle), $(!REG_VT_MULTI_SZ), $(AdapterList)}}

   Shell "utility.inf", AddValueList, $(hParameters), $(NewValueList)
   Set RegistryErrorIndex = $($R0)
   CloseRegKey $(hParameters)

   Debug-Output "UpdateAdapterList RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "UpdateAdapterList ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
         Debug-Output "UpdateAdapterList *Error* can't write back the DetectKey ValueKey"
      EndIf
      Set Status = REG_UNABLE_WRITE_REGISTRY
      Return $(Status)
      Exit
   EndIf

;##############################################
; to close:
;   nothing
;##############################################

   Debug-Output "UpdateAdapterList *"
   Set Status = STATUS_SUCCESSFUL
   Return $(Status) $(AdapterList)
   Exit


;***************************************************************************
;
;                G e t C u r r e n t C a p i D e v i c e
;
;   Input:       $($0)     NetCardServiceName
;
;   Output:      $($R0)    Status
;                $($R1)    CapiDevice
;
;------------------------------------------------------------------------
[GetCurrentCapiDevice]
   Debug-Output "GetCurrentCapiDevice >"
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameter
   Set NetCardServiceName = $($0)

   ; print the callerparameter
   Debug-Output "GetCurrentCapiDevice NetCardServiceName "$(NetCardServiceName)

   ; initialize the returnvalue
   Set CapiDevice = ""

   ; read the initialized parameters
   Read-Syms GeneralConstants

   ; öffne den Key ..\NetCard\(n)
   Set ServicePath = $(ServicesPath)"\"$(NetCardServiceName)"\Parameters"
   OpenRegKey $(!REG_H_LOCAL), "", $(ServicePath)"\", $(MAXIMUM_ALLOWED), hNetCardServiceParameters

   IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)
      Debug-Output "GetCurrentCapiDevice *Error* can't open NetCardServiceParameters"
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   ; lese das CapiDevice
   GetRegValue $(hNetCardServiceParameters), "CapiDevice", CapiDevice
   IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)
      Debug-Output "GetCurrentCapiDevice *Error* can't read ValueKey CapiDevice"
      CloseRegKey $(hNetCardServiceParameters)
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   Set CapiDevice = *($(CapiDevice),4)
   Debug-Output "GetCurrentCapiDevice CapiDevice "$(CapiDevice)


   ; cleanup
   CloseRegKey $(hNetCardServiceParameters)

   ; return
   Debug-Output "GetCurrentCapiDevice *"
   Return $(Status) $(CapiDevice)
   Exit


;***************************************************************************
;
;                G e t C u r r e n t S e r v i c e N a m e
;
;   Input:       $($0)     Language
;                $($1)     Option
;
;   Output:      $($R0)    Status
;                $($R1)    ServiceName
;
;------------------------------------------------------------------------
[GetCurrentServiceName]
   Debug-Output "GetCurrentServiceName >"
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameter
   Set Language = $($0)
   Set Option = $($1)

   ; print the callerparameter
   Debug-Output "GetCurrentServiceName Language "$(Language)
   Debug-Output "GetCurrentServiceName Option   "$(Option)

   ; initialize the returnvalue
   Set ServiceName = ""

   ; read the initialized parameters
   Read-Syms ProductConstants

   ; return
   Debug-Output "GetCurrentServiceName *"
   Return $(Status) $(ServiceName)
   Exit

;***************************************************************************
;
;                G e t N e t C a r d S e r v i c e N a m e
;
;   Input:       --
;
;   Output:      $($R0)    Status
;                $($R1)    NetCardServiceName
;
;------------------------------------------------------------------------
[GetNetCardServiceName]
   Debug-Output "GetNetCardServiceName >"
   Set Status = STATUS_SUCCESSFUL

   ; initialize the returnvalue
   Set NetCardServiceName = ""

   ; read the initialized parameters
   Read-Syms GeneralConstants

   ; öffne den Key ..\NetCard\(n)
   OpenRegKey $(!REG_H_LOCAL), "", $(!NTN_RegBase), $(MAXIMUM_ALLOWED), hNetCardService

   IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)
      Debug-Output "GetNetCardServiceName *Error* can't open NetCardService"
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   ; lese den NetCardServiceName
   GetRegValue $(hNetCardService), "ServiceName", NetCardServiceName
   IfStr(i) $(RegLastError) != $(!REG_ERROR_SUCCESS)
      Debug-Output "GetNetCardServiceName *Error* can't read ValueKey ServiceName"
      CloseRegKey $(hNetCardService)
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   Set NetCardServiceName = *($(NetCardServiceName),4)
   Debug-Output "GetNetCardServiceName NetCardServiceName "$(NetCardServiceName)


   ; cleanup
   CloseRegKey $(hNetCardService)

   ; return
   Debug-Output "GetNetCardServiceName *"
   Return $(Status) $(NetCardServiceName)
   Exit

;***************************************************************************
;
;                S e t P n p S u p p o r t
;
;   Input:       $($0)     Language
;                $($1)     Option
;                $($2)     NetCardServiceName
;
;   Output:      $($R0)    Status
;                $($R1)    SerialId
;
;------------------------------------------------------------------------
[SetPnpSupport]
   Debug-Output "SetPnpSupport >"
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)
   Set NetCardServiceName = $($2)

   ; print the callerparameters
   Debug-Output "SetPnpSupport Language            "$(Language)
   Debug-Output "SetPnpSupport Option              "$(Option)
   Debug-Output "SetPnpSupport NetCardServiceName  "$(NetCardServiceName)
   Debug-Output "SetPnpSupport PnpServiceName      "$(PnpServiceName)

   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants

   Debug-Output "SetPnpSupport PnpServiceName      "$(PnpServiceName)

   ; ist der ServiceName ungültig
   IfStr(i) $(PnpServiceName) == ""
      Set RegistryErrorIndex = "UNABLE_CREATE_CONFIGURE_SERVICE"
      Shell "utility.inf" RegistryErrorString $(RegistryErrorIndex)
      Set Error = $($R0)" 'Detect - Service'"
      Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   ; ist der PnpSupport bereits installiert
   OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(PnpServiceName) $(MAXIMUM_ALLOWED) hPnpService
   IfStr(i) $(hPnpService) == $(KeyNull)
      ; der PnpSupport ist noch nicht installiert

      ; setze die PnpServiceGroup vor die CapiServiceGroup
      Shell "" ServiceGroupOrderList, "set", {$(PnpServiceGroup), $(ServiceGroup)}
      Set Status = $($R0)

      IfStr(i) $(Status) == STATUS_FAILED
         Debug-Output "MakeServiceGroupOrder can't set ServiceGroupOrder for '"$(PnpServiceGroup)"'"
         Return $(Status)
         Exit
      EndIf

      Shell "" AddCleanUpList {"","ServiceGroupOrderList","remove",{$(PnpServiceGroup),""}}

      ; installiere den PnpService 
      Shell "utility.Inf", CreateService, +
                           $(PnpServiceName),     $(PnpServiceDisplayName), +
                           $(PnpDriverImagePath), "kernelautostart", +
                           $(PnpServiceGroup),    {""}, ""

      Set RegistryErrorIndex = $($R0)
      Debug-Output "SetPnpSupport RegistryErrorIndex "$(RegistryErrorIndex)
      Debug-Output "SetPnpSupport ShellCode          "$($ShellCode)

      IfStr(i) $(RegistryErrorIndex) != NO_ERROR
         IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
         Else-IfStr(i) $(RegistryErrorIndex) == SERVICE_ALREADY_EXISTS
         Else-IfStr(i) $(RegistryErrorIndex) == SERVICE_MARKED_FOR_DELETE
         Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_CREATE_CONFIGURE_SERVICE
         Else-IfStr(i) $(RegistryErrorIndex) == UNABLE_CREATE_SERVICE_SUBKEY
         EndIf
         Debug-Output "SetPnpSupport *Error * can't create the Service for PnpSupport "$(RegistryErrorIndex)
         Set Status = STATUS_FAILED
         Return $(Status)
         Exit
      EndIf

      Set hPnpService        = $($R1)
      CloseRegKey $($R2)
      CloseRegKey $($R3)

      ;##############################################
      ; to close:
      ;   hPnpService
      ;##############################################

      Shell "" AddCleanUpList {"utility.inf","RemoveService",$(PnpServiceName),"YES"}

      ; initialisiere die ValueKey's DetectKey, DeviceName
	  Set InitAdapter = {};
      Set NewValueList = {{DetectKey,  0, $(!REG_VT_MULTI_SZ), $(InitAdapter)}, +
                          {DeviceName, 0, $(!REG_VT_SZ),        $(DeviceName)}}
      Shell  "utility.inf", AddValueList, $(hPnpService), $(NewValueList)
      Set RegistryErrorIndex = $($R0)

      Debug-Output "PnpSupport RegistryErrorIndex "$(RegistryErrorIndex)
      Debug-Output "PnpSupport ShellCode          "$($ShellCode)

      IfStr(i) $(RegistryErrorIndex) != NO_ERROR
         IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
            Debug-Output "PnpSupport *Error* can't set the dafault ValueKey's for PnpService"
         EndIf
         Set Status = STATUS_FAILED
         Return $(Status)
         Exit
      EndIf

   Else
      ; ggf. ein paar handles erzeugen

   EndIf

   CloseRegKey $(hPnpService)
   ;##############################################
   ; to close:
   ;   nothing
   ;##############################################

   ; --> der PnpSupport ist installiert
   ; ----------------------------------
   Shell "" UpdateAdapterList, $(Language), $(Option), "append", $(ServiceName)
   Set RegistryErrorIndex = $($R0)
   Debug-Output "PnpSupport RegistryErrorIndex  "$(RegistryErrorIndex)
   Debug-Output "PnpSupport ShellCode           "$($ShellCode)
         
   IfStr(i) $(RegistryErrorIndex) != STATUS_SUCCESSFUL
      Set Status = STATUS_FAILED
      Debug-Output "PnpSupport *Error* UpdateAdapterList"
      Return $(Status)
      Exit
   EndIf

   Shell "" AddCleanUpList {"","UpdateAdapterList",$(Language),$(Option),"remove",$(ServiceName)}   


   ; ermittle den SerialId der zu installierenden PnpKarte
   Shell  "", GetSerialId, $(Option), $(PnpServiceName), $(DeviceName), $(PnpVendorId)
   Set RegistryErrorIndex = $($R0)

   Debug-Output "PnpSupport RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "PnpSupport ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != STATUS_SUCCESSFUL
      Debug-Output "PnpSupport *Error* can't get the SerialId of selected PnpCard"
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   Set SerialId = $($R1)
   Debug-Output "PnpSupport SerialId "$(SerialId)

   ; aktualisiere ..\Services\$(NetCardServiceName)\Parameters ValueKey PnpId
   OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(NetCardServiceName)"\Parameters", +
                                 $(MAXIMUM_ALLOWED), hCardParameters
   IfStr(i) $(hCardParameters) == $(KeyNull)
      Debug-Output "PnpSupport *Error* can't open the CardServiceParameters Key"
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   ;##############################################
   ; to close:
   ;   hCardParameters
   ;##############################################

   Set NewValueList = {{PnpId,      0, $(!REG_VT_MULTI_SZ), $(SerialId)}, +
 					   {PnpMapping, 0, $(!REG_VT_MULTI_SZ), $(PnpMapping)}, +
					   {PnpParams,  0, $(!REG_VT_MULTI_SZ), $(PnpParams)}}

   Shell  "utility.inf", AddValueList, $(hCardParameters), $(NewValueList)
   Set RegistryErrorIndex = $($R0)
   CloseRegKey $(hCardParameters)

   ;##############################################
   ; to close:
   ;   nothing
   ;##############################################

   Debug-Output "PnpSupport RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "PnpSupport ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
         Debug-Output "PnpSupport *Error* can't ValueKey 'PnpId' for CardService"
      Else 
      EndIf
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   Debug-Output "SetPnpSupport *"
   Set Status = STATUS_SUCCESSFUL
   Return $(Status) $(SerialId)
   Exit


;***************************************************************************
;
;                GetSerialId
;
;   Input:       $($0)     Option
;                $($1)     ServiceName
;                $($2)     DeviceName
;                $($3)     PnpVendorIdList
;
;   Output:      $($R0)    Status
;                $($R1)    SerialId     // {'VendorId','SerialId'}
;
;------------------------------------------------------------------------
[GetSerialId]
   Debug-Output "GetSerialId >"

   ; inititialize the returnparameters
   Set Status = STATUS_SUCCESSFUL
   Set SerialId = ""

   ; save the callerparameters
   Set Option = $($0)
   Set ServiceName = $($1)
   Set DeviceName = $($2)
   Set PnpVendorIdList = $($3)

   ; print the callerparameters
   Debug-Output "GetSerialId Option          "$(Option)
   Debug-Output "GetSerialId ServiceName     "$(ServiceName)
   Debug-Output "GetSerialId DeviceName      "$(DeviceName)
   Debug-Output "GetSerialId PnpVendorIdList "$(PnpVendorIdList)

   ; lade die configdll
   LoadLibrary "" "capicfg.dll" hLibrary
   Debug-Output "ConfigureAdapter hLibrary "$(hLibrary)

   ; lese den status des PnpService
   LibraryProcedure ServiceStatus $(hLibrary) CFG_Service "status" $(ServiceName)
   Debug-Output "ConfigureAdapter ReadStatus "$(ServiceStatus)

   IfStr(i) $(ServiceStatus) != STATUS_SERVICE_STARTED
      ; starte den PnpService
      LibraryProcedure Result $(hLibrary) CFG_Service "start" $(ServiceName)
      Debug-Output "ConfigureAdapter Result "$(Result)

      IfStr(i) $(Result) != STATUS_SERVICE_STARTED
         Debug-Output "GetSerialId der PnpService konnte nicht gestartet werden"
         FreeLibrary $(hLibrary)
         Set SerialId = ""
         Set Status = STATUS_FAILED
         Return $(Status) $(SerialId)
         Exit
      EndIf
   EndIf

   ; lese alle SerialId's der sich im System befindenden Karten
   Shell "" ScannCsn, $(hLibrary), $(ServiceName), $(PnpVendorIdList)
   Set AdapterList = $($R1)

Debug-Output "GetSerialId AdapterList "$(AdapterList)

   IfStr(i) $(ServiceStatus) != STATUS_SERVICE_STARTED
      ; stoppe den PnpService
      LibraryProcedure Result $(hLibrary) CFG_Service "stop" $(ServiceName)
      Debug-Output "ConfigureAdapter Result "$(Result)
      FreeLibrary $(hLibrary)
   EndIf

   ; lese alle SerialId's der bereits benutzten Karten
   Shell "" GetUsedCards, $(Language), $(Option)
   Set UsedAdapterList = $($R1)

   ; bestimme die unbenutzten Karten
Debug-Output "GetSerialId UsedAdapterList "$(UsedAdapterList)
Debug-Output "GetSerialId AdapterList     "$(AdapterList)
   
   ForListDo $(UsedAdapterList)
      Set Temp = $($)
      Set SerialId = {}
      ForListDo $(AdapterList)
         Set Vendor = *($($),1)
         Set Serial = *($($),2)
         IfStr(i) $(Temp) == $($)
         Else
            Set SerialId = >($(SerialId),$($))
		 EndIf
      EndForListDo
      Set AdapterList = $(SerialId)
   EndForListDo

   ; wähle die erste davon aus
   Set SerialId = *($(AdapterList),1)

Debug-Output "GetSerialId SerialId "$(SerialId)

   Debug-Output "GetSerialId *"
   Set Status = STATUS_SUCCESSFUL
   Return $(Status) $(SerialId)
   Exit


;***************************************************************************
;
;                S c a n n C s n 
;
;   Input:       $($0)     hLibrary          // Handle der KonfigurationsLibrary
;                $($1)     ServiceName       // Name des KonfigurationsDienstes
;                $($2)     PnpVendorIdList   //{'SAG0001'}
;                                            //{'SAG0001','SAG0003'}
;
;   Output:      $($R0)    Status
;                $($R1)    SerialId          // {'VendorId','SerialId'}
;
;------------------------------------------------------------------------
[ScannCsn]
   Debug-Output "ScannCsn >"
   Set Status = STATUS_SUCCESSFUL
   Set hLibrary = $($0)
   Set ServiceName = $($1)
   Set PnpVendorIdList = $($2)

   Debug-Output "ScannCsn hLibrary "$(hLibrary)
   Debug-Output "ScannCsn ServiceName "$(ServiceName)
   Debug-Output "ScannCsn PnpVendorIdList "$(PnpVendorIdList)

   ; lese bis zu acht PnpKarten
   Set CsnList = {1,2,3,4,5,6,7,8}
   Set PnpIdList = {}

   ForListDo $(CsnList)
      Set Csn = $($)
      LibraryProcedure Result $(hLibrary) CFG_GetSerialIdentifier $(ServiceName) $(Csn)
      Debug-Output "GetSerialId Result "$(Result)
      IfStr(i) $(Result) != {}
	     Set AdapterVendorId = *($(Result),1)
         ForListDo $(PnpVendorIdList)
            IfStr(i) $($) == $(AdapterVendorId)
               Set PnpIdList = >($(PnpIdList),$(Result))
            EndIf
         EndForListDo
      Else
         Debug-Output "ScannCsn * PnpIdList "$(PnpIdList)
         Return $(Status) $(PnpIdList)
         Exit
      EndIf
   EndForListDo

   Debug-Output "ScannCsn * PnpIdList "$(PnpIdList)
   Return $(Status) $(PnpIdList)
   Exit


;***************************************************************************
;
;                G e t U s e d C a r d s  
;
;   Input:       $($0)     Language
;                $($1)     Option
;                                            //{'SAG0001','SAG0003'}
;
;   Output:      $($R0)    Status
;                $($R1)    AdapterList          // {'VendorId','SerialId'}
;
;------------------------------------------------------------------------
[GetUsedCards]
   Debug-Output "GetUsedCards >"

   ; init returnparameters
   Set Status = STATUS_SUCCESSFUL
   Set AdapterList = {}

   ; save callerparameters
   Set Language = $($0)
   Set Option = $($1)

   ; print callerparameters
   Debug-Output "GetUsedCards Language "$(Language)
   Debug-Output "GetUsedCards Option   "$(Option)

   ; initialize 
   Read-Syms GeneralConstants
   Read-Syms ProductConstants

   ; read the NetCardServiceNames
   OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(ServiceName)"\Parameters", +
                                 $(MAXIMUM_ALLOWED) hParameters
   Debug-Output "GetUsedCards RegLastError "$(RegLastError)

   ; read the ControllerList
   GetRegValue $(hParameters) "Controllers" ControllerList
   Debug-Output "GetUsedCards RegLastError "$(RegLastError)
   Set ControllerList = *($(ControllerList),4) 

   CloseRegKey $(hParameters)

   ForListDo $(ControllerList)
      ; read the NetCardServiceNames
      OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$($)"\Parameters", +
                                    $(MAXIMUM_ALLOWED) hParameters
      Debug-Output "GetUsedCards RegLastError "$(RegLastError)

      ; read the PnpIdentification
	  Set PnpId = {}
      GetRegValue $(hParameters) "PnpId" PnpId
      Debug-Output "GetUsedCards RegLastError "$(RegLastError)
      IfStr(i) $(RegLastError) == 0
         Set PnpId = *($(PnpId),4) 
         Set AdapterList = >($(AdapterList),$(PnpId))
      Endif
      ; close the registrykey
	  CloseRegKey $(hParameters)

   EndForListDo


   Debug-Output "GetUsedCards * AdapterList "$(AdapterList)
   Return $(Status) $(AdapterList)
   Exit


;***************************************************************************
;
;                ConfigDialogType
;
;   Input:       $($0)     Option
;                $($1)     ServiceName
;                $($2)     DlgType
;                $($3)     CfgServiceName
;
;   Output:      $($R0)    Status
;
;------------------------------------------------------------------------
[ConfigDialogType]
   Debug-Output "ConfigDialogType >"

   ; inititialize the returnparameters
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameters
   Set Option = $($0)
   Set ServiceName = $($1)
   Set NewType = $($2)
   Set CfgServiceName = $($3)
   
   ; Print the callerparameters
   Debug-Output "ConfigDialogType Option         "$(Option)
   Debug-Output "ConfigDialogType ServiceName    "$(ServiceName)
   Debug-Output "ConfigDialogType DialogType     "$(NewType)
   Debug-Output "ConfigDialogType CfgServiceName "$(CfgServiceName)
   
   ; read the initialized parameters
   Read-Syms GeneralConstants

   ; open the ServiceName\Paramters
   OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(ServiceName)"\Parameters", +
                                 $(MAXIMUM_ALLOWED) hServiceParameters

   ;##############################################
   ; to close:
   ;   hServiceParameters
   ;##############################################

   ; Read the old DialogType 
   GetRegValue $(hServiceParameters), "DialogType", DialogType
   Set DialogType = *($(DialogType),4)
   Debug-Output "ConfigDialogType DialogType "$(DialogType)

   Set OldType = *($(DialogType),1)
   Set OldService = *($(DialogType),2)
   IfStr(i) $(OldType) == ""
      Debug-Output "ConfigDialogType DialogType ist leer"
      Set DialogType = {$(NewType), $(CfgServiceName)}
   
   Else-IfStr(i) $(OldType) == "Card"
      Debug-Output "ConfigDialogType DialogType ist Card"
      IfStr(i) $(NewType) == "Card"
         Set DialogType = {$(NewType), $(CfgServiceName)}
      Else-IfStr(i) $(NewType) == "Ndis"
         Set DialogType = {"All", $(OldService),$(CfgServiceName)}
	  EndIf

   Else-IfStr(i) $(OldType) == "Ndis"
      Debug-Output "ConfigDialogType DialogType ist Ndis"
      IfStr(i) $(NewType) == "Ndis"
         Set DialogType = {$(NewType), $(CfgServiceName)}
      Else-IfStr(i) $(NewType) == "Card"
         Set DialogType = {"All", $(CfgServiceName), $(OldService)}
	  EndIf

   Else-IfStr(i) $(OldType) == "All"
      Debug-Output "ConfigDialogType DialogType ist All"
      Debug-Output "ConfigDialogType kann nicht vorkommen"
   Else
      Debug-Output "ConfigDialogType DialogType ist unbekannt"
   EndIf

   Debug-Output "ConfigDialogType DialogType "$(DialogType)

   Set NewValueList = {{DialogType,      0, $(!REG_VT_MULTI_SZ), $(DialogType)}}

   Shell "utility.inf", AddValueList, $(hServiceParameters), $(NewValueList)
   Set RegistryErrorIndex = $($R0)
;   Set RegistryErrorIndex = NO_ERROR

   Debug-Output "ConfigDialogType RegistryErrorIndex "$(RegistryErrorIndex)
   Debug-Output "ConfigDialogType ShellCode          "$($ShellCode)

   IfStr(i) $(RegistryErrorIndex) != NO_ERROR
      IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
      ; 
      EndIf
      Set Status = STATUS_FAILED
      Return $(Status)
      Exit
   EndIf

   CloseRegKey $(hServiceParameters)
   ;##############################################



   Debug-Output "ConfigDialogType *"
   Return $(Status)
   Exit

;***************************************************************************
;
;                C o n f i g u r e A d a p t e r
;
;   Input:       $($0)     Language
;                $($1)     Option
;                $($2)     ServiceName
;
;   Output:      $($R0)    Status
;
;------------------------------------------------------------------------
[ConfigureAdapterParameter]
   Debug-Output "ConfigureAdapterParameter >"

   ; inititialize the returnparameters
   Set Status = STATUS_SUCCESSFUL

   ; save the callerparameters
   Set Language = $($0)
   Set Option = $($1)
   Set ConfigServiceName = $($2)
   
   
   ; read the initialized parameters
   Read-Syms GeneralConstants
   Read-Syms ProductConstants


   ; print the callerparameters
   Debug-Output "ConfigureAdapterParameter Language          "$(Language)
   Debug-Output "ConfigureAdapterParameter Option            "$(Option)
   Debug-Output "ConfigureAdapterParameter ConfigServiceName "$(ConfigServiceName)
   Debug-Output "ConfigureAdapterParameter >"

   Debug-Output "ConfigureAdapterParameter BusType "$(BusType)

   IfStr(i) $(BusType) == 5
      Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", +
                         #(SetupMessage$(Language), PCIConfig,1)
      Set Status = STATUS_SUCCESSFUL
      Return $(Status)
      Exit
   Else
      ; open the ServiceName\Paramters
      OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(ConfigServiceName)"\Parameters", +
                                    $(MAXIMUM_ALLOWED) hConfigParameters

      Debug-Output "ConfigureAdapterParameter hConfigParameters "$(hConfigParameters)
 
      ;##############################################
      ; to close:
      ;   hConfigParameters
      ;##############################################

      ; Read DialogType
      GetRegValue $(hConfigParameters), "DialogType", DialogType
      Debug-Output "ConfigureAdapterParameter DialogType "$(DialogType)
      Set DialogType = *($(DialogType),4)
      Debug-Output "ConfigureAdapterParameter DialogType "$(DialogType)

      CloseRegKey $(hConfigParameters)
      ;##############################################

      Set DlgType = *($(DialogType),1)
      IfStr(i) $(DlgType) == All
         Set NetCardServiceName = *($(DialogType),2)
         Set NdisServiceName = *($(DialogType),3)

         ; open the NetCardService\Parameters
         OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(NetCardServiceName)"\Parameters", +
                                       $(MAXIMUM_ALLOWED) hNetCardParameters

         ; open the NdisService\Parameters
         OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(NdisServiceName)"\Parameters", +
                                       $(MAXIMUM_ALLOWED) hNdisParameters

         ;##############################################
         ; to close:
         ;   hNetCardParameters
         ;   hNdisParameters
         ;##############################################

         ; Read CardParameters
         ; -------------------
         ; Read PortAddress
         GetRegValue $(hNetCardParameters), "IoBaseAddress", Port
         Set Port = *($(Port),4)
         Debug-Output "ConfigureAdapterParameter Port "$(Port)

         ; Konvertiere die adresse in einen String 
         Set IsBox = *(^(HardWare,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
         IfStr(i) $(IsBox) == "ParallelPort"
            Set-Add Port = $(Port), 1
	        Set Port = "LPT"$(Port)
         Else
            Set-DecToHex Port = $(Port)
         EndIf
   
         ;Read Irq
         GetRegValue $(hNetCardParameters), "InterruptNumber", Irq
         Set Irq = *($(Irq),4)
         Set Irq = *(^(InterruptStrings,1),$(Irq))

         ; lese die CardOptionen für Port und Irq
         Set PortChoose = *(^(HardWare, $(HwPc)),~(^(HardWare, $(HwO)), $(Option)))
         Set IrqChoose  = *(^(HardWare, $(HwIc)),~(^(HardWare, $(HwO)), $(Option)))

         ; Read NdisParameters
   	     ; -------------------
         ; Read Msn1
         GetRegValue $(hNdisParameters), "MSNL0", Msn1
         Set Msn1 = *($(Msn1),4)
         Debug-Output "ConfigureAdapterParameter Msn1 "$(Msn1)

         ;Read Msn1
         GetRegValue $(hNdisParameters), "MSNL1", Msn2
         Set Msn2 = *($(Msn2),4)

         ; --> setze die kommandozeile zusammen
         Set Msn1 = {"MSN1", $(Msn1)}
         Set Msn2 = {"MSN2", $(Msn2)}
         Set Port      = {"Port",     $(Port), $(PortChoose)}
         Set Interrupt = {"Interrupt",$(Irq),  $(IrqChoose)}
         Set Parameter = {$(Msn1),$(Msn2),$(Port),$(Interrupt)}
         Debug-Output "ConfigureAdapterParameter Parameter "$(Parameter)

         ; lade die library
         LoadLibrary "" "capicfg.dll" hLibrary
         Debug-Output "ConfigureAdapterParameter hLibrary "$(hLibrary)

         ; lese die Dialog und TabulatorTitel
         Read-Syms DialogConstants
         LibraryProcedure ConfigureResult $(hLibrary) CFG_SetCaption, $(DlgCaption), +
                                                      $(Tab1Title), $(Tab2Title)

         ; Starte den ConfigDialog
         LibraryProcedure ConfigureResult $(hLibrary) CFG_All $(Parameter)
         Debug-Output "ConfigureAdapterParameter ConfigureResult "$(ConfigureResult)

         ; entlade die Library
         FreeLibrary $(hLibrary)

         ; lese die RückgabeParameter
         ForListDo $(ConfigureResult)
            Set ConfigName = *($($),1)
            Set ConfigValue = *($($),2)
            IfStr(i) $(ConfigName) == "STATUS_USERCANCEL"  ;-- Dialog abgebrochen
               CloseRegKey $(hNetCardParameters)
               CloseRegKey $(hNdisParameters)
               Set Status = STATUS_USERCANCEL
			   Return $(Status)
			   Exit
            Else-IfStr(i) $(ConfigName) == "Port"          ;-- Port
               Set Port = $(ConfigValue)
            Else-IfStr(i) $(ConfigName) == "Interrupt"     ;-- Irq
               Set Interrupt = $(ConfigValue)
            Else-IfStr(i) $(ConfigName) == "MSN1"          ;-- MSN1
               Set Msn1 = $(ConfigValue)
            Else-IfStr(i) $(ConfigName) == "MSN2"          ;-- MSN2
               Set Msn2 = $(ConfigValue)
            EndIf
         EndForListDo

         ; korrektur Irq
         Set Interrupt = *(^(InterruptStrings, 2),~(^(InterruptStrings, 1), $(Interrupt)))

         ; korrektur Port
         Set IsBox = *(^(HardWare,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
         IfStr(i) $(IsBox) == "ParallelPort"
            Set Port = *(^(LptStrings, 2),~(^(LptStrings, 1), $(Port)))
         Else
            Set-HexToDec Port = $(Port)
         Endif

         ; schreibe die Parameter in die Registrierung
         Set NewValueList = {{InterruptNumber, 0, $(!REG_VT_DWORD), $(Interrupt)}, +
                             {IoBaseAddress,   0, $(!REG_VT_DWORD), $(Port)}}
         Shell "utility.inf", AddValueList, $(hNetCardParameters), $(NewValueList)
         Set RegistryErrorIndex = $($R0)
         Debug-Output "ConfigureAdapterParameter RegistryErrorIndex "$(RegistryErrorIndex)
         Debug-Output "ConfigureAdapterParameter ShellCode          "$($ShellCode)

         IfStr(i) $(RegistryErrorIndex) != NO_ERROR
            IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
               Debug-Output "ConfigureAdapterParameter *Error* can't writeback Card ConfigValues"
            EndIf
            Set Status = STATUS_FAILED
            Return $(Status)
            Exit
         EndIf

         CloseRegKey $(hNetCardParameters)
         ;##############################################
         ; to close:
         ;   hNdisParameters
         ;##############################################

         ; schreibe die Parameter in die Registrierung
         Set NewValueList = {{MSNL0, 0, $(!REG_VT_SZ), $(Msn1)}, +
                             {MSNL1, 0, $(!REG_VT_SZ), $(Msn2)}}
         Shell "utility.inf", AddValueList, $(hNdisParameters), $(NewValueList)
         Set RegistryErrorIndex = $($R0)
         Debug-Output "ConfigureAdapterParameter RegistryErrorIndex "$(RegistryErrorIndex)
         Debug-Output "ConfigureAdapterParameter ShellCode          "$($ShellCode)

         IfStr(i) $(RegistryErrorIndex) != NO_ERROR
            IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
               Debug-Output "ConfigureAdapterParameter *Error* can't writeback Ndis ConfigValues"
            EndIf
            Set Status = STATUS_FAILED
            Return $(Status)
            Exit
         EndIf

         CloseRegKey $(hNdisParameters)
         ;##############################################

      Else-IfStr(i) $(DlgType) == Card
         Set NetCardServiceName = *($(DialogType),2)
   
         ; print the callerparameters
         Debug-Output "ConfigureAdapterParameter DlgType       "$(DlgType)
         Debug-Output "ConfigureAdapterParameter Option        "$(Option)
         Debug-Output "ConfigureAdapterParameter NetCardServiceName   "$(NetCardServiceName)

         ; open the NetCardService\Parameters
         OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(NetCardServiceName)"\Parameters", +
                                       $(MAXIMUM_ALLOWED) hNetCardParameters

         ;##############################################
         ; to close:
         ;   hNetCardParameters
         ;##############################################

         ; Read PortAddress
         GetRegValue $(hNetCardParameters), "IoBaseAddress", Port
         Set Port = *($(Port),4)
         Debug-Output "ConfigureAdapterParameter Port "$(Port)

         ; Konvertiere die adresse in einen String 
         Set IsBox = *(^(HardWare,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
         IfStr(i) $(IsBox) == "ParallelPort"
            Set-Add Port = $(Port), 1
     	    Set Port = "LPT"$(Port)
         Else
            Set-DecToHex Port = $(Port)
         EndIf
   
         ;Read Irq
         GetRegValue $(hNetCardParameters), "InterruptNumber", Irq
         Set Irq = *($(Irq),4)
         Set Irq = *(^(InterruptStrings,1),$(Irq))

         ; lese die CardOptionen für Port und Irq
         Set PortChoose = *(^(HardWare, $(HwPc)),~(^(HardWare, $(HwO)), $(Option)))
         Set IrqChoose  = *(^(HardWare, $(HwIc)),~(^(HardWare, $(HwO)), $(Option)))

         ; --> setze die kommandozeile zusammen
         Set Port      = {"Port",     $(Port), $(PortChoose)}
         Set Interrupt = {"Interrupt",$(Irq),  $(IrqChoose)}
         Set Parameter = {$(Port),$(Interrupt)}
         Debug-Output "ConfigureAdapterParameter Parameter "$(Parameter)

         ; lade die library
         LoadLibrary "" "capicfg.dll" hLibrary
         Debug-Output "ConfigureAdapterParameter hLibrary "$(hLibrary)

         ; lese die Dialog und TabulatorTitel
         Read-Syms DialogConstants
         LibraryProcedure ConfigureResult $(hLibrary) CFG_SetCaption, $(DlgCaption), +
                                                      $(Tab1Title), $(Tab2Title)

         ; Starte den ConfigDialog
         Debug-Output "ConfigureAdapterParameter CFG_Card entry"
         LibraryProcedure ConfigureResult $(hLibrary) CFG_Card $(Parameter)
         Debug-Output "ConfigureAdapterParameter CFG_Card returned"
;         Debug-Output "ConfigureAdapterParameter ConfigureResult "$(ConfigureResult)

         ; entlade die Library
         FreeLibrary $(hLibrary)
   
         ; lese die RückgabeParameter
         ForListDo $(ConfigureResult)
            Set ConfigName = *($($),1)
            Set ConfigValue = *($($),2)
            IfStr(i) $(ConfigName) == "STATUS_USERCANCEL"  ;-- Dialog abgebrochen
               CloseRegKey $(hNetCardParameters)
               Set Status = STATUS_USERCANCEL
			   Return $(Status)
			   Exit
            Else-IfStr(i) $(ConfigName) == "Port"               ;-- Port
               Set Port = $(ConfigValue)
            Else-IfStr(i) $(ConfigName) == "Interrupt"     ;-- Irq
               Set Interrupt = $(ConfigValue)
            EndIf
         EndForListDo

         ; korrektur Irq
         Set Interrupt = *(^(InterruptStrings, 2),~(^(InterruptStrings, 1), $(Interrupt)))

         ; korrektur Port
         Set IsBox = *(^(HardWare,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
         IfStr(i) $(IsBox) == "ParallelPort"
            Set Port = *(^(LptStrings, 2),~(^(LptStrings, 1), $(Port)))
         Else
            Set-HexToDec Port = $(Port)
         Endif

         ; schreibe die Parameter in die Registrierung
         Set NewValueList = {{InterruptNumber, 0, $(!REG_VT_DWORD), $(Interrupt)}, +
                             {IoBaseAddress,   0, $(!REG_VT_DWORD), $(Port)}}
         Shell "utility.inf", AddValueList, $(hNetCardParameters), $(NewValueList)
         Set RegistryErrorIndex = $($R0)
         Debug-Output "ConfigureAdapterParameter RegistryErrorIndex "$(RegistryErrorIndex)
         Debug-Output "ConfigureAdapterParameter ShellCode          "$($ShellCode)

         IfStr(i) $(RegistryErrorIndex) != NO_ERROR
            IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
               Debug-Output "ConfigureAdapterParameter *Error* can't writeback Card ConfigValues"
            EndIf
            Set Status = STATUS_FAILED
            Return $(Status)
            Exit
         EndIf

         CloseRegKey $(hNetCardParameters)
         ;##############################################

      Else-IfStr(i) $(DlgType) == Ndis
         Set NdisServiceName = *($(DialogType),2)
         ; print the callerparameters
         Debug-Output "ConfigureAdapterParameter DlgType       "$(DlgType)
         Debug-Output "ConfigureAdapterParameter Option        "$(Option)
         Debug-Output "ConfigureAdapterParameter NetCardServiceName   "$(NetCardServiceName)
   
         ; open the NdisService\Paramters
         OpenRegKey $(!REG_H_LOCAL) "" $(ServicesPath)"\"$(NdisServiceName)"\Parameters", +
                                       $(MAXIMUM_ALLOWED) hNdisParameters

         ;##############################################
         ; to close:
         ;   hNdisParameters
         ;##############################################

         ; Read Msn1
         GetRegValue $(hNdisParameters), "MSNL0", Msn1
         Set Msn1 = *($(Msn1),4)
         Debug-Output "ConfigureAdapterParameter Msn1 "$(Msn1)

   
         ;Read Msn1
         GetRegValue $(hNdisParameters), "MSNL1", Msn2
         Set Msn2 = *($(Msn2),4)

         ; --> setze die kommandozeile zusammen
         Set Msn1 = {"MSN1", $(Msn1)}
         Set Msn2 = {"MSN2", $(Msn2)}
         Set Parameter = {$(Msn1),$(Msn2)}
         Debug-Output "ConfigureAdapterParameter Parameter "$(Parameter)

         ; lade die library
         LoadLibrary "" "capicfg.dll" hLibrary
         Debug-Output "ConfigureAdapterParameter hLibrary "$(hLibrary)

         ; lese die Dialog und TabulatorTitel
         Read-Syms DialogConstants
         LibraryProcedure ConfigureResult $(hLibrary) CFG_SetCaption, $(DlgCaption), +
                                                      $(Tab1Title), $(Tab2Title)

         ; Starte den ConfigDialog
         LibraryProcedure ConfigureResult $(hLibrary) CFG_Ndis $(Parameter)
         Debug-Output "ConfigureAdapterParameter ConfigureResult "$(ConfigureResult)

         ; entlade die Library
         FreeLibrary $(hLibrary)

         ; lese die RückgabeParameter
         ForListDo $(ConfigureResult)
            Set ConfigName = *($($),1)
            Set ConfigValue = *($($),2)
            IfStr(i) $(ConfigName) == "STATUS_USERCANCEL"  ;-- Dialog abgebrochen
               CloseRegKey $(hNdisParameters)
               Set Status = STATUS_USERCANCEL
			   Return $(Status)
			   Exit
            IfStr(i) $(ConfigName) == "MSN1"               ;-- MSN1
               Set Msn1 = $(ConfigValue)
            Else-IfStr(i) $(ConfigName) == "MSN2"          ;-- MSN2
               Set Msn2 = $(ConfigValue)
            EndIf
         EndForListDo

         ; schreibe die Parameter in die Registrierung
         Set NewValueList = {{MSNL0, 0, $(!REG_VT_SZ), $(Msn1)}, +
                             {MSNL1, 0, $(!REG_VT_SZ), $(Msn2)}}
         Shell "utility.inf", AddValueList, $(hNdisParameters), $(NewValueList)
         Set RegistryErrorIndex = $($R0)
         Debug-Output "ConfigureAdapterParameter RegistryErrorIndex "$(RegistryErrorIndex)
         Debug-Output "ConfigureAdapterParameter ShellCode          "$($ShellCode)

         IfStr(i) $(RegistryErrorIndex) != NO_ERROR
            IfStr(i) $(RegistryErrorIndex) == UNABLE_WRITE_REGISTRY
               Debug-Output "ConfigureAdapterParameter *Error* can't writeback Ndis ConfigValues"
            EndIf
            Set Status = STATUS_FAILED
            Return $(Status)
            Exit
         EndIf

         CloseRegKey $(hNdisParameters)
         ;##############################################


      EndIf
   EndIf
   


   Debug-Output "ConfigureAdapterParameter *"
   Set Status = STATUS_SUCCESSFUL
   Return $(Status)
   Exit


;***************************************************************************
;
;                G e t V a l i d C a p i C o n t r o l l e r
;
;   Input:       keine
;
;   Output:      $($R0)    Status
;                $($R1)    CapiDevice
;------------------------------------------------------------------------
[GetValidCapiController]
Set !DebugOutputControl = 1
Debug-Output "GetValidCapiDevice >"

   Read-Syms GeneralConstants

   Set CapiDevice = 0
   ; lese alle Capi20 SubKey's
   ; -------------------------
   OpenRegKey $(!REG_H_LOCAL) "" $(Capi20Path) $(MAXIMUM_ALLOWED) hKey
   IfStr(i) $(hKey) != $(KeyNull)
      ; Capi20Key ist vorhanden
      ; -----------------------
      EnumRegKey $(hKey) KeyList
      CloseRegKey $(hKey)
Debug-Output "GetValidCapiController KeyList "$(KeyList)

      ; erzeuge die DeviceIdList
      ; ------------------------
      Set DeviceIdList = {}
;      Set Max = 0
      ForListDo $(KeyList)
	           Set DeviceId = *($($), 1)
;               Set-Add = $(Max), 1
         IfInt $(DeviceId) == 0
            ; generic CapiDevice
            ; ------------------
            ; unknown to do
         Else-IfInt $(DeviceId) >= 1
            Set DeviceIdList = >($(DeviceIdList), $(DeviceId))
         EndIf
      EndForListDo

      ; prüfe die Konsistenz der Eintragungen
      ; -------------------------------------
      ; später
 
      ; sortiere die ControllerList
      ; -------------------------
      

      Shell "Utility.Inf", SortList, $(DeviceIdList), TRUE, FALSE
      Set DeviceIdList = $($R0)

      ; finde die erste freie Nummer
      ; ----------------------------
      ForListDo $(DeviceIdList)
         Set DeviceId = *($($), 1)
         Set-Add CapiDevice = $(CapiDevice), 1
         IfInt $(CapiDevice) < $(DeviceId)
            ; eine Lücke gefunden
            ; -------------------
			Debug-Output "GetValidCapiDevice *"
            Set Status = STATUS_SUCCESSFUL
            Return $(Status) $(CapiDevice)
			Exit
         endif
      EndForListDo
   EndIf

   ; keine Lücke gefunden oder Capi20-Key nicht vorhanden
   ; ----------------------------------------------------
   Debug-Output "GetValidCapiDevice *"
   Set-Add CapiDevice = $(CapiDevice), 1
   Set Status = STATUS_SUCCESSFUL

   Return $(Status) $(CapiDevice)
   Exit

;***************************************************************************
;                S e t C a p i D e v i c e
;
;   Input:       $($0)     Modus           ( "add" | "remove" )
;                $($1)     CapiDevice        'x'     'x'
;                $($2)     Option            'x'     '-'
;                $($3)     Manufacturer      'x'     '-'
;
;   Output:      $($R0)    Status
;------------------------------------------------------------------------
[SetCapiDevice]
Set !DebugOutputControl = 1
Debug-Output "SetCapiDevice >"

   Set Modus  = $($0)

   ; lese die CapiConstanten
   ; -----------------------
   Read-Syms GeneralConstants

   IfStr(i) $(Modus) == set
      Set CapiDevice = $($1)
      Set Option = $($2)
      Set Manufacturer = $($3)
      Debug-Output "SetCapiDevice set CapiDevice "$(CapiDevice)
      Debug-Output "SetCapiDevice Option "$(Option)
      Debug-Output "SetCapiDevice Manufacturer "$(Manufacturer)

      Set NumberOfControllers = *(^(HardWare, $(HwCo)),~(^(HardWare, $(HwO)), $(Option)))
      Set Channels = *(^(HardWare, $(HwCh)),~(^(HardWare, $(HwO)), $(Option)))

      Debug-Output "SetCapiDevice NumberOfControllers "$(NumberOfControllers)      
      Debug-Output "SetCapiDevice Channels "$(Channels)      

      ; öffne den CAPI20Key in der Registrierung
      ; ----------------------------------------
      Debug-Output "SetCapiDevice set Capi20Path "$(Capi20Path)
      OpenRegKey $(!REG_H_LOCAL) "" $(Capi20Path) $(MAXIMUM_ALLOWED) hCapi   
      Debug-Output "SetCapiDevice set hCapi "$(hCapi)
      IfStr(i) $(hCapi) == $(KeyNull)
         ; der Schlüssel ist noch nicht vorhanden
         ; --------------------------------------
         CreateRegKey $(!REG_H_LOCAL) {$(Capi20Path), 0, GenericClass} "" $(MAXIMUM_ALLOWED) "" hCapi
      EndIf

      ; erzeuge den neuen ControllerKey in der Registrierung
      ; ----------------------------------------------------
      CreateRegKey $(hCapi) {$(CapiDevice), 0, GenericClass} "" $(MAXIMUM_ALLOWED) "" hDevice

      ; trage alle KeyValues ein
      ; ------------------------
      set ValueList = {{"DeviceName",$(NoTitle),$(!REG_VT_SZ),"CAPI20"$(CapiDevice)},+
                       {"NumberOfControllers",$(NoTitle),$(!REG_VT_DWORD),$(NumberOfControllers)},+
                       {"Manufacturer",$(NoTitle),$(!REG_VT_SZ), $(Manufacturer)}}

      Shell "Utility.Inf", AddValueList, $(hDevice), $(ValueList)

      ; trage ControllerSubKey's und zugehörige Channels ein
      ; ----------------------------------------------------    
      Debug-Output "SetCapiDevice set Channels "$(Channels)
      ForListDo $(Channels)
         Set CurrentChannel = $($)
         Debug-Output "SetCapiDevice set CurrentChannel "$(CurrentChannel)
         Set-Add CurrentController = $(CurrentController) , 1

         CreateRegKey $(hDevice) {$(CurrentController), 0, GenericClass} "" $(MAXIMUM_ALLOWED) "" hController
         Set ValueList = {{"Channels",$(NoTitle),$(!REG_VT_DWORD),$(CurrentChannel)}+
                          ; ggf rasconfig +
                         }
         Shell "Utility.Inf", AddValueList, $(hController), $(ValueList)
         CloseRegKey $(hController)
      EndForListDo

      CloseRegKey $(hDevice)
      Set Status = STATUS_SUCCESSFUL

   Else-IfStr(i) $(Modus) == remove
      Set CapiDevice = $($1)
      Set Available = "no"
      Debug-Output "SetCapiDevice remove CapiDevice "$(CapiDevice)

      ; öffne den CAPI20Key in der Registrierung
      ; ----------------------------------------
      OpenRegKey $(!REG_H_LOCAL) "" $(Capi20Path) $(MAXIMUM_ALLOWED) hCapi   
      IfStr(i) $(hCapi) == $(KeyNull)
         Set Status = STATUS_FAILED
		 Debug-Output "SetCapiDevice 'remove' can't open Key 'CAPI20'"

		 Return $(Status)
		 Exit
      EndIf

      ; lösche das angebene CapiDevice
      ; ------------------------------
      DeleteRegTree $(hCapi) $(CapiDevice)
      
      ; scanne nach weiteren CapiDevices
      ; --------------------------------
      Set Available = "yes"
      EnumRegKey $(hCapi) CapiList
      IfStr(i) $(CapiList) == {}
         Set Available = "no"
      EndIf

      Set Status = STATUS_SUCCESSFUL
   Else
      Debug-Output "SetCapiDevice unknown modus"
      Set Status = STATUS_FAILED
   EndIf
   CloseRegKey $(hCapi)

Debug-Output "SetCapiDevice *"

   Return $(Status) $(Available)
   Exit


;***************************************************************************
;
;                S e r v i c e G r o u p O r d e r L i s t
;
;   Input:       $($0)     modus              (set | get | remove)
;                $($1)     ServiceGroupOrder   'x'   'x'     'x'      // {'Svc_x','Svc_y'}
;
;   Output:      $($R0)    Status
;
;------------------------------------------------------------------------
[ServiceGroupOrderList]
   Debug-Output "ServiceGroupOrderList >"

   Set Status = STATUS_SUCCESSFUL
   Set Modus = $($0)
   Set ServiceGroupOrder = $($1)
   Set CurrentServiceGroupOrder = {}

   Debug-Output "ServiceGroupOrderList ServiceGroupOrder "$(ServiceGroupOrder)

   Read-Syms GeneralConstants

   OpenRegKey $(!REG_H_LOCAL) "" $(ServiceGroupOrderPath), $(MAXIMUM_ALLOWED), hKey

   Ifstr(i) $(hKey) == $(KeyNull)
      ; der ServiceGroupOrderKey kann nicht geöffnet werden
      ; ---------------------------------------------------
      Debug-Output "ServiceGroupOrderList can't open "$(ServiceGroupOrderPath)
      Debug-Output "ServiceGroupOrderList * Error"
      Set Status = STATUS_REGISTRY_ERROR
      Return $(Status)
	  Exit
   EndIf

   ; lese die alte ServiceGroupOrderList
   ; -----------------------------------
   GetRegValue  $(hKey) "List" OldList
   Set OldList = *($(OldList), 4)
   Set NewList = {}

   Ifstr(i) $(Modus) == set
      Debug-Output "ServiceGroupOrderList add"
	  Set GroupName = *($(ServiceGroupOrder),1)
	  Set NextGroupName = *($(ServiceGroupOrder),2)
      ; füge die ServiceGroup vor der NextGroupName in die ServiceGroupOrderList ein
      ; ----------------------------------------------------------------------------
      IfStr(i) $(NextGroupName) == ""
         ; wenn die ServiceGroup vorhanden ist, nicht kopieren
         ; ----------------------------------------------------
         ForListDo $(OldList)
            ; kopiere nur die ungleichen GroupNamen
            Ifstr(i) $($) != $(GroupName)
               Set NewList = >($(NewList),$($))
            Endif
         EndForListDo

         ; neue ServiceGroup ans Ende der Liste stellen
         ; --------------------------------------------
         Set NewList = >($(NewList), $(GroupName))

      Else
         ForListDo $(OldList)
            IfStr(i) $($) == $(NextGroupName)
               ; NextGroup vorhanden: kopieren und ServiceGroup anhängen 
               ; -------------------------------------------------------
               Set NewList = >($(NewList), $(GroupName))
               Set NewList = >($(NewList), $($))
            Else-IfStr(i) $($) == $(GroupName)
               ; ServiceGroup ist bereits vorhanden, dann nicht kopieren
               ; -------------------------------------------------------
               ; nothing to do

            Else
               ; unverändertes ListenElement
               ; ---------------------------
               Set NewList = >($(NewList), $($))
            Endif

         EndForListDo
      EndIf

      ; schreibe die ServiceGroupOrderList zurück
      ; -----------------------------------------
      SetRegValue $(hKey) {List, $(NoTitle), $(!REG_VT_MULTI_SZ), $(NewList)}
      Set Status = STATUS_SUCCESSFUL

   Else-Ifstr(i) $(Modus) == get
      ; die erste gefundene Folge zurückgeben
      ; -------------------------------------
      Debug-Output "ServiceGroupOrderList get"
	  Set GroupName = *($(ServiceGroupOrder),1)
	  Set NextGroupName = *($(ServiceGroupOrder),2)
      Set Found = 0
      Debug-Output "ServiceGroupOrderList GroupName "$(GroupName)
      ForListDo $(OldList)
         Debug-Output "ServiceGroupOrderList $ "$($)
         IfStr(i) $(Found) == 0
            IfStr(i) $($) == $(GroupName)
               Set Found = 1
               Set CurrentServiceGroupOrder = >($(CurrentServiceGroupOrder),$($))
             EndIf
         Else-IfStr(i) $(Found) == 1
            Set Found = 2
            Set CurrentServiceGroupOrder = >($(CurrentServiceGroupOrder),$($))
         EndIf
      EndForListDo

   Else-Ifstr(i) $(Modus) == remove
      ; wenn die ServiceGroup vorhanden ist, nicht kopieren
      ; ----------------------------------------------------
      Debug-Output "ServiceGroupOrderList remove"
	  Set GroupName = *($(ServiceGroupOrder),1)
	  Set NextGroupName = *($(ServiceGroupOrder),2)
      ForListDo $(OldList)
         ; kopiere nur die ungleichen GroupNamen
         Ifstr(i) $($) != $(GroupName)
            Set NewList = >($(NewList),$($))
         Endif
      EndForListDo

      ; schreibe die ServiceGroupOrderList zurück
      ; -----------------------------------------
      SetRegValue $(hKey) {List, $(NoTitle), $(!REG_VT_MULTI_SZ), $(NewList)}
      Set Status = STATUS_SUCCESSFUL
   Else
      Debug-Output "ServiceGroupOrderList Modus nicht unterstützt"
         Set Status = STATUS_FAILED
         Set Reason = CommandNotFound
   EndIf
   CloseRegKey $(hKey)

   Debug-Output "ServiceGroupOrderList *"
   Return $(Status) $(CurrentServiceGroupOrder)
   Exit

;***************************************************************************
;
;                G e t S e r v i c e H a n d l e s
;
;   Input:       $($0)     ServiceName
;
;   Output:      $($R0)    Status
;                $($R1)    hService
;                $($R2)    hParameters
;------------------------------------------------------------------------
[GetServiceHandles]
   Set !DebugOutputControl = 1
   Debug-Output "GetServiceHandles >"
   
   Set Status = STATUS_SERVICE_EXIST
   Set ServiceName = $($0)
   Read-Syms GeneralConstants

   OpenRegKey $(!REG_H_LOCAL), "", $(ServicesPath)"\"$(ServiceName), $(MAXIMUM_ALLOWED), hService
   IfStr(i) $(hService) == $(KeyNull)
      Debug-Output "GetServiceHandles can't open PnpServiceKey *"
      Set Status = STATUS_SERVICE_NO_EXIST
	  Return $(Status)
	  Exit
   EndIf

   OpenRegKey $(hService), "", "Parameters", $(MAXIMUM_ALLOWED), hParameters
   IfStr(i) $(hService) == $(KeyNull)
      Debug-Output "GetServiceHandles can't open PnpParametersKey *"
      CloseRegKey $(hService)
      Set Status = STATUS_FAILED
	  Return $(Status)
	  Exit
   EndIf
   Debug-Output "GetServiceHandles *"
   Return $(Status) $(hService) $(hParameters)
   Exit





;***************************************************************************
;
;                C o p y F i l e s 
;
;   Input:       --
;
;   Output:      --
;------------------------------------------------------------------------
[CopyFiles]
   Debug-Output "CopyFiles >"
   Set STF_VITAL = ""

   ; fülle die copy liste


   IfStr(i) $(AddCopy) == "YES"
      AddSectionFilesToCopyList Files-Driver   $(SrcDir) $(DriverDir)
      AddSectionFilesToCopyList Files-System32 $(SrcDir) $(System32Dir)
      IfStr(i) $(Option) != "Ndis"
         AddSectionFilesToCopyList Files-Capi32   $(SrcDir) $(System32Dir)
         AddSectionFilesToCopyList Files-Capi16   $(SrcDir) $(SystemDir)
      EndIf
   EndIf

   Set IsPnp = *(^(HardWare,$(HwSup)),~(^(HardWare,$(HwO)),$(Option)))
   IfStr(i) $(IsPnp) == "Pnp"
       AddSectionFilesToCopyList Files-Pnp      $(SrcDir) $(DriverDir)
   EndIf

   ; kopiere alle file's
;   IfStr(i) $(DoCopy) == "YES"
      Set !STF_NCPA_FLUSH_COPYLIST = TRUE
      CopyFilesInCopyList
;   EndIf

   Debug-Output "CopyFiles *"
   Exit


;***************************************************************************
;
;                P c m c i a U p d a t e D a t a B a s e
;
;   Input:       $($0)     Option
;                $($1)     ServiceName
;                $($2)     Manufacturer
;                $($3)     AdapterList
;
;   Output:      $($R0)    Status
;
;------------------------------------------------------------------------
[PcmciaUpdateDataBase]
   Debug-Output "PcmciaUpdateDataBase >"
   Set Status       = STATUS_SUCCESS

   ; save callerparameter
   Set Option = $($0)
   Set ServiceName  = $($1)
   Set Manufacturer = $($2)
   Set AdapterList = $($3)

   ; print callerparameter
   Debug-Output "PcmciaUpdateDataBase Option       "$(Option)
   Debug-Output "PcmciaUpdateDataBase ServiceName  "$(ServiceName)
   Debug-Output "PcmciaUpdateDataBase Manufacturer "$(Manufacturer)
   Debug-Output "PcmciaUpdateDataBase AdapterList  "$(AdapterList)

   ; initialize Constants
   Read-Syms GeneralConstants

   ; write the pcmciavalues
   Set NewValueList = {{DeviceType,  0, $(!REG_VT_SZ), NET},+
                       {Driver,      0, $(!REG_VT_SZ), $(ServiceName)}, +
                       {InfFileName, 0, $(!REG_VT_SZ), $(STF_CONTEXTINFNAME)},+
                       {Option,      0, $(!REG_VT_SZ), $(Option)}}

   Debug-Output "PcmciaUpdateDataBase NewValueList "$(NewValueList)

   OpenRegKey $(!REG_H_LOCAL) "" $(PcmciaDataBasePath) $(MAXIMUM_ALLOWED) hDataBase
   IfStr $(hDataBase) != $(KeyNull)

      ; open the ManufacturerKey in the PcmciaDataBase
      ; ----------------------------------------------
      OpenRegKey $(hDataBase) "" $(Manufacturer) $(MAXIMUM_ALLOWED) hManufacturer
      IfStr $(hManufacturer) == $(KeyNull)

         ; if not open then create 
         ; -----------------------
         CreateRegKey $(hDataBase) {$(Manufacturer), 0, GenericClass}, +
                      "", $(MAXIMUM_ALLOWED), "",hManufacturer
      EndIf

      ; and now scan the manufacturer database
      ; --------------------------------------
      EnumRegKey $(hManufacturer) KeyList
      Debug-Output "PcmciaUpdateDataBase KeyList: "$(KeyList)

      IfStr(i) $(KeyList) == {}
         ForListDo $(AdapterList)
            Set NewAdapterName = $($)
               Debug-Output "PcmciaUpdateDataBase Create the Key "$(NewApterName)
               CreateRegKey $(hManufacturer) {$(NewAdapterName), 0, GenericClass},+
                              "", $(MAXIMUM_ALLOWED), "",hAdapter
               Shell  "utility.inf", AddValueList, $(hAdapter), $(NewValueList)
               CloseRegKey $(hAdapter)
         EndForListDo
      Else
         ForListDo $(AdapterList)
            Set NewAdapterName = $($)
            Debug-Output "PcmciaUpdateDataBase NewAdapterName: "$(NewAdapterName)

            ForListDo $(KeyList)
               Set OldAdapterName = *($($),1)
               Debug-Output " PcmciaUpdateDataBase OldAdapterName: "$(OldAdapterName)
               IfStr(i) $(OldAdapterName) == $(NewAdapterName)
                  Debug-Output "PcmciaUpdateDataBase Adapter already installed"
                  OpenRegKey $(!REG_H_LOCAL), "", $(NewAdapterName), $(MAXIMUM_ALLOWED), hAdapter 
               Else
                  Debug-Output "PcmciaUpdateDataBase Create the Key "$(NewApterName)
                  CreateRegKey $(hManufacturer) {$(NewAdapterName), 0, GenericClass},+
                               "", $(MAXIMUM_ALLOWED), "",hAdapter
               EndIf
               Shell  "utility.inf", AddValueList, $(hAdapter), $(NewValueList)
               CloseRegKey $(hAdapter)
            EndForListDo
         EndForListDo
      EndIf
      CloseRegKey $(hManufacturer)
      CloseRegKey $(hDataBase)
      Set Status = STATUS_SUCCESSFUL
   Else
      Set Status = STATUS_FAILED
   EndIf

   
   Debug-Output "PcmciaUpdateDataBase >"
   Return $(Status)
   Exit

;***************************************************************************
;
;                S e t D e f a u l t P a r a m s
;
;   Input:       $($0)     Option
;
;   Output:      $($R0)    Status       yes	- configure by install
;                                       no  - don't configure by install
;
;------------------------------------------------------------------------
[SetDefaultParams]
   Debug-Output "SetDefaultParams >"

   ; save callerparameter
   Set Option = $(S0)

   ; init returnvalues
   Set Status = yes

   ; print callerparameter
   Set Option = $(S0)


   Debug-Output "SetDefaultParams *"
   Return $(Status)
   Exit
   
   
[GetTempDir]
   Set !DebugOutputControl = 1
   Debug-Output "GetTempDir >"

   Set DummyDir = "c:\kuddelmuddel" 
   CreateDir $(DummyDir)


   Set !DebugOutputControl = 1
   Debug-Output "GetTempDir !STF_SRCDIR_KEYED     "$(!STF_SRCDIR_KEYED)
   Debug-Output "GetTempDir !STF_SRCDIR_USED      "$(!STF_SRCDIR_USED)
   Debug-Output "GetTempDir !STF_SRCDIR_OVERRIDE  "$(!STF_SRCDIR_OVERRIDE)
   Debug-Output "GetTempDir !STF_SRCDIR           "$(!STF_SRCDIR)
   ;AddSectionFilesToCopyList AllFiles $(!STF_SRCDIR) $(DummyDir)

   ;Set !STF_NCPA_FLUSH_COPYLIST = TRUE
   ;CopyFilesInCopyList

   Debug-Output "GetTempDir *"
   Exit


;***************************************************************************
;
;                InstallLanguageSupported
;
;   Input:       -
;
;   Output:      $($R0)    Status
;                $($R1)    Language
;------------------------------------------------------------------------
[InstallLanguageSupported]
   Set !DebugOutputControl = 1
   Debug-Output "InstallLanguageSupported >"
   Set Status = STATUS_SUCCESSFUL

   Read-Syms GeneralConstants

   ; bestimme die reginalsettings
   OpenRegKey $(!REG_H_CUSER) "" $(LocationsPath) $(MAXIMUM_ALLOWED) hRegion

   Set Language = "ENG"
   IfStr(i) $(RegLastError) == $(!REG_ERROR_SUCCESS)
      GetRegValue $(hRegion), "sLanguage", Lang
      CloseRegKey $(hRegion)
      IfStr(i) $(RegLastError) == $(!REG_ERROR_SUCCESS)
         Set Lang = *($(Lang),4)
         Set Language = *(^(LanguageConstants,2),~(^(LanguageConstants,1),$(Lang)))
         IfStr(i) $(Language) == ""
            Set Language = "ENG"
         EndIf
      EndIf
   EndIf

   Debug-Output "InstallLanguageSupported Language "$(Language)
   Debug-Output "InstallLanguageSupported *"
   Return $(Status) $(Language)
   Exit

[LanguageConstants]
ENG, ENG
DEU, GER
ENU, ENG
FRA, FRA
ITA, ITA

; #####################################################################

;***************************************************************************
;   allgemeine Installations-Informationen
;
;---------------------------------------------------------------------------
;
; Identifikation Parameter
;___________________________________________________________________________

[Identification]
    OptionType = NetAdapter

[Source Media Descriptions]
    1  = "Sedlbauer-AG ISDN Adapter Setup Disk" 

;---------------------------------------------------------------------------
;
; ReturnOptions Parameter
;___________________________________________________________________________
[LanguagesSupported]
   GER
   ENG
   ITA
   FRA

[PlatformsSupported]
    ISA

[Options]
   Ndis
   Star
   Starii

[OptionsText]
   Ndis        = *(^($(OEM),$(OtIo)),~(^($(OEM),$(OtO)),Ndis))
   Star        = *(^($(OEM),$(OtIo)),~(^($(OEM),$(OtO)),Star))
   Starii      = *(^($(OEM),$(OtIo)),~(^($(OEM),$(OtO)),Starii))


[Date]
    Now                     = {} ? $(!LIBHANDLE) GetSystemDate

;---------------------------------------------------------------------------
;
; Konvertierung Parameter
;___________________________________________________________________________
[LptStrings]
LPT1,   0
LPT2,   1
LPT3,   2
LPT4,   3

[InterruptStrings]
IRQ_1,   1
IRQ_2,   2
IRQ_3,   3
IRQ_4,   4
IRQ_5,   5
IRQ_6,   6
IRQ_7,   7
IRQ_8,   8
IRQ_9,   9
IRQ_10, 10
IRQ_11, 11
IRQ_12, 12
IRQ_13, 13
IRQ_14, 14
IRQ_15, 15

[BusTypes]
ISA,    1
PCI,    5
PCMCIA, 1

;---------------------------------------------------------------------------
;
; InstallOptions Parameter
;___________________________________________________________________________
[Manufacturer 1]
;Option - RealOption,  - ServiceGroup - DialogCaption                                     - Tab1Title - Tab2Title - InstallOptionText                                     - ProductSoftwareName - ProductSoftwareDescription           -                      ProductSoftwareTitle     -                 ServiceDisplayName      -                  NetRuleAdapter - ProductHardwareDescription                      - ProductHardwareName             -   ProductHardwareTitle
Ndis,       {Ndis},        NDIS,          #(SetupText$(Language), NdisDialogCaption, 1),    Ports,      NdisWan,    #(SetupText$(Language), NdisInstallOptionText, 1),        "CardNdisWan",          $(Manufacturer)" NDIS WAN Miniportdriver",                $(Manufacturer)" NDIS WAN Miniportdriver", $(Manufacturer)" NDIS WAN",                "Driver",        $(Manufacturer)" NDIS WAN Miniportdriver",        SpeedNdisWan,                  $(Manufacturer)" NDIS WAN Miniportdriver"
Star,       {Star},        CAPI20,        #(SetupText$(Language), StarDialogCaption, 1),    Ports,      NdisWan,    #(SetupText$(Language), StarInstallOptionText, 1),        "PC-Card",              $(Manufacturer)" PCMCIA ISDN-Adapter PC-Card",            $(Manufacturer)" PC-Card",                 $(Manufacturer)" PC-Card",                 "Adapter",       $(Manufacturer)" PC-Card",                        $(Manufacturer)" PC-Card",     $(Manufacturer)" ISDN-Adapter PC-Card"
Starii,     {Starii},      CAPI20,        #(SetupText$(Language), StariiDialogCaption, 1),  Ports,      NdisWan,    #(SetupText$(Language), StariiInstallOptionText, 1),      "PC-Card II",           $(Manufacturer)" PCMCIA ISDN-Adapter PC-Card II",         $(Manufacturer)" PC-Card II",              $(Manufacturer)" PC-Card II",              "Adapter",       $(Manufacturer)" PC-Card II",                     $(Manufacturer)" PC-Card II",  $(Manufacturer)" ISDN-Adapter PC-Card II"

[HardWare]
;Option - AdpId - Support       - PnpId    - Controller - Channels - PortChoose                     - IrqChoose                                                                  - PortDefault - IrqDefault - BusType    - BusNumber
Star,     0,      "Pcmcia",       "",        1,           {2},       {Range, 0x100, 0x008, 0x3ff},    {List,  IRQ_3, IRQ_4, IRQ_5, IRQ_7, IRQ_9,  IRQ_10, IRQ_11, IRQ_12, IRQ_15}, 0x270,        IRQ_5,       PCMCIA,      0
Starii,   0,      "Pcmcia",       "",        1,           {2},       {Range, 0x100, 0x008, 0x3ff},    {List,  IRQ_3, IRQ_4, IRQ_5, IRQ_7, IRQ_9,  IRQ_10, IRQ_11, IRQ_12, IRQ_15}, 0x270,        IRQ_5,       PCMCIA,      0

[GeneralConstants]
   ; Optionen RegistryPaths und Rechte 
   ; Hardware Options
   HwO                     = 1
   HwAId                   = 2
   HwSup                   = 3
   HwPId                   = 4
   HwCo                    = 5
   HwCh                    = 6
   HwPc                    = 7
   HwIc                    = 8
   HwDp                    = 9
   HwDi                    = 10
   HwDBu                   = 11
   HwDNu                   = 12

   ;Manufacturer Options
   OtO                     = 1
   OtNeO                   = 2
   OtSGr                   = 3
   OtDCa                   = 4
   OtDT1                   = 5
   OtDT2                   = 6
   OtIo                    = 7
   OtPsn                   = 8
   OtPsd                   = 9
   OtPst                   = 10
   OtSdn                   = 11
   OtNrA                   = 12
   OtPhd                   = 13
   OtPhn                   = 14
   OtPht                   = 15

   ; Paths
   LocationsPath           = "Control Panel\International"
   ServiceGroupOrderPath   = "SYSTEM\CurrentControlSet\Control\ServiceGroupOrder"
   ServicesPath            = "SYSTEM\CurrentControlSet\Services"
   NetworkCardsPath        = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards"
   SoftwarePath            = "SOFTWARE"
   DeviceMapPath           = "HARDWARE\DEVICEMAP"
   TapiDevicesPath         = "TAPI DEVICES"
   RasTapiDevicesPath      = "SOFTWARE\Microsoft\RAS\"$(TapiDevicesPath)
   Capi20Path              = $(SoftwarePath)"\CAPI20"
   PcmciaDataBasePath      = $(ServicesPath)"\Pcmcia\DataBase"
   KeyNull                 = ""

   ; Rights
   MAXIMUM_ALLOWED         = 33554432

[DialogConstants]
   DlgCaption    = *(^($(OEM),$(OtDCa)),~(^($(OEM),$(OtO)),$(Option)))
   Tab1Title     = *(^($(OEM),$(OtDT1)),~(^($(OEM),$(OtO)),$(Option)))
   Tab2Title     = *(^($(OEM),$(OtDT2)),~(^($(OEM),$(OtO)),$(Option)))

[ProductConstants]
   ; allgemeine Informationen
   ; ------------------------
   Manufacturer            = "SCM"
   OEM                     = "Manufacturer 1"
   ProductSoftwareName     = *(^($(OEM),$(OtPsn)),~(^($(OEM),$(OtO)),$(Option)))
   ProductSoftwareNamePath = $(SoftwarePath)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"

   ; allgemeine DateiVerzeichnispfade
   ; --------------------------------
   DriverDir             = $(!STF_WINDOWSPATH)"\System32\Drivers"
   System32Dir           = $(!STF_WINDOWSPATH)"\System32"
   SystemDir             = $(!STF_WINDOWSPATH)"\System"

   ; CurrentDriver
   ; -------------
   Driver                      = ~(^(FilesBinaries, 1),$(Option))
   DriverName                  = *(^(FilesBinaries, 2),~(^(FilesBinaries, 1), $(Option)))
   DriverReName                = *(^(FilesBinaries, 4),~(^(FilesBinaries, 1), $(Option)))
   DriverSize                  = *(^(FilesBinaries, 3),~(^(FilesBinaries, 1), $(Option)))

   ; ErrorLogging
   ; ------------
   ErrorLogging            = "%SystemRoot%\System32\Drivers\"$(DriverReName)

   ; Software\..\CurrentVersion
   ; -----------------------------------
   ProductSoftwareDescription  = *(^($(OEM),$(OtPsd)),~(^($(OEM),$(OtO)),$(Option)))
   ProductVersion              = {1,29}
   ServiceName                 = $(ProductSoftwareName)   ; wird durch AddSoftware festgelegt
   SoftwareType                = "driver"
   ProductSoftwareTitle        = *(^($(OEM),$(OtPst)),~(^($(OEM),$(OtO)),$(Option)))

   ; Services\$(ServiceName)
   ; -----------------------
   ServiceDisplayName          = *(^($(OEM),$(OtSdn)),~(^($(OEM),$(OtO)),$(Option)))
   DriverImagePath             = "%SystemRoot%\System32\Drivers\"$(DriverReName)
   ServiceGroup                = *(^($(OEM),$(OtSGr)),~(^($(OEM),$(OtO)),$(Option)))

   ; Software\..\CurrentVersion\Netrules
   ; -----------------------------------
   NetRuleAdapter              = *(^($(OEM),$(OtNrA)),~(^($(OEM),$(OtO)),$(Option)))
   BindableTxt                 = {$(ServiceName)"Driver "$(ServiceName)$(NetRuleAdapter)" non exclusive 100"}
   NetRuleSoftwareBindForm     = """"$(ServiceName)Sys""" yes no container"
   NetRuleSoftwareClass        = {$(ServiceName)"Driver basic"}
   NetRuleSoftwareType         = $(ServiceName)"Sys "$(ServiceName)"Driver"
   NetRuleSoftwareUse          = $(SoftwareType)

   ; Service Namen, Anzeigetexte
   ; ---------------------------
   ; später entfernen
   ProductKeyName              = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"+
                                 $(ProductSoftwareName)"\CurrentVersion"

   ; Software\..\NetworkCards\n\
   ; ---------------------------
   ProductHardwareDescription  = *(^($(OEM),$(OtPhd)),~(^($(OEM),$(OtO)),$(Option)))
   ProductHardwareName         = *(^($(OEM),$(OtPhn)),~(^($(OEM),$(OtO)),$(Option)))
   ProductHardwareTitle        = *(^($(OEM),$(OtPht)),~(^($(OEM),$(OtO)),$(Option)))

   ; Software\..\NetworkCards\n\NetRules\
   ; ------------------------------------
   NetRuleHardwareBindForm      = " yes yes container"
   NetRuleHardwareClass         = {$(ServiceName)$(NetRuleAdapter)" basic"}
   NetRuleHardwareType          = $(ServiceName)" "$(ServiceName)$(NetRuleAdapter)


   ; Services\...n\Parameters\
   ;-------------------------
   ; --> others
   AdapterId                    = *(^(HardWare ,$(HwAId)),~(^(HardWare ,$(HwO)), $(Option)))
   BusName                      = *(^(HardWare ,$(HwDBu)),~(^(HardWare ,$(HwO)), $(Option)))
   BusNumber                    = *(^(HardWare ,$(HwDNu)),~(^(HardWare ,$(HwO)), $(Option)))
   BusType                      = *(^(BusTypes ,2),~(^(BusTypes ,1), $(BusName)))
   MediaType                    = "ISDN"
   InterruptNumber              = *(^(HardWare,$(HwDi)),~(^(HardWare,$(HwO)),$(Option)))
   IoBaseAddress                = *(^(HardWare,$(HwDp)),~(^(HardWare,$(HwO)),$(Option)))
   ; --> Ndis
   AddressList                  = {" 1 0", " 2 0"}
   LineType                     = 1
   MSNL0_Value                  = ""
   MSNL1_Value                  = ""
   MiscParam0_Value             = "0"
   MiscParam1_Value             = "0"

   ; PnpService Namen, Anzeigetexte
   ; ------------------------------
   PnpVendorId                 = *(^(HardWare,$(HwPId)),~(^(HardWare,$(HwO)),$(Option)))
   PnpDriverName               = *(^(FilesBinaries, 2),~(^(FilesBinaries, 1), Pnp))
   PnpDriverReName             = *(^(FilesBinaries, 4),~(^(FilesBinaries, 1), Pnp))
   PnpDriverSize               = *(^(FilesBinaries, 3),~(^(FilesBinaries, 1), Pnp))
   PnpMapping                  = {"Irq","Port"}
   PnpParams                   = {"InterruptNumber","IoBaseAddress"}

   ; Services\$(PnpServiceName)
   ;---------------------------
   PnpServiceName              = *(^($(OEM),$(OtPsn)),~(^($(OEM),$(OtO)),Pnp))
   PnpServiceDisplayName       = *(^($(OEM),$(OtSdn)),~(^($(OEM),$(OtO)),Pnp))
   PnpDriverImagePath          = "%SystemRoot%\System32\Drivers\"$(PnpDriverReName)
   PnpServiceGroup             = *(^($(OEM),$(OtSGr)),~(^($(OEM),$(OtO)),Pnp))
   DeviceName                  = "CapiCfg"

   ; Pcmcia-Cards
   ; ------------
   PcmciaAdapterNames          = {"ISDN-Adapter", +
                                  "ISDN-Adapter II"}
   Pcmcia                      = 1
   IoLength                    = 8

   ; übrige dateinamen
   ; -----------------
   HelpFileName               = *(^(FilesBinaries, 2),~(^(FilesBinaries, 1), Hlp))
   HelpFileReName             = *(^(FilesBinaries, 4),~(^(FilesBinaries, 1), Hlp))
   HelpFileSize               = *(^(FilesBinaries, 3),~(^(FilesBinaries, 1), Hlp))
   ConfigFileName             = *(^(FilesBinaries, 2),~(^(FilesBinaries, 1), Cfg))
   ConfigFileReName           = *(^(FilesBinaries, 4),~(^(FilesBinaries, 1), Cfg))
   ConfigFileSize             = *(^(FilesBinaries, 3),~(^(FilesBinaries, 1), Cfg))
   Capi20Name                 = *(^(FilesBinaries, 2),~(^(FilesBinaries, 1), C20))
   Capi20ReName               = *(^(FilesBinaries, 4),~(^(FilesBinaries, 1), C20))
   Capi20Size                 = *(^(FilesBinaries, 3),~(^(FilesBinaries, 1), C20))
   Capi2032Name               = *(^(FilesBinaries, 2),~(^(FilesBinaries, 1), C32))
   Capi2032ReName             = *(^(FilesBinaries, 4),~(^(FilesBinaries, 1), C32))
   Capi2032Size               = *(^(FilesBinaries, 3),~(^(FilesBinaries, 1), C32))


;***********************************************************************
;                 F i l e s S e c t i o n
;
;***********************************************************************
; FileNames für die Driver
;***********************************************************************
[FilesBinaries]
Box,    scbe.sys,     262000, scbe.sys
Card,   scwe.sys,     262000, scwe.sys
Fax,    scfe.sys,     262000, scfe.sys
Pc104,  scie.sys,     262000, scie.sys
Ndis,   sedlw.sys,    262000, sedlw.sys
Pnp,    scwd.sys,     262000, scwd.sys
Star,   scpe.sys,     262000, scpe.sys
Starii, scpiie.sys,   262000, scpiie.sys
Win,    scwe.sys,     262000, scwe.sys
WinPci, scwpe.sys,    262000, scwpe.sys
Hlp,    sc.hlp,       262000, sc.hlp
Cfg,    capicfg.dll,  262000, capicfg.dll
C20,    capi20.dll,   262000, capi20.dll
C32,    capi2032.dll, 262000, capi2032.dll
 
;***********************************************************************
; DriverBinaries
;***********************************************************************
[Files-Driver]
    1, $(DriverName),    SIZE=$(DriverSize), DECOMPRESS, RENAME=$(DriverReName)

[Files-PnP]
    1, $(PnpDriverName), SIZE=$(PnpDriverSize), DECOMPRESS, RENAME=$(PnpDriverReName)

;***********************************************************************
; laufzeit und hilfe
;***********************************************************************
[Files-System32]
    1, $(HelpFileName), SIZE=$(HelpFileSize), DECOMPRESS, RENAME=$(HelpFileReName)
    1, $(ConfigFileName), SIZE=$(ConfigFileSize), DECOMPRESS, RENAME=$(ConfigFileReName)

;***********************************************************************
; laufzeit und hilfe
;***********************************************************************
[Files-Capi32]
    1, $(Capi2032Name), SIZE=$(Capi2032Size), DECOMPRESS, RENAME=$(Capi2032ReName)

;***********************************************************************
; 16-Bit Umgebung
;***********************************************************************
[Files-Capi16]
    1, $(Capi20Name), SIZE=$(Capi20Size), DECOMPRESS, RENAME=$(Capi20ReName)

;***********************************************************************
; SetupScript
;***********************************************************************
[Files-Oem]
    1, oemsetup.inf, SIZE=31000, RENAME=$(OldInfName) 


;***********************************************************************
; DialogTexte
;***********************************************************************
[SetupMessageGER]
OptionAlreadyInstalled = "Diese Produktoption wurde bereits installiert."
RecentlyRemoved        = "Diese Netzwerkkomponente wurde gerade entfernt. Bitte führen Sie einen Neustart Ihres Computers durch und installieren Sie erneut."
PCIConfig              = "PCI ISDN-Adapter werden vom Betriebssystem konfiguriert."
SetServiceGroupOrder   = "Erzeuge die ServiceGroupOrder"
SetNewCapiDevice       = "Erzeuge einen neuen Controller"
AddNewSoftware         = "Installiere die neue Software"
AddNewNetworkCard      = "Installiere die neue Netzwerkkarte"
InitNetworkCard        = "Initialisiere den ISDN - Adapter"
CopyFiles              = "Kopiere die Dateien"
PcmciaSupport          = "Installiere den Pcmcia-Support"
ParallelPortSupport    = "Installiere den Parallelport-Support"
PnpSupport             = "Installiere den Pnp-Service"
NdisSupport            = "Registriere die Tapi-Devices"
ConfigureAdapter       = "Konfiguriere den ISDN - Adapter"
InstallationFailed     = "Die Installation ist fehlgeschlagen. Es werden alle neu installierten Komponenten entfernt."

[SetupMessageENG]
OptionAlreadyInstalled = "This product option is already installed."
RecentlyRemoved        = "This network component was recently removed. Please restart your computer."
PCIConfig              = "PCI ISDN adapters will be configured by the operating system."
SetServiceGroupOrder   = "Am setting the service group order"
SetNewCapiDevice       = "Am setting a new controller"
AddNewSoftware         = "Am installing the new software"
AddNewNetworkCard      = "Am installing the new network card"
InitNetworkCard        = "Am initializing the ISDN adapter"
CopyFiles              = "Am copying the files"
PcmciaSupport          = "Am installing the Pcmcia support"
ParallelPortSupport    = "Am installing the parallel port support"
PnpSupport             = "Am installing the Pnp service"
NdisSupport            = "Am registering the Tapi devices"
ConfigureAdapter       = "Am configuring the ISDN adapter"
InstallationFailed     = "The installation has failed. All newly installed components will be removed."

[SetupMessageITA]
OptionAlreadyInstalled = "Questa opzione di prodotto è già stata installata."
RecentlyRemoved        = "Questo componente di rete è stato appena disinstallato. Esegui un riavvio del computer."
PCIConfig              = "Gli adattatori ISDN PCI vengono configurati dal sistema operativo."
SetServiceGroupOrder   = "Crea il ServiceGroupOrder"
SetNewCapiDevice       = "Crea un nuovo controllore"
AddNewSoftware         = "Installa il nuovo software"
AddNewNetworkCard      = "Installa la nuova carta di rete"
InitNetworkCard        = "Inizializza l'adattatore ISDN"
CopyFiles              = "Copia i file"
PcmciaSupport          = "Installa il supporto Pcmcia"
ParallelPortSupport    = "Installa il supporto porta parallela"
PnpSupport             = "Installa il servizio Pnp"
NdisSupport            = "Registra il dispositivo Tapi"
ConfigureAdapter       = "Configura l'adattatore ISDN"
InstallationFailed     = "L'installazione non è riuscita. Tutti i nuovi componenti vengono disinstallati."

[SetupMessageFRA]
OptionAlreadyInstalled = "Cette option de produit a déjà été installée"
RecentlyRemoved        = "Ce composant de réseau vient d’être enlevé, veuillez effectuer un nouveau démarrage de votre ordinateur."
PCIConfig              = "Les adaptateurs PCI ISDN sont configurés par le système d’exploitation"
SetServiceGroupOrder   = "Crée le ServiceGroupOrder"
SetNewCapiDevice       = "Crée un nouveau contrôleur"
AddNewSoftware         = "Installe lenouveau logiciel"
AddNewNetworkCard      = "Installe la nouvelle carte de réseau"
InitNetworkCard        = "Initialise l’adaptateur ISDN"
CopyFiles              = "Copie les fichiers"
PcmciaSupport          = "Installe le support Pcmcia"
ParallelPortSupport    = "Installe le support Parallelport"
PnpSupport             = "Installe le service Pnp"
NdisSupport            = "Enregistre les Tapi-Devices"
ConfigureAdapter       = "Configure l’adaptateur ISDN"
InstallationFailed     = "L’installation n’a pas réussi. Tous les composants nouvellement installés seront effacés."

; Optionsabhängige InstallationsTexte
; -----------------------------------
[SetupTextGER]
NdisInstallOptionText        = $(Manufacturer)" NDIS WAN Miniportdriver"
StarInstallOptionText        = $(Manufacturer)" PC-Card ISDN-Adapter"
StariiInstallOptionText      = $(Manufacturer)" PC-Card II ISDN-Adapter"

NdisDialogCaption            = $(Manufacturer)" NDIS WAN Miniportdriver Konfiguration"
StarDialogCaption            = $(Manufacturer)" PC-Card ISDN-Adapter Konfiguration"
StariiDialogCaption          = $(Manufacturer)" PC-Card II ISDN-Adapter Konfiguration"

[SetupTextENG]
NdisInstallOptionText        = $(Manufacturer)" NDIS WAN Miniportdriver"
StarInstallOptionText        = $(Manufacturer)" PC-Card ISDN-Adapter"
StariiInstallOptionText      = $(Manufacturer)" PC-Card II ISDN-Adapter"

NdisDialogCaption            = $(Manufacturer)" NDIS-WAN Miniport driver configuration"
StarDialogCaption            = $(Manufacturer)" PC-Card ISDN-Adapter configuration"
StariiDialogCaption          = $(Manufacturer)" PC-Card II ISDN-Adapter configuration"

[SetupTextITA]
NdisInstallOptionText        = $(Manufacturer)" NDIS WAN Miniportdriver"
StarInstallOptionText        = $(Manufacturer)" PC-Card ISDN-Adapter"
StariiInstallOptionText      = $(Manufacturer)" PC-Card II ISDN-Adapter"

NdisDialogCaption            = $(Manufacturer)" Configurazione del driver NDIS-WAN Miniport"
StarDialogCaption            = $(Manufacturer)" Configurazione del PC-Card driver ISDN"
StariiDialogCaption          = $(Manufacturer)" Configurazione del PC-Card II driver ISDN"

[SetupTextFRA]
NdisInstallOptionText        = $(Manufacturer)" NDIS WAN Miniportdriver"
StarInstallOptionText        = $(Manufacturer)" PC-Card ISDN-Adapter"
StariiInstallOptionText      = $(Manufacturer)" PC-Card II ISDN-Adapter"

NdisDialogCaption            = $(Manufacturer)" Configuration du driver Miniport NDIS WAN"
StarDialogCaption            = $(Manufacturer)" Configuration de l´ adaptateur RNIS PC-Card"
StariiDialogCaption          = $(Manufacturer)" Configuration de l´ adaptateur RNIS PC-Card II"
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: web2, load: 0.84