
[General Constants]
  Radio1 = "1"
  Radio2 = "2"
  Radio3 = "3"
  Radio4 = "4"
  Radio5 = "5"
  Radio6 = "6"
  Radio7 = "7"
  Radio8 = "8"
  Radio9 = "9"

  False  = "0"
  True   = "1"

  Chosen    = "ON"
  NotChosen = "OFF"

  LinkTypeList    = { 3, 4, 10, 11 }  ; See SETUPUTL.INF:[SNAServiceTypes]
  NapTypeList     = { 28, 29 }        ; CESCLIENTNAP, CESSERVERNAP

  MaskAllAccess   = 33554432
  KeyNull         = ""

  ERROR_INVALID_NAME   = 123
  ERROR_ALREADY_EXISTS = 183

[File Constants]
  UtilInfFile     = $(!STF_CWDDIR)"SETUPUTL.INF"
  SubroutineInf	  = $(!STF_WINDOWSSYSPATH)"\SUBROUTN.INF"
  DialogLibrary   = "SETUP.SRL"
  SNABinDir       = "SYSTEM"
  InstallChkFile  = $(SNABinDir)"\SNABASE.EXE"
  ServerChkFile   = $(SNABinDir)"\SNASERVR.EXE"
  AdminChkFile    = $(SNABinDir)"\SNAADMIN.EXE"

[UiVars]
  STF_WINDOWSPATH    = "" ? $(!LIBHANDLE) GetWindowsNtDir
  STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  STF_COMPUTERNAME   = "" ? $(!LIBHANDLE) GetMyComputerName
  STF_USERNAME       = "" ? $(!LIBHANDLE) GetMyUserName
  STF_FLOPPYLIST     = {} ? $(!LIBHANDLE) GetFloppyDriveLetters
  STF_UNUSEDDRIVES   = {} ? $(!LIBHANDLE) GetUnusedDrives
  STF_LANGUAGE       = "ENG"

  NTN_InstallMode    = "Install"
  NTN_SoftwareBase   = "Software"
  NTN_ServiceBase    = "System\CurrentControlSet\Services"
  NTN_ScUseRegistry  = "NO"

  FLibraryErrCtl     = 1	; Error codes from external routines will be handled here

  SNA_SetupMode      = "Server"

  SNA_NosLanman      = $(False)
  SNA_NosNetware     = $(False)
  SNA_DoNosLanman    = $(False)
  SNA_DoNosNetware   = $(False)
  SNA_NosCount       = 0
  SNA_NetwareDomain  = "DOMAIN"
  NOS_Lanman         = "Lanman"
  NOS_Netware        = "Netware"

  SNAVersion         = "2.0"
  SNARootDir         = ""

  ClientInstalls     = { $(Chosen), $(Chosen), $(Chosen), $(Chosen) }
  InitialInstall     = $(True)
  IconsInstalled     = $(False)
  OneLSInstalled     = $(False)
  LaunchAdmin        = $(False)

  SNAEventLogEntries = { +
      "SNA Server",                "SNA Base Service",           +
      "SNA DLC Link Service",      "SNA IBM SDLC Link Service",  +
      "SNA IBM X.25 Link Service", "SNA IBM DFT Link Service",   +
      "SNA 3270 Emulator",         "SNA APPC Application",       +
      "SNA CPI-C Application",     "SNA CSV Application",        +
      "SNA SLI Application",       "SNA RUI Application"        }

  OldPerfMonCounter = "Frames Received"
  OldPerfMonHelp    = "Frames Received"

  SNAPerfMonCounters = { +
      "SNA Connections",           "SNA Logical Unit Sessions",  +
      "Data Bytes Received/Sec",   "Data Bytes Transmitted/Sec", +
      "Frames Received/Sec",       "Frames Transmitted/Sec",     +
      "Successful Connects",       "Adapter Failures",           +
      "Throughput Bytes/Sec",      "Throughput Frames/Sec",      +
      " ",                         " "                          }

  SNAPerfMonHelp = { +
      "SNA Connections", +
      "SNA Logical Unit Sessions", +
      "The number of data bytes received per second.", +
      "The number of data bytes transmitted per second.", +
      "The number of data frames received per second.  A frame is an information structure recognized by one of the various protocols related to SNA.  Frames contain multiple bytes of data.", +
      "The number of data frames transmitted per second.  A frame is an information structure recognized by one of the various protocols related to SNA.  Frames contain multiple bytes of data.", +
      "The number of times since startup that a successful connection has been made.", +
      "The number of times since startup that a network adapter has encountered an error condition.", +
      "The total number of bytes flowing through the SNA server per second.  This includes both incoming and outgoing bytes, and is a good indicator of how heavily your SNA server is loaded.", +
      "The total number of data frames flowing through the SNA server per second.  This includes both incoming and outgoing frames, and is a good indicator of how heavily your SNA server is loaded.", +
      " ", +
      " " }

  Status         = ""
  BackLabel      = ""
  LSReturn       = ""
  Install4       = ""

  DefSourceDir   = $(!STF_CWDDIR)
  DefSNARootDir  = "C:\SNA"
  DefDriverDir   = "A:"

  SourceDir      = $(DefSourceDir)
  SNARootDir     = $(DefSNARootDir)
  DriverDir      = $(!STF_CWDDIR)  ; This gets set to DefDriverDir later on
  ClientSrcDir   = "A:\"

  OptionConfig   = $(Radio1)
  OptionChange   = $(Radio2)
  OptionClient   = $(Radio3)
  OptionRemove   = $(Radio4)

  SetupOption    = $(OptionConfig)

  SNATraceDirName   = "traces"

  ClientLocal       = $(Radio1)
  ClientRemote      = $(Radio2)
  ClientMode        = $(ClientLocal)
  OldClientMode     = $(ClientMode)
  RemoteSvr1        = ""
  RemoteSvr2        = ""
  RemoteSav1        = ""
  RemoteSav2        = ""

  DriverToInstall   = ""
  DriversAvailable  = {}
  DriversInstalled  = {}
  OtherDriverList   = {}
  LinkServiceList   = {}

  NodeInstalled     = $(False)
  NapInstalled      = $(False)
  SNANetInstalled   = $(False)
  NVAlertInstalled  = $(False)
  NVRunInstalled    = $(False)
  BounceTpInstalled = $(False)
  NapStarted        = $(False)
  RebootNow         = $(False)
  MustBind          = $(False)
  LinkAdded         = $(False)
  LinkRemoved       = $(False)
  LinkChanged       = $(False)
  LinkChangedReboot = $(False)
  ClientsFound      = $(False)
  AdminFilesExist   = $(False)
  InstallAdminFiles = $(True)

  NM_Primary  = "Primary"
  NM_Backup   = "Backup"
  NM_Member   = "Member"
  NM_Client   = "Client"
  NapRole     = $(!NM_Primary)
  SvrNapRoles = { $(!NM_Primary), $(!NM_Backup), $(!NM_Member) }

  HelpFile    = "SNASETUP.HLP"
  MinID       = "100"
  MaxID       = "125"

[ProductNameVars]  ;NOTE! -- see [Source Media Descriptions] section
  !SNA_ProductName   = "SNA Server"
  !SNA_ProductFlavor = "SNA "$(!SNA_SetupMode)

[FreeSpaceVars]
  STF_VolList     = {} ? $(!LIBHANDLE) GetHardDriveLetters
  STF_VolFreeList = {} ? $(!LIBHANDLE) GetHardDriveFreeSpace

[DriveTypeVars]
  STF_DriveType   = {} ? $(!LIBHANDLE) GetTypeOfDrive $(SnaDrive)

[ProgressCopyVars]
  ProCaption   = "Copying Files..."
  ProCancel    = "&Cancel"
  ProCancelMsg = "Setup still needs to copy more files.  If you cancel now,"$(!LF)+
                 "the directory "$(!SNARootDir)" will be left as it is, and no"$(!LF)+
                 "system services will be created."$(!LF)$(!LF)+
                 "Are you sure you want to cancel?"
  ProCancelCap = $(!SNA_ProductFlavor)" Setup Warning"
  ProText1     = "Copying "           ; this spacing looks right in
  ProText2     = "         to "       ; the proportional font we use


[HelpContextIDs]
  IDD_WELCOME           = 101
  IDD_CHOOSEMETHOD      = 102
  IDD_DESTPATH          = 103
  IDD_LINKOPS           = 104
  IDD_OTHERPATH         = 105
  IDD_ENTERSERVICENAME  = 106
  IDD_LINKCONFIG        = 107
  IDD_SETUPOPTIONS      = 108
  IDD_CLNTSETUPOPTIONS  = 108
  IDD_CONFIRMREMSNA     = 109
  IDD_CONFIRMREMLS      = 110
  IDD_LAUNCHADMIN       = 111
  IDD_CLIENTTYPES       = 112
  IDD_SRVSETUPOPTIONS   = 113
  IDD_SERVERROLE        = 114
  IDD_SETUPMODE         = 115
  IDD_CLIENTMODE        = 116
  IDD_CLIENTSUCCESS     = 117
  IDD_REMOTESVRS        = 118
  IDD_SUCCESSREBOOT     = 119
  IDD_ADMINFILES        = 121
  IDD_WKSTASETUPOPTIONS = 122
  IDD_NOSTYPES          = 123
  IDD_NETWAREDOMAIN     = 124
  IDD_CLIENTPATH        = 125
; any more to add?  don't forget to check [EnterServiceName]!


[LoadSetupLibrary1stTime]
  set !LIBHANDLE = ""
  LoadLibrary "x" $(!STF_CWDDIR)\setupdll.dll !LIBHANDLE
  exit

[LoadSetupLibrary]
  set !LIBHANDLE = ""
  LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\setupdll.dll !LIBHANDLE
  exit

[FreeSetupLibrary]
  FreeLibrary $(!LIBHANDLE)
  set !LIBHANDLE = ""
  exit


[LoadDlgLibrary]
  set !DLGHANDLE = ""
  LoadLibrary "x" $(!STF_CWDDIR)$(!DialogLibrary) !DLGHANDLE
  exit

[FreeDlgLibrary]
  FreeLibrary $(!DLGHANDLE)
  set !DLGHANDLE = ""
  exit


[LoadNCPALibrary]
  set !NCPA_HANDLE = ""
  LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\NCPA.CPL !NCPA_HANDLE
  exit

[FreeNCPALibrary]
  FreeLibrary $(!NCPA_HANDLE)
  set !NCPA_HANDLE = ""
  exit


[LoadServiceLibrary]
  set !SVCHANDLE = ""
  LoadLibrary "x" $(!SNARootDir)"\SETUPSVC.DLL" !SVCHANDLE
  exit

[LoadSvrServiceLibrary]
  set !SVCHANDLE = ""
  LoadLibrary "x" $(!STF_CWDDIR)"\SETUPSVC.DLL" !SVCHANDLE
  exit

[FreeServiceLibrary]
  FreeLibrary $(!SVCHANDLE)
  set !SVCHANDLE = ""
  exit


[GetNtBuildNumber]
  set Status = STATUS_SUCCESSFUL
  OpenRegKey $(!REG_H_LOCAL), "", +
             "Software\Microsoft\Windows NT\CurrentVersion", +
             $(!REG_KEY_READ), KeyCurVer
  ifstr(i) $(KeyCurVer) != $(KeyNull)
    GetRegValue $(KeyCurVer) "CurrentBuild" BuildValue
    ifstr(i) $(BuildValue) != ""
      split-string *( $(BuildValue), 4 ), "." TmpStr
      set BuildNum = *( $(TmpStr), 3 )
    endif

    CloseRegKey $(KeyCurVer)
    set TmpStr = ""
    set BuildValue = {}
    return $(Status) $(BuildNum)

  else
    return STATUS_FAILED 999 ;;Assume they'll remove this regentry when NT ships

  endif


[InstallOption]
  read-syms "File Constants"
  read-syms "ProductNameVars"
  set TmpStr = ""

  ifstr(i) $(!NTN_InstallMode) == "configure"
    set TmpStr = "configure"
  else-ifstr(i) $(!NTN_InstallMode) == "deinstall"
    set TmpStr = "remove"
  else-ifstr(i) $(!NTN_InstallMode) == "fullremove"
    set TmpStr = "remove"
  endif

  ifstr(i) $(TmpStr) == "configure"
    shell $(SubroutineInf) SetupMessage $($0) STATUS +
          "Please run the SNA Admin program to configure "$(!SNA_ProductName)"."

  else-ifstr(i) $(TmpStr) == "remove"
    shell $(SubroutineInf) SetupMessage ENG STATUS +
          "Please run the SNA Setup program to remove "$(!SNA_ProductName)"."
  endif

  return STATUS_SUCCESSFUL


[Shell Commands]
  StartWait  ; Mouse pointer -> hourglass

  set-subst LF = "\n"
  set Exit_Code = 0

  install LoadSetupLibrary1stTime      ; happens to be %SystemRoot%\system32
                                       ; if not set otherwise in this script

  ifstr(i) $(STF_RANFROM) != ""        ; but we want it to point to where we
    set !STF_CWDDIR = $(STF_RANFROM)   ; ran our own (SNA) setup.exe
  endif

  read-syms "General Constants"
  read-syms UiVars
  detect    UiVars

  install FreeSetupLibrary

  ifstr(i) $(SNA_WORKSTATION) == ""
    set !SNA_WKSTA = $(!False)
  else
    set !SNA_WKSTA = $(!True)
    set !SNA_SetupMode = "Workstation"
  endif

  read-syms ProductNameVars
  set-title $(!SNA_ProductFlavor)" Setup"  ; Sets title for the Task List

  split-string $(STF_CWDDIR) "\" TmpCwdPathList

  ifcontains(i) *( $(TmpCwdPathList), 1 ) in $(STF_FLOPPYLIST)
    set !STF_FLOPPY_INSTALL = $(!True)
  else
    set !STF_FLOPPY_INSTALL = $(!False)
  endif

  read-syms "File Constants"

  SetHelpFile $(!STF_CWDDIR)$(HelpFile) $(MinID) $(MaxID)

  install LoadDlgLibrary

  ifstr(i) $(!DLGHANDLE) == ""
    shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) +
          "WARNING" +
          "Couldn't load "$(!DialogLibrary)"!  This library contains all"$(!LF)+
          "the dialogs needed by the "$(!SNA_ProductFlavor)" Setup program."$(!LF)+
          $(!LF)+
          "Please find this file and copy it into the same directory"$(!LF)+
          "from which you ran Setup."
    goto End
  endif

  read-syms BillboardDlg
  set TextFields = { "Please wait while your system configuration is analyzed." }
  ui start "IDD_BILLBOARD" $(!DLGHANDLE)

  shell $(!UtilInfFile) FindRootDir
  ifstr(i) $($R0) == STATUS_SUCCESSFUL
    set _RootDir = $($R1)
    set !SNARootDir = $(_RootDir)
    set !SNA_SetupMode = $($R2)
    read-syms ProductNameVars

    shell "" InstallCheck
    ifstr(i) $($R0) == "No"
      set !InitialInstall = $(!True)
      set !IconsInstalled = $(!False)
    else
      set !InitialInstall = $(!False)
      set !IconsInstalled = $(!True)
    endif

  else
    set _RootDir = ""
    set !InitialInstall = $(!True)
    set !IconsInstalled = $(!False)

  endif

  ifstr(i) $(!InitialInstall) == $(!False)
    ifstr(i) $(_RootDir) == ""
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) FATAL +
            "The "$(!SNA_ProductFlavor)" files have been detected on your"$(!LF)+
            "computer (in "$(!SNARootDir)"), but there are no"$(!LF)+
            "entries for "$(!SNA_ProductFlavor)" in the Windows NT"$(!LF)+
            "Registry.  Suggest you delete all of "$(!SNARootDir)" and"$(!LF)+
            "install this machine again from scratch."
      goto End
    endif
    ifstr(i) $(!STF_CWDDIR) != $(!SNARootDir)"\"
      goto NetworkSetupPostInstall
    endif
  endif

  shell "" GetNtBuildNumber
  ifstr(i) $($R0) == STATUS_SUCCESSFUL
    set !STF_NTBUILDNUM = $($R1)
  else
    set !STF_NTBUILDNUM = 999
  endif

  ifint $(!STF_NTBUILDNUM) < 438
    shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) FATAL +
          "Setup has detected build "$(!STF_NTBUILDNUM)" of Windows NT"+
          " on this machine.  The earliest version which supports SNA"+
          " Server is 438, with 475 or later recommended for best performance."+
          $(!LF)$(!LF)"Please upgrade to a newer version of Windows NT before"+
          " installing SNA Server."
    goto End
  endif

  set !STF_BUSTYPE = "ISA"
  shell $(!UtilInfFile) GetBusType
  ifstr(i) $($R0) == STATUS_SUCCESSFUL
    set !STF_BUSTYPE = $($R1)
  endif

  install LoadSetupLibrary

  ifstr(i) $(!LIBHANDLE) == ""
    exit
  endif ;fubar


; LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
;                  $(!SNARootDir)"\SETUPSVC.DLL"
;
; ifstr(i) $(ExistStatus) == "YES"
;   ifstr(i) $(!InitialInstall) == $(!False)
;     install LoadServiceLibrary
;   endif
; else
;   LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
;                    $(!STF_CWDDIR)"\SETUPSVC.DLL"
;
;   ifstr(i) $(ExistStatus) == "YES"
;     install LoadSvrServiceLibrary
;
;   else
;     shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) FATAL +
;           "Could not load SETUPSVC.DLL locally or from the server."
;   endif
;
; endif

  ifstr(i) $(!InitialInstall) == $(!True)
    install LoadSvrServiceLibrary
  else
    install LoadServiceLibrary
  endif

  LibraryProcedure ExistStatus $(!SVCHANDLE) SNAQueryAdmin

  ifstr(i) $(ExistStatus) == "ADMIN"
    goto VerifyInstallSrv
  endif

  shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) FATAL +
        "Before you can set up "$(!SNA_ProductFlavor)" on this machine, you need to log on "+
        "either as ""Administrator"" or another user in the local Administrators group."+
        $(!LF)$(!LF)$(!SNA_ProductFlavor)" Setup cannot continue without Administrator privileges."
  goto End


VerifyInstallSrv =+
  ifstr(i) $(!InitialInstall) == $(!False)
    goto NosCheck
  endif

  ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!True)
    goto NosCheck
  endif

  LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
                   $(!STF_CWDDIR)"\system\ctl3d32.dll"
  ifstr(i) $(ExistStatus) == "NO"
    LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
                     $(!STF_CWDDIR)"\system\ctl3d32.dl$"
    ifstr(i) $(ExistStatus) == "NO"
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) FATAL +
            "You cannot set up a new SNA Server from one that"$(!LF)+
            "has already been installed."$(!LF)$(!LF)+
            "You need to run Setup from the original SNA Server"$(!LF)+
            "installation point (either diskettes or the ""master"""$(!LF)+
            "network tree)."
      goto End
    endif
  endif


NosCheck =+
  LibraryProcedure DomResult $(!SVCHANDLE) SNAGetLMDomain
  ifstr(i) $(DomResult) != ""
    set !SNA_NetwareDomain = $(DomResult)
  endif

  ifstr(i) $(!SNA_SetupMode) == "Workstation"
    goto EndNosCheck
  endif

  LibraryProcedure NosResult $(!SVCHANDLE) SNAGetNosTypesInstalled

  set NosTypesInstalled = {}
  set !SNA_NosCount = 0

  ForListDo $(NosResult)
    ifstr(i) *( $($), 2 ) == "Yes"

      set ThisNos = *( $($), 1 )
      set NosTypesInstalled = >( $(NosTypesInstalled), $(ThisNos) )
      set-add !SNA_NosCount = $(!SNA_NosCount), 1

      ifstr(i) $(ThisNos) == $(!NOS_Lanman)
        set !SNA_NosLanman   = $(!True)
        set !SNA_DoNosLanman = $(!True)
      endif

      ifstr(i) $(ThisNos) == $(!NOS_Netware)
        set !SNA_NosNetware   = $(!True)
        set !SNA_DoNosNetware = $(!True)
      endif

    endif
  EndForListDo


EndNosCheck =+
  install FreeServiceLibrary
  install FreeSetupLibrary

  ifstr(i) $(!SNA_SetupMode) == "Server"
    set !InstallAdminFiles = $(!True)

  else-ifstr(i) $(!SNA_SetupMode) == "Workstation"
    set !InstallAdminFiles = $(!True)

  else
    set !InstallAdminFiles = $(!False)

  endif

  set !DriverDir    = $(!STF_CWDDIR)"system\hwsetup\"
  set !CurDriverDir = "A:\"

  shell $(!UtilInfFile) EnumerateDrivers $(!DriverDir)

  ;
  ; This piece of code adds the LOCALLY_INSTALLED value to each of
  ; the available drivers.
  ;
  set !DriversAvailable = {}
  ForListDo $($R1)
    set $ = >( $($), "LOCAL" )
    set $ = >( $($), $(!DriverDir) )
    set !DriversAvailable = >( $(!DriversAvailable), $($) )
  EndForListDo

  ifstr(i) $(!InitialInstall) == $(!False)
    set !DriverDir = "A:\"
    set !CurDriverDir = "A:\"
  endif

  ifstr(i) $(!InitialInstall) == $(!False)
    shell $(!UtilInfFile) EnumSNAServices
    set !_SNAServiceList = $($R1)
    set !SNAServiceList  = {}
    set !LinkServiceList = {}

    ;
    ; Look at all the SNA Services in the registry to see
    ; what's installed.
    ;
    ForListDo $(!_SNAServiceList)
      set TmpServiceType = *( $($), 3 )

      ifcontains(i) $(TmpServiceType) in $(!LinkTypeList)
        set !LinkServiceList = >( $(!LinkServiceList), $($) )

      else-ifcontains(i) $(TmpServiceType) in $(!NapTypeList)
        set !NapInstalled = $(!True)
        set !SNAServiceList = >( $(!SNAServiceList), $($) )

      else-ifint $(TmpServiceType) == 1   ; Node, similarly
        set !NodeInstalled = $(!True)
        set !SNAServiceList = >( $(!SNAServiceList), $($) )

      else-ifint $(TmpServiceType) == 17  ; SnaNetMn, similarly
        set !SNANetInstalled = $(!True)
        set !SNAServiceList = >( $(!SNAServiceList), $($) )

      else-ifint $(TmpServiceType) == 5   ; BounceTp, same
        set !BounceTpInstalled = $(!True)
        set !SNAServiceList = >( $(!SNAServiceList), $($) )

      else-ifint $(TmpServiceType) == 97  ; NVRunCmd, similarly
        set !NVRunInstalled = $(!True)
        set !SNAServiceList = >( $(!SNAServiceList), $($) )

      else-ifint $(TmpServiceType) == 98  ; NVAlerter, similarly
        set !NVAlertInstalled = $(!True)
        set !SNAServiceList = >( $(!SNAServiceList), $($) )

      endif

    EndForListDo
  endif

  ifstr(i) $(!InitialInstall) == $(!True)
    goto EndInit
  endif

  ;
  ; Start the NAP if it's not already going
  ;
  install LoadServiceLibrary

  ifstr(i) $(!SVCHANDLE) == ""
    goto EndInit
  endif

  LibraryProcedure NapStatus $(!SVCHANDLE) SNAQueryService "SnaBase"

  install FreeServiceLibrary

  set !NapStarted = $(!False)
  ifstr(i) $(NapStatus) != "SERVICE_STOPPED"
    set !NapStarted = $(!True)
    goto EndInit
  endif

  shell $(!UtilInfFile) StartService "SnaBase"

  ifstr(i) $($R0) == STATUS_FAILED
    shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL +
          "The SNABase service couldn't be started."
    set !NapStarted = $(!False)
  else
    set !NapStarted = $(!True)
  endif


EndInit =+
  ui pop 1  ; Remove Init billboard

  EndWait


Welcome =+
  shell "" DoWelcome

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    goto End

  endif

  ifstr(i) $(!InitialInstall) == $(!False)
    goto SetupOptions
  endif

  ifstr(i) $(!SNA_SetupMode) != "Workstation"
    ifint $(!SNA_NosCount) == 0
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) WARNING +
            "Setup cannot detect any network (Novell Netware, Microsoft Network, or other) on this computer,"+
            " and the "$(!SNA_ProductFlavor)" cannot function without one."$(!LF)$(!LF)+
            "You may continue installing the "$(!SNA_ProductFlavor)", but it will"+
            " not work correctly until this machine's network is properly"+
            " installed and configured."

      ifstr(i) $($R1) == "Cancel"
        goto End
      endif
    endif
  endif


SetupMode =+
  ifstr(i) $(!InitialInstall) == $(!True)

    ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!True)
      shell "" DoSetupMode

      ifstr(i) $($R0) == STATUS_FAILED
        goto End

      else-ifstr(i) $($R0) == STATUS_USEREXIT
        shell "" ExitCheck
        ifstr(i) $($R0) == $(!True)
          goto End
        else
          goto SetupMode
        endif

      else-ifstr(i) $($R0) == STATUS_GOBACK
        goto Welcome

      endif

      set !SNA_SetupMode = $($R1)
      ifstr(i) $(!SNA_SetupMode) == "Client"
        set !NapRole = $(!NM_Client)
      endif

    else
      ifstr(i) $(!SNA_WKSTA) == $(!True)
        set !SNA_SetupMode = "Workstation"

      else
        install LoadSetupLibrary

        LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
                         $(!STF_CWDDIR)"\"$(!ServerChkFile)

        ifstr(i) $(ExistStatus) == "YES"
          set !SNA_SetupMode = "Server"
        else
          set !SNA_SetupMode = "Client"
          set !NapRole = $(!NM_Client)
        endif

        install FreeSetupLibrary
      endif

    endif

    read-syms ProductNameVars

  endif


DestPath =+
  shell "" DoDestPath

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck

    ifstr(i) $($R0) == $(!True)
      goto End
    else
      goto DestPath
    endif

  else-ifstr(i) $($R0) == STATUS_GOBACK
    ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!True)
      goto SetupMode
    else
      goto Welcome
    endif

  endif

  set CameFrom = "DestPath"

  ifstr(i) $(!SNA_SetupMode) == "Workstation"
    goto InstallFiles
  endif


NosTypes =+
  ifint $(!SNA_NosCount) < 2
    goto NetwareDomain
  endif

  shell "" DoNosTypes

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck
    ifstr(i) $($R0) == $(!True)
      goto End
    else
      goto NosTypes
    endif

  else-ifstr(i) $($R0) == STATUS_GOBACK
    goto DestPath

  endif


NetwareDomain =+
  set CameFrom = "NetwareDomain"

  ifstr(i) $(!SNA_DoNosNetware) == $(!True)
    ifstr(i) $(!SNA_DoNosLanman) == $(!False)
      goto NDSkip1
    endif
  endif

  ifstr(i) $(!SNA_SetupMode) == "Server"
    goto ServerRole
  else
    goto SetClientMode
  endif

NDSkip1 =+
  shell "" DoNetwareDomain

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck
    ifstr(i) $($R0) == $(!True)
      goto End
    else
      goto NetwareDomain
    endif

  else-ifstr(i) $($R0) == STATUS_GOBACK
    ifint $(!SNA_NosCount) > 1
      goto NosTypes
    else
      goto DestPath
    endif

  endif

  ifstr(i) $(!SNA_SetupMode) == "Server"
    goto ServerRole
  else
    goto SetClientMode
  endif


SetClientMode =+
  shell "" DoClientMode

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck

    ifstr(i) $($R0) == $(!True)
      goto End
    else
      goto SetClientMode
    endif

  else-ifstr(i) $($R0) == STATUS_GOBACK
    ifstr(i) $(CameFrom) == "SetupOptions"
      goto SetupOptions
    else
      ifstr(i) $(!SNA_DoNosNetware) == $(!True)
        ifstr(i) $(!SNA_DoNosLanman) == $(!False)
          goto NetwareDomain
        endif
      endif

      ifint $(!SNA_NosCount) > 1
        goto NosTypes
      else
        goto DestPath
      endif
    endif
  endif

  ifstr(i) $(!ClientMode) == $(!ClientLocal)
    ifstr(i) $(CameFrom) == "SetupOptions"
      goto SetupOptions
    else
      goto SetAdminFiles
    endif
  endif


SetRemoteServers =+
  shell "" DoRemoteServers

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck
    ifstr(i) $($R0) == $(!True)
      goto End
    else
      goto SetRemoteServers
    endif

  else-ifstr(i) $($R0) == STATUS_GOBACK
    goto SetClientMode

  endif

  ifstr(i) $(CameFrom) == "SetupOptions"
    goto SetupOptions
  endif


SetAdminFiles =+
  shell "" DoAdminFiles

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck
    ifstr(i) $($R0) == $(!True)
      goto End
    else
      goto SetAdminFiles
    endif

  else-ifstr(i) $($R0) == STATUS_GOBACK
    ifstr(i) $(!ClientMode) == $(!ClientLocal)
      goto SetClientMode
    else-ifstr(i) $(!ClientMode) == $(!ClientRemote)
      goto SetRemoteServers
    endif

  endif
  goto InstallFiles


ClientTypes =+
  read-syms ClientCheckFiles

  ; If we've just come from the SetupOptions dialog, we're doing a
  ; maintenance-mode setup and we don't know where to get the client
  ; files (as we did on the initial setup).  So we ask.

  ;bugbug: swap following 2 paragraphs?

  ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!True)
    set !ClientsFound = $(!True)
    set !ClientInstalls = { $(!Chosen), $(!Chosen), $(!Chosen), $(!Chosen) }
    goto AskAboutClients
  endif

  ifstr(i) $(CameFrom) != "SetupOptions"
    set !ClientSrcDir = $(!STF_CWDDIR)"\clients\"  ; during initial install only
  endif

  ifstr(i) $(CameFrom) == "SetupOptions"
    shell "" ObtainPath ClientSrcPathDlg

    ifstr(i) $($R0) != STATUS_SUCCESSFUL
      goto SetupOptions
    endif

    set !ClientSrcDir = $($R1)
    set !ClientsFound = $(!False)
  endif

  GetDriveInPath !ClientDrive $(!ClientSrcDir)

  ifstr(i) $(!ClientsFound) == $(!False)
    install LoadSetupLibrary

    ifstr(i) $(CameFrom) != "SetupOptions"
      set !ClientsFound = $(!True)
      set !ClientInstalls = {    $(!Chosen),              +
                              *( $(!ClientInstalls), 2 ), +
                              *( $(!ClientInstalls), 3 ), +
                              *( $(!ClientInstalls), 4 ) }
    else
      set ExistStatus = "YES"

      ifcontains(i) $(!ClientDrive) in $(!STF_FLOPPYLIST)
        set !ClientsFound = $(!True)
      else
        LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
                         $(!SNARootDir)"\"$(CheckFileNTLoc)
      endif
      ifstr(i) $(ExistStatus) == "YES"
          set !ClientInstalls = {    $(!Chosen),              +
                                  *( $(!ClientInstalls), 2 ), +
                                  *( $(!ClientInstalls), 3 ), +
                                  *( $(!ClientInstalls), 4 ) }
      else
          set !ClientInstalls = {    $(!NotChosen),           +
                                  *( $(!ClientInstalls), 2 ), +
                                  *( $(!ClientInstalls), 3 ), +
                                  *( $(!ClientInstalls), 4 ) }
      endif

      ifcontains(i) $(!ClientDrive) in $(!STF_FLOPPYLIST)
      else
        LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
                       $(!ClientSrcDir)$(CheckFileDos)
      endif
      ifstr(i) $(ExistStatus) == "YES"
          set !ClientsFound = $(!True)
          set !ClientInstalls = { *( $(!ClientInstalls), 1 ), +
                                     $(!Chosen),              +
                                  *( $(!ClientInstalls), 3 ), +
                                  *( $(!ClientInstalls), 4 ) }
      else
          set !ClientInstalls = { *( $(!ClientInstalls), 1 ), +
                                     $(!NotChosen),           +
                                  *( $(!ClientInstalls), 3 ), +
                                  *( $(!ClientInstalls), 4 ) }
      endif

      ifcontains(i) $(!ClientDrive) in $(!STF_FLOPPYLIST)
      else
        LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
                         $(!ClientSrcDir)$(CheckFileWin16)
      endif
      ifstr(i) $(ExistStatus) == "YES"
          set !ClientsFound = $(!True)
          set !ClientInstalls = { *( $(!ClientInstalls), 1 ), +
                                  *( $(!ClientInstalls), 2 ), +
                                     $(!Chosen),              +
                                  *( $(!ClientInstalls), 4 ) }
      else
          set !ClientInstalls = { *( $(!ClientInstalls), 1 ), +
                                  *( $(!ClientInstalls), 2 ), +
                                     $(!NotChosen),           +
                                  *( $(!ClientInstalls), 4 ) }
      endif

      ifcontains(i) $(!ClientDrive) in $(!STF_FLOPPYLIST)
      else
        LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
                         $(!ClientSrcDir)$(CheckFileOs2)
      endif
      ifstr(i) $(ExistStatus) == "YES"
          set !ClientsFound = $(!True)
          set !ClientInstalls = { *( $(!ClientInstalls), 1 ), +
                                  *( $(!ClientInstalls), 2 ), +
                                  *( $(!ClientInstalls), 3 ), +
                                     $(!Chosen) }
      else
          set !ClientInstalls = { *( $(!ClientInstalls), 1 ), +
                                  *( $(!ClientInstalls), 2 ), +
                                  *( $(!ClientInstalls), 3 ), +
                                     $(!NotChosen) }
      endif
    endif

    install FreeSetupLibrary
  endif

  ifstr(i) $(!ClientsFound) == $(!False)
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL +
            "Setup could not find any subdirectories of "$(!ClientSrcDir)+
            " which contain SNA Client software."$(!LF)$(!LF)+
            "The possible subdir names are WINNT, WIN3X, MSDOS, and OS2;"+
            "  each of these subdirs should contain the SNA Client software"+
            " for that operating system.  Alternatively, you may specify a"+
            " floppy drive (A: or B:)."
      goto ClientTypes
  endif

AskAboutClients =+
; shell "" DoClientTypes $(!ClientSrcDir)
  shell "" DoClientTypes

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck

    ifstr(i) $($R0) == $(!True)
      goto End
    else
      goto ClientTypes
    endif

  else-ifstr(i) $($R0) == STATUS_GOBACK
    ifstr(i) $(CameFrom) == "SetupOptions"
      goto $(CameFrom)
    else
      goto ServerRole
    endif

  else  ; sucessful
    ifstr(i) $(CameFrom) != "SetupOptions"
      goto InstallFiles
    endif

    ; None checked?  Take a hike.

    set DoClients = $(!False)
    ForListDo $(!ClientInstalls)
      ifstr(i) $($) == $(!Chosen)
        set DoClients = $(!True)
      endif
    EndForListDo

    ifstr(i) $(DoClients) == $(!True)
      ForListDo { NT, DOS, WIN16, OS2 }
        read-syms ClientDirList$($)
      EndForListDo

      read-syms DestTree5250DirList
      read-syms ProgressCopyVars

      set STF_DECOMPRESS = ""

      install InstallClientFiles

    endif

    goto SetupOptions
  endif


SetupOptions =+
  shell "" DoSetupOptions

  set BackLabel = ""

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    goto SuccessInstall

  else-ifstr(i) $($R0) == STATUS_GOBACK
    ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!True)
      goto SetupMode
    else
      goto Welcome
    endif

  else-ifstr(i) $($R0) == STATUS_CONTINUE
    goto SuccessInstall

  endif

  set BackLabel = "SetupOptions"
  set LSReturn  = "SetupOptions"
  set CameFrom  = "SetupOptions"

  ifstr(i) $(!SNA_SetupMode) == "Server"

    ifstr(i) $(SetupOption) == $(OptionConfig)
      set !Install4 = $(!True)
      set !LSReturn = "SetupOptions"
      goto LinkServiceStuff

    else-ifstr(i) $(SetupOption) == $(OptionChange)
      goto ServerRole

    else-ifstr(i) $(SetupOption) == $(OptionClient)
      goto ClientTypes

    else-ifstr(i) $(SetupOption) == $(OptionRemove)
      goto ConfirmRemove

    endif

  else-ifstr(i) $(!SNA_SetupMode) == "Client"

    ifstr(i) $(SetupOption) == $(OptionConfig)
      goto SetClientMode

    else-ifstr(i) $(SetupOption) == $(OptionChange)  ;for the client dialog, this is "remove"
      goto ConfirmRemove

    endif

  else-ifstr(i) $(!SNA_SetupMode) == "Workstation"

    ifstr(i) $(SetupOption) == $(OptionConfig)
      set !Install4 = $(!True)
      set !LSReturn = "SetupOptions"
      goto LinkServiceStuff

    else-ifstr(i) $(SetupOption) == $(OptionChange)  ;for the wksta dialog, this is "remove"
      goto ConfirmRemove

    endif
  endif


ServerRole =+
  shell "" DoServerRole

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck

    ifstr(i) $($R0) == $(!True)
      goto End
    else
      goto ServerRole
    endif

  else-ifstr(i) $($R0) == STATUS_GOBACK
    ifstr(i) $(CameFrom) == "SetupOptions"
      goto SetupOptions
    else
      ifstr(i) $(!SNA_DoNosNetware) == $(!True)
        ifstr(i) $(!SNA_DoNosLanman) == $(!False)
          goto NetwareDomain
        endif
      endif

      ifint $(!SNA_NosCount) > 1
        goto NosTypes
      else
        goto DestPath
      endif
    endif
  endif

  ifstr(i) $(CameFrom) == "SetupOptions"
    goto SetupOptions
  else
    goto ClientTypes
  endif


InstallFiles =+
  shell "" DoReview

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck

    ifstr(i) $($R0) == $(!True)
      goto End
    else
      goto InstallFiles
    endif

  else-ifstr(i) $($R0) == STATUS_REVIEW
    goto SetupMode

  endif

  shell "" DoInstallFiles

  ifstr(i) $($R0) == STATUS_USERQUIT
    goto ExitUserAbortCopy
  else-ifstr(i) $($R0) == STATUS_FAILED
    goto End
  endif

  set !FilesInstalled = $(!True)
  set !Install4       = $(!False)

  ;
  ; Set the path to the tracefile directory.
  ;
  set !SNATraceDir = $(!SNARootDir)"\"$(!SNATraceDirName)"\"

InstallBaseServices =+
  set BillFlag = $(!True)
  ifstr(i) $(!NapInstalled) == $(!True)
    set BillFlag = $(!False)
  endif

  ifstr(i) $(BillFlag) == $(!True)
    read-syms BillboardDlg

    set TextFields = { "Creating and configuring the "$(!SNA_ProductFlavor)"..." }
    ui start "IDD_BILLBOARD" $(!DLGHANDLE)
  endif

  set TmpDeps = {}
  ifstr(i) $(!SNA_SetupMode) != "Workstation"

    ifstr(i) $(!SNA_NosLanman) == $(!True)
      ifstr(i) $(!SNA_DoNosLanman) == $(!True)
        set TmpDeps = >( $(TmpDeps), "LanmanWorkstation" )
        ifstr(i) $(!SNA_SetupMode) == "Server"
          set TmpDeps = >( $(TmpDeps), "LanmanServer" )
        endif
      endif
    endif

;   ifstr(i) $(!SNA_NosNetware) == $(!True)
;     ifstr(i) $(!SNA_DoNosNetware) == $(!True)
;       set TmpDeps = >( $(TmpDeps), "NetwareServiceName" )   ; BUGBUG: find out what this really is
;     endif
;   endif

  endif

  ifstr(i) $(!SNA_SetupMode) == "Client"
    set TmpNapType = "CESCLIENTNAP"
  else
    set TmpNapType = "CESSERVERNAP"
  endif

  ifstr(i) $(BillFlag) == $(!True)
    set TextFields = { "Creating service: SnaBase" }
    ui start "IDD_BILLBOARD" $(!DLGHANDLE)
  endif

  ifstr(i) $(!NapInstalled) == $(!False)
    shell $(!UtilInfFile) CreateSNAService +
      "SnaBase",  +
      $(TmpNapType), +
      "", +
      $(TmpDeps), +
      { +
        { "Role",           $(NoTitle), $(!REG_VT_SZ), $(!NapRole) }, +
        { "ConfigFilePath", $(NoTitle), $(!REG_VT_SZ), "" }, +
        { "Sponsors",       $(NoTitle), $(!REG_VT_MULTI_SZ), { $(!RemoteSvr1), $(!RemoteSvr2) } },  +
      },  +
      {}, +
      "", +
      "", +
      ""

    set !NapInstalled = $(!True)

    ifstr(i) $($R0) == STATUS_SUCESSFUL
      CloseRegKey $($R1)
      CloseRegKey $($R2)
      CloseRegKey $($R3)
    endif

  endif

  ifstr(i) $(!SNA_SetupMode) == "Client"
    goto InstallNVStuff
  endif

  ifstr(i) $(BillFlag) == $(!True)
    set Textfields = { "Creating service: SnaServr" }
    ui start "IDD_BILLBOARD" $(!DLGHANDLE)
  endif

  ifstr(i) $(!NodeInstalled) == $(!False)
    shell $(!UtilInfFile) CreateSNAService +
          "SnaServr", "CES21", "", {"SnaBase"}, {}, {}, "", "", ""

    set !NodeInstalled = $(!True)

    ifstr(i) $($R0) == STATUS_SUCESSFUL
      CloseRegKey $($R1)
      CloseRegKey $($R2)
      CloseRegKey $($R3)
    endif

    shell $(!UtilInfFile) CreateSNARegEntry $(!NTN_SoftwareBase)"\Microsoft", "SNA Server", "CurrentVersion"

    ifstr(i) $($R0) == STATUS_SUCCESSFUL
      set KeyProductBase  = $($R1)
      set KeyProduct      = $($R2)
      set KeyServiceIndex = $($R3)
      set KeyNetRules     = $($R4)

      shell $(!UtilInfFile) AddValueList $(KeyServiceIndex), +
            { +
                { "ServiceName",  $(NoTitle), $(!REG_VT_SZ),  "SnaServr" }, +
                { "SoftwareType", $(NoTitle), $(!REG_VT_SZ),  "service" }, +
                { "SNAVersion",   $(NoTitle), $(!REG_VT_SZ),  "2.0" }, +
                { "Title",        $(NoTitle), $(!REG_VT_SZ),  "SNA Server" }, +
                { "Description",  $(NoTitle), $(!REG_VT_SZ),  "SNA Server Service" }, +
                { "PathName",     $(NoTitle), $(!REG_VT_SZ),  $(!SNARootDir)"\system" } +
            }

      set NRClass    = { "snaservice basic", "snalink basic" }
      set NRBindable = { "snaservice snalink non non 100" }

      shell $(!UtilInfFile) AddValueList $(KeyNetRules), +
            { +
                { "class",       $(NoTitle), $(!REG_VT_MULTI_SZ), $(NRClass) }, +
                { "type",        $(NoTitle), $(!REG_VT_SZ),       "snaserver snaservice" }, +
                { "use",         $(NoTitle), $(!REG_VT_SZ),       "service yes yes" }, +
                { "InfName",     $(NoTitle), $(!REG_VT_SZ),       $(!SNARootDir)"\setup.inf" }, +
                { "InfOption",   $(NoTitle), $(!REG_VT_SZ),       "SnaServer" }, +
                { "bindform",    $(NoTitle), $(!REG_VT_SZ),       """SnaServer"" yes yes container" }, +
                { "bindable",    $(NoTitle), $(!REG_VT_MULTI_SZ), $(NRBindable) } +
            }

      CloseRegKey $(KeyNetRules)
      CloseRegKey $(KeyServiceIndex)
      CloseRegKey $(KeyProduct)
      CloseRegKey $(KeyProductBase)

  endif

  ifstr(i) $(BillFlag) == $(!True)
    set TextFields = { "Creating service: SnaNetMn" }
    ui start "IDD_BILLBOARD" $(!DLGHANDLE)
  endif

  ifstr(i) $(!SNANetInstalled) == $(!False)
    shell $(!UtilInfFile) CreateSNAService +
          "SnaNetMn", "CESNETMN", "", {"SnaBase"}, {}, {}, "", "", ""

    set !SNANetInstalled = $(!True)

    ifstr(i) $($R0) == STATUS_SUCESSFUL
      CloseRegKey $($R1)
      CloseRegKey $($R2)
      CloseRegKey $($R3)
    endif

  endif


; ifstr(i) $(!BounceTpInstalled) == $(!False)
;   shell $(!UtilInfFile) CreateSNAService +
;         "BounceTp", "CESQTP", "", {}, {}, {}, "", "", ""
;
;   set !BounceTpInstalled = $(!True)
;
;   ifstr(i) $($R0) == STATUS_SUCESSFUL
;     CloseRegKey $($R1)
;     CloseRegKey $($R2)
;     CloseRegKey $($R3)
;   endif
; endif


InstallNVStuff =+
  ;
  ; We should only install the NVAlert service on machines that
  ; also have a node installed.
  ;

  ifstr(i) $(BillFlag) == $(!True)
    set TextFields = { "Creating service: NVAlert" }
    ui start "IDD_BILLBOARD" $(!DLGHANDLE)
  endif

  ifstr(i) $(!NVAlertInstalled) == $(!False)
    shell $(!UtilInfFile) CreateSNAService +
          "NVAlert", "NVALERT", +
          $(!SNARootDir)"\system\nvalert.exe", +
          {"EventLog","SnaBase"}, $(NVAlertParams), {}, +
          $(!SNARootDir)"\"$(!SNABinDir)"\NVALERT.DLL", "7", "Application"

    set TmpKey = $($R1)
    CloseRegKey $($R2)
    CloseRegKey $($R3)

    OpenRegKey $(TmpKey) "" "EventLogModuleName" +
               $(MaskAllAccess) KeyEventName

    ifstr(i) $(KeyEventName) == $(KeyNull)
      CreateRegKey $(TmpKey) +
                   {"EventLogModuleName",$(NoTitle),$(MaskAllAccess)} +
                   "" $(MaskAllAccess) "" KeyEventName
    endif

    ifstr(i) $(KeyEventName) != $(KeyNull)
      shell $(!UtilInfFile) AddValueList $(KeyEventName) +
            { +
               { "1", $(NoTitle), $(!REG_VT_SZ), "System" },      +
               { "2", $(NoTitle), $(!REG_VT_SZ), "Application" }, +
               { "3", $(NoTitle), $(!REG_VT_SZ), "Security" }     +
            }
      CloseRegKey $(KeyEventName)
    endif

    set !NVAlertInstalled = $(!True)

    CloseRegKey $(TmpKey)
  endif

  ifstr(i) $(!SNA_SetupMode) != "Client"

  ifstr(i) $(BillFlag) == $(!True)
    set TextFields = { "Creating service: NVRunCmd" }
    ui start "IDD_BILLBOARD" $(!DLGHANDLE)
  endif

  ifstr(i) $(!NVRunInstalled) == $(!False)
    shell $(!UtilInfFile) CreateSNAService +
          "NVRunCmd", "NVRUNCMD", +
          $(!SNARootDir)"\system\nvruncmd.exe", +
          {"EventLog","SnaBase"}, $(NVRunParams), {}, +
          $(!SNARootDir)"\"$(!SNABinDir)"\NVRUNCMD.DLL", "7", "Application"

    set TmpKey = $($R1)
    CloseRegKey $($R2)
    CloseRegKey $($R3)

    OpenRegKey $(TmpKey) "" "ExtensionDLLs" +
               $(MaskAllAccess) KeyEventName

    ifstr(i) $(KeyEventName) == $(KeyNull)
      CreateRegKey $(TmpKey) +
                   {"ExtensionDLLs",$(NoTitle),$(MaskAllAccess)} +
                   "" $(MaskAllAccess) "" KeyEventName
    endif

    ifstr(i) $(KeyEventName) != $(KeyNull)
      shell $(!UtilInfFile) AddValueList $(KeyEventName) +
            { +
               { "1", $(NoTitle), $(!REG_VT_SZ), "cmddll\1.0" }, +
            }
      CloseRegKey $(KeyEventName)
    endif

    OpenRegKey $(!REG_H_LOCAL) "" "Software\Microsoft\NVRunCmd" +
               $(MaskAllAccess) KeyEventName

    ifstr(i) $(KeyEventName) == $(KeyNull)
      CreateRegKey $(!REG_H_LOCAL) +
                   {"Software\Microsoft\NVRunCmd",$(NoTitle),$(MaskAllAccess)} +
                   "" $(MaskAllAccess) "" KeyEventName
      CreateRegKey $(KeyEventName) +
                   {"cmddll",$(NoTitle),$(MaskAllAccess)} +
                   "" $(MaskAllAccess) "" KeyCmdDll
      CreateRegKey $(KeyCmdDll) +
                   {"1.0",$(NoTitle),$(MaskAllAccess)} +
                   "" $(MaskAllAccess) "" Key10

      ifstr(i) $(Key10) != $(KeyNull)
        shell $(!UtilInfFile) AddValueList $(Key10) +
              { +
                 { "Pathname", $(NoTitle), $(!REG_VT_SZ), +
                     $(!SNARootDir)"\"$(!SNABinDir)"\nvcmd.dll" }, +
              }
        CloseRegKey $(Key10)
      endif

      CloseRegKey $(KeyCmdDll)
      CloseRegKey $(KeyEventName)

    endif

    set !NVRunInstalled = $(!True)

    CloseRegKey $(TmpKey)
  endif

  endif ; if SNA_SetupMode != Client


SkipNodeInstall =+
  ifstr(i) $(BillFlag) == $(!True)
    set TextFields = { "Making SNA Server registry entries..." }
    ui start "IDD_BILLBOARD" $(!DLGHANDLE)
  endif

  ;
  ; Write SnaDomain if necessary
  ;
  ifstr(i) $(!SNA_DoNosNetware) == $(!True)
    set KeyParams = $(!KeyNull)
    OpenRegKey $(!REG_H_LOCAL), "", +
               "System\CurrentControlSet\Services\SnaBase\Parameters", +
               $(!REG_KEY_READWRITE), KeyParams
    ifstr(i) $(KeyParams) != $(!KeyNull)
      SetRegValue $(KeyParams) { "SnaDomain", 0, $(!REG_VT_SZ), $(!SNA_NetwareDomain) }
      CloseRegKey $(KeyParams)
    endif
  endif

  ;
  ; Add any necessary additional EventLog entries.
  ;
  OpenRegKey $(!REG_H_LOCAL), "", +
             "System\CurrentControlSet\Services\EventLog\Application", +
             $(!REG_KEY_READWRITE), KeyProduct

  ifstr(i) $(KeyProduct) != $(KeyNull)

    ForListDo $(!SNAEventLogEntries)

      CreateRegKey $(KeyProduct), +
                   { $($), $(NoTitle), $(MaskAllAccess) }, +
                   "", $(MaskAllAccess), "", KeyDriver

      ifstr(i) $(KeyDriver) != $(KeyNull)
        shell $(!UtilInfFile) AddValueList $(KeyDriver) +
              { +
                 { "EventMessageFile", $(NoTitle), $(!REG_VT_EXPAND_SZ), +
                      $(!SNARootDir)"\"$(!SNABinDir)"\SNAEVENT.DLL" }, +
                 { "TypesSupported", $(NoTitle), $(!REG_VT_DWORD), "7" } +
              }

        CloseRegKey $(KeyDriver)
      endif

    EndForListDo

    CloseRegKey $(KeyProduct)
  endif

  ;
  ; Create various registry entries required for performance monitoring.
  ;
  install LoadServiceLibrary
  ifstr(i) $(!SVCHANDLE) != ""

    ifstr(i) $(BillFlag) == $(!True)
      set TextFields = { "Creating Performance Monitor information..." }
      ui start "IDD_BILLBOARD" $(!DLGHANDLE)
    endif

      ;
      ; Enumerate language keys under SW\MS\W.NT\CV\Perflib, and use the first.
      ;
      set TmpLangId = "009"
      OpenRegKey $(!REG_H_LOCAL), "", +
                 "Software\Microsoft\Windows NT\CurrentVersion\Perflib", +
                 $(!REG_KEY_READ), KeyPerflib
      ifstr(i) $(KeyPerflib) != $(KeyNull)
        EnumRegKey $(KeyPerflib) PerfLangKeyList
        ifstr(i) $(PerfLangKeyList) != {}
          set TmpLangId = *( *($(PerfLangKeyList),1), 1 )
          set PerfLangKeyList = {}
        endif
        CloseRegKey $(KeyPerflib)
      endif

      ;
      ; SNAAddPerfCounters won't add the strings if they already exist.
      ;
      LibraryProcedure Result $(!SVCHANDLE) +
                       SNAAddPerfCounters $(TmpLangId) Counters $(SNAPerfMonCounters) $(OldPerfMonCounter)

      set FirstSNAPerfCounter = $(Result)

      LibraryProcedure Result $(!SVCHANDLE) +
                       SNAAddPerfCounters $(TmpLangId) Help $(SNAPerfMonHelp) $(OldPerfMonHelp)

      install FreeServiceLibrary
  endif

  ;
  ; Create/update values under SnaServr\Performance.
  ;
  OpenRegKey $(!REG_H_LOCAL), "", +
             "System\CurrentControlSet\Services\SnaServr", +
             $(!REG_KEY_READWRITE), KeySnaServr

  ifstr(i) $(KeySnaServr) != $(KeyNull)
    OpenRegKey $(KeySnaServr), "", "Performance", $(!REG_KEY_READWRITE), KeyPerf

    ifstr(i) $(KeyPerf) == $(KeyNull)
      CreateRegKey $(KeySnaServr), +
                   { "Performance", $(NoTitle), $(MaskAllAccess) }, +
                   "", $(MaskAllAccess), "", KeyPerf
    endif

    ifstr(i) $(KeyPerf) != $(KeyNull)
      shell $(!UtilInfFile) AddValueList $(KeyPerf) +
            { +
              { "Library", $(NoTitle), $(!REG_VT_SZ), +
                             $(!SNARootDir)"\"$(!SNABinDir)"\SNAPERF.DLL"     }, +
              { "Open",    $(NoTitle), $(!REG_VT_SZ), "OpenPerformanceData"   }, +
              { "Collect", $(NoTitle), $(!REG_VT_SZ), "ReturnPerformanceData" }, +
              { "Close",   $(NoTitle), $(!REG_VT_SZ), "ClosePerformanceData"  }  +
            }
      CloseRegKey $(KeyPerf)
    endif

    ;
    ; Add performance values under Services\SnaServr\Parameters.
    ;
    OpenRegKey $(KeySnaServr), "", "Parameters", $(!REG_KEY_READWRITE), KeyParams

    ifstr(i) $(KeyParams) != $(KeyNull)
      set-add TmpIndex = $(FirstSNAPerfCounter), 4

      shell $(!UtilInfFile) AddValueList $(KeyParams) +
            { +
              { "PerformanceObject",       $(NoTitle), $(!REG_VT_DWORD),    +
                                             $(FirstSNAPerfCounter)      }, +
              { "FirstPerformanceCounter", $(NoTitle), $(!REG_VT_DWORD),    +
                                             $(TmpIndex)                 }  +
            }

      CloseRegKey $(KeyParams)
    endif

    CloseRegKey $(KeySnaServr)
  endif

  ;
  ; Done with performance monitoring stuff.
  ;

EndPerfStuff =+
  ifstr(i) $(BillFlag) == $(!True)
    set TextFields = { "Creating Program Manager group and icons..." }
    ui start "IDD_BILLBOARD" $(!DLGHANDLE)
  endif

  ;
  ; Append the SNA binaries directory to the system's Path.
  ;
  shell $(!UtilInfFile) ModifyPath "Add" $(!SNARootDir)"\"$(SNABinDir)

  ;
  ; Create the Program Manager group and items.
  ;
  ifstr(i) $(!IconsInstalled) == $(!False)
    install CreateProgManStuff
    set !IconsInstalled = $(!True)
  endif

  ;
  ; Point to the locally installed help file.
  ;
  SetHelpFile $(!SNARootDir)"\"$(HelpFile) $(MinID) $(MaxID)

  ifstr(i) $(!SNA_SetupMode) == "Client"
    goto TakeAwayBillBoard
  endif

  ifstr(i) $(BillFlag) == $(!True)
    set TextFields = { "Locating available Link Services..." }
    ui start "IDD_BILLBOARD" $(!DLGHANDLE)
  endif

  ;
  ; Look at which drivers we have available.
  ;
  shell $(!UtilInfFile) EnumerateDrivers $(!SNARootDir)"\system\hwsetup\"

  ;
  ; Server-only stuff from here on...
  ;
  set !DriversAvailable = {}
  ForListDo $($R1)
    set $ = >( $($), "LOCAL" )
    set $ = >( $($), $(!SNARootDir)"\system\hwsetup\" )
    set !DriversAvailable = >( $(!DriversAvailable), $($) )
  EndForListDo

  ;
  ; Create shares and adjust server disconnect value.
  ;
  ifstr(i) $(!SNA_SetupMode) == "Server"

    ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!True)
      install LoadServiceLibrary
    else
      install LoadSvrServiceLibrary
    endif

    ifstr(i) $(!SVCHANDLE) != ""
      LibraryProcedure ShareResult $(!SVCHANDLE) SNACreateShare +
                       "SNASERV" $(!SNARootDir) +
                       $(!SNA_ProductName)" Root Directory"

      LibraryProcedure ShareResult $(!SVCHANDLE) SNACreateShare +
                       "COMCFG" $(!SNARootDir)"\system\config" +
                       $(!SNA_ProductName)" Config Directory"

      LibraryProcedure ShareResult $(!SVCHANDLE) SNACreateShare +
                       "COMLOGS" $(!SNARootDir)"\system" +
                       $(!SNA_ProductName)" Logging Directory"

      LibraryProcedure ShareResult $(!SVCHANDLE) SNACreateShare +
                       "CLIENTS" $(!SNARootDir)"\clients" +
                       $(!SNA_ProductName)" Client Directories"

      LibraryProcedure AdjustResult $(!SVCHANDLE) SNAAdjustServer

      install FreeServiceLibrary
    endif
  endif

  ;
  ; Done for now, remove billboard.
  ;

TakeAwayBillBoard =+
  ifstr(i) $(BillFlag) == $(!True)
    ui pop 1
  endif

  set LSReturn = "SuccessInstall"

  ifstr(i) $(!SNA_SetupMode) == "Client"
    goto SuccessInstall
  endif


LinkServiceStuff =+
  ifstr(i) $(!InitialInstall) == $(!False)
    ifstr(i) $(!NapStarted) == $(!False)
      shell $(!UtilInfFile) StartService SnaBase

      ifstr(i) $($R0) == STATUS_FAILED
        shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL +
              "The SnaBase service couldn't be started."
      else
        set !NapStarted = $(!True)
      endif
    endif
  endif

  ; BUGBUG: Move this somewhere else
  set !SNATraceDir = $(!SNARootDir)"\"$(!SNATraceDirName)"\"

  ifstr(i) $(!LinkServiceList) != {}
    set !OneLSInstalled = $(!True)
  else
    set !OneLSInstalled = $(!False)
    goto LinkServiceInstallRemove
  endif


LinkServiceConfig =+
  shell "" DoLSConfigure

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck

    ifstr(i) $($R0) == $(!True)
      goto SuccessInstall
    else
      goto LinkServiceConfig
    endif

  else-ifstr(i) $($R0) == STATUS_GOBACK
    goto $(BackLabel)

  else-ifstr(i) $($R0) == STATUS_CONFIG
    set LinkToUse = $($R1)

    ifstr(i) $(LinkToUse) == {}
      shell "" DoWarnNoLSToConfig
      goto LinkServiceConfig
    endif

    set InfName = *( $(LinkToUse), 4 )
    set !DriverDir = $(!SNARootDir)"\system\hwsetup\"
    set NTN_InfOption = *( $(LinkToUse), 5 )
    set NTN_InstallMode = "configure"

    shell $(InfName) SnaInvocation

    set RetStatus = $($R0)
    set RetData   = *( $($R1), 1 )

    ifint $($R2) == 1
      set !LinkChanged = $(!True)
      ifint $($R2) == 2
        set !LinkChangedReboot = $(!True)
      endif
    endif


    ifstr(i) $(RetStatus) == STATUS_SUCCESSFUL
      set _NewList = {}

      ForListDo $(!LinkServiceList)
        ifstr(i) $($) != $(LinkToUse)
          set _NewList = >( $(_NewList), $($) )

        else
          set _NewLink = { *( $(RetData), 2 ), +
                           *( $(RetData), 3 ), +
                           0, +
                           $(InfName), +
                           $(NTN_InfOption) }
          set _NewList = >( $(_NewList), $(_NewLink) )

        endif

      EndForListDo

      set !LinkServiceList = $(_NewList)

      ;
      ; Signal the NAP that something has changed.
      ;
      shell $(!UtilInfFile) SnapTheNAP Notify

    endif

    goto LinkServiceConfig

  else-ifstr(i) $($R0) == STATUS_REMOVE   ; Remove a single link service
    set LinkToUse = $($R1)

    ifstr(i) $(LinkToUse) == {}
      shell "" DoWarnNoLSToRemove
      goto LinkServiceConfig
    endif

BeginConfirmRemoveLS =+
    shell "" DoConfirmRemoveLS

    ifstr(i) $($R0) == STATUS_FAILED
      set RemoveStatus = STATUS_USERCANCEL
      goto finish_status_remove

    else-ifstr(i) $($R0) == STATUS_GOBACK
      goto LinkServiceConfig

    else-ifstr(i) $($R0) == STATUS_USEREXIT
      shell "" ExitCheck

      ifstr(i) $($R0) == $(!True)
        goto SuccessInstall
      else
        goto LinkServiceConfig
      endif

    endif

    ;
    ; Format of one entry in LinkServiceList:
    ; { ServiceName, Title, Type, InfName, InfOption }
    ;
    set TmpSvcName = *( $(LinkToUse), 1 )
    set InfName = *( $(LinkToUse), 4 )
    set !DriverDir = $(!SNARootDir)"\system\hwsetup\"
    set NTN_InfOption = *( $(LinkToUse), 5 )
    set NTN_InstallMode = "getbindings"

    install LoadServiceLibrary
    ifstr(i) $(!SVCHANDLE) != ""
;     set FLibraryErrCtl = 0
      LibraryProcedure StopStatus $(!SVCHANDLE) +
                       SNAStopService $(TmpSvcName)
;     set FLibraryErrCtl = 1
      install FreeServiceLibrary
    endif

    shell $(InfName) SnaInvocation

    set RetStatus = $($R0)
    set RetBinds  = $($R1)

    ifstr(i) $(RetStatus) != STATUS_SUCCESSFUL
      shell "" DoWarnBadLSRemove
      goto LinkServiceConfig
    endif

    set NTN_InstallMode = "snaremove"

    shell $(InfName) SnaInvocation

    set RetStatus = $($R0)

    ifstr(i) $(RetStatus) != STATUS_SUCCESSFUL
      shell "" DoWarnBadLSRemove
      goto LinkServiceConfig
    endif

    ForListDo $(RetBinds)
      ifstr(i) $(RetStatus) == STATUS_SUCCESSFUL
        set NTN_InfOption = *( $($), 2 )"_"*( $($), 1 )
        set NTN_InstallMode = "snaremove"

        shell $(InfName) SnaInvocation

        set RetStatus = $($R0)
      endif
    EndForListDo

    ifstr(i) $(RetStatus) != STATUS_SUCCESSFUL
      shell "" DoWarnBadLSRemove
      goto LinkServiceConfig
    endif

    ifstr(i) $(RetStatus) == STATUS_SUCCESSFUL
      set _NewList = {}

      ForListDo $(!LinkServiceList)
        ifstr(i) $($) != $(LinkToUse)
          set _NewList = >( $(_NewList), $($) )
        endif
      EndForListDo

      set !LinkServiceList = $(_NewList)
    endif

    set !LinkRemoved = $(!True)
    set !MustBind = $(!True)

    ;
    ; Signal the NAP that something has changed.
    ;
    shell $(!UtilInfFile) SnapTheNAP Notify

    goto LinkServiceConfig

  else-ifstr(i) $($R0) == STATUS_OTHER
    set LSReturn = "LinkServiceConfig"
    goto LinkServiceInstallRemove

  else
    ifstr(i) $(!OneLSInstalled) == $(!False)
      shell "" DoWarnNoLSInstalled

      ifstr(i) $($R0) == STATUS_CANCEL
        goto LinkServiceConfig
      else
        ifstr(i) $(!InitialInstall) == $(!False)
          goto SetupOptions
        else
          goto SuccessInstall
        endif
      endif

    else
      ifstr(i) $(!InitialInstall) == $(!False)
        goto SetupOptions
      else
        goto SuccessInstall
      endif

    endif

  endif


LinkServiceInstallRemove =+
;
; DoLSInstallRemove returns the chosen driver (if any) in $R1 as a 3-item list:
;    { "Title", "InfName", "InfOption" }
; This list will be null if, for some reason, no driver was chosen.
;
  ifstr(i) $(!DriversAvailable) == {}
    goto SkipToOtherDrivers
  endif

  shell "" DoLSInstallRemove

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck

    ifstr(i) $($R0) == $(!True)
      goto SuccessInstall
    else
      goto LinkServiceInstallRemove
    endif

  else-ifstr(i) $($R0) == STATUS_GOBACK
    goto $(LSReturn)

  else-ifstr(i) $($R0) == STATUS_OTHER

SkipToOtherDrivers =+
    shell "" DoOtherDrivers

    ifstr(i) $($R0) == STATUS_FAILED
      goto End

    else-ifstr(i) $($R0) == STATUS_USEREXIT
      shell "" ExitCheck

      ifstr(i) $($R0) == $(!True)
        goto End
      else
        goto SkipToOtherDrivers
      endif

    endif

    goto LinkServiceInstallRemove

  else-ifstr(i) $($R0) == STATUS_REMOVE
    ; BUGBUG: This is a hack cause I don't want to move the code for calling
    ;         fullremove all over the place.  Sooner or later, it should be
    ;         in its own section with a goto label...
    set CameFromRemoveAll = $(!False)
    set TmpRemove = $($R1)

RemoveLinkSupportEntry = +
    ifstr(i) $(TmpRemove) == {}  ; We don't have a valid support system to remove
      goto finish_status_remove
    endif

    set TmpInfTitle  = *( $(TmpRemove), 1 )
    set TmpInfName   = *( $(TmpRemove), 2 )
    set TmpInfOption = *( $(TmpRemove), 3 )
    set TmpInfType   = *( $(TmpRemove), 4 )
    set TmpInfDir    = *( $(TmpRemove), 5 )

    set RemoveStatus = STATUS_SUCCESSFUL
    set !DriverDir   = $(TmpInfDir)

    ifstr(i) $(TmpInfType) == "IMPORT"
      set TempDriversAvailable = $(!DriversAvailable)
      set !DriversAvailable = {}

      ForListDo $(TempDriversAvailable)
        ifstr(i) *( $($), 1 ) != $(TmpInfTitle)
          set !DriversAvailable = >( $(!DriversAvailable), $($) )
        endif
      EndForListDo

      goto finish_status_remove

    endif

    ifint $(CameFromRemoveAll) == $(!False)
      shell "" DoConfirmRemoveLS

      ifstr(i) $($R0) == STATUS_FAILED
        set RemoveStatus = STATUS_USERCANCEL
        goto finish_status_remove

      else-ifstr(i) $($R0) == STATUS_GOBACK
        goto $(BackLabel)

      endif

    endif

    shell $(!DriverDir)$(TmpInfName) "ReturnSNAAdds" $(TmpInfOption)

    set RemoveStatus = $($R0)
    ifstr(i) $(RemoveStatus) != STATUS_SUCCESSFUL
      goto finish_status_remove
    endif

    set TmpInfAdds = $($R1)
    set NTN_InstallMode = "fullremove"

    set ErrCount = 0

    ForListDo $(TmpInfAdds)
      set NTN_InfOption = $($)

      ifstr(i) $($) != "DLCDD"

        StartWait

          shell $(!DriverDir)$(TmpInfName) "SnaInvocation"

          set RemoveStatus = $($R0)
          ifstr(i) $(RemoveStatus) == STATUS_FAILED
            set-add ErrCount = $(ErrCount), 1
          endif

          EndWait

          shell $(!UtilInfFile) RemoveFileList $(!_FileRemoveList)

          set DeleteStatus = $($R0)
      endif

    EndForListDo

    set NTN_InfOption = $(TmpInfOption)

    shell $(!DriverDir)$(TmpInfName) "SnaInvocation"

    set RemoveStatus = $($R0)
    ifstr(i) $(RemoveStatus) == STATUS_FAILED
      set-add ErrCount = $(ErrCount), 1
    endif

    shell $(!UtilInfFile) RemoveFileList $(!_FileRemoveList)

    set DeleteStatus = $($R0)

    ifint $(ErrCount) != 0
      set RemoveStatus = STATUS_FAILED
      goto finish_status_remove
    endif

    ;
    ; SnaInvocation returns a list of the services it removed.  We need to
    ; compile a temporary list of those services in LinkServiceList format,
    ; which is:
    ;
    ;   { ServiceName, Title, LinkTypeDword, InfName, InfOption }
    ;
    ; Then, we go through LinkList, and for
    ; each element we check if it's one of the removed ones.
    ;
    set TmpRetList = *( $($R1), 1 )
    set TmpCheckList = {}

    StartWait

    ForListDo $(TmpRetList)
      set TmpCheckList = >( $(TmpCheckList), +
                            { *( $(TmpRetList) , 2 ), +
                              *( $(TmpRetList) , 3 ), +
                              0, +
                              $(!SNARootDir)"\system\hwsetup\"$(TmpInfName), +
                              $(TmpInfOption)"_"*( $(TmpRetList), 1 ) } )
    EndForListDo

    set TmpLinkList = $(!LinkServiceList)
    set !LinkServiceList = {}

    ForListDo $(TmpLinkList)
      set _test_ = { *($($),1), *($($),2), 0, *($($),4), *($($),5) }

      ifcontains(i) $(_test_) not-in $(TmpCheckList)
        set !LinkServiceList = >( $(!LinkServiceList), $($) )
      endif

    EndForListDo

    ;
    ; We need to recreate the DriversAvailable and take this one out
    ;
    set TempDriversAvailable = $(!DriversAvailable)
    set !DriversAvailable = {}

    ForListDo $(TempDriversAvailable)
      ifstr(i) *( $($), 1 ) != $(TmpInfTitle)
        set !DriversAvailable = >( $(!DriversAvailable), $($) )
      endif
    EndForListDo

    ifstr(i) $(CameFromRemoveAll) == $(!False)
      set !MustBind = $(!True)
    endif

    ;
    ; Signal the NAP that something has changed.
    ;
    ifstr(i) $(CameFromRemoveAll) == $(!False)
      shell $(!UtilInfFile) SnapTheNAP Notify
    endif

    set !LinkRemoved = $(!True)
    set !MustBind    = $(!True)

    EndWait

finish_status_remove = +
    ifint $(CameFromRemoveAll) == $(!True)
      goto RemoveAllNextOne
    endif

    ifstr(i) $(RemoveStatus) != STATUS_SUCCESSFUL
      shell "" DoWarnLSBadRemove
    endif

    goto LinkServiceStuff

  else-ifstr(i) $($R0) == STATUS_INSTALL
    ifstr(i) $($R1) != {}  ; We have a valid driver to install
      set TmpInfTitle  = *( $($R1), 1 )
      set TmpInfName   = *( $($R1), 2 )
      set TmpInfOption = *( $($R1), 3 )
      set TmpInfType   = *( $($R1), 4 )
      set TmpInfDir    = *( $($R1), 5 )

      set InstallStatus = STATUS_SUCCESSFUL
      set !DriverDir    = $(TmpInfDir)

      install LoadSetupLibrary
      ifstr(i) $(!LIBHANDLE) != ""
        LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
                         $(!DriverDir)$(TmpInfName)
        install FreeSetupLibrary
      endif

      ifstr(i) $(ExistStatus) == "NO"
        set InstallStatus = STATUS_INVALIDINF
        goto finish_status_install
      endif

      shell $(!DriverDir)$(TmpInfName) "ReturnSNAAdds" $(TmpInfOption)

      set InstallStatus = $($R0)
      ifstr(i) $(InstallStatus) != STATUS_SUCCESSFUL
        goto finish_status_install
      endif

      set TmpInfAdds = $($R1)

      set NTN_InstallMode = "install"
      set NTN_InfType = $(TmpInfType)

      ForListDo $(TmpInfAdds)
        ifstr(i) $(InstallStatus) == STATUS_SUCCESSFUL
          set NTN_InfOption = $($)

          shell $(!DriverDir)$(TmpInfName) "SnaInvocation"

          set InstallStatus = $($R0)
          ifstr(i) $(InstallStatus) == STATUS_EXISTS
            set InstallStatus = STATUS_SUCCESSFUL
            ; For now, it should behave like a success.  However, at
            ; some future point in time, we might do something different.
          endif

        endif

      EndForListDo

      ifstr(i) $(InstallStatus) != STATUS_SUCCESSFUL
        goto finish_status_install
      endif

      set NTN_InfOption = $(TmpInfOption)

      shell $(!DriverDir)$(TmpInfName) "SnaInvocation"

      set InstallStatus = $($R0)
      ifstr(i) $(InstallStatus) != STATUS_SUCCESSFUL
        goto finish_status_install
      endif

      ;
      ; SNAInvocation returns a list of lists in $R1 if it creates a service,
      ; which it should have just done for us.  We need the service name and
      ; the title, which are in the first list item at indices 2 and 3,
      ; respectively.  We also need the full option name...
      ;
      set TmpRetList = *( $($R1), 1 )
      set !LinkServiceList = >( $(!LinkServiceList), +
                                {*( $(TmpRetList), 2 ), +
                                 *( $(TmpRetList), 3 ), +
                                 0, +
                                 $(!SNARootDir)"\system\hwsetup\"$(TmpInfName),+
                                 $(TmpInfOption)"_"*($(TmpRetList), 1) } )
      ;
      ; If this was an IMPORT, we need to recreate the DriversAvailable
      ; list and make it a LOCAL.  Sad.  We should have a "set element"
      ; function or something.  Maybe later.
      ;
      ifstr(i) $(TmpInfType) == "IMPORT"
        set TempDriversAvailable = $(!DriversAvailable)
        set !DriversAvailable = {}

        ForListDo $(TempDriversAvailable)
          set NewDriverIn = $($)

          ifstr(i) *( $($), 1 ) == $(TmpInfTitle)
            set NewDriverIn = { $(TmpInfTitle), +
                                $(TmpInfName), +
                                $(TmpInfOption), +
                                "LOCAL", +
                                $(!SNARootDir)"\system\hwsetup\" +
                              }
          endif

          set !DriversAvailable = >( $(!DriversAvailable), $(NewDriverIn) )

        EndForListDo

      endif

      ; Signal the NAP that something has changed.
      ;
      ifstr(i) $(!InitialInstall) == $(!False)
        shell $(!UtilInfFile) SnapTheNAP Notify
      endif

      set !LinkAdded = $(!True)
      set !MustBind  = $(!True)

    endif

finish_status_install = +
    ifstr(i) $(InstallStatus) == STATUS_EXISTS
      set InstallStatus = STATUS_SUCCESSFUL
    else-ifstr(i) $(InstallStatus) == STATUS_SOSO
      set InstallStatus = STATUS_SUCCESSFUL
    endif

    ifstr(i) $(InstallStatus) != STATUS_SUCCESSFUL
      shell "" DoWarnLSBadInstall
    endif

    goto LinkServiceStuff

  else  ; Status = CONTINUE
    ifstr(i) $(!OneLSInstalled) == $(!False)
      shell "" DoWarnNoLSInstalled

      ifstr(i) $($R0) == STATUS_CANCEL
        goto LinkServiceInstallRemove
      else
        ifstr(i) $(!InitialInstall) == $(!False)
          goto SetupOptions
        else
          goto SuccessInstall
        endif
      endif

    else
      goto LinkServiceStuff

    endif

  endif


ConfirmRemove =+
  shell "" DoConfirmRemove

  ifstr(i) $($R0) == STATUS_FAILED
    goto End

  else-ifstr(i) $($R0) == STATUS_USEREXIT
    shell "" ExitCheck

    ifstr(i) $($R0) == $(!True)
      goto End
    else
      goto ConfirmRemove
    endif

  else-ifstr(i) $($R0) == STATUS_GOBACK
    goto SetupOptions

  endif

  set ErrorCount = 0
  set ErrorList = {}

  read-syms BillboardDlg
  set TextFields = { "Please wait while the "$(!SNA_ProductFlavor)" is removed." }

  ui start "IDD_BILLBOARD" $(!DLGHANDLE)

  StartWait

  ;
  ; Signal the NAP that it should tear itself down, bringing down
  ; the rest of the components with it.
  ;
  shell $(!UtilInfFile) SnapTheNAP TERMINATE
  set TmpStatus = $($R0)

  ifstr(i) $(TmpStatus) == STATUS_RUNNING
    shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) WARNING +
          "Some SNA components are still running, which will prevent certain"+
          " files from being properly removed."$(!LF)$(!LF)+
          "Click OK to attempt to force these components to stop, or click"+
          " Cancel to try the removal again later."

    ifstr(i) $($R1) != "OK"
      ui pop 1
      goto SetupOptions
    endif

ForceRetry =+
    shell $(!UtilInfFile) SnapTheNAP FORCE

  endif


  ; STEP 0:  Remove Program Manager stuff
  ;------------------------------

RemoveStep0 =+
  set TextFields = { "Removing Program Manager group and icons..." }
  ui start "IDD_BILLBOARD" $(!DLGHANDLE)

  install LoadSetupLibrary
  LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
                   $(!STF_CWDDIR)"\"$(!AdminChkFile)
  ifstr(i) $(ExistStatus) == "YES"
      set !AdminFilesExist = $(!True)
  else
      set !AdminFilesExist = $(!False)
  endif
  install FreeSetupLibrary


  install RemoveProgManStuff


  ; STEP 1:  Remove Link Supports
  ;------------------------------

  set TextFields = { "Removing Link Support files..." }
  ui start "IDD_BILLBOARD" $(!DLGHANDLE)

  ifstr(i) $(!SNA_SetupMode) != "Client"

    set CameFromRemoveAll = $(!True)
    set DrvList = $(!DriversAvailable)

    ForListDo $(DrvList)
      set TmpRemove = $($)

      goto RemoveLinkSupportEntry

RemoveAllNextOne = +
      ifstr(i) $(RemoveStatus) != STATUS_SUCCESSFUL
        set-add ErrorCount = $(ErrorCount), 1
      endif

    EndForListDo

    ifint $(ErrorCount) > 0
      set ErrorList = >( $(ErrorList), "Removing Link Services." )
    endif

  endif


  ; STEP 2:  Remove remaining SNA Services
  ;---------------------------------------

  set ErrorCount = 0

  install LoadNCPALibrary

  shell $(!UtilInfFile) GetServiceBaseKey
  set SvcBaseKey = $($R1)

  ; If the NetView services are running, stop them.

  install LoadServiceLibrary
  ifstr(i) $(!SVCHANDLE) != ""

    ForListDo { "NVRunCmd", "NVAlert" }
      LibraryProcedure NVStatus $(!SVCHANDLE) SNAQueryService $($)
      ifstr(i) $(NVStatus) != "SERVICE_STOPPED"
        ifstr(i) $(NVStatus) != "SERVICE_STOP_PENDING"
          LibraryProcedure NVStatus $(!SVCHANDLE) SNAStopService $($)
        endif
      endif
    EndForListDo

  endif

  ; Now try removing all remaining SNA services.

  set RunningList = {}
  ForListDo $(!SNAServiceList)
    set SvcName = *( $($), 1 )

    set TextFields = { "Removing SNA Service """$(SvcName)"""" }
    ui start "IDD_BILLBOARD" $(!DLGHANDLE)

    LibraryProcedure SvcStatus $(!SVCHANDLE) SNAQueryService $(SvcName)
    ifstr(i) $(SvcStatus) != "SERVICE_STOPPED"
      ifstr(i) $(SvcStatus) != "SERVICE_STOP_PENDING"
        set RunningList = >( $(RunningList), $(SvcName) )
      endif
    endif

    shell $(!UtilInfFile) DeleteSNAService $(SvcName) $(SvcBaseKey)

    ifstr(i) $($R0) != STATUS_SUCCESSFUL
      set-add ErrorCount = $(ErrorCount), 1
    endif

  EndForListDo

  install FreeServiceLibrary
  install FreeNCPALibrary

  ifint $(ErrorCount) > 0
    set ErrorList = >( $(ErrorList), "Removing "$(!SNA_ProductName)" service control entries." )
  endif

  ifstr(i) $(RunningList) != {}
    set TmpTxt =  "The following SNA services are still running, although"$(!LF)+
                  "Setup has instructed them to stop:"$(!LF)$(!LF)+
                  "      "
    ForListDo $(RunningList)
      ifint $(#) > 1
        set TmpTxt = $(TmpTxt)",  "
      endif
      set TmpTxt = $(TmpTxt)$($)
    EndForListDo
    set TmpTxt = $(TmpTxt)$(!LF)$(!LF)+
                 "These services have been marked for deletion, and will go"$(!LF)+
                 "away the next time this computer is restarted.  This means"$(!LF)+
                 "that you must reboot once before reinstalling SNA Server!"$(!LF)$(!LF)+
                 "If you try to reinstall without rebooting, Setup will be"$(!LF)+
                 "unable to recreate these services, and SNA Server might"$(!LF)+
                 "not run properly."

    shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS $(TmpTxt)
    set TmpTxt = ""
  endif

  set ErrorCount = 0


  ; STEP 3:  Remove binaries directories from the path,
  ;          take out the SNA Services entry from
  ;          Software\Microsoft, and remove shares.
  ; ------------------------------------------------------

  set TextFields = { "Removing "$(!SNA_ProductFlavor)" registry entries..." }
  ui start "IDD_BILLBOARD" $(!DLGHANDLE)

  shell $(!UtilInfFile) ModifyPath "Delete" $(!SNARootDir)"\"$(SNABinDir)

  OpenRegKey $(!REG_H_LOCAL) "" "Software\Microsoft" 33554432 MSKey

  ifstr(i) $(MSKey) == $(KeyNull)
    set ErrorList = >( $(ErrorList), "Removing SNA Server key from LOCAL_MACHINE registry." )
  else
    DeleteRegTree $(MSKey) "SNA Server"
    DeleteRegTree $(MSKey) "NVRunCmd"
    CloseRegKey $(MSKey)
  endif

  OpenRegKey $(!REG_H_CUSER), "", "Software\Microsoft" 33554432 MSKey

  ifstr(i) $(MSKey) == $(KeyNull)
    set ErrorList = >( $(ErrorList), "Removing SNA Server key from CURRENT_USER registry." )
  else
    DeleteRegTree $(MSKey) "SNA Server"
    CloseRegKey $(MSKey)
  endif

  OpenRegKey $(!REG_H_LOCAL), "", +
             "System\CurrentControlSet\Services\EventLog\Application", +
             $(!REG_KEY_READWRITE), KeyProduct

  ifstr(i) $(KeyProduct) != $(KeyNull)

    ForListDo $(!SNAEventLogEntries)
      DeleteRegTree $(KeyProduct) $($)
    EndForListDo

    CloseRegKey $(KeyProduct)

  endif

  ifstr(i) $(!NapRole) != $(!NM_Primary)
    ifstr(i) $(!NapRole) != $(!NM_Backup)
      goto RemoveStep4
    endif
  endif

  install LoadServiceLibrary

  ifstr(i) $(!SVCHANDLE) != ""
    LibraryProcedure ShareResult $(!SVCHANDLE) SNARemoveShare "CLIENTS"
    LibraryProcedure ShareResult $(!SVCHANDLE) SNARemoveShare "COMLOGS"
    LibraryProcedure ShareResult $(!SVCHANDLE) SNARemoveShare "COMCFG"
    LibraryProcedure ShareResult $(!SVCHANDLE) SNARemoveShare "SNASERV"

    install FreeServiceLibrary
  endif

  install Remove3270IniSection


  ; STEP 4:  Delete all files!
  ;---------------------------
RemoveStep4 =+
  FreeLibrary $(!DLGHANDLE)
  set !DLGHANDLE = ""

  set TextFields = { "Removing "$(!SNA_ProductFlavor)" files..." }
  ui start "IDD_BILLBOARD" $(!DLGHANDLE)

  shell $(!UtilInfFile) RemoveDirTree $(!SNARootDir)

  ifstr(i) $($R0) != STATUS_SUCCESSFUL
    set-add ErrorCount = $(ErrorCount) , 1
  endif

  ifint $(ErrorCount) > 0
    set ErrorList = >( $(ErrorList), "Deleting the "$(!SNA_ProductFlavor)" files." )
  endif

  ;
  ; Remove our DLLs from \nt\system.
  ;

; set LibList = {}

; set Tmp = ^( DllsIn-NtSystem, 2 );
; ForListDo $(Tmp)
;   set LibList = >( $(LibList), $(!STF_WINDOWSSYSPATH)"\"$($) )
; EndForListDo

; ifstr(i) $(!SNA_SetupMode) != "Client"
;   set Tmp = ^( ServerOnlyDllsIn-NtSystem, 2 )
;   ForListDo $(Tmp)
;     set LibList = >( $(LibList), $(!STF_WINDOWSSYSPATH)"\"$($) )
;   EndForListDo
; endif

; shell $(!UtilInfFile) RemoveFileList $(LibList)

; set Tmp = {}
; set LibList = {}

  ifstr(i) $(!SNA_SetupMode) != "Client"
    shell "" NCPA_Bind
  endif

  ui pop 1  ; remove billboard

  EndWait

  goto CheckSuccessRemove


SuccessInstall =+
  ifstr(i) $(!SNA_SetupMode) == "Client"
    shell "" DoSuccessClient

  else
    ifstr(i) $(!MustBind) == $(!True)
      shell "" NCPA_Bind
    endif

    ifstr(i) $(!InitialInstall) == $(!True)

      install LoadServiceLibrary
      ifstr(i) $(!SVCHANDLE) == ""
        goto SkipNapHS
      endif

      ifstr(i) $($R0) == STATUS_FAILED
        shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL +
              "The SNABase service couldn't be started."
      endif
    endif

SkipNapHS =+
    ifstr(i) $(!LinkAdded) == $(!True)
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) "STATUS" +
            "Before you can use a new link service, you must first run the "+
            $(!SNA_ProductName)" Admin program to configure its connections."
    endif

    ifstr(i) $(!LinkRemoved) == $(!True)
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) "STATUS" +
            "If any link service you removed was active at the time, it will"+
            " continue functioning until halted by the "$(!SNA_ProductName)+
            " Admin program."
    endif

    ifstr(i) $(!LinkChanged) == $(!True)
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) "STATUS" +
            "Any link services which had parameters changed must be"+
            " stopped and restarted by the "$(!SNA_ProductName)" Admin program"+
            " for the change to be noticed."
    endif

    ifstr(i) $(!LinkChangedReboot) == $(!True)
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) "STATUS" +
            "Some change(s) you have made will not take effect until your"+
            " computer is rebooted."
    endif

    ifstr(i) $(!InitialInstall) == $(!True)
      shell "" DoSuccessInstall
    else
      shell "" DoSuccessModify
    endif

    set LaunchAdminFlag = $($R0)

  endif

  shell $(!UtilInfFile) StartService "SnaBase"

  set !LaunchAdmin = $(!False)
  set !RebootNow   = $(!False)

  ifstr(i) $(LaunchAdminFlag) == STATUS_LAUNCHADMIN
    set !LaunchAdmin = $(!True)
  else-ifstr(i) $(LaunchAdminFlag) == STATUS_REBOOT
    set !RebootNow   = $(!True)
  endif

  goto End


CheckSuccessRemove =+
  ifstr(i) $(ErrorList) == {}
    shell "" DoSuccessRemove
  else
    shell "" DoFailedRemove
  endif

  goto End


NetworkSetupPostInstall = +
  shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) +
        "NONFATAL" +
        "To configure or remove "$(!SNA_ProductFlavor)", you must run Setup"$(!LF)+
        "from the directory into which it was installed."$(!LF)$(!LF)+
        "If you would like to reinstall "$(!SNA_ProductFlavor)", please"$(!LF)+
        "remove the currently installed copy first."
  goto End


ExitUserAbortCopy =+
  read-syms ExitUserAbortDlg
  ui start $(DlgTemplate) $(!DLGHANDLE)
  ui pop 1
  goto End


End =+
  ifstr(i) $(!DLGHANDLE) != ""
    install FreeDlgLibrary
  endif

  ifstr(i) $(!LaunchAdmin) == $(!True)
    exit-and-exec $(!SNARootDir)"\system\snaadmin.exe"
  endif

; ifstr(i) $(!RebootNow) == $(!True)
;   Install Shutdown
; endif

  exit


[Shutdown]
  install LoadSetupLibrary
  ifstr(i) $(!LIBHANDLE) != ""
    LibraryProcedure Status $(!LIBHANDLE) ShutdownSystem YES
    install FreeSetupLibrary ;could probably get away without doing this
  endif

;=============================================================================
;
; Subroutines
;
;=============================================================================

[InstallCheck]
  install LoadSetupLibrary
  ifstr(i) $(!LIBHANDLE) != ""
    LibraryProcedure Status, $(!LIBHANDLE), CheckFileExistance +
                   $(!SNARootDir)"\"$(!InstallChkFile)
    install FreeSetupLibrary
  endif

  return $(Status)


[NCPA_Bind]
  set Status = STATUS_FAILED
  set NCPA_CMD_LINE = " /t STF_INSTALL_MODE = EXPRESS"
  set NCPA_FUNC     = "NCPA"

  install LoadNCPALibrary

  ifstr(i) $(!NCPA_HANDLE) != ""
    LibraryProcedure NcpaResult, $(!NCPA_HANDLE), CPlSetup, +
                     $(!STF_HWND), $(NCPA_FUNC), $(NCPA_CMD_LINE)
    install FreeNCPALibrary
    set Status = STATUS_SUCCESSFUL
  endif

  return $(Status)


[DoWelcome]
  set Status = STATUS_FAILED
  read-syms WelcomeDlg

  ifstr(i) $(!SNA_SetupMode) == "Server"
    set DlgText1 = $(DlgText1)$(SvrDlgText)
  endif

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_SUCCESSFUL

  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  endif

  ui pop 1
  return $(Status)


[DoSetupMode]
  set Status = STATUS_SUCCESSFUL
  read-syms SetupModeDlg

  set Mode = "Server"
  ifstr(i) $($0) == "Client"
    set Mode = "Client"
  endif

  ifstr(i) $(!SNA_WKSTA) == $(!True)
    set Mode = "Workstation"
    goto EndDoSetupMode
  endif

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "DlgButton1"
    set Mode = "Server"

  else-ifstr(i) $(DLGEVENT) == "DlgButton2"
    set Mode = "Client"

  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK

  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  endif

  ui pop 1

EndDoSetupMode =+
  return $(Status) $(Mode)


[DoDestPath]
  install LoadSvrServiceLibrary
BeginDoDestPath =+
  set Status = STATUS_FAILED
  read-syms DestPathDlg

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    ;
    ; Check path validity.
    ;
    install LoadSetupLibrary
    ifstr(i) $(!LIBHANDLE) != ""
      LibraryProcedure IsFullPath $(!LIBHANDLE) +
                       CheckPathFullPathSpec $(EditTextOut)
    endif

    ifstr(i) $(IsFullPath) == "No"
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL +
            """"$(EditTextOut)""" is not a valid path!  Please try again."
      ui pop 1
      goto BeginDoDestPath
    endif

    ifstr(i) $(!SVCHANDLE) != ""
      LibraryProcedure IsValidDir $(!SVCHANDLE) DirCheck $(EditTextOut)
      ifstr(i) $(IsValidDir) != "YES"

        ifstr(i) $(IsValidDir) == $(!ERROR_INVALID_NAME)
          shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL +
                "Setup could not create the directory "$(EditTextOut)"."$(!LF)$(!LF)+
                "Please enter a different path."
          ui pop 1
          goto BeginDoDestPath

        else-ifstr(i) $(IsValidDir) == $(!ERROR_ALREADY_EXISTS)
          shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) WARNING +
                "The directory "$(EditTextOut)" already exists."$(!LF)$(!LF)+
                "Click OK to use it anyway, or Cancel to enter a different path."
          ifstr(i) $($R1) != "OK"
            ui pop 1
            goto BeginDoDestPath
          endif

        endif
      endif
    endif

    ;
    ; Check that there's enough disk space on the target drive.
    ;
    read-syms TreeSizes

    GetDriveInPath SnaDrive $(EditTextOut)
    detect FreeSpaceVars
    detect DriveTypeVars

    install FreeSetupLibrary

    ifstr(i) $(STF_DriveType) != "FIX"
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL +
            "You may only install SNA Server for Windows NT onto a local"+
            " hard disk.  Installation to network or floppy drives is"+
            " not supported."
      ui pop 1
      goto BeginDoDestPath
    endif

    ForListDo $(STF_VolList)
      ifstr(i) $($) == $(SnaDrive)
        set VolSpaceFree = *( $(STF_VolFreeList), $(#) )
      endif
    EndForListDo

    ifint $(VolSpaceFree) < $(TreeSizeNT$(!SNA_SetupMode))
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS +
            "Not enough room for the "$(!SNA_ProductFlavor)" on drive "+
            $(SnaDrive)" ("$(TreeSizeNT$(!SNA_SetupMode))" megs needed, "+
            $(VolSpaceFree)" available)."$(!LF)$(!LF)+
            "Click OK to try a path on a different drive."
      ui pop 1
      goto BeginDoDestPath
    endif

    set Status = STATUS_SUCCESSFUL
    set !SNARootDir = $(EditTextOut)

  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK

  endif

  ui pop 1
  install FreeServiceLibrary
  return $(Status)


[DoServerRole]
  set Status = STATUS_FAILED

  ;
  ; Find out current Nap mode, if any
  ;
  shell $(!UtilInfFile) GetServiceBaseKey

  ifstr(i) $($R0) != STATUS_FAILED
    set SvcKey = $($R1)
    OpenRegKey $(SvcKey) "" "SnaBase\Parameters" +
               $(!MaskAllAccess) SBParamKey

    ifstr(i) $(SBParamKey) != $(!KeyNull)
      GetRegValue $(SBParamKey) "Role" RoleValue
      set !NapRole = *( $(RoleValue), 4 )

      CloseRegKey $(SBParamKey)

    endif

    CloseRegKey $(SvcKey)
  endif

  read-syms ServerRoleDlg

  ForListDo $(!SvrNapRoles)
    ifstr(i) $(!NapRole) == $($)
      set RadioDefault = $(#)
    endif
  EndForListDo

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    set OldRole  = $(!NapRole)
    set !NapRole = *( $(!SvrNapRoles), $(ButtonChecked) )

    ;
    ; Write new Nap role into the registry.
    ;
    shell $(!UtilInfFile) GetServiceBaseKey

    ifstr(i) $($R0) != STATUS_FAILED
      set SvcKey = $($R1)
      OpenRegKey $(SvcKey) "" "SnaBase\Parameters" +
                 $(!MaskAllAccess) SBParamKey

      ifstr(i) $(SBParamKey) != $(!KeyNull)
        set RoleValue = { "Role", 0, $(!REG_VT_SZ), $(!NapRole) }
        SetRegValue $(SBParamKey) $(RoleValue)
        CloseRegKey $(SBParamKey)

        ifstr(i) $(!InitialInstall) == $(!False)
          ifstr(i) $(!NapRole) != $(OldRole)
            shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS +
                  "The change in server role will not take effect until "+
                  "you stop and restart the SnaBase service via the Control "+
                  "Panel Services applet."
          endif
        endif
      endif

      CloseRegKey $(SvcKey)
    endif

    set Status = STATUS_SUCCESSFUL

  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK

  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  endif

  ui pop 1
  return $(Status)


[DoNosTypes]
BeginDoNosTypes =+
  set Status = STATUS_FAILED
  read-syms NosTypesDlg

  set CheckItemsIn  = {}
  set OptionsGreyed = {}

  ifstr(i) $(!SNA_DoNosLanman) == $(!True)
    set CheckItemsIn = >( $(CheckItemsIn), $(!Chosen) )
  else
    set CheckItemsIn = >( $(CheckItemsIn), $(!NotChosen) )
  endif

  ifstr(i) $(!SNA_DoNosNetware) == $(!True)
    set CheckItemsIn = >( $(CheckItemsIn), $(!Chosen) )
  else
    set CheckItemsIn = >( $(CheckItemsIn), $(!NotChosen) )
  endif

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_SUCCESSFUL

    ifstr(i) *( $(CheckItemsOut), 1 ) == $(!Chosen)
      set !SNA_DoNosLanman = $(!True)
    else
      set !SNA_DoNosLanman = $(!False)
    endif

    ifstr(i) *( $(CheckItemsOut), 2 ) == $(!Chosen)
      set !SNA_DoNosNetware = $(!True)
    else
      set !SNA_DoNosNetware = $(!False)
    endif

    ifstr(i) $(!SNA_DoNosLanman) == $(!False)
      ifstr(i) $(!SNA_DoNosNetware) == $(!False)
        shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) WARNING +
              "You must select at least one NOS from the list available."
        goto BeginDoNosTypes
      endif
    endif

  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK

  endif

  ui pop 1
  return $(Status)


[DoNetwareDomain]
BeginDoNetwareDomain =+
  set Status = STATUS_FAILED
  read-syms NetwareDomainDlg

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"

    ifstr(i) $(EditTextOut) == ""
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS +
            "A blank domain name is invalid.  Please enter a name of one to 15 characters."
      goto BeginDoNetwareDomain
    endif

    set !SNA_NetwareDomain = $(EditTextOut)

    set Status = STATUS_SUCCESSFUL

  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK

  endif

  ui pop 1
  return $(Status)


[DoClientTypes]
BeginDoClientTypes =+
  set Status = STATUS_FAILED
  read-syms ClientTypesDlg

  set CheckItemsIn  = $(!ClientInstalls)
  set OptionsGreyed = {}

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_SUCCESSFUL
    set !ClientInstalls = $(CheckItemsOut)

    ;
    ; Check that there's enough disk space on the target drive.
    ;
    read-syms TreeSizes

    install LoadSetupLibrary
    detect  FreeSpaceVars
    install FreeSetupLibrary

    GetDriveInPath SnaDrive $(!SNARootDir)

    ForListDo $(STF_VolList)
      ifstr(i) $($) == $(SnaDrive)
        set VolFreeSpace = *( $(STF_VolFreeList), $(#) )
      endif
    EndForListDo

    ifstr(i) $(!InitialInstall) == $(!True)
      set ClientSpace = $(TreeSizeNT$(!SNA_SetupMode))
    else
      set ClientSpace = 0
    endif

    ForListDo { NT Dos Win16 Os2 }
      ifstr(i) *( $(!ClientInstalls), $(#) ) == $(!Chosen)  ; ! doesn't mean "not"
        set-add ClientSpace = $(ClientSpace), $(TreeSize$($)Client)
      endif
    EndForListDo

    ifint $(VolFreeSpace) < $(ClientSpace)
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS +
            "Not enough room on drive "$(SnaDrive)" for the selected"+
            " SNA Clients ("$(ClientSpace)" megs needed, "$(VolFreeSpace)+
            " available)."$(!LF)$(!LF)+
            "Click OK to retry your selection."
      ui pop 1
      goto BeginDoClientTypes
    endif

  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK

  endif

  ui pop 1
  return $(Status)


[DoClientMode]
;
; Globals affected: !ClientMode, !RemoteSvr1/2
;
  set Status = STATUS_FAILED
  read-syms ClientModeDlg

  ;
  ; Read server names from registry
  ;
  OpenRegKey $(!REG_H_LOCAL), "", +
             "System\CurrentControlSet\Services\SnaBase\Parameters", +
             $(!REG_KEY_READWRITE), KeyParams
  ifstr(i) $(KeyParams) != ""
    GetRegValue $(KeyParams) "Sponsors" SponsVal
    ifstr(i) $(SponsVal) != {}
      set SponsStrList = *( $(SponsVal), 4 )
      QueryListSize SponsListSize $(SponsStrList)
      ifint $(SponsListSize) > 0
        set !RemoteSvr1 = *( $(SponsStrList), 1 )
        ifint $(SponsListSize) > 1
          set !RemoteSvr2 = *( $(SponsStrList), 2 )
        endif
      endif
      set SponsStrList = {}
      set SponsVal = {}
    endif
    CloseRegKey $(KeyParams)
  endif

  ifstr(i) $(!RemoteSvr1) != ""
    set !ClientMode = $(!ClientRemote)
  else
    set !ClientMode = $(!ClientLocal)
  endif

  set RadioDefault  = $(!ClientMode)
  set OptionsGreyed = {}

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_SUCCESSFUL

    ;
    ; Save current remote server names, and re-suggest them if
    ; the user later switches back to local mode.
    ;
    set !OldClientMode = $(!ClientMode)
    set !ClientMode    = $(ButtonChecked)

    ifstr(i) $(!ClientMode) == $(!ClientLocal)
      ifstr(i) $(!OldClientMode) == $(!ClientRemote)
        set !RemoteSav1 = $(!RemoteSvr1)
        set !RemoteSav2 = $(!RemoteSvr2)
      endif
      set !RemoteSvr1 = ""
      set !RemoteSvr2 = ""
      shell "" WriteSvrNames $(!RemoteSvr1) $(!RemoteSvr2)

    else-ifstr(i) $(!ClientMode) == $(!ClientRemote)
      ifstr(i) $(!OldClientMode) == $(!ClientLocal)
        set !RemoteSvr1 = $(!RemoteSav1)
        set !RemoteSvr2 = $(!RemoteSav2)
      endif
    endif

  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK

  endif

  ui pop 1
  return $(Status)


[DoRemoteServers]
  set Status = STATUS_FAILED
  read-syms RemoteServersDlg

  set EditTextIn  = { $(!RemoteSvr1), $(!RemoteSvr2) }
  set EditTextLim = { 16, 16 }
  set EditFocus   = "ALL"

BeginDRS =+
  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    ifstr(i) *( $(EditTextOut), 1 ) == ""
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS +
            "For remote operation of your SNA Client,"$(!LF)+
            "you must supply the primary server name."
      goto BeginDRS
    endif
    set Status = STATUS_SUCCESSFUL
    set T1 = *( $(EditTextOut), 1 )
    set T2 = *( $(EditTextOut), 2 )

    Split-String $(T1) "\" T1Split
    QueryListSize T1Size $(T1Split)
    ifint $(T1Size) > 1
      set Index = 1
RSLoop1 =+
      ifstr(i) *( $(T1Split), $(Index) ) == "\"
        set-add Index = $(Index), 1
        ifint $(Index) > $(T1Size)
          set T1 = ""
        else
          goto RSLoop1
        endif
      else
        set T1 = *( $(T1Split), $(Index) )
      endif
    endif

    Split-String $(T2) "\" T2Split
    QueryListSize T2Size $(T2Split)
    ifint $(T2Size) > 1
      set Index = 1
RSLoop2 =+
      ifstr(i) *( $(T2Split), $(Index) ) == "\"
        set-add Index = $(Index), 1
        ifint $(Index) > $(T2Size)
          set T2 = ""
        else
          goto RSLoop2
        endif
      else
        set T2 = *( $(T2Split), $(Index) )
      endif
    endif

    set !RemoteSvr1 = $(T1)
    set !RemoteSvr2 = $(T2)

    ifstr(i) $(!InitialInstall) == $(!False)
      ;
      ; Write 'em to the registry RIGHT NOW -- this will allow
      ; SnaBase to pick them up when it receives the "update
      ; yourself" event which we'll send shortly.
      ;
      shell "" WriteSvrNames $(!RemoteSvr1) $(!RemoteSvr2)
    endif

  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK

  endif

  ui pop 1
  return $(Status)


[WriteSvrNames]
    set Status = STATUS_SUCCESSFUL

    OpenRegKey $(!REG_H_LOCAL), "", +
               "System\CurrentControlSet\Services\SnaBase\Parameters", +
               $(!REG_KEY_READWRITE), KeyParams
    ifstr(i) $(KeyParams) != ""
      shell $(!UtilInfFile) AddValueList $(KeyParams) +
            { +
               { "Sponsors", $(NoTitle), $(!REG_VT_MULTI_SZ), { $($0), $($1) } }, +
            }
      CloseRegKey $(KeyParams)
    else
      set Status = STATUS_FAILED
    endif

    return $(Status)


[DoAdminFiles]
  set Status = STATUS_SUCCESSFUL
  read-syms AdminFilesDlg

  set OptionsGreyed = {}
  ifstr(i) $(!InstallAdminFiles) == $(!True)
    set CheckItemsIn  = { $(!Chosen) }
  else
    set CheckItemsIn  = { $(!NotChosen) }
  endif

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_SUCCESSFUL
    ifstr(i) *( $(CheckItemsOut), 1 ) == $(!Chosen)
      set !InstallAdminFiles = $(!True)
    else
      set !InstallAdminFiles = $(!False)
    endif

  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK

  endif

  ui pop 1
  return $(Status)


    set Status = STATUS_SUCCESSFUL
    return $(Status)


[DoSetupOptions]
  set Status = STATUS_SUCCESSFUL
  read-syms SetupOptionsDlg

  ifstr(i) $(!SNA_SetupMode) == "Client"
    set DlgTemplate   = "IDD_CLNTSETUPOPTIONS"
    set ButtonDesc1   = "Configure SNA Client Software"
    set ButtonDesc2   = "Remove SNA Client Software"
    set ButtonDesc3   = ""
    set ButtonText1   = "Con&figure..."
    set ButtonText2   = "&Remove..."
    set ButtonText3   = ""

  else-ifstr(i) $(!SNA_SetupMode) == "Workstation"
    set DlgTemplate   = "IDD_WKSTASETUPOPTIONS"
    set ButtonDesc2   = "Remove "$(!SNA_ProductFlavor)" Software"
    set ButtonDesc3   = ""
    set ButtonDesc4   = ""
    set ButtonText2   = "&Remove..."
    set ButtonText3   = ""
    set ButtonText4   = ""

  endif

  set HelpContext = #( HelpContextIDs, $(DlgTemplate), 1 )

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "DlgButton1"
    set !SetupOption = "1"

  else-ifstr(i) $(DLGEVENT) == "DlgButton2"
    set !SetupOption = "2"

  else-ifstr(i) $(DLGEVENT) == "DlgButton3"
    set !SetupOption = "3"

  else-ifstr(i) $(DLGEVENT) == "DlgButton4"
    set !SetupOption = "4"

  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK

  else-ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_CONTINUE

  endif

  ui pop 1
  return $(Status)


[DoReview]
  set Status = STATUS_FAILED
  read-syms ReviewDlg

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT

  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_REVIEW

  else-ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_SUCCESSFUL

  endif

  ui pop 1
  return $(Status)


[DoWarnNoLSToConfig]
  shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) +
        "NONFATAL" +
        "You must specify a link service to configure."

  return STATUS_SUCCESSFUL


[DoWarnNoLSToRemove]
  shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) +
        "NONFATAL" +
        "You must specify a link service to remove."

  return STATUS_SUCCESSFUL


[DoWarnBadLSRemove]
  shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) +
        "NONFATAL" +
        "The remove operation failed."

  return STATUS_SUCCESSFUL


[DoWarnNoLSInstalled]
  shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) +
        "WARNING" +
        "You have not yet installed any link services."$(!LF)$(!LF)+
        "Are you sure you want to continue?"$(!LF)

  ifstr(i) $($R1) == "Ok"
    set Status = STATUS_CONTINUE
  else
    set Status = STATUS_CANCEL
  endif

  return $(Status)


[DoWarnLSBadInstall]
  ifstr(i) $(!P:InstallStatus) == STATUS_USERCANCEL
    set ErrorMsg = "Installation process cancelled by user."

  else-ifstr(i) $(!P:InstallStatus) == STATUS_INVALIDINF
    ifstr(i) $(!P:TmpInfTitle) == ""
      set ErrorMsg = "Please select a link service from the list box "$(!LF)+
                     "before clicking the Install button."
    else
      set ErrorMsg = "Setup cannot find the necessary information"$(!LF)+
                     "to install:"$(!LF)+
                     $(!P:TmpInfTitle)$(!LF)+
                     "in:"$(!LF)+
                     $(!DriverDir)
    endif
  else
    set ErrorMsg = $(!LF)"The installation process failed."
  endif

  shell $(!P:SubroutineInf) SetupMessage $(!STF_LANGUAGE) +
        "NONFATAL" +
        $(ErrorMsg)

  return


[DoWarnLSBadRemove]
  ifstr(i) $(!P:InstallStatus) == STATUS_USERCANCEL
    set ErrorMsg = "Removal process cancelled by user."

  else
    set ErrorMsg = $(!LF)"The removal process failed and damage to"$(!LF)+
                   $(!SNA_ProductFlavor)" may have resulted."$(!LF)$(!LF)
  endif

  shell $(!P:SubroutineInf) SetupMessage $(!STF_LANGUAGE) +
        "NONFATAL" +
        $(ErrorMsg)

  return


[DoLSConfigure]
  set Status = STATUS_FAILED
  read-syms LSConfigureDlg

  ifstr(i) $(!Install4) == $(!True)
    set DlgTemplate = "IDD_LINKCONFIG4"
  else
    set DlgTemplate = "IDD_LINKCONFIG3"
  endif

  set ListItemsIn = {}
  set Counter = 1

  ForListDo $(!LinkServiceList)
    set Title = *( $($), 2 )

    ifstr(i) $(Title) == ""
      set Title = "<null "$(Counter)">"
      set-add Counter = $(Counter), 1
    endif

    set ListItemsIn = >( $(ListItemsIn), $(Title) )

  EndForListDo

  set ListItemsOut = *( $(ListItemsIn), 1 )

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_SUCCESSFUL
  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT
  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK
  else-ifstr(i) $(DLGEVENT) == "DlgButton1"
    set Status = STATUS_CONFIG
  else-ifstr(i) $(DLGEVENT) == "DlgButton2"
    set Status = STATUS_OTHER
  else-ifstr(i) $(DLGEVENT) == "DlgButton3"
    set Status = STATUS_REMOVE
  endif

  ifstr(i) $(ListDblClick) == "True"
    set Status = STATUS_CONFIG
  endif

  ui pop 1

  ;
  ; When we need to figure out which title the user selected, all we have to
  ; do is the same thing that I did for Driver titles and []'s.  Go through
  ; ListItemsIn till we find this particular title and then index
  ; LinkServiceList with $(#)
  ;
  ForListDo $(ListItemsIn)
   ifstr(i) $(ListItemsOut) == *( $($), 1 )
     set LinkToUse = *( $(!LinkServiceList), $(#) )
   endif
  EndForListDo

  return $(Status) $(LinkToUse)


[DoLSInstallRemove]
  set Status = STATUS_FAILED
  read-syms LSInstallRemoveDlg

  ifstr(i) $(!Install4) == $(!True)
    set DlgTemplate = "IDD_LINKOPSBUT4"
  else
    set DlgTemplate = "IDD_LINKOPSBUT3"
  endif

  set ListItemsIn = {}
  ForListDo $(!DriversAvailable)
    set DriverIn = *( $($), 1 )

    ifstr(i) *( $($), 4 ) == "IMPORT"
      set DriverIn = "[ "$(DriverIn)" ]"
    endif

    set ListItemsIn = >( $(ListItemsIn), $(DriverIn) )

  EndForListDo

; set ListItemsOut = *( $(ListItemsIn), 1 )
  set ListItemsOut = ""

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_SUCCESSFUL
  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT
  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK
  else-ifstr(i) $(DLGEVENT) == "DlgButton2"
    set Status = STATUS_OTHER
  else-ifstr(i) $(DLGEVENT) == "DlgButton1"
    set Status = STATUS_INSTALL
  endif

  ifstr(i) $(ListDblClick) == "True"
    set Status = STATUS_INSTALL
  endif

  ForListDo $(ListItemsIn)

   ifstr(i) $(ListItemsOut) == *( $($), 1 )
     set DriverToUse = *( $(!DriversAvailable), $(#) )
   endif

  EndForListDo

EndDoLSInstallRemove =+
  ui pop 1
  return $(Status) $(DriverToUse)


[ObtainPath]
  ; pass in name of dlg section to read
  ifstr(i) $($0) != ""
    read-syms $($0)
  endif

OD_DoDlg =+
  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Back"
    ui pop 1
    return STATUS_GOBACK

  else-ifstr(i) $(DLGEVENT) == "Exit"
    ui pop 1
    return STATUS_USEREXIT

  else-ifstr(i) $(DLGEVENT) == "Continue"

    ; Test path validity

    install LoadSetupLibrary
    ifstr(i) $(!LIBHANDLE) != ""
      LibraryProcedure IsFullPath $(!LIBHANDLE) +
                       CheckPathFullPathSpec $(EditTextOut)
      install FreeSetupLibrary
    endif

    ifstr(i) $(IsFullPath) == "No"
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL +
            """"$(EditTextOut)""" is not a valid path!  Please try again."
      ui pop 1
      goto OD_DoDlg
    else
      set Status  = STATUS_SUCCESSFUL
      set TestDir = $(EditTextOut)
    endif

    ; Make sure there's a drive letter at the front

    Split-String $(TestDir) ":" _DirSplit
    QueryListSize _DirSize $(_DirSplit)

    ifstr(i) *( $(_DirSplit), $(_DirSize) ) == ":"
      shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL +
            $(!SNA_ProductFlavor)" Setup requires that the full"$(!LF)+
            "path be specified with a drive letter included."
      ui pop 1
      goto OD_DoDlg
    endif

    ; Append a trailing backslash if necessary

    Split-String $(TestDir) "\" _DirSplit
    QueryListSize _DirSize $(_DirSplit)

    ifstr(i) *( $(_DirSplit), $(_DirSize) ) != "\"
      set TestDir = $(TestDir)"\"
    endif

    ui pop 1
    return $(Status) $(TestDir)


[DoOtherDrivers]
  set !DriverDir = $(!CurDriverDir)

  shell "" ObtainPath OtherDriversDlg

  ifstr(i) $($R0) != STATUS_SUCCESSFUL
    return $($R0)
  endif

  set !DriverDir = $($R1)
  set !CurDriverDir = $(!DriverDir)

  shell $(!UtilInfFile) EnumerateDrivers $(!DriverDir)
  set OtherDriverList = $($R1)

  ifstr(i) $(OtherDriverList) == {}
      shell $(!P:SubroutineInf) SetupMessage $(!STF_LANGUAGE) +
            "NONFATAL" +
            "Setup can't find any INF files in:"$(!LF)+
            $(!DriverDir)$(!LF)$(!LF)+
            "Please double check your path."
      set Status = STATUS_REPEAT
  endif

  StartWait

  ForListDo $(OtherDriverList)
      ;
      ; Add the "IMPORT" flag to each of the new drivers
      ;
      set $ = >( $($), "IMPORT" )
      set $ = >( $($), $(!DriverDir) )
      set TmpDriverName  = *( $($), 1 )
      set TmpDriverMatch = $(!False)

      ForListDo $(!DriversAvailable)
        ifstr(i) *( $($), 1 ) == $(TmpDriverName)
          set TmpDriverMatch = $(!True)
        endif

      EndForListDo

      ifstr(i) $(TmpDriverMatch) == $(!False)
        set !DriversAvailable = >( $(!DriversAvailable), $($) )
      endif

  EndForListDo

  EndWait

  return $(Status)


[DoConfirmRemove]
  set Status = STATUS_FAILED
  read-syms ConfirmRemoveDlg

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_SUCCESSFUL
  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK
  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT
  endif

  ui pop 1
  return $(Status)


[DoConfirmRemoveLS]
  set Status = STATUS_FAILED
  read-syms ConfirmRemoveLSDlg

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_SUCCESSFUL
  else-ifstr(i) $(DLGEVENT) == "Back"
    set Status = STATUS_GOBACK
  else-ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_USEREXIT
  endif

  ui pop 1
  return $(Status)


[DoSuccessClient]
  read-syms SuccessClientDlg

  ui start $(DlgTemplate) $(!DLGHANDLE)

  ui pop 1
  return STATUS_SUCCESSFUL


[DoSuccessInstall]
  set Status = STATUS_FAILED

; ifstr(i) $(!InitialInstall) == $(!False)
    read-syms SuccessAdminDlg
    set DlgText1 = $(!LF)"   Your system has been successfully installed."
; else
;   read-syms SuccessRebootDlg
; endif

  ui start $(DlgTemplate) $(!DLGHANDLE)

; ifstr(i) $(!InitialInstall) == $(!False)
    ifstr(i) $(DLGEVENT) == "Exit"
      set Status = STATUS_LAUNCHADMIN
    else-ifstr(i) $(DLGEVENT) == "Continue"
      set Status = STATUS_SUCCESSFUL
    endif

; else
;   ifstr(i) $(DLGEVENT) == "Exit"
;     set Status = STATUS_SUCCESSFUL
;   else-ifstr(i) $(DLGEVENT) == "Continue"
;     set Status = STATUS_REBOOT
;   endif

  endif

  ui pop 1
  return $(Status)


[DoSuccessModify]
  set Status = STATUS_FAILED
  read-syms SuccessAdminDlg

  set DlgText1 = $(!LF)"   Your system has been successfully modified."
  ui start $(DlgTemplate) $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Exit"
    set Status = STATUS_LAUNCHADMIN
  else-ifstr(i) $(DLGEVENT) == "Continue"
    set Status = STATUS_SUCCESSFUL
  endif

  ui pop 1
  return $(Status)


[DoSuccessRemove]
  shell $(!P:SubroutineInf) SetupMessage $(!STF_LANGUAGE) +
        "STATUS" +
        "The "$(!SNA_ProductFlavor)" has been removed from your machine."$(!LF)$(!LF)+
        "Run this Setup program again to reinstall it,"$(!LF)+
        "if you wish to do so sometime in the future."

  return STATUS_SUCCESSFUL


[DoFailedRemove]
  set ErrorMsg = +
        "The "$(!SNA_ProductFlavor)" has not been completely removed from your"$(!LF)+
        "machine due to a failure in:"$(!LF)

  ForListDo $(!P:ErrorList)
    set ErrorMsg = $(ErrorMsg)$(#)") "$($)$(!LF)
  EndForListDo

  shell $(!P:SubroutineInf) SetupMessage $(!STF_LANGUAGE) +
        "STATUS" +
        $(ErrorMsg)

  return STATUS_SUCCESSFUL


[CreateProgManStuff]
  set SNAProgManGroup = $(!SNA_ProductName)

  CreateCommonProgManGroup $(SNAProgManGroup) ""

  ifstr(i) $(!SNA_SetupMode) != "Workstation"
    CreateCommonProgmanItem  $(SNAProgManGroup) +
                             $(!SNA_ProductName)" 3270 Applet" +
                             $(!SNARootDir)"\"$(!SNABinDir)"\WIN3270" +
                             "" 0

    CreateCommonProgmanItem  $(SNAProgManGroup) +
                             $(!SNA_ProductName)" 5250 Applet" +
                             $(!SNARootDir)"\"$(!SNABinDir)"\WIN5250" +
                             "" 0
  endif

  CreateCommonProgmanItem  $(SNAProgManGroup) +
                           $(!SNA_ProductName)" Setup" +
                           $(!SNARootDir)"\SETUP.EXE" +
                           $(!STF_WINDOWSSYSPATH)"\SETUP.EXE" 0

  ifstr(i) $(!InstallAdminFiles) == $(!True)
    CreateCommonProgmanItem  $(SNAProgManGroup) +
                             $(!SNA_ProductName)" Admin" +
                             $(!SNARootDir)"\"$(!SNABinDir)"\snaadmin" +
                             "" 0

    CreateCommonProgmanItem  $(SNAProgManGroup) +
                             $(!SNA_ProductName)" Trace" +
                             $(!SNARootDir)"\"$(!SNABinDir)"\snatrace" +
                             "" 0

    CreateCommonProgmanItem  $(SNAProgManGroup) +
                             $(!SNA_ProductName)" Read Me" +
                             $(!STF_WINDOWSSYSPATH)"\NOTEPAD.EXE "$(!SNARootDir)"\README.TXT" +
                             "PROGMAN.EXE" 29
  endif

  exit


[RemoveProgManStuff]
  set SNAProgManGroup = $(!SNA_ProductName)

  RemoveCommonProgManItem $(SNAProgManGroup), $(!SNA_ProductName)" Setup"
  ifstr(i) $(!AdminFilesExist) == $(!True)
    RemoveCommonProgManItem $(SNAProgManGroup), $(!SNA_ProductName)" Admin"
    RemoveCommonProgManItem $(SNAProgManGroup), $(!SNA_ProductName)" Trace"
    RemoveCommonProgManItem $(SNAProgManGroup), $(!SNA_ProductName)" Read Me"
  endif

  ifint $(!STF_NTBUILDNUM) > 340
    RemoveCommonProgManGroup $(SNAProgManGroup)
  endif

  exit


[Remove3270IniSection]
  RemoveIniSection "WIN.INI", "SnaServerWin3270"
  exit


[ExitCheck]
  read-syms "ExitCheckDlg"

  ui start "IDD_EXITCHECK" $(!DLGHANDLE)

  ifstr(i) $(DLGEVENT) == "Back"
    set Status = $(!False)
    set !P:Exit_Code = 0
  else
    set Status = $(!True)
    set !P:Exit_Code = 1
  endif

  ui pop 1
  return $(Status)


;=============================================================================
;
; Dialog symbols
;
;=============================================================================

[LSConfigureDlg]
  DlgType       = "List"
  DlgTemplate   = "IDD_LINKCONFIG"
  Caption       = "Link Service Configuration"
  DlgText1      = +
            "To configure one of the listed link services, select it and "+
            "click Configure."$(!LF)$(!LF)+
            "To install a link service not listed, click Add."
  ListHeader1   = "Link Services Installed"
  Other1        = "Con&figure"
  Other2        = "&Add..."
  Other3        = "&Remove"
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext   = #( HelpContextIDs, "IDD_LINKCONFIG", 1 )


;-----------------------------------------------------------------------------
[LSInstallRemoveDlg]
  DlgType       = "List"
  DlgTemplate   = "Dummy"  ; Filled in later
  Caption       = "Link Service Installation"
  DlgText1      = "The following link services are available.  Select "+
                  "one and click the Install button."$(!LF)$(!LF)+
                  "To install a link service not listed, click Other."
  ListHeader1   = "Available Link Services:"
  Other1        = "&Install"
  Other2        = "&Other..."
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext   = #( HelpContextIDs, IDD_LINKOPS, 1 )


;-----------------------------------------------------------------------------
[ClientModeDlg]
  DlgType       = "Radio"
  DlgTemplate   = "IDD_CLIENTMODE"
  Caption       = "SNA Client Mode"
  DlgText1      = $(!LF)"Your SNA Client may operate on the same network domain "+
                  "as the Primary SNA Server (""Local"" operation), "+
                  "or on a different network domain than the server (""Remote"" "+
                  "operation)."
  RadioText1    = "&Local (same domain)"
  RadioText2    = "&Remote (different domain)"
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext   = #( HelpContextIDs, IDD_CLIENTMODE, 1 )


;-----------------------------------------------------------------------------
[RemoteServersDlg]
  DlgType       = "MultiEdit"
  DlgTemplate   = "IDD_REMOTESVRS"
  Caption       = "Remote SNA Server Names"
  DlgText1      = "Since you have selected Remote operation for your client, "+
                  "you must enter the name of the Primary remote SNA Server "+
                  "you'll be communicating through."$(!LF)$(!LF)+
                  "You may also enter the name of an optional Backup remote "+
                  "SNA Server."
  EditLabel1    = "&Primary:"
  EditLabel2    = "Bac&kup:"
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext   = #( HelpContextIDs, IDD_REMOTESVRS, 1 )


;-----------------------------------------------------------------------------
[AdminFilesDlg]
  DlgType       = "Check"
  DlgTemplate   = "IDD_ADMINFILES"
  Caption       = "Optional Administration Program"
  DlgText1      = "Do you want to install the "$(!SNA_ProductName)" Administration Program?"
  DlgText2      = "This program gives you control over your SNA Servers by allowing"+
                  " you to manage users, control link services, and change certain"+
                  " configuration items.  Most clients probably won't need to do this."
  CheckText1    = "&Install Administration Program"
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext   = #( HelpContextIDs, IDD_ADMINFILES, 1 )

;-----------------------------------------------------------------------------
[ClientTypesDlg]
  DlgType       = "Check"
  DlgTemplate   = "IDD_CLIENTTYPES"
  Caption       = "SNA Client Availability"
  DlgText1      = "You may choose to make SNA client software available to "+
                  "users on DOS, Windows, and OS/2 machines.  Users will be "+
                  "able to install the proper client over the network."
  CheckText1    = "Windows &NT (32-bit)"
  CheckText2    = "MS-&DOS"
  CheckText3    = "&Windows 3.1 (16-bit)"
  CheckText4    = "&OS/2"
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext   = #( HelpContextIDs, IDD_CLIENTTYPES, 1 )


;-----------------------------------------------------------------------------
[ConfirmRemoveDlg]
  DlgType       = "Info"
  DlgTemplate   = "IDD_CONFIRMREMSNA"
  Caption       = "Confirm Removal"
  DlgText1      = $(!LF)+
                  "   Are you sure you want to remove"$(!LF)+
                  "   the "$(!SNA_ProductFlavor)" from this machine?"
  DlgText2      = "If you remove them, all the "$(!SNA_ProductFlavor)" files will be deleted, "+
                  "and all your configuration information will be lost.  You'll "+
                  "have to run this Setup program again, and then run the Admin "+
                  "program to reconfigure your system."
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext	= #( HelpContextIDs, $(DlgTemplate), 1 )


;-----------------------------------------------------------------------------
[ConfirmRemoveLSDlg]
  DlgType       = "Info"
  DlgTemplate   = "IDD_CONFIRMREMSNA"
  Caption       = "Confirm Link Service Removal"
  DlgText1      = $(!LF)+
                  "Are you sure you want to remove this"$(!LF)+
                  "link service from your machine?"
  DlgText2      = $(!LF)$(!LF)+
                  "If you do remove it, and later change your mind, "+
                  "you'll have to reimport and reinstall it."
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext	= #( HelpContextIDs, "IDD_CONFIRMREMLS", 1 )


;-----------------------------------------------------------------------------
[DestPathDlg]
  DlgType       = "Edit"
  DlgTemplate   = "IDD_DESTPATH"
  Caption       = "Installation Path"
  DlgText1      = "The "$(!SNA_ProductFlavor)" files will be installed in the "+
                  "directory shown below."$(!LF)$(!LF)+
                  "To install the files somewhere else, edit the path."
  EditTextIn    = $(!SNARootDir)
  EditFocus     = "END"
  EditTextLim   = 48
  EditLabel1    = "Install to:"
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext   = #( HelpContextIDs, $(DlgTemplate), 1 )


;-----------------------------------------------------------------------------
[ExitCheckDlg]
  DlgType      = "Info"
  DlgTemplate  = "IDD_EXITCHECK"
  Caption      = "Exit "$(!SNA_ProductFlavor)" Setup"
  DlgText1     = "Do you really want to exit "$(!SNA_ProductFlavor)" Setup?"
  DlgText2     = "You may end Setup now by clicking Exit again, and all changes"+
                 " you've made so far will remain intact.  To return to Setup,"+
                 " click Cancel."
  Continue     = "E&xit"
  Back         = "&Cancel"


;-----------------------------------------------------------------------------
[ExitUserAbortDlg]
  DlgType      = "Info"
  DlgTemplate  = "IDD_EXITUSERABORT"
  Caption      = "Goodbye!"
  DlgText1     = $(!LF)$(!SNA_ProductFlavor)" Setup has been cancelled."
  DlgText2     = "If you want to reinstall at a later time, please remove"$(!LF)+
                 $(!SNARootDir)" manually before running Setup again."
  Continue     = "E&xit"


;-----------------------------------------------------------------------------
[NosTypesDlg]
  DlgType      = "Check"
  DlgTemplate  = "IDD_NOSTYPES"
  Caption      = "Select Network Operating Systems"
  DlgText1     = "Several Network Operating Systems (NOS) have been detected"+
                 " on this computer."
  DlgText2     = "SNA Server can work with any or all of them; please choose"+
                 " the ones you want by clicking on their check boxes."
  CheckText1   = "&Microsoft Networking"
  CheckText2   = "&Novell Netware"
  Continue     = "&Continue"
  Back         = "&Back"
  Help         = "&Help"
  Exit         = "E&xit"
  HelpContext  = #( HelpContextIDs, $(DlgTemplate), 1 )


;-----------------------------------------------------------------------------
[NetwareDomainDlg]
  DlgType      = "Edit"
  DlgTemplate  = "IDD_NETWAREDOMAIN"
  Caption      = "Netware Domain Name"
  DlgText1     = "To use SNA Server with Novell Netware, you will need to enter"+
                 " the name of the Netware domain in which you wish to operate."
  EditTextIn    = $(!SNA_NetwareDomain)
  EditFocus     = "ALL"
  EditTextLim   = 15
  EditLabel1    = "Domain Name:"
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext   = #( HelpContextIDs, $(DlgTemplate), 1 )


;-----------------------------------------------------------------------------
[OtherDriversDlg]
  DlgType      = "Edit"
  DlgTemplate  = "IDD_OTHERPATH"
  Caption      = "Link Service Import"
  DlgText1     = "Please insert a "$(!SNA_ProductName)" Link Service diskette "+
                 "into the drive shown below."$(!LF)$(!LF)+
                 "To import a link service from a different location, "+
                 "edit the path."
  EditLabel1   = "   Path:"
  EditTextIn   = $(!DriverDir)
  EditTextLim  = 255
  EditFocus    = "END"
  Continue     = "&Continue"
  Back         = "&Back"
  Help         = "&Help"
  Exit         = "E&xit"
  HelpContext  = #( HelpContextIDs, $(DlgTemplate), 1 )


;-----------------------------------------------------------------------------
[ClientSrcPathDlg]
  DlgType      = "Edit"
  DlgTemplate  = "IDD_OTHERPATH"
  Caption      = "Path To SNA Client Files"
  DlgText1     = "Please enter the path where the SNA Client files can be found."$(!LF)$(!LF)+
                 "This path can be a floppy drive, or a network drive connected"+
                 " to the ""CLIENTS"" share on another SNA Server."
  EditLabel1   = "   Path:"
  EditTextIn   = $(!ClientSrcDir)
  EditFocus    = "END"
  EditTextLim  = 255
  Continue     = "&Continue"
  Back         = "&Back"
  Help         = "&Help"
  Exit         = "E&xit"
  HelpContext  = #( HelpContextIDs, "IDD_CLIENTPATH", 1 )


;-----------------------------------------------------------------------------
[ServerRoleDlg]
  DlgType       = "Radio"
  DlgTemplate   = "IDD_SERVERROLE"
  Caption       = "Change SNA Server Role"
  DlgText1      = $(!LF)"Select the configuration role this SNA server "+
                  "should perform on this Domain."
  RadioGroup    = "Server Roles for this Domain:"
  RadioText1    = "&Primary Configuration Server"
  RadioText2    = "Back&up Configuration Server"
  RadioText3    = "&Member Server (no configuration)"
  OptionsGreyed = {}
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext   = #( HelpContextIDs, $(DlgTemplate), 1 )


;-----------------------------------------------------------------------------
[SetupModeDlg]
  DlgType       = "Info"
  DlgTemplate   = "IDD_SETUPMODE"
  Caption       = "Server/Client Selection"
  DlgText1      = $(!LF)"Choose Server or Client installation."
  GroupLabel1   = ""
  ButtonDesc1   = "SNA Server"
  ButtonDesc2   = "SNA Client"
  ButtonText1   = "&Server"
  ButtonText2   = "&Client"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"
  HelpContext   = #( HelpContextIDs, $(DlgTemplate), 1 )


;-----------------------------------------------------------------------------
[SetupOptionsDlg]
  DlgType       = "Info"
  DlgTemplate   = "IDD_SRVSETUPOPTIONS"
  Caption       = "Setup Options"
  DlgText1      = "The "$(!SNA_ProductFlavor)" program exists on this machine "+
                  "in the following directory:"
  DlgText2      = $(!SNARootDir)
  GroupLabel1   = "Options"
  ButtonDesc1   = "Configure Link Services"
  ButtonDesc2   = "Change Server Role"
  ButtonDesc3   = "Add new SNA Client types"
  ButtonDesc4   = "Remove "$(!SNA_ProductFlavor)
  ButtonText1   = "&Links..."
  ButtonText2   = "&Role..."
  ButtonText3   = "Clien&ts..."
  ButtonText4   = "Re&move..."
  Continue      = "&Continue"
  Back          = "&Back"
  Help          = "&Help"
  Exit          = "E&xit"

;-----------------------------------------------------------------------------
[WelcomeDlg]
  DlgType     = "Info"
  DlgTemplate = "IDD_WELCOME"
  Caption     = "Welcome to "$(!SNA_ProductFlavor)" Setup"
  DlgText1    = "This Setup program is for installing and removing"$(!LF)+
                "the "$(!SNA_ProductFlavor)" on your computer."
  SvrDlgText  = "  It also allows you to install, remove, and maintain"+
                " the computer's SNA Link Services."
  DlgText2    = "For help on how to use this Setup program, click Help."$(!LF)$(!LF)+
                "To quit now without doing anything, click Exit."$(!LF)$(!LF)+
                "To continue, click Continue."
  Continue    = "&Continue"
  Help        = "&Help"
  Exit        = "E&xit"
  HelpContext = #( HelpContextIDs, $(DlgTemplate), 1 )

;-----------------------------------------------------------------------------
[ReviewDlg]
  DlgType     = "Info"
  DlgTemplate = "IDD_REVIEW"
  Caption     = "Review Settings"
  DlgText1    = "Setup is ready to copy files to your hard disk in the"+
                " following directory:"
  DlgText2    = $(!SNARootDir)
  DlgText3    = "If you'd like to review your selections, click Review."$(!LF)+
                "When you are satisfied, click Continue."
  Continue    = "&Continue"
  Review      = "&Review"
  Exit        = "E&xit"

;-----------------------------------------------------------------------------
[SuccessClientDlg]
  DlgType     = "Info"
  DlgTemplate = "IDD_ONEBUTTON"
  Caption     = $(!SNA_ProductFlavor)" Setup Finished"
  DlgText1    = "Your SNA Client has been successfully installed."
  DlgText2    = "You may now begin communication with a host by starting the "+
                "SNA 3270 or 5250 Applet from the SNA Client Program Manager group."
  Exit        = "E&xit"

;-----------------------------------------------------------------------------
[SuccessAdminDlg]
  DlgType     = "Info"
  DlgTemplate = "IDD_ADMINEXIT"
  Caption     = $(!SNA_ProductFlavor)" Setup Finished"
  DlgText1    = "Dummy"
  DlgText2    = $(!LF)"You may now exit Setup, or you can run the "$(!SNA_ProductName)+
                " Admin program by clicking the Admin button."
  Continue    = "E&xit"
  Help        = "&Help"
  Exit        = "&Admin"
  HelpContext = #( HelpContextIDs, IDD_LAUNCHADMIN, 1 )

;-----------------------------------------------------------------------------
[SuccessRebootDlg]
  DlgType     = "Info"
  DlgTemplate = "IDD_ADMINEXIT"
  Caption     = $(!SNA_ProductFlavor)" Setup Finished"
  DlgText1    = "Your "$(!SNA_ProductFlavor)" has been been successfully installed."
  DlgText2    = "You must reboot your computer for the "$(!SNA_ProductFlavor)" to work "+
                "properly.  You may do this now by clicking the Reboot "+
                "button, or you may return to Windows NT by clicking Exit."
  Continue    = "&Reboot"
  Help        = "&Help"
  Exit        = "E&xit"
  HelpContext = #( HelpContextIDs, IDD_SUCCESSREBOOT, 1 )

;-----------------------------------------------------------------------------
[UserNotAdminDlg]
  DlgType     = "Info"
  DlgTemplate = "IDD_NOTADMIN"
  Caption     = "Administrator Error"

;-----------------------------------------------------------------------------
[BillboardDlg]
  DlgType     = "Billboard"
  DlgTemplate = "IDD_BILLBOARD"
  Caption     = $(!SNA_ProductName)" for Windows NT"


;=============================================================================
;
; File lists and install/copy subroutines
;
;=============================================================================

[DoInstallFiles]
  set Status = STATUS_SUCCESSFUL
  read-syms ProgressCopyVars

  ifstr(i) $(!SNA_SetupMode) == "Server"
    read-syms DestTreeDirList
  else-ifstr(i) $(!SNA_SetupMode) == "Workstation"
    read-syms DestTreeDirList
  else-ifstr(i) $(!SNA_SetupMode) == "Client"
    read-syms DestTreeClientDirList
  endif

  read-syms DestTree5250DirList

  ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!True)
    set DriverSrcDir = $(!SourceDir)
  else
    set DriverSrcDir = $(!SourceDir)"system\hwsetup\"
  endif

  set STF_OVERWRITE = "VERIFYSOURCEOLDER"

  install InstallSNAFiles

  ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
    return STATUS_USERQUIT
  else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
    return STATUS_FAILED
  endif

  shell $(!UtilInfFile) UpdateRootDir $(!SNARootDir) $(!SNA_SetupMode)

  ;
  ; If server, install client files for selected OSs.
  ;
  ifstr(i) $(!SNA_SetupMode) == "Server"
    set DoClients = $(!False)
    ForListDo $(!ClientInstalls)
      ifstr(i) $($) == $(!Chosen)
        set DoClients = $(!True)
      endif
    EndForListDo

    ifstr(i) $(DoClients) == $(!True)
      ForListDo { NT, DOS, WIN16, OS2 }
        read-syms ClientDirList$($)
      EndForListDo

      set STF_DECOMPRESS = ""

      install InstallClientFiles

      ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
        return STATUS_USERQUIT
      else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
        return STATUS_FAILED
      endif

    endif
  endif

; install CreateToolsIni

  return $(Status)


[CreateToolsIni]
  CreateIniKeyValue $(!SNARootDir)"\system\tools.ini" +
                    "ntsd" +
                    "inifile "$(!SNARootDir)"\system\snadump.scr"$(!LF)$(!LF) +
                    "" VITAL
  exit


[InstallSNAFiles]
  ; BUGBUG:  Add checking to DESTPATH dialog to ensure that SNARootDir is creatable.

  set STF_VITAL = ""
  set STF_OVERWRITE = "VERIFYSOURCEOLDER"

  CreateDir $(!SNARootDir)

  AddSectionFilesToCopyList "FilesIn-SnaRoot" +
      $(!SourceDir) $(!SNARootDir)

  ForListDo $(DestTreeDirs)
    CreateDir $(!SNARootDir)\$($)

    AddSectionFilesToCopyList "FilesIn-"$($) +
        $(!SourceDir)$($) $(!SNARootDir)"\"$($)

  EndForListDo

  AddSectionFilesToCopyList "DllsIn-NtSystem" +
      $(!SourceDir)"system" $(!STF_WINDOWSSYSPATH)

  ifstr(i) $(!SNA_SetupMode) == "Client"
    ifstr(i) $(!InstallAdminFiles) == $(!True)

      AddSectionFilesToCopyList "AdminFilesIn-SnaRoot" +
          $(!SourceDir) $(!SNARootDir)

      AddSectionFilesToCopyList "AdminFilesIn-system" +
          $(!SourceDir)"system" $(!SNARootDir)"\system"
    endif
  endif

  ifstr(i) $(!SNA_SetupMode) != "Workstation"
    ; 3270 emulator files

    AddSectionFilesToCopyList "EmulatorFiles" +
      $(!SourceDir)"system" $(!SNARootDir)"\system"

    ; 5250 emulator files

    AddSectionFilesToCopyList "5250FilesIn-SnaSystem" +
      $(!SourceDir)"system" $(!SNARootDir)"\system"

    ForListDo $(DestTree5250Dirs)
      CreateDir $(!SNARootDir)\$($)
      AddSectionFilesToCopyList "5250FilesIn-"$($) +
        $(!SourceDir)$($) $(!SNARootDir)"\"$($)
    EndForListDo

    ; Emulator font files

    AddSectionFilesToCopyList "EmulatorFont" +
      $(!SourceDir)"system" $(!SNARootDir)"\system"
    ;
    ; If the emulator's font file is already in \winnt\system32,
    ; don't try to copy over it (avoids an error if it's locked).
    ;
    LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\setupdll.dll !LIBHANDLE
    LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance +
                     $(!STF_WINDOWSSYSPATH)"\LTYPE.TTF"
    ifstr(i) $(ExistStatus) == "NO"
      AddSectionFilesToCopyList "EmulatorFont" +
          $(!SourceDir)"system" $(!STF_WINDOWSSYSPATH)
    endif
    FreeLibrary $(!LIBHANDLE)
  endif

  ;
  ; Files for server/wksta install only
  ;
  ifstr(i) $(!SNA_SetupMode) != "Client"

    AddSectionFilesToCopyList "ServerOnlyFilesIn-system" +
      $(!SourceDir)"system" $(!SNARootDir)"\system"

    AddSectionFilesToCopyList "ServerOnlyFilesIn-system\config" +
      $(!SourceDir)"system\config" $(!SNARootDir)"\system\config"

;   AddSectionFilesToCopyList "ServerOnlyDllsIn-NtSystem" +
;     $(!SourceDir)"system" $(!STF_WINDOWSSYSPATH)

    AddSectionFilesToCopyList "AdminFilesIn-SnaRoot" +
        $(!SourceDir) $(!SNARootDir)

    AddSectionFilesToCopyList "AdminFilesIn-system" +
        $(!SourceDir)"system" $(!SNARootDir)"\system"

    ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!False)
      AddSectionFilesToCopyList "CDIBMLinkServiceFiles" +
        $(DriverSrcDir) $(!SNARootDir)"\system\hwsetup\"
    else
      AddSectionFilesToCopyList "IBMLinkServiceFiles" +
        $(DriverSrcDir) $(!SNARootDir)"\system\hwsetup\"
    endif

  endif

  CopyFilesInCopyList

  exit


[InstallClientFiles]
  set STF_VITAL = ""

  CreateDir $(!SNARootDir)"\clients"

  set TmpDirNames = { "WinNT", "MSDOS", "Win3x", "OS2" }

  ForListDo { NT DOS WIN16 OS2 }

    ifstr(i) *( $(!ClientInstalls), $(#) ) == $(!Chosen)

      set ClientType = $($)
      set _DstDir    = $(!SNARootDir)"\clients\"*($(TmpDirNames),$(#))

      ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!False)
        set _SrcDir    = $(!SourceDir)"clients\"*($(TmpDirNames),$(#))
      else
        set _SrcDir    = $(!SourceDir)
      endif

      ifstr(i) $(!InitialInstall) == $(!False)  ; we must've come from SetupOptions
        ifcontains(i) $(!ClientDrive) in $(!STF_FLOPPYLIST)
          set _SrcDir = $(!ClientSrcDir)
        else
          set _SrcDir = $(!ClientSrcDir)*($(TmpDirNames),$(#))
        endif
      endif

      CreateDir $(_DstDir)

      ifstr(i) $(ClientType) == "NT"
        AddSectionFilesToCopyList "FilesIn-SnaRoot" +
            $(!SNARootDir) $(_DstDir)

        ifstr(i) $(!InstallAdminFiles) == $(!True)
          AddSectionFilesToCopyList "AdminFilesIn-SnaRoot" +
              $(!SNARootDir) $(_DstDir)
        endif

      else
        ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!True)
          AddSectionFilesToCopyList "ClientFiles"$(ClientType)"-root" +
              $(_SrcDir) $(_DstDir)
        else
          AddSectionFilesToCopyList "CDClientFiles"$(ClientType)"-root" +
              $(_SrcDir) $(_DstDir)
        endif
      endif

      ForListDo $(ClientDirs$(ClientType))

        ; bugbug: it'd be nice to make the use of trailing backslashes consistent.

        ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!True)
          set _from = $(_SrcDir)$($)
        else
          set _from = $(_SrcDir)"\"$($)
        endif

        ifcontains(i) $(!ClientDrive) in $(!STF_FLOPPYLIST)
          set _from = $(_SrcDir)$($)
        endif

        CreateDir $(_DstDir)"\"$($)

        ifstr(i) $(ClientType) == "NT"

          ifstr(i) $($) == "system"

            AddSectionFilesToCopyList "FilesIn-system" +
                $(!SNARootDir)"\system" +
                $(_DstDir)"\"$($)

            AddSectionFilesToCopyList "DllsIn-NtSystem" +
                $(!STF_WINDOWSSYSPATH) +
                $(_DstDir)"\"$($)

            ; 3270 emulator files

            AddSectionFilesToCopyList "EmulatorFiles" +
                $(!SNARootDir)"\system" +
                $(_DstDir)"\"$($)

            ; 5250 emulator files

            AddSectionFilesToCopyList "5250FilesIn-SnaSystem" +
              $(!SNARootDir)"\system" $(_DstDir)"\system"

            ForListDo $(DestTree5250Dirs)
              CreateDir $(_DstDir)"\"$($)
              AddSectionFilesToCopyList "5250FilesIn-"$($) +
                $(!SNARootDir)"\"$($) $(_DstDir)"\"$($)
            EndForListDo

            AddSectionFilesToCopyList "EmulatorFont" +
                $(!SNARootDir)"\system" +
                $(_DstDir)"\"$($)

            ifstr(i) $(!InstallAdminFiles) == $(!True)
              AddSectionFilesToCopyList "AdminFilesIn-system" +
                  $(!SNARootDir)"\system" +
                  $(_DstDir)"\"$($)
            endif

          endif

        else
          ifstr(i) $(!STF_FLOPPY_INSTALL) == $(!True)
            AddSectionFilesToCopyList "ClientFiles"$(ClientType)"-"$($) +
                                      $(_from) $(_DstDir)"\"$($)
          else
            AddSectionFilesToCopyList "CDClientFiles"$(ClientType)"-"$($) +
                                      $(_from) $(_DstDir)"\"$($)
          endif
        endif

      EndForListDo

    endif

  EndForListDo

  CopyFilesInCopyList

  exit


[Source Media Descriptions]
   1  = "SNA Server Diskette #1",      TAGFILE = SETUPUTL.INF
   2  = "SNA Server Diskette #2",      TAGFILE = SYSTEM\DISK2.TAG
   3  = "SNA Server Diskette #3",      TAGFILE = SYSTEM\NETVIEW.DL$
   4  = "SNA Server Diskette #4",      TAGFILE = SYSTEM\DISK4.TAG
   5  = "IBM Drivers Diskette (#5)",   TAGFILE = IBMDFT.SRL
   20 = "IBM Drivers Diskette (#5)",   TAGFILE = SYSTEM\HWSETUP\IBMDFT.SRL
   6  = "MS-DOS Client Diskette",      TAGFILE = SNABASE.EXE
   21 = "MS-DOS Client Diskette",      TAGFILE = CLIENTS\MSDOS\SNABASE.EXE
   7  = "Windows Client Diskette #1",  TAGFILE = WNAP.EX$
   22 = "Windows Client Diskette #1",  TAGFILE = CLIENTS\WIN3X\WNAP.EX$
   8  = "Windows Client Diskette #2",  TAGFILE = WIN3270.EX$
   23 = "Windows Client Diskette #2",  TAGFILE = CLIENTS\WIN3X\WIN3270.EX$
   9  = "OS/2 Client Diskette",        TAGFILE = COMBASE.SYS
   24 = "OS/2 Client Diskette",        TAGFILE = CLIENTS\OS2\COMBASE.SYS
   99 = "IRMA Workstation for Windows NT #9",      TAGFILE = DCADFT.HLP

[TreeSizes]             ; megabytes
  TreeSizeNTServer      =  9
  TreeSizeNTWorkstation =  9
  TreeSizeNTClient      =  7
  TreeSizeDosClient     =  2
  TreeSizeWin16Client   =  2
  TreeSizeOs2Client     =  2

[DestTreeDirList]
  DestTreeDirs = { +
    traces,                 +
    system,                 +
    system\config,          +
    system\hwsetup,         +
    system\hwsetup\ibmdft,  +
    system\hwsetup\ibmsdlc, +
    system\hwsetup\ibmx25,  +
    system\hwsetup\dcadft,  +
    system\hwsetup\dcasdlc, +
    system\hwsetup\dcax25,  +
    system\hwsetup\snadlc   }

[DestTreeClientDirList]
  DestTreeDirs = { traces, system }

[DestTree5250DirList]
  DestTree5250Dirs = { system\charsets, system\kbdinfo, system\mri2924 }

[FilesIn-SnaRoot]
  1, setup.exe
  1, snasetup.hlp
  1, setup.inf
  1, setupsvc.dll
  1, setuputl.inf
  1, setup.srl

[FilesIn-system]
  1, comtblg.dat
  1, checksum.exe
  1, chk.sum
  1, snapopup.exe
  1, snabase.exe
  2, disk2.tag
  2, snashmem.exe
  2, snatrace.exe
  2, snatrace.hlp
  1, snadmod.dll
  1, snaevent.dll
  1, snalm.dll
  1, snareg.dll
  1, snasvc.dll
  1, snatrc.dll
  1, snatrccn.dll
  1, snatrcsn.dll
  1, snaupdat.dll
  2, snaperf.dll
  2, winappc.dll
  2, wincpic.dll
  2, wincsv.dll
  2, winmgt.dll
  2, winrui.dll
  2, winsli.dll
  2, snancp.dll
  2, snanw.dll
  2, snaver.exe
  3, nvalert.dll
  3, netview.dll
  3, nvalert.exe
  3, nvalert.ini

[EmulatorFiles]
  3, cfgs3270.dll
  3, fmis3270.dll
  3, ftp3270.dll
  3, sna3270.dll
  3, snas3270.dll
  3, trc3270.dll
  3, win3270.exe
  3, win3270.hlp

[5250FilesIn-SnaSystem]
  3, intrface.lst
  3, rumba.ini
  3, snasrv.exe
  3, win5250.exe
  3, win5250.hlp
  3, nls.dll
  3, qrmb.dll
  3, rumbaflv.dll

[5250FilesIn-system\charsets]
  3, convtbls.256
  3, convtbls.259
  3, convtbls.260
  3, convtbls.273
  3, convtbls.277
  3, convtbls.278
  3, convtbls.280
  3, convtbls.281
  3, convtbls.284
  3, convtbls.285
  3, convtbls.290
  3, convtbls.297
  3, convtbls.37
  3, convtbls.500
  3, convtbls.871

[5250FilesIn-system\kbdinfo]
  3, kbdinfo.bgm
  3, kbdinfo.cnd
  3, kbdinfo.dmk
  3, kbdinfo.frn
  3, kbdinfo.grm
  3, kbdinfo.ice
  3, kbdinfo.ity
  3, kbdinfo.ltn
  3, kbdinfo.ntl
  3, kbdinfo.nwy
  3, kbdinfo.ptg
  3, kbdinfo.sfr
  3, kbdinfo.sgr
  3, kbdinfo.spn
  3, kbdinfo.swd
  3, kbdinfo.uk
  3, kbdinfo.usa

[5250FilesIn-system\mri2924]
  3, ncomm.dll
  3, nrmb.dll
  3, nwsf.dll

[EmulatorFont]
  3, ltype.ttf

[DllsIn-NtSystem]
  1, ctl3d32.dll
  1, getuser.dll

[ServerOnlyFilesIn-system]
  4, disk4.tag
  4, nvcmd.dll
  4, nvruncmd.dll
  4, nvruncmd.exe
  4, snalink.exe
  4, snanmvt.exe
  4, snaservr.exe
  4, snalink.dll

[ServerOnlyFilesIn-system\config]
  4, com.cfg

[ServerOnlyDllsIn-NtSystem]

[AdminFilesIn-SnaRoot]
;  1, readme.txt

[AdminFilesIn-system]
  2, snacfg.exe
  2, snacfg.dll
  2, snamanag.dll
  2, snaadmin.exe
  3, snaadmin.hlp

[FilesIn-system\config]
[FilesIn-system\hwsetup]
[FilesIn-system\hwsetup\ibmdft]
[FilesIn-system\hwsetup\ibmsdlc]
[FilesIn-system\hwsetup\ibmx25]
[FilesIn-system\hwsetup\snadlc]
[FilesIn-system\hwsetup\dcadft]
[FilesIn-system\hwsetup\dcasdlc]
[FilesIn-system\hwsetup\dcax25]
[FilesIn-traces]

[IBMLinkServiceFiles]
  5, ibmdft.hlp
  5, ibmdft.inf
  5, ibmdft.srl
  5, ibmsdlc.hlp
  5, ibmsdlc.inf
  5, ibmsdlc.srl
  5, ibmx25.hlp
  5, ibmx25.inf
  5, ibmx25.srl
  5, snadlc.hlp
  5, snadlc.inf
  5, snadlc.srl
  99, dcadft.hlp
  99, dcadft.inf
  99, dcadft.srl
  99, dcasdlc.hlp
  99, dcasdlc.inf
  99, dcasdlc.srl
  99, dcax25.hlp
  99, dcax25.inf
  99, dcax25.srl
  5, ibmdft\ibmdft.dll
  5, ibmdft\ibmdft.sys
  5, ibmdft\snadftlu.exe
  5, ibmsdlc\ibmsdlc.dll
  5, ibmsdlc\ibmsync.sys
  5, ibmx25\ibmsync.sys
  5, ibmx25\ibmx25.dll
  5, snadlc\snadlc.dll
  99, dcadft\dcadft.dll
  99, dcadft\dcadft.sys
  99, dcadft\snadftlu.exe
  99, dcasdlc\dcasdlc.dll
  99, dcasdlc\dcasync.sys
  99, dcax25\dcax25.dll
  99, dcax25\dcasync.sys
; 5, snadlc\dlc.sys

[CDIBMLinkServiceFiles]
  20, ibmdft.hlp
  20, ibmdft.inf
  20, ibmdft.srl
  20, ibmsdlc.hlp
  20, ibmsdlc.inf
  20, ibmsdlc.srl
  20, ibmx25.hlp
  20, ibmx25.inf
  20, ibmx25.srl
  20, snadlc.hlp
  20, snadlc.inf
  20, snadlc.srl
  20, dcadft.hlp
  20, dcadft.inf
  20, dcadft.srl
  20, dcasdlc.hlp
  20, dcasdlc.inf
  20, dcasdlc.srl
  20, dcax25.hlp
  20, dcax25.inf
  20, dcax25.srl
  20, ibmdft\ibmdft.dll
  20, ibmdft\ibmdft.sys
  20, ibmdft\snadftlu.exe
  20, ibmsdlc\ibmsdlc.dll
  20, ibmsdlc\ibmsync.sys
  20, ibmx25\ibmsync.sys
  20, ibmx25\ibmx25.dll
  20, snadlc\snadlc.dll
  20, dcadft\dcadft.dll
  20, dcadft\dcadft.sys
  20, dcadft\snadftlu.exe
  20, dcasdlc\dcasdlc.dll
  20, dcasdlc\dcasync.sys
  20, dcax25\dcax25.dll
  20, dcax25\dcasync.sys
; 20, snadlc\dlc.sys


[ClientCheckFiles]
  CheckFileNTLoc = system\snabase.exe
  CheckFileNT    = WinNT\snabase.exe
  CheckFileWin16 = Win3x\wnap.ex$
  CheckFileDos   = MSDOS\comndis.com
  CheckFileOs2   = OS2\comdmod.dll


;---------------------------------------------------------------------
; Windows NT Client Files
;---------------------------------------------------------------------

[ClientDirListNT]
  ClientDirsNT = { system }

[ClientFilesNT-root]


;---------------------------------------------------------------------
; MS-DOS Client Files
;---------------------------------------------------------------------

[ClientDirListDOS]
  ClientDirsDOS = {}

[ClientFilesDOS-root]
  6, setup.exe
  6, setup.inf
  6, setup.msg
  6, comndis.com
  6, csbase.exe
  6, lmbase.exe
  6, snabase.exe
  6, router.exe
  6, initrtr.exe
  6, nwbase.exe
  6, nwlogon.exe

[CDClientFilesDOS-root]
  21, setup.exe
  21, setup.inf
  21, setup.msg
  21, comndis.com
  21, csbase.exe
  21, lmbase.exe
  21, snabase.exe
  21, router.exe
  21, initrtr.exe
  21, nwbase.exe
  21, nwlogon.exe


;---------------------------------------------------------------------
; Windows 16-bit Client Files
;---------------------------------------------------------------------

[ClientDirListWIN16]
  ClientDirsWIN16 = { charsets, kbdinfo, mri2924 }

[ClientFilesWIN16-root]
;
; MS Setup Toolkit files
;
  7, _mssetup.exe
  7, _mstest.exe
  7, mscomstf.dll
  7, mscuistf.dll
  7, msdetect.inc
  7, msdetstf.dll
  7, msinsstf.dll
  7, msshlstf.dll
  7, msuilstf.dll
  7, setup.exe
  7, setup.lst
  7, setupapi.inc
  7, ver.dll
  7, win16cl.dll
  7, win16cl.inf
  7, win16cl.mst
;
; SNA Client files
;
  7, lmcli.dl$
  7, wdmod.dl$
  7, winappc.dl$
  7, wincpic.dl$
  7, wincsv.dl$
  7, winmgt.dl$
  7, winrui.dl$
  7, winsli.dl$
  7, wintrc.dl$
  7, wlogtr.dl$
  7, wnap.ex$
  7, wpopup.ex$
  7, wshowmem.ex$
  7, ymgr.dl$
  7, snaver.ex$
  7, ctl3d.dl$
  7, toolhelp.dl$
  7, nwcli.dl$
  7, nwipxspx.dll
  7, nwnetapi.dll
;
; NSA 3270 Emulator files
;
  8, cfgs3270.dl$
  8, fmis3270.dl$
  8, ftp3270.dl$
  8, ltype.tt$
  8, sna3270.dl$
  8, snas3270.dl$
  8, trc3270.dl$
  8, win3270.ex$
  8, win3270.hl$
;
; NSA 5250 Emulator files
;
; 8, ctl3d.dl$
  8, intrface.lst
  8, nls.dl$
  8, qrmb.dl$
  8, rumba.ini
  8, rumbaflv.dl$
  8, snasrv.ex$
  8, win5250.ex$
  8, win5250.hl$

[ClientFilesWIN16-charsets]
  8, convtbls.256
  8, convtbls.259
  8, convtbls.260
  8, convtbls.273
  8, convtbls.277
  8, convtbls.278
  8, convtbls.280
  8, convtbls.281
  8, convtbls.284
  8, convtbls.285
  8, convtbls.290
  8, convtbls.297
  8, convtbls.37
  8, convtbls.500
  8, convtbls.871

[ClientFilesWIN16-kbdinfo]
  8, kbdinfo.bg$
  8, kbdinfo.cn$
  8, kbdinfo.dm$
  8, kbdinfo.fr$
  8, kbdinfo.gr$
  8, kbdinfo.ic$
  8, kbdinfo.it$
  8, kbdinfo.lt$
  8, kbdinfo.nt$
  8, kbdinfo.nw$
  8, kbdinfo.pt$
  8, kbdinfo.sf$
  8, kbdinfo.sg$
  8, kbdinfo.sp$
  8, kbdinfo.sw$
  8, kbdinfo.uk$
  8, kbdinfo.us$

[ClientFilesWIN16-mri2924]
  8, ncomm.dl$
  8, nrmb.dl$
  8, nwsf.dl$


[CDClientFilesWIN16-root]
;
; MS Setup Toolkit files
;
  22, _mssetup.exe
  22, _mstest.exe
  22, mscomstf.dll
  22, mscuistf.dll
  22, msdetect.inc
  22, msdetstf.dll
  22, msinsstf.dll
  22, msshlstf.dll
  22, msuilstf.dll
  22, setup.exe
  22, setup.lst
  22, setupapi.inc
  22, ver.dll
  22, win16cl.dll
  22, win16cl.inf
  22, win16cl.mst
;
; SNA Client files
;
  22, lmcli.dl$
  22, wdmod.dl$
  22, winappc.dl$
  22, wincpic.dl$
  22, wincsv.dl$
  22, winmgt.dl$
  22, winrui.dl$
  22, winsli.dl$
  22, wintrc.dl$
  22, wlogtr.dl$
  22, wnap.ex$
  22, wpopup.ex$
  22, wshowmem.ex$
  22, ymgr.dl$
  22, snaver.ex$
  22, ctl3d.dl$
  22, toolhelp.dl$
  22, nwcli.dl$
  22, nwipxspx.dll
  22, nwnetapi.dll
;
; NSA 3270 Emulator files
;
  23, cfgs3270.dl$
  23, fmis3270.dl$
  23, ftp3270.dl$
  23, ltype.tt$
  23, sna3270.dl$
  23, snas3270.dl$
  23, trc3270.dl$
  23, win3270.ex$
  23, win3270.hl$
;
; NSA 5250 Emulator files
;
  23, ctl3d.dl$
  23, intrface.lst
  23, nls.dl$
  23, qrmb.dl$
  23, rumba.ini
  23, rumbaflv.dl$
  23, snasrv.ex$
  23, win5250.ex$
  23, win5250.hl$

[CDClientFilesWIN16-charsets]
  23, convtbls.256
  23, convtbls.259
  23, convtbls.260
  23, convtbls.273
  23, convtbls.277
  23, convtbls.278
  23, convtbls.280
  23, convtbls.281
  23, convtbls.284
  23, convtbls.285
  23, convtbls.290
  23, convtbls.297
  23, convtbls.37
  23, convtbls.500
  23, convtbls.871

[CDClientFilesWIN16-kbdinfo]
  23, kbdinfo.bg$
  23, kbdinfo.cn$
  23, kbdinfo.dm$
  23, kbdinfo.fr$
  23, kbdinfo.gr$
  23, kbdinfo.ic$
  23, kbdinfo.it$
  23, kbdinfo.lt$
  23, kbdinfo.nt$
  23, kbdinfo.nw$
  23, kbdinfo.pt$
  23, kbdinfo.sf$
  23, kbdinfo.sg$
  23, kbdinfo.sp$
  23, kbdinfo.sw$
  23, kbdinfo.uk$
  23, kbdinfo.us$

[CDClientFilesWIN16-mri2924]
  23, ncomm.dl$
  23, nrmb.dl$
  23, nwsf.dl$


;---------------------------------------------------------------------
; OS/2 Client Files
;---------------------------------------------------------------------

[ClientDirListOS2]
  ClientDirsOS2 = {}

[ClientFilesOS2-root]
  9, com.msg
  9, comh.msg
  9, setup.exe
  9, setup.inf
  9, setup.msg
  9, combase.sys
  9, comm.exe
  9, comnap.exe
  9, compop.exe
  9, comvers.exe
  9, showmem.exe
  9, acsrui.dll
  9, acssli.dll
  9, acssvc.dll
  9, appc.dll
  9, comasyn.dll
  9, comdmod.dll
  9, commgt.dll
  9, comstr.dll
  9, comtrc.dll
  9, comtrsn.dll
  9, cpic.dll
  9, mshelp.dll

[CDClientFilesOS2-root]
  24, com.msg
  24, comh.msg
  24, setup.exe
  24, setup.inf
  24, setup.msg
  24, combase.sys
  24, comm.exe
  24, comnap.exe
  24, compop.exe
  24, comvers.exe
  24, showmem.exe
  24, acsrui.dll
  24, acssli.dll
  24, acssvc.dll
  24, appc.dll
  24, comasyn.dll
  24, comdmod.dll
  24, commgt.dll
  24, comstr.dll
  24, comtrc.dll
  24, comtrsn.dll
  24, cpic.dll
  24, mshelp.dll

