;************************************************************************ ;************************************************************************ ; ; MGATEX.INF ; ; Microgate X25 Link Service and Device Driver INF file ; ; History: ; andyg, t-danfr Aug 05, 92 Initial Design ; andyg Jan '94 Netcard detection ; andyg Feb '94 Cloned and modified ; ;************************************************************************ ;************************************************************************ ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; INITIALIZATION SECTION ; ---------------------- ; This section is responsible for defining the product variables. It is the ; highest level of definition. Installation programs will use this section ; to figure out available options etc. ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ;======================================================================== ; ; SOURCE MEDIA DESCRIPTIONS ; ------------------------- ; The IHV should list all the diskette labels here. The source media ; description is used during copy to prompt the user for a diskette ; if the source is diskettes. The TAGFILE field is used to confirm that ; the proper disk is being used. ; ; FORMAT: ; The format includes an enumeration constant and a name for the disk, ; as well as a number of possible flags (including the TAGFILE flag.) ; 1 = "Diskette 1 Label", TAGFILE = "Disk1.Tag" ; 2 = "Diskette 2 Label", TAGFILE = "Disk2.Tag" ; ... ; ; REFERENCES: ; TODO - Add a reference to somewhere ; ;======================================================================== [Source Media Descriptions] 1 = "SNA Link Service diskette" ;======================================================================== ; ; OPTION TYPE ; ----------- ; This identifies the Option type we are dealing with. The different ; possible types are: ; ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ... ; ; Types specific to networking: ; NetAdapter, A netcard/adapter combination or just a netcard ; NetDriver, A netcard driver ; NetTransport, A complete NDIS-compliant TDI transport stack ; NetService, An NT networking service ; NetWork, A complete network ensemble ; NetProvider, A complete network which supports NT MPR protocol ; ; TODO - do we want to mention all those types or just the ones relevant to us? ; ; REFERENCES: ; TODO - Add a reference to somewhere ; ;======================================================================== [Identification] OptionType = NetService ;======================================================================== ; ; LANGUAGES SUPPORTED ; ------------------- ; The languages supported by the IHV INF, For every language supported ; we need to have a separate text section for every displayable text ; section. ; ; REFERENCES: ; TODO - Add a reference to somewhere ; ;======================================================================== [LanguagesSupported] ENG ;======================================================================== ; ; OPTION LIST ; ----------- ; This section lists the IHV Option key names. These keys are locale ; independent and used to represent the option in a locale independent ; manner. ; ; REFERENCES: ; TODO - Add a reference to somewhere ; ;======================================================================== [Options] MGATEXLS MGATEXDD ;======================================================================== ; ; OPTION TEXT SECTION ; ------------------- ; These are text strings used to identify the option to the user. There ; are separate sections for each language supported. ; ; FORMAT: ; The format of the section name is "OptionsText" concatenated with the ; Language represented by the section. ; [OptionsTextLNG1] ; ... ; [OptionsTextLNG2] ; ... ; ; REFERENCES: ; TODO - Add a reference to somewhere ; ;======================================================================== [OptionsTextENG] MGATEXLS = "Microgate X.25 (QLLC) Link Service" MGATEXDD = "SNA SDLC/X.25 Device Driver" ;======================================================================== ; ; SNA OPTION LIST ; --------------- ; This is the list of options available to the SNA Server user. This is ; the list presented to the user from the SNA Server setup as the ; available options. Like the normal options list, it is locale independent. ; ; REFERENCES: ; TODO - Add a reference to somewhere ; ;======================================================================== [SNAOptions] MGATEXLS ;======================================================================== ; ; SNA OPTION ADDITIONALS ; ---------------------- ; This section specifies the additional installations that should be performed ; for each of the main options. The SNA Server setup will invoke this INF ; file with each of these additional options in order followed by the main ; option. ; ; FORMAT: ; The format for the section name is "SNAOptionAdds" concatenated with the ; option name. ; [SNAOptionAddsSNAOPT1] ; ... ; [SNAOptionAddsSNAOPT2] ; ... ; ; REFERENCES: ; TODO - Add a reference to somewhere ; ;======================================================================== [SNAOptionAddsMGATEXLS] MGATEXDD ;======================================================================== ; ; INSTALLATION STEPS SECTION ; -------------------------- ; In this section, the IHV gets to define which steps will be taken in the ; installation procedure. There are three variables and they all must be ; defined. ; ; FORMAT: ; The format is "InstallSteps" concatenated with the option name ; [InstallStepsOPT1] ; ... ; ;======================================================================== [InstallStepsMGATEXLS] AddFilesToCopyList = YES CopyFilesInCopyList = YES [InstallStepsMGATEXDD] AddFilesToCopyList = YES CopyFilesInCopyList = NO ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; DIALOG CONSTANTS SECTION ; ------------------------ ; This section is responsible for defining dialog constants. It is ; meant to be used to simplify programming this INF file as well as reading ; it. ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: [DialogConstants] Radio1 = "1" Radio2 = "2" Radio3 = "3" Radio4 = "4" Radio5 = "5" Radio6 = "6" Radio7 = "7" Radio8 = "8" Radio9 = "9" ;++++++++++++++++++++++++++++++++++++ ; ; ProgressCopyVars: ; These variables specify the look of the gauge that comes up ; when copying files. ; ;++++++++++++++++++++++++++++++++++++ [ProgressCopyVars] ProCaption = "File copy in progress" ProCancel = "&Cancel" ProCancelMsg = $(ProductTitle)$(!LF)"is not fully installed."$(!LF)+ "Are you sure you want to cancel before all"$(!LF)+ "the files are copied?" ProCancelCap = $(SetupTitle)" Warning" ProText1 = "Copying " ProText2 = " to" [HelpContextIDs] IDD_MGATEXDDCONFIG = 201 IDD_MGATEXLSCONFIG = 202 IDD_DETAILS_ISA = 203 IDD_DETAILS_MCA = 204 IDD_DIALER = 205 ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; FILE CONSTANTS SECTION ; ---------------------- ; This section is responsible for defining some general product information ; that will be used mostly for the registry ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ;++++++++++++++++++++++++++++++++++++ ; ; File Names Subsection: ; This subsection contains useful filenames for use as macros. ; ;++++++++++++++++++++++++++++++++++++ [FileConstants] UtilityInf = $(!SNARootDir)"\SETUPUTL.INF" SubroutineInf = $(!STF_WINDOWSSYSPATH)"\SUBROUTN.INF" DialogLibrary = $(!SNARootDir)"\SETUP.SRL" ThisFile = "MGATEX" ThisInf = $(ThisFile)".INF" ThisSrl = $(ThisFile)".SRL" ThisHlp = $(ThisFile)".HLP" HlpMin = "100" HlpMax = "299" $ShellCode = 0 ;++++++++++++++++++++++++++++++++++++ ; ; Product Information Subsection: ; This subsection contains lots of product information that will be used ; mostly in the registry. ; ; For the SNAServiceType value, please refer to the "SNAServiceTypes" section ; in the SETUPUTL.INF file. Also, only Link Services have this value, all ; others should have a NULL string ("") for this value. ; ;++++++++++++++++++++++++++++++++++++ [FileConstantsMGATEXLS] ; ; Product Info ; ProductVersion = "1.0" ProductName = "MGATEXLS" ProductFullName = $(ProductName)"_"$(ProductVersion)"_"$(Instance) ProductRegBase = $(!NTN_SoftwareBase)"\Microsoft" ProductType = "Link" ProductImagePath = "SNALINK.EXE" ProductDepends = {} ProductParams = {} ProductExtraParams = {} ProductExclusive = $(!False) ProductDLL = "IBMX25.DLL" ProductServicePrefix = "SnaMGX" ProductServiceQuery = $(!True) ; ; Registry Key Information ; SNAServiceType = "CESX25" ; ; NetRules Stuff ; NetRulesClass = "snax25link snalink" NetRulesTitle = "Microgate X.25 (QLLC) Link Service" NetRulesUse = "service yes yes" NetRulesBindable = "snax25link snasyncdriver non non 100" NetRulesType = "mgx25_"$(Instance)" snax25link" FullInfName = $(!SNARootDir)"\system\hwsetup\"$(ThisInf) SoftwareType = "service" [FileConstantsMGATEXDD] ; ; Product Info ; ProductVersion = "1.0" ProductName = "IBMSYNCDD" ProductFullName = $(ProductName)"_"$(ProductVersion)"_"$(Instance) ProductRegBase = $(!NTN_SoftwareBase)"\Microsoft" ProductType = "Driver" ProductImagePath = "IBMSYNC.SYS" ProductDepends = {} ProductParams = {} ProductExtraParams = {} ProductExclusive = $(!True) ProductDLL = "" ProductServicePrefix = "IBMSYNC" ProductServiceQuery = $(!False) ; ; Registry Key Information ; SNAServiceType = "DRIVER" ; ; NetRules Stuff ; NetRulesClass = "snasyncdriver basic yes" NetRulesTitle = "SNA SDLC/X.25 Device Driver" NetRulesUse = "driver yes yes" NetRulesBindable = "" NetRulesType = "mgsyncdd snasyncdriver" FullInfName = $(!SNARootDir)"\system\hwsetup\"$(ThisInf) SoftwareType = "driver" ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; GENERAL CONSTANTS SECTION ; ------------------------- ; This section is responsible for defining some general constants that ; are used in this INF script. These constants include flow control ; variables, exit codes, and registry reference numbers. ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: [GeneralConstants] ;++++++++++++++++++++++++++++++++++++ ; ; Flow Control Variables: ; From will generally represents the label we just came from while To ; represents the label we are headed to. ; ;++++++++++++++++++++++++++++++++++++ from = "" to = "" ;++++++++++++++++++++++++++++++++++++ ; ; Booleans: ; ;++++++++++++++++++++++++++++++++++++ !True = 1 !False = 0 ;++++++++++++++++++++++++++++++++++++ ; ; Other values ; ;++++++++++++++++++++++++++++++++++++ NOTIFY = 2 ;++++++++++++++++++++++++++++++++++++ ; ; Registry Initialization Parameters: ; ;++++++++++++++++++++++++++++++++++++ NoTitle = 0 KeyNull = "" KeyProduct = "" KeyParameters = "" ;++++++++++++++++++++++++++++++++++++ ; ; Other Initialization Parameters: ; ;++++++++++++++++++++++++++++++++++++ ExitState = "Active" OldVersionExisted = $(!False) ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; LANGUAGE-DEPENDENT DIALOG CONSTANTS SECTION ; ------------------------------------------- ; This section is responsible for defining dialog constants that are ; language dependent. ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ;++++++++++++++++++++++++++++++++++++ ; ; Common Button Names: ; ;++++++++++++++++++++++++++++++++++++ [DialogConstantsENG] Help = "&Help" Exit = "C&ancel" Continue = "&Continue" Cancel = "C&ancel" OK = "&OK" HelpContext = "" ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; LANGUAGE-DEPENDENT FILE CONSTANTS SECTION ; ----------------------------------------- ; This section is responsible for defining language dependent information. ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: [FileConstantsENG] ; ; The following name should include the name of the IHV as per the example ; SetupTitle = "Microgate X.25 (QLLC) Link Service Setup" [FileConstantsMGATEXLS_ENG] ProductTitle = "Microgate X.25 (QLLC) Link Service" ProductDesc = "Microgate X.25 (QLLC) Link Service for "$(!SNA_ProductName) [FileConstantsMGATEXDD_ENG] ProductTitle = "SNA SDLC/X.25 Device Driver" ProductDesc = "SNA SDLC/X.25 Device Driver for "$(!SNA_ProductName) ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; DATE SECTION ; ------------ ; This section is responsible for establishing the value of the "Now" ; variable. This variable is a list of the following format: ; { Seconds from 1-1-1970, Year, Month, Day, Hour, Minute, Second } ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: [LoadSetupLibrary] set !LIBHANDLE = "" LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\setupdll.dll !LIBHANDLE exit [LoadSvcLibrary] set !SVCHANDLE = "" LoadLibrary "x" $(!SNARootDir)\setupsvc.dll !SVCHANDLE exit [date] Now = {} ? $(!LIBHANDLE) GetSystemDate [FreeSetupLibrary] FreeLibrary $(!LIBHANDLE) set !LIBHANDLE = "" exit [FreeSvcLibrary] FreeLibrary $(!SVCHANDLE) set !SVCHANDLE = "" exit ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; INPUT DIALOGS SECTION ; --------------------- ; This section should contain all the information about the input dialogs. ; ; FORMAT: ; The format of the section name is the string name concatenated with the ; Language represented by the section. ; [InputDialog1LNG1] ; ... ; [InputDialog2LNG1] ; ... ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: [DoMGATEXLSConfigENG] DlgTemplate = IDD_MGATEXLSCONFIG DlgType = "RadioCombination" Caption = $(!P:SetupTitle) DlgText1 = "Service Name: "$(ServiceName) Details = "Adapter &Details..." Dialer = "D&ialer Settings..." EditLabel1 = "Service &Title:" EditLabel2 = "Local &X.25 Address:" EditLabel3 = "T&1 Timeout (0.1s):" EditLabel4 = "N&2 Retry Limit:" EditLabel5 = "Outgoing SVC:" EditLabel6 = "Two-Way SVC:" EditLabel7 = "Incoming SVC:" EditLabel8 = "PVC:" EditGroup1 = "Channel Ran&ges" EditTextIn = { $(ServiceTitle), $(LNUA), + $(T1Timeout), $(N2Retry), + $(OSVCRng), $(2SVCRng), + $(ISVCRng), $(PVCRng) } EditTextLim = { 40, 15, 3, 3, 9, 9, 9, 9 } ComboLabel1 = "Adapter Typ&e:" ComboLabel2 = "Default L3 &Window Size:" ComboListIn2 = { "1", "2", "3", "4", "5", "6", "7" } ComboListOut2 = $(L3Window) ComboLabel3 = "Default L3 &Packet Size:" ComboListIn3 = { "64", "128", "256", "512" } ComboListOut3 = $(L3PktSz) ComboLabel4 = "L2 Window Si&ze:" ComboListIn4 = { "1", "2", "3", "4", "5", "6", "7" } ComboListOut4 = $(L2Window) NotifyFields = { "NO", "NO", "NO", "NO" } RadioGroup1 = "&Line Type" RadioText1 = "Leased" RadioText2 = "Switched: Server-stored number" RadioText3 = "Switched: Modem-stored number" RadioText4 = "Switched: Manual dial" RadioGroup2 = "Data &Rate" RadioText5 = "High" RadioText6 = "Low" RadioGroup3 = "Enc&oding" RadioText7 = "NRZ" RadioText8 = "NRZI" RadioOptionsGreyed = {2} CheckText1 = "Accept Re&v. Charge" CheckText2 = "&Startup Restart" CheckText3 = "Select Standb&y" CheckText4 = "Incoming &Filter" CBOptionsGreyed = {} HelpContext = #( HelpContextIDs, $(DlgTemplate), 1 ) ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; INPUT DIALOGS SCRIPTS ; --------------------- ; This section should contain all the scripts for doing input dialogs. ; Each script may return as many parameters as it wants, so long as the ; first parameter is the status and is one of the following: ; ; STATUS_SUCCESSFUL ; STATUS_FAILED ; STATUS_USERCANCEL ; STATUS_USERBACK ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; DoMGATEXLSConfig: ; ; DESCRIPTION: This shell script pops up a dialog to get the configuration ; of this product. ; ; INPUT: $($0) : Service Name ; $($1) : Current Title ; $($2) : Current Driver Info ; $($3) : Current Local NUA Address ; $($4) : Current L3 Window Size ; $($5) : Current L3 Packet Size ; $($6) : Current L2 Window Size ; $($7) : Current T1 Timeout ; $($8) : Current N2 Retry Limit ; $($9) : Current Accept Reverse Charge ; $($10): Current Startup Restart ; $($11): Current Select Standby ; $($12): Current Outgoing SVC Range ; $($13): Current Two-Way SVC Range ; $($14): Current Incoming SVC Range ; $($15): Current PVC Range ; $($16): Current Data Rate ; $($17): Current Encoding ; $($18): Current Incoming Filter status ; $($19): Current Line Type ; $($20): Current Manual Dial setting ; $($21): Current COM Port number ; $($22): Current Baud Rate ; $($23): Current Dialer In String ; $($24): Current Dialer Out String ; ; OUTPUT: $($R0): STATUS: One of the above ; $($R1): Changes flag ; $($R2) ; ... : New values of above variables ; $($R24): In their respective slots ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [DoMGATEXLSConfig] set ServiceName = $($0) set ServiceTitle = $($1) set DriverInfo = $($2) set LNUA = $($3) set L3Window = $($4) set L3PktSz = $($5) set L2Window = $($6) set T1Timeout = $($7) set N2Retry = $($8) set AcceptRevCh = $($9) set Restart = $($10) set Standby = $($11) set OSVCRng = $($12) set 2SVCRng = $($13) set ISVCRng = $($14) set PVCRng = $($15) set DataRate = $($16) set NRZI = $($17) set FilterIncoming = $($18) set LineType = $($19) set FRadio4 = $($20) set ComPort = $($21) set BaudRate = $($22) set DialInStr = $($23) set DialOutStr = $($24) set SvDriverInfo = $($2) set SvLNUA = $($3) set SvL3Window = $($4) set SvL3PktSz = $($5) set SvL2Window = $($6) set SvT1Timeout = $($7) set SvN2Retry = $($8) set SvAcceptRevCh = $($9) set SvRestart = $($10) set SvStandby = $($11) set SvOSVCRng = $($12) set Sv2SVCRng = $($13) set SvISVCRng = $($14) set SvPVCRng = $($15) set SvDataRate = $($16) set SvNRZI = $($17) set SvFilterIncoming = $($18) set SvLineType = $($19) set SvRadio4 = $($20) set SvComPort = $($21) set SvBaudRate = $($22) set SvDialInStr = $($23) set SvDialOutStr = $($24) ; ; set the default values ; set Changes = 0 set DriverId = 99 set GotDMA = $(!False) set CardVal = "" read-syms DialogConstants read-syms DialogConstants$(!STF_LANGUAGE) read-syms DoMGATEXLSConfig$(!STF_LANGUAGE) ; ; See what cards we can support ; install LoadSvcLibrary ifstr(i) $(!SVCHANDLE) == "" set Status = STATUS_FAILED goto X25ConfReturn endif LibraryProcedure RetVal $(!SVCHANDLE) + SNAQueryPossibleCards $(!SNARootDir)\system ifstr(i) $(RetVal) == "NO_SYNCLIB" shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) FATAL + "Cannot find SYNCDTCT.DLL!" set Status = STATUS_FAILED goto X25ConfReturn endif ifstr(i) $(RetVal) == {} shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) FATAL + "Setup could not detect any network adapters capable of"+ " supporting this link service. Please install your adapter"+ " first, then run Setup again to install the link service." set Status = STATUS_FAILED goto X25ConfReturn endif set PCardList = $(RetVal) ; ; Fill in list box with driver title strings ; set ComboListIn1 = {} ForListDo $(PCardList) set Id = *($($),1) ; ; The following numbers come from %SRCINDY%\win32src\syncdtct.c ; ifint $(Id) >= 3 ; Microgate cards for E/ISA machines ifint $(Id) <= 5 set ComboListIn1 = >( $(ComboListIn1), *($($),3) ) endif endif ifint $(Id) >= 14 ; Microgate cards for MCA machines ifint $(Id) <= 21 set ComboListIn1 = >( $(ComboListIn1), *($($),3) ) endif endif EndForListDo set ComboListOut1 = *($(ComboListIn1),1) ; Default to the first one ; ; If this is a new install, detect all cards in the box ; ifstr(i) *($(DriverInfo),2) == *($(!DefDriverInfo),2) ifstr(i) *($(DriverInfo),1) == *($(!DefDriverInfo),1) LibraryProcedure DCardList $(!SVCHANDLE) + SNADetectPresentCards $(!SNARootDir)\system ifstr(i) $(DCardList) != {} set TmpName = *(*(*($(DCardList),1),1),3) ForListDo $(PCardList) ifstr(i) *($($),3) == $(TmpName) set ComboListOut1 = $(TmpName) endif EndForListDo endif else set ComboListOut1 = *(*($(DriverInfo),1),3) endif else set ComboListOut1 = *(*($(DriverInfo),1),3) endif set ComboListItemsIn = { ComboListIn1, ComboListIn2, ComboListIn3, ComboListIn4 } set ComboListItemsOut = { ComboListOut1, ComboListOut2, ComboListOut3, ComboListOut4 } set-add Temp = $(LineType), 1 set RadioIn1 = *( {1,3,2}, $(Temp) ) ifstr(i) $(FRadio4) == $(!True) set RadioIn1 = "4" endif ifint $(DataRate) == 0 set RadioIn2 = $(Radio6) else set RadioIn2 = $(Radio5) endif ifint $(NRZI) == 0 set RadioIn3 = $(Radio7) else set RadioIn3 = $(Radio8) endif set RadioIn = { $(RadioIn1), $(RadioIn2), $(RadioIn3) } set TmpCheckItemsIn = { $(AcceptRevCh), $(Restart), $(Standby), + $(FilterIncoming) } set CheckItemsIn = {} ForListDo $(TmpCheckItemsIn) ifint $($) == 0 set CheckItemsIn = >( $(CheckItemsIn), "OFF" ) else set CheckItemsIn = >( $(CheckItemsIn), "ON" ) endif EndForListdo set DMAch = *( $(DriverInfo), 5 ) ifstr(i) $(DMAch) != 255 ifstr(i) $(DMAch) != 99 set GotDMA = $(!True) endif endif RefreshDlg =+ set Status = STATUS_SUCCESSFUL ui start $(DlgTemplate) $(!IHVDLGHANDLE) ifstr(i) $(DLGEVENT) == "Exit" set Status = STATUS_USERCANCEL else-ifstr(i) $(DLGEVENT) == "DlgButton2" ;Dialer shell "" DoDialer $(ComPort) $(BaudRate) $(DialInStr) $(DialOutStr) ifstr(i) $($R0) == STATUS_SUCCESSFUL set ComPort = $($R1) set BaudRate = $($R2) set DialInStr = $($R3) set DialOutStr = $($R4) ; ; Determine if we'll have to add a COM port. ; ifstr(i) $(ComPort) == "0" goto SkipComWarn endif set SerFlag = $(!True) ; True if machine has COMx set KeySerial = "" OpenRegKey $(!REG_H_LOCAL), "", "HARDWARE\DEVICEMAP\SERIALCOMM", $(!REG_KEY_READ), KeySerial ifstr(i) $(KeySerial) == "" set SerFlag = $(!False) else EnumRegValue $(KeySerial) SerList ifstr(i) $(SerList) == {} set SerFlag = $(!False) else set SerFlag2 = $(!False) ForListDo $(SerList) set SerVal = *( $($), 4 ) ifstr(i) $(SerVal) == "COM"$(ComPort) set SerFlag2 = $(!True) endif EndForListDo ifstr(i) $(SerFlag2) == $(!False) set SerFlag = $(!False) endif endif CloseRegKey $(KeySerial) endif ifstr(i) $(SerFlag) == $(!False) shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) WARNING + "You specified that the built-in dialer should use COM"$(ComPort)","+ " but your computer does not have that port configured. You"+ " need to run the Ports Control Panel Applet, and add COM"$(ComPort)+ " to your system, before the dialer will function."$(!LF)$(!LF)+ "Click OK to start the Control Panel, or Cancel if you want to"+ " do this later." ifstr(i) $($R1) == "OK" RunProgram Result "" "" $(!STF_WINDOWSSYSPATH)\Control.exe Ports endif endif endif SkipComWarn =+ goto RefreshDlg else ; either Details or OK was pressed. set Status = STATUS_SUCCESSFUL set Error = {} ; ; Get the ID of the selected card. ; set OldDriverId = $(DriverId) ForListDo $(PCardList) ifstr(i) *($($),3) == $(ComboListOut1) set DriverId = *($($),1) endif EndForListDo ; ; Try to query that card, but only if it's not the same ; one we queried last time through, and not an unknown. ; StartWait set Qflag = $(!False) ifstr(i) $(DriverId) != $(OldDriverId) set Qflag = $(!True) endif ifstr(i) *($(DriverInfo),4) == 99 ; Unknown Irq set Qflag = $(!True) endif ifstr(i) *($(DriverInfo),5) == 99 ; Unknown DMA set Qflag = $(!True) endif ifstr(i) $(CardVal) == "BAD_DEVICE" set Qflag = $(!True) endif ifstr(i) $(Qflag) == $(!True) set SaveCount = *(*($(DriverInfo),1),2) LibraryProcedure TmpCardVal $(!SVCHANDLE) + SNAQueryCardConfig $(!SNARootDir)\system $(DriverId) ifstr(i) $(TmpCardVal) == {} set CardVal = $(TmpCardVal) else-ifstr(i) $(TmpCardVal) == "BAD_DEVICE" set CardVal = $(TmpCardVal) else ; OK set CardVal = {} ForListDo {1,2,3,4,5,6,7,8,9} ifint $(#) == 1 set CardVal = >( $(CardVal), + { *(*($(TmpCardVal),1),1), + $(SaveCount), + *(*($(TmpCardVal),1),3) } ) else-ifint $(#) == 5 set CardVal = >( $(CardVal), $(DMAch) ) else set CardVal = >( $(CardVal), *($(TmpCardVal),$(#) )) endif EndForListDo endif else set CardVal = {} ForListDo {1,2,3,4,5,6,7,8,9} ifint $(#) == 5 set CardVal = >( $(CardVal), $(DMAch) ) else set CardVal = >( $(CardVal), *($(DriverInfo),$(#)) ) endif EndForListDo endif ; ; Set Dflag = True if card was detected okay. ; set Dflag = $(!True) ifstr(i) $(CardVal) == "BAD_DEVICE" set Dflag = $(!False) else-ifstr(i) $(CardVal) == {} set Dflag = $(!False) endif EndWait ; ; If we detected the card, set the DMA channel to whatever ; was detected. ; ifstr(i) $(Dflag) == $(!True) ifstr(i) $(GotDMA) == $(!False) set DMAch = *( $(CardVal), 5 ) endif ifstr(i) $(DMAch) != 255 ifstr(i) $(DMAch) != 99 set GotDMA = $(!True) endif endif endif ifstr(i) $(DLGEVENT) == "DlgButton1" ; Details button ifstr(i) $(Dflag) == $(!False) shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + " "$(ComboListOut1)$(!LF)$(!LF)+ "This adapter must be installed in your computer"$(!LF)+ "before details of its settings can be obtained." goto RefreshDlg else shell "" DoDetails $(CardVal) $(DMAch) set DMAch = $($R0) set GotDMA = $(!True) goto RefreshDlg endif endif ; Details button -- always goes back to RefreshDlg, no fallthru here ifstr(i) $(DLGEVENT) == "Continue" ; OK button set Force = $(!False) ifstr(i) $(Dflag) == $(!False) ; Card was not detected shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) WARNING + "Setup cannot detect the following adapter:"+ $(!LF)$(!LF)" "$(ComboListOut1)$(!LF)$(!LF)+ "Do you want to set up this adapter anyway?" ifstr(i) $($R1) != "OK" goto RefreshDlg endif shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + "After installing your adapter card, you must re-run"+ " Setup to properly configure the link service software"+ " settings for that adapter."$(!LF)$(!LF)+ "This link service cannot function until your adapter"+ " and software are properly installed and configured." set DriverInfo = {{$(DriverId),1,$(ComboListOut1)},Unknown,{99,99},99,99,99,99,{99,99},99} set Force = $(!True) else ; Card was detected ifint *($(CardVal),4) == 255 shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + "This adapter has been detected in your computer, but"+ " it does not seem to be responding. There may be an"+ " interrupt conflict between this adapter and some other"+ " device, such as a serial port, disk controller, or"+ " another network adapter."$(!LF)$(!LF)+ "Setup will "$(!NTN_InstallMode)" this link service anyway, but it"+ " will not function until you correct the conflict." endif ; ; Build up DriverInfo list with current DMA channel. ; set DriverInfo = {} ForListDo {1,2,3,4,5,6,7,8,9} ifint $(#) == 5 set DriverInfo = >( $(DriverInfo), $(DMAch) ) else set DriverInfo = >( $(DriverInfo), *($(CardVal),$(#)) ) endif EndForListDo endif ; Dflag set LNUA = *( $(EditTextOut), 2 ) set L3Window = $(ComboListOut2) set L3PktSz = $(ComboListOut3) set L2Window = $(ComboListOut4) set T1Timeout = *( $(EditTextOut), 3 ) ifint $(T1Timeout) < 1 set Error = >( $(Error), ERROR_T1 ) else-ifint $(T1Timeout) > 100 set Error = >( $(Error), ERROR_T1 ) endif set N2Retry = *( $(EditTextOut), 4 ) ifint $(N2Retry) < 1 set Error = >( $(Error), ERROR_N2 ) else-ifint $(N2Retry) > 100 set Error = >( $(Error), ERROR_N2 ) endif ifstr(i) *( $(CheckItemsOut), 1 ) == "OFF" set AcceptRevCh = 0 else set AcceptRevCh = 1 endif ifstr(i) *( $(CheckItemsOut), 2 ) == "OFF" set Restart = 0 else set Restart = 1 endif ifstr(i) *( $(CheckItemsOut), 3 ) == "OFF" set Standby = 0 else set Standby = 1 endif ; ; Check the SVC/PVC range parameters for validity ; and range. ; set errflag = 0 set errindex = 0 ForListDo { 1 2 3 4 } ifint $(errflag) == 0 ; ; Check for two fields separated by a dash. ; set-add index = $(#), 4 set item = *($(EditTextOut),$(index)) ifstr(i) $(item) == "" set n = 0 set m = 0 set t$(#) = 0 else Split-String *($(EditTextOut),$(index)), "-", list QueryListSize size $(list) ifint $(size) != 3 set errflag = 1 set errindex = $(#) endif ifint $(errflag) == 1 goto _nerr endif set n = *($(list),1) set m = *($(list),3) ; ; Check the two fields are numeric with the first ; less than or equal to the second. ; ifint $(n) > 0 goto _nok else-ifstr $(n) == "0" goto _nok else set errflag = 1 set errindex = $(#) endif _nok =+ ifint $(m) > 0 goto _mok else-ifstr $(m) == "0" goto _mok else set errflag = 1 set errindex = $(#) endif _mok =+ ifint $(errflag) == 0 ifint $(n) > $(m) set errflag = 2 set errindex = $(#) endif ifint $(errflag) > 0 goto _nerr endif ; ; Save the fields for later totalling. ; set-sub t$(#) = $(m), $(n) else set t$(#) = 0 endif endif ; item == "" endif ; errflag == 0 _nerr =+ EndForlistDo set desclist = { "Outgoing SVC", "Two-Way SVC", "Incoming SVC", "PVC" } ifint $(errflag) == 1 shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + "Please enter the "*($(desclist),$(errindex))" range value as two numbers"+ " separated by a hyphen, for example, ""1018-1024""." goto RefreshDlg else-ifint $(errflag) == 2 shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + "Please enter the "*($(desclist),$(errindex))" range value so that the"+ " first number is less than or equal to the second." goto RefreshDlg endif ; ; Add up ranges and check total < 16. ; set total = 0 ForListDo { 1 2 3 4 } set-add total = $(total), $(t$(#)) EndForListDo ifint $(total) > 16 shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + "The sum total of all four channel ranges cannot be greater than 16." goto RefreshDlg endif ; ; All range values should be okay at this point. ; set OSVCRng = *( $(EditTextOut), 5 ) set 2SVCRng = *( $(EditTextOut), 6 ) set ISVCRng = *( $(EditTextOut), 7 ) set PVCRng = *( $(EditTextOut), 8 ) set LineType = *( {0,2,1,1}, *( $(RadioOut), 1 )) ifstr(i) *( $(RadioOut), 1 ) == "4" set FRadio4 = $(!True) else set FRadio4 = $(!False) endif ifint *( $(RadioOut), 2 ) == $(Radio5) set DataRate = 1 else-ifint *( $(RadioOut), 2 ) == $(Radio6) set DataRate = 0 endif ifint *( $(RadioOut), 3 ) == $(Radio7) set NRZI = 0 else-ifint *( $(RadioOut), 3 ) == $(Radio8) set NRZI = 1 endif ifstr(i) *( $(CheckItemsOut), 4 ) == "OFF" set FilterIncoming = 0 else set FilterIncoming = 1 endif ; ; Check title against those configured for other link services ; set TmpTitle = *( $(EditTextOut), 1 ) ifstr(i) $(TmpTitle) == "" shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL + "Please enter at least one character for the link service title." goto RefreshDlg endif set TmpFlag = $(!False) ForListDo $(!LinkServiceList) ifstr(i) $(TmpTitle) == *( $($), 2 ) set TmpSvcName = *( $($), 1 ) ifstr(i) $(ServiceName) != $(TmpSvcName) set TmpFlag = $(!True) endif endif EndForListDo ifstr(i) $(TmpFlag) == $(!False) set ServiceTitle = *( $(EditTextOut), 1 ) else shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL + "The title """$(TmpTitle)""" is already in use by link service "$(TmpSvcName)"." goto RefreshDlg endif ForListDo $(Error) set Status = STATUS_REPEAT ifstr(i) $($) == ERROR_T1 shell $(!P:SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL + "The T1 Timeout parameter must be a number"+ " between 1 and 100."$(!LF)$(!LF)+ "Please reconfigure." endif ifstr(i) $($) == ERROR_N2 shell $(!P:SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL + "The N2 Retry parameter must be a number"+ " between 1 and 100."$(!LF)$(!LF)+ "Please reconfigure." endif EndForListDo set Dflag = $(!False) ifstr(i) *($(DriverInfo),5) == "255" set Dflag = $(!True) endif ifstr(i) *($(DriverInfo),5) == "99" set Dflag = $(!True) endif ifstr(i) $(Force) == $(!True) set Dflag = $(!False) endif ifstr(i) $(GotDMA) == $(!True) set Dflag = $(!False) endif ifstr(i) $(Dflag) == $(!True) shell $(!P:SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL + "Please set this adapter's DMA channel using the ""Adapter Details..."" button." goto RefreshDlg endif ifstr(i) $(DriverInfo) != $(SvDriverInfo) set Changes = 1 endif ifstr(i) $(LNUA) != $(SvLNUA) set Changes = 1 endif ifstr(i) $(L3Window) != $(SvL3Window) set Changes = 1 endif ifstr(i) $(L3PktSz) != $(SvL3PktSz) set Changes = 1 endif ifstr(i) $(L2Window) != $(SvL2Window) set Changes = 1 endif ifstr(i) $(T1Timeout) != $(SvT1Timeout) set Changes = 1 endif ifstr(i) $(N2Retry) != $(SvN2Retry) set Changes = 1 endif ifstr(i) $(AcceptRevCh) != $(SvAcceptRevCh) set Changes = 1 endif ifstr(i) $(Restart) != $(SvRestart) set Changes = 1 endif ifstr(i) $(Standby) != $(SvStandby) set Changes = 1 endif ifstr(i) $(OSVCRng) != $(SvOSVCRng) set Changes = 1 endif ifstr(i) $(2SVCRng) != $(Sv2SVCRng) set Changes = 1 endif ifstr(i) $(ISVCRng) != $(SvISVCRng) set Changes = 1 endif ifstr(i) $(PVCRng) != $(SvPVCRng) set Changes = 1 endif ifstr(i) $(DataRate) != $(SvDataRate) set Changes = 1 endif ifstr(i) $(NRZI) != $(SvNRZI) set Changes = 1 endif ifstr(i) $(FilterIncoming) != $(SvFilterIncoming) set Changes = 1 endif ifstr(i) $(LineType) != $(SvLineType) set Changes = 1 endif ifstr(i) $(FRadio4) != $(SvFRadio4) set Changes = 1 endif ifstr(i) $(ComPort) != $(SvComPort) set Changes = 1 endif ifstr(i) $(BaudRate) != $(SvBaudRate) set Changes = 1 endif ifstr(i) $(DialInStr) != $(SvDialInStr) set Changes = 1 endif ifstr(i) $(DialOutStr) != $(SvDialOutStr) set Changes = 1 endif endif ; OK button endif ; Either OK or Details button ifstr(i) $(Status) == STATUS_REPEAT goto RefreshDlg endif ui pop 1 X25ConfReturn =+ ifstr(i) $(!SVCHANDLE) != "" install FreeSvcLibrary endif Return $(Status), $(Changes), $(ServiceTitle), + $(DriverInfo), $(LNUA), $(L3Window), $(L3PktSz), + $(L2Window), $(T1Timeout), $(N2Retry), $(AcceptRevCh), + $(Restart), $(Standby), $(OSVCRng), $(2SVCRng), + $(ISVCRng), $(PVCRng), $(DataRate), $(NRZI), + $(FilterIncoming), $(LineType), $(FRadio4), + $(ComPort), $(BaudRate), $(DialInStr), $(DialOutStr) [DoDetails] ifstr(i) $($0) == "" return 255 else set Info = $($0) endif ifstr(i) $($1) == "" set DMAch = 255 else set DMAch = $($1) endif ifstr(i) $(!STF_BUSTYPE) == "MCA" set DlgTemplate = "IDD_DETAILS_MCA" else set DlgTemplate = "IDD_DETAILS_ISA" endif set DlgType = "MultiCombo" set Caption = "Network Adapter Settings" set DlgLabel1 = "Adapter Name:" set DlgLabel2 = "Device Name:" set GroupLabel = "Settings:" set DlgLabel3 = "I/O Port Address:" set DlgLabel4 = "Interrupt (IRQ):" set DlgLabel5 = "DMA Channel:" set DlgLabel6 = "MCA Bus Slot:" set DlgLabel7 = "MCA Bus I.D.:" set Continue = "OK" set Help = "Help" set HelpContext = #( HelpContextIDs, $(DlgTemplate), 1 ) ; Display Name set DlgText1 = *(*($(Info),1),3) ; Device Name set DlgText2 = *($(Info),2) ; I/O Port Address set Tmp = *(*($(Info),3),1) ifint $(Tmp) == 99 set DlgText3 = "Unknown" else set-dectohex Str = $(Tmp) set DlgText3 = $(Str) endif ; Interrupt set Tmp = *($(Info),4) ifint $(Tmp) == 255 set DlgText4 = "Conflict?" else-ifint $(Tmp) == 99 set DlgText4 = "Unknown" else set DlgText4 = $(Tmp) endif ; DMA Channel set ComboListIn1 = { "(None)", 0, 1, 3 } ifstr(i) $(DMAch) == "255" ; not detectable? set ComboListOut1 = "1" ; suggest default else-ifstr(i) $(DMAch) == "99" ; unknown? set ComboListOut1 = "1" ; suggest default else-ifstr(i) $(DMAch) == "16" ; not in use? set ComboListOut1 = "(None)" ; say so else ; seems valid set ComboListOut1 = $(DMAch) ; actual value endif set ComboListItemsIn = { ComboListIn1 } set ComboListItemsOut = { ComboListOut1 } ifstr(i) $(!STF_BUSTYPE) == "MCA" ; MCA Slot set Tmp = *($(Info),7) ifint $(Tmp) == 99 set DlgText6 = "Unknown" else set DlgText6 = $(Tmp) endif ; MCA Id set Tmp = *($(Info),6) ifint $(Tmp) == 99 set DlgText7 = "Unknown" else set-dectohex DlgText7 = *($(Info),6) endif endif ui start $(DlgTemplate) $(!IHVDLGHANDLE) ; do DMA thing ifstr(i) $(ComboListOut1) == "(None)" set DMAch = 16 else set DMAch = $(ComboListOut1) endif ui pop 1 return $(DMAch) [DoDialer] set Status = STATUS_FAILED set ComPort = "" set BaudRate = "" set DialInStr = "" set DialOutStr = "" ifstr(i) $($0) == "" goto EndDialer endif set ComPort = $($0) ifstr(i) $(ComPort) == "0" set ComPort = "(None)" endif set BaudRate = $($1) set DialInStr = $($2) set DialOutStr = $($3) read-syms DialerDlg$(!STF_LANGUAGE) set COut1 = $(ComPort) set COut2 = $(BaudRate) set ComboListItemsIn = { ComboListIn1, ComboListIn2 } set ComboListItemsOut = { COut1, COut2 } set EditTextIn = { $(DialInStr), $(DialOutStr) } ui start $(DlgTemplate) $(!IHVDLGHANDLE) ui pop 1 ifstr(i) $(DLGEVENT) == "Continue" set ComPort = $(COut1) ifstr(i) $(ComPort) == "(None)" set ComPort = "0" endif set BaudRate = $(COut2) set DialInStr = *( $(EditTextOut), 1 ) set DialOutStr = *( $(EditTextOut), 2 ) set Status = STATUS_SUCCESSFUL else-ifstr(i) $(DLGEVENT) == "Exit" set Status = STATUS_USERCANCEL endif EndDialer =+ return $(Status) $(ComPort) $(BaudRate) $(DialInStr) $(DialOutStr) [DialerDlgENG] DlgTemplate = IDD_DIALER DlgType = "RadioCombination" Caption = "Microgate Dialer Setup" DlgText1 = "These parameters affect the behavior of the"+ " Microgate adapter's built-in phone dialer." EditLabel1 = "COM &Port:" EditLabel2 = "Baud &Rate:" EditLabel3 = "&Incoming String:" EditLabel4 = "&Outgoing String:" EditTextLim = { 512, 512 } EditFocus = "END" Continue = "&Continue" Help = "&Help" Cancel = "C&ancel" HelpContext = #( HelpContextIDs, $(DlgTemplate), 1 ) ComboListIn1 = + {"(None)",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,+ 26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,+ 51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,+ 76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,+ 101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,+ 121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,+ 141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,+ 161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,+ 181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,+ 201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,+ 221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,+ 241,242,243,244,245,246,247,248,249,250,251,252,253,254} ComboListIn2 = + {75,110,134,150,300,600,1200,1800,2400,4800,7200,9600,14400,19200,38400,57600,115200} ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; Identify ; ; DESCRIPTION: To verify that this INF deals with the same type of options ; as we are choosing currently. ; ; INPUT: None ; ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL ; $($R1): Option Type (COMPUTER ...) ; $($R2): Diskette description ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [Identify] read-syms Identification set Status = STATUS_SUCCESSFUL set Identifier = $(OptionType) set Media = #(Source Media Descriptions, 1, 1) Return $(Status) $(Identifier) $(Media) ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; ReturnOptions ; ; DESCRIPTION: To return the option list supported by this INF and the ; localised text list representing the options. ; ; ; INPUT: $($0): Language used. ( ENG | FRN | ... ) ; ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL | ; STATUS_NOLANGUAGE ; STATUS_FAILED ; ; $($R1): Option List ; $($R2): Option Text List ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [ReturnOptions] set Status = STATUS_FAILED set OptionList = {} set OptionTextList = {} ; ; Check if the language requested is supported ; set LanguageList = ^(LanguagesSupported, 1) ifcontains(i) $($0) in $(LanguageList) goto returnoptions else set Status = STATUS_NOLANGUAGE goto finish_ReturnOptions endif ;++++++++++++++++++++++++++++++++++++ ; ; returnoptions: ; get the options from the Options and OptionsText sections and set appropriate ; return values. ; ;++++++++++++++++++++++++++++++++++++ returnoptions = + set OptionList = ^(Options, 1) set OptionTextList = ^(OptionsText$($0), 1) set Status = STATUS_SUCCESSFUL ;++++++++++++++++++++++++++++++++++++ ; ; finish_ReturnOptions: ; ;++++++++++++++++++++++++++++++++++++ finish_ReturnOptions = + Return $(Status) $(OptionList) $(OptionTextList) ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; ReturnSNAOptions ; ; DESCRIPTION: To return the option list supported by this INF and ; recognized by SNA Server. This script also returns ; the localized text list representing those options. ; ; ; INPUT: None ; ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL | ; STATUS_NOLANGUAGE ; STATUS_FAILED ; ; $($R1): Option List ; $($R2): Option Text List ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [ReturnSNAOptions] set Status = STATUS_FAILED set SNAOptionList = {} set SNAOptionTextList = {} set LANG = $(!STF_LANGUAGE) ; ; Check if the language requested is supported ; set LanguageList = ^(LanguagesSupported, 1) ifcontains(i) $(LANG) in $(LanguageList) goto returnSNAoptions else set Status = STATUS_NOLANGUAGE goto finish_ReturnSNAOptions endif ;++++++++++++++++++++++++++++++++++++ ; ; returnSNAoptions: ; get the options from the Options and OptionsText sections and set appropriate ; return values. ; ;++++++++++++++++++++++++++++++++++++ returnSNAoptions = + set SNAOptionList = ^(SNAOptions, 1) set OptionList = ^(Options, 1) set SNAOptionTextList = {} set Status = STATUS_SUCCESSFUL ; ; Check that each of the SNA Options is a valid option and compile ; the list of text descriptions ; ForListDo $(SNAOptionList) ifcontains $($) in $(OptionList) set SNAOptionTextList = >( $(SNAOptionTextList), + #(OptionsText$(LANG), $($), 1) ) else set Status = STATUS_FAILED goto finish_ReturnSNAOptions endif ; TODO: whenever language gets checked, they use an (i) check. ; the question is: are section names case sensitive or case ; insensitive. if they are case insensitive, might as well ; make this a case insensitive check. if they are case ; sensitive, report this as a bug. ; CODENAME: CASECHECK EndForListDo ;++++++++++++++++++++++++++++++++++++ ; ; finish_ReturnSNAOptions: ; ;++++++++++++++++++++++++++++++++++++ finish_ReturnSNAOptions = + Return $(Status) $(SNAOptionList) $(SNAOptionTextList) ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; ReturnSNAAdds ; ; DESCRIPTION: To return the list of dependencies and their text ; descriptions for a particular option. ; ; ; INPUT: $($0): Option used. ; ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL | ; STATUS_NOLANGUAGE ; STATUS_FAILED ; ; $($R1): Dependency List ; $($R2): Dependency Text List ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [ReturnSNAAdds] set Status = STATUS_FAILED set SNAAddList = {} set SNAAddTextList = {} set LANG = $(!STF_LANGUAGE) ; ; Check if the language requested is supported ; set LanguageList = ^(LanguagesSupported, 1) ifcontains(i) $(LANG) in $(LanguageList) goto returnSNAadds else set Status = STATUS_NOLANGUAGE goto finish_ReturnSNAAdds endif ;++++++++++++++++++++++++++++++++++++ ; ; returnSNAadds: ; get the additional options for an option and compile their text list ; ;++++++++++++++++++++++++++++++++++++ returnSNAadds = + set SNAAddList = ^(SNAOptionAdds$($0), 1) set OptionList = ^(Options, 1) set Status = STATUS_SUCCESSFUL ; ; Check that each of the SNA Dependencies is a valid option and compile ; the list of text descriptions ; ForListDo $(SNAAddList) ifcontains $($) in $(OptionList) set SNAAddTextList = >( $(SNAAddTextList), + #(OptionsText$(LANG), $($), 1) ) else set Status = STATUS_FAILED goto finish_ReturnSNAAdds endif ; TODO: Check CODENAME: CASECHECK EndForListDo ;++++++++++++++++++++++++++++++++++++ ; ; finish_ReturnSNAAdds: ; ;++++++++++++++++++++++++++++++++++++ finish_ReturnSNAAdds = + Return $(Status) $(SNAAddList) $(SNAAddTextList) ;************************************************************************ ;************************************************************************ ; SNA INVOCATION SECTION ;************************************************************************ ;************************************************************************ ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; SnaInvocation ; ; DESCRIPTION: To perform operations requested by the SNA Setup ; ; INPUT: NTN_XXXXX and STF_XXXXX variables defined ; ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL | ; STATUS_NOLANGUAGE | ; STATUS_USERCANCEL | ; STATUS_FAILED ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [SnaInvocation] set LongOption = $(!NTN_InfOption) set Changes = 0 set Instance = "xx" Split-String $(LongOption) "_" OptionList QueryListSize OptionSize $(OptionList) ifint $(OptionSize) == 3 set Option = *( $(OptionList), 1 ) set Instance = *( $(OptionList), 3 ) else set Option = $(LongOption) endif ; ; These three variables describe the execution of the installation. ; AddCopy adds the files in the file list to the copy list ; DoCopy actually copies the files on the spot ; ifstr(i) $(!NTN_InstallMode) == install read-syms InstallSteps$(Option) set !AddCopy = $(AddFilesToCopyList) set !DoCopy = $(CopyFilesInCopyList) ifstr(i) $(!NTN_InfType) == "LOCAL" set !AddCopy = NO set !DoCopy = NO endif Else set !AddCopy = NO set !DoCopy = NO Endif shell "" CommonSection $(Option) $(Instance) set Status = $($R0) set ReturnData = $($R1) set Changes = $($R2) Return $(Status) $(ReturnData) $(Changes) ;************************************************************************ ;************************************************************************ ; NCPA INVOCATION SECTION ;************************************************************************ ;************************************************************************ ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; InstallOption ; ; DESCRIPTION: To perform operations requested by the NCPA ; ; INPUT: NTN_XXXXX and STF_XXXXX variables defined ; ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL | ; STATUS_NOLANGUAGE | ; STATUS_USERCANCEL | ; STATUS_FAILED ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [NTVersion] !STF_WINDOWSVERSION = "" ? $(!LIBHANDLE) GetWindowsNtVersion [InstallOption] set LongOption = $(!NTN_InfOption) set Changes = 0 set Instance = "xx" set !SNA_ProductName = "SNA Server" Split-String $(LongOption) "_" OptionList QueryListSize OptionSize $(OptionList) ifint $(OptionSize) == 3 set Option = *( $(OptionList), 1 ) set Instance = *( $(OptionList), 3 ) else set Option = $(LongOption) endif ; ; We don't really have upgrade functionality yet, so for the ; time being, we can just return successfully if we've been ; invoked as part of Windows NT Upgrade. ; ifstr(i) $(!NTN_InstallMode) == "upgrade" return STATUS_SUCCESSFUL endif ; ; These three variables describe the execution of the installation. ; AddCopy adds the files in the file list to the copy list ; DoCopy actually copies the files on the spot ; ifstr(i) $(!NTN_InstallMode) == "install" read-syms InstallSteps$(Option) set !AddCopy = YES set !DoCopy = YES else set !AddCopy = NO set !DoCopy = NO Endif ; ; Set SNA Root Directory before reading File Constants ; OpenRegKey $(!REG_H_LOCAL), "", + "Software\Microsoft\SNA Server\CurrentVersion\Setup", + $(!REG_KEY_READ), KeySNAServices ifstr(i) $(KeySNAServices) != {} GetRegValue $(KeySNAServices) "RootDir" RootDirValue ifstr(i) $(RootDirValue) != "" set !SNARootDir = *( $(RootDirValue), 4 ) endif endif read-syms FileConstants read-syms FileConstants$(Option) set !NT31Flag = "0" install LoadSetupLibrary ifstr(i) $(!LIBHANDLE) != "" detect NTVersion install FreeSetupLibrary split-string $(!STF_WINDOWSVERSION) "{" TmpVerStr1 split-string *($(TmpVerStr1),2) "}" TmpVerStr2 split-string *($(TmpVerStr2),1) "," TmpVerStr1 ifint *($(TmpVerStr1),1) == 3 ifint *($(TmpVerStr1),3) == 10 set !NT31Flag = "1" endif endif endif ifstr(i) $(!NT31Flag) == "1" shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + "Please use SNA Server Setup to configure SNA link services." return STATUS_SUCCESSFUL endif OpenRegKey $(!REG_H_LOCAL), "", + $(ProductRegBase)"\"$(ProductFullName)"\CurrentVersion", + $(!REG_KEY_READWRITE), KeyServiceIndex ifstr(i) $(KeyServiceIndex) == "" set ErrMesg = "Can't Find This Product Instance." set ErrProc = "InstallOption" set ErrFunc = "OpenRegKey (1)" goto fatal_registry endif GetRegValue $(KeyServiceIndex), "SNAVersion", SNAVersionInfo set !SNAVersion = *( $(SNAVersionInfo), 4 ) CloseRegKey $(KeyServiceIndex) set !DriverDir = $(!SNARootDir)"\system\hwsetup\" shell $(UtilityInf) GetBusType ifstr(i) $($R0) == STATUS_SUCCESSFUL set !STF_BUSTYPE = $($R1) else set !STF_BUSTYPE = "ISA" endif LoadLibrary "" $(DialogLibrary) !DLGHANDLE shell "" CommonSection $(Option) $(Instance) set Status = $($R0) ifstr(i) $($R2) == 1 shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) "STATUS" + "For the changed parameters to be noticed, you must stop and"+ " restart this link service with the "$(!SNA_ProductName)" Admin program." else-ifstr(i) $($R2) == 2 shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) "STATUS" + "You must reboot for the changed parameters to be noticed." endif FreeLibrary $(!DLGHANDLE) Return $(Status) fatal_registry = + set Error = + "Fatal Registry Error:"$(!LF)+ $(ErrMesg)$(!LF)+ "File: "$(ThisInf)$(!LF)+ "Procedure: "$(ErrProc)$(!LF)+ "Function: "$(ErrFunc) shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE) "FATAL" $(Error) Return STATUS_FAILED {} $(Changes) ;************************************************************************ ;************************************************************************ ; COMMON SECTION ;************************************************************************ ;************************************************************************ ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; CommonSection ; ; DESCRIPTION: To carry out the install/config/etc. operations ; ; INPUT: NTN_XXXXX and STF_XXXXX variables defined ; $($0): Option to be used ; $($1): Instance to be used ; ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL | ; STATUS_NOLANGUAGE | ; STATUS_EXISTS | ; STATUS_USERCANCEL | ; STATUS_FAILED ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [CommonSection] StartWait set Option = $($0) set Instance = $($1) set Index = "CurrentVersion" set RetData = {} set Changes = 0 set !DefDriverInfo = {{99,1,Unknown},Unknown,{99,99},99,99,99,99,{99,99},99} ; ; Check if the language requested is supported ; set LanguageList = ^(LanguagesSupported, 1) ifcontains(i) $(!STF_LANGUAGE) in $(LanguageList) goto languageexists else set Status = STATUS_NOLANGUAGE goto end endif ;++++++++++++++++++++++++++++++++++++ ; ; languageexists: ; ;++++++++++++++++++++++++++++++++++++ languageexists = + ; ; Define some constants, read some variable sections, and set the date ; StartWait read-syms GeneralConstants read-syms FileConstants read-syms FileConstants$(!STF_LANGUAGE) read-syms FileConstants$(Option) read-syms FileConstants$(Option)_$(!STF_LANGUAGE) install LoadSetupLibrary detect date install FreeSetupLibrary SetHelpFile $(!DriverDir)$(ThisHlp) $(HlpMin) $(HlpMax) LoadLibrary "" $(!DriverDir)$(ThisSrl) !IHVDLGHANDLE ifstr(i) $(!IHVDLGHANDLE) == "" goto set_status_failed endif set to = Begin set from = Begin ; ; Assume that all is well as we begin ; set CommonStatus = STATUS_SUCCESSFUL EndWait ;++++++++++++++++++++++++++++++++++++ ; ; Begin: ; Set up the operation-mode-based variables and gaily welcome ; the user. if the "install mode" variable is improperly set, ; assume this is a new installation. ; ;++++++++++++++++++++++++++++++++++++ Begin = + ifstr(i) $(!NTN_InstallMode) == deinstall set StartLabel = remove_component else-ifstr(i) $(!NTN_InstallMode) == fullremove set StartLabel = remove_component else-ifstr(i) $(!NTN_InstallMode) == snaremove set StartLabel = remove_component else-ifstr(i) $(!NTN_InstallMode) == getbindings set StartLabel = getbind_component else-ifstr(i) $(!NTN_InstallMode) == bind set StartLabel = bind_component else-ifstr(i) $(!NTN_InstallMode) == configure set StartLabel = config_component else ;; install set StartLabel = install_component endif goto set_defaults_$(Option) ;++++++++++++++++++++++++++++++++++++ ; ; set_defaults_MGATEXLS ; ;++++++++++++++++++++++++++++++++++++ set_defaults_MGATEXLS = + set ServiceName = $(Option) set ServiceTitle = $(ProductTitle) set ServiceDesc = $(ProductDesc) set DriverInfo = $(!DefDriverInfo) set LNUA = "000000000000000" set L3Window = "2" set L3PktSz = "128" set L2Window = "7" set T1Timeout = "30" set N2Retry = "10" set AcceptRevCh = "0" set Restart = "1" set Standby = "0" set OSVCRng = "" set 2SVCRng = "0001-0004" set ISVCRng = "" set PVCRng = "" set DataRate = "1" set NRZI = "0" set FilterIncoming = "1" set LineType = "0" ; Leased set Radio4Flag = "0" set ComPort = "0" set BaudRate = "9600" set DialInStr = "AT&F&C1&S1&D3&Q1Q1S0=1" set DialOutStr = "AT&F&C1&S1&D3&Q1Q1S0=0DT" set CfgArray = {} set DeviceIndex = 1 set DeviceName = "" set DeviceId = 0 ; Initialize CfgArray from the registry install LoadSvcLibrary ifstr(i) $(!SVCHANDLE) != "" LibraryProcedure CfgArray $(!SVCHANDLE) SNAReadSyncConfig $(!SNARootDir)\system install FreeSvcLibrary endif goto finish_defaults ;++++++++++++++++++++++++++++++++++++ ; ; set_defaults_MGATEXDD ; ;++++++++++++++++++++++++++++++++++++ set_defaults_MGATEXDD = + set ServiceName = $(Option) set ServiceTitle = $(ProductTitle) set ServiceDesc = $(ProductDesc) goto finish_defaults ;++++++++++++++++++++++++++++++++++++ ; ; finish_defaults: ; ;++++++++++++++++++++++++++++++++++++ finish_defaults = + set from = end set to = end goto $(StartLabel) ;++++++++++++++++++++++++++++++++++++ ; ; install_component: ; ;++++++++++++++++++++++++++++++++++++ install_component = + ; ; First, check if there are any existing services of this product ; already in the registry. ; shell $(UtilityInf) FindSNAProductServices, $(ProductRegBase), + $(ProductFullName) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set SvcIndexList = $($R1) set SvcNameList = $($R2) set SvcTitleList = $($R3) set SvcDescList = $($R4) ifstr(i) $(Status) == STATUS_FAILED set ErrMesg = "Can't Find This Product." set ErrProc = "install_component" set ErrFunc = "FindSNAProductServices" goto fatal_registry endif ; ; if there are no services of this product installed, it could mean ; that the product doesn't exist. Either way, we are installing service ; index "01" and on to modify params. ; QueryListSize SvcIndexListSize $(SvcIndexList) set ProductExists = $(!True) ifint $(SvcIndexListSize) == 0 ifstr(i) $(Status) == STATUS_NOSUCHPRODUCT set ProductExists = $(!False) endif set Instance = "01" goto install_nextstep endif ; ; If there are one or more services installed, but the product's files ; don't exist in the sna\system directory, then we consider this ; product to be NOT INSTALLED. We'll continue on using instance 01. ; ifstr(i) $(Option) == MGATEXDD set Missing = 0 set FileList = ^( FilesFor_system_$(Option), 2 ) ifstr(i) $(FileList) != "" install LoadSetupLibrary ifstr(i) $(!LIBHANDLE) != "" ForListDo $(FileList) LibraryProcedure ExistStatus $(!LIBHANDLE) + CheckFileExistance $(!SNARootDir)\system\$($) ifstr(i) $(ExistStatus) == "NO" set-add Missing = $(Missing), 1 endif EndForListDo install FreeSetupLibrary endif endif ; FileList ifint $(Missing) > 0 set Instance = "01" set ProductExists = $(!False) goto install_nextstep endif endif ; Option == MGATEXDD ; ; If there is one instance of this service and this product is an ; exclusive install, return with the appropriate status. ; ifint $(ProductExclusive) != $(!False) ifint $(SvcIndexListSize) == 1 set Status = STATUS_EXISTS ifint $(ProductExclusive) == $(NOTIFY) shell $(SubroutineInf) SetupMessage $(!STF_LANGUAGE), + "NONFATAL", + "This product is already installed and can only be installed once." endif goto end endif endif shell $(UtilityInf) FindNextAvailableIndex $(SvcIndexList) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set Instance = $($R1) ifstr(i) $(Status) != STATUS_SUCCESSFUL goto end endif ;++++++++++++++++++++++++++++++++++++ ; ; install_nextstep: ; we have a service index and are ready to start the ; process of installing an instance. ; ;++++++++++++++++++++++++++++++++++++ install_nextstep = + read-syms FileConstants$(Option) set TmpStr = "" ifint $(Instance) < 10 split-string $(Instance) "0" TmpList QueryListSize TmpSize $(TmpList) ifstr(i) *($(TmpList),1) != "0" set TmpStr = $(TmpStr)*($(TmpList),1) endif ifint $(TmpSize) > 1 set TmpStr = $(TmpStr)*($(TmpList),2) endif else set TmpStr = $(Instance) endif set ServiceTitle = $(ProductTitle)" #"$(TmpStr) ifint $(ProductServiceQuery) == $(!True) shell $(UtilityInf) EnterServiceName, + $(ProductTitle), + $(ProductServicePrefix), + $(Instance) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set ServiceName = $($R1) ifstr(i) $(Status) != STATUS_SUCCESSFUL goto end endif else set ServiceName = $(ProductServicePrefix) endif goto modify_params ;++++++++++++++++++++++++++++++++++++ ; ; config_component: ; get the current values for all the parameters and prepare them for ; modify_params. ; ;++++++++++++++++++++++++++++++++++++ config_component = + read-syms FileConstants$(Option) ; ; Try and open this product and see if it's even installed. ; shell $(UtilityInf) FindSNAProductServices $(ProductRegBase), + $(ProductFullName) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set SvcIndexList = $($R1) set SvcNameList = $($R2) set SvcTitleList = $($R3) set SvcDescList = $($R4) ifstr(i) $(Status) != STATUS_SUCCESSFUL set ErrMesg = "Can't Find This Product." set ErrProc = "config_component" set ErrFunc = "FindSNAProductServices" goto fatal_registry endif shell $(UtilityInf) GrepUniqueServiceInfo "Index", + $(Instance), + $(SvcIndexList), + $(SvcNameList),+ $(SvcTitleList),+ $(SvcDescList) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set ServiceIndex = $($R1) set ServiceName = $($R2) set ServiceTitle = $($R3) set ServiceDesc = $($R4) ifstr(i) $(Status) != STATUS_SUCCESSFUL goto end endif ;++++++++++++++++++++++++++++++++++++ ; ; read_params: ; read the parameters from the SCA and assign them to the appropriate ; variables. ; ;++++++++++++++++++++++++++++++++++++ read_params = + ; ; Find the entry in the Service Control Architecture and get a handle ; to the Parameters Key and to the ExtraParameters key if one exists. ; shell $(UtilityInf) FindSNAService, $(ServiceName) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set KeyService = $($R1) set KeyParameters = $($R2) set KeyExtraParams = $($R3) ifstr(i) $(Status) != STATUS_SUCCESSFUL CloseRegKey $(KeyService) CloseRegKey $(KeyParameters) CloseRegKey $(KeyExtraParams) set ErrMesg = "Can't Find Service Entry For Instance "$(ServiceName) set ErrProc = "read_params" set ErrFunc = "FindSNAService" goto fatal_registry endif set OldVersionExisted = $(!True) set ValueName = "" set ValueData = "" set ValueStr = "" set ValueList = {} ; ; Get the old values from the parameters key ; EnumRegValue $(KeyParameters) ValueList ; ; if there's an ExtraParameters subkey, add those values to the list ; ifstr(i) $(KeyExtraParams) != $(KeyNull) EnumRegValue $(KeyExtraParams) ExtraValueList ForListDo $(ExtraValueList) set ValueList = >( $(ValueList), $($) ) EndForListDo endif ForListDo $(ValueList) set ValueItem = $($) set ValueName = *($(ValueItem), 1) set ValueData = *($(ValueItem), 4) goto assign_value_$(Option) ;++++++++++++++++++++++++++++++++++++ ; ; assign_value_MGATEXLS: ; ;++++++++++++++++++++++++++++++++++++ assign_value_MGATEXLS = + ifstr(i) $(ValueName) == "LNUA" set LNUA = $(ValueData) else-ifstr(i) $(ValueName) == "L3Window" set L3Window = $(ValueData) else-ifstr(i) $(ValueName) == "L3PktSz" set L3PktSz = $(ValueData) else-ifstr(i) $(ValueName) == "L2Window" set L2Window = $(ValueData) else-ifstr(i) $(ValueName) == "T1Timeout" set T1Timeout = $(ValueData) else-ifstr(i) $(ValueName) == "N2Retry" set N2Retry = $(ValueData) else-ifstr(i) $(ValueName) == "AcceptRevCh" set AcceptRevCh = $(ValueData) else-ifstr(i) $(ValueName) == "Restart" set Restart = $(ValueData) else-ifstr(i) $(ValueName) == "Standby" set Standby = $(ValueData) else-ifstr(i) $(ValueName) == "OSVCRng" set OSVCRng = $(ValueData) else-ifstr(i) $(ValueName) == "2SVCRng" set 2SVCRng = $(ValueData) else-ifstr(i) $(ValueName) == "ISVCRng" set ISVCRng = $(ValueData) else-ifstr(i) $(ValueName) == "PVCRng" set PVCRng = $(ValueData) else-ifstr(i) $(ValueName) == "DataRate" set DataRate = $(ValueData) else-ifstr(i) $(ValueName) == "NRZI" set NRZI = $(ValueData) else-ifstr(i) $(ValueName) == "FilterIncoming" set FilterIncoming = $(ValueData) else-ifstr(i) $(ValueName) == "LineType" set LineType = $(ValueData) else-ifstr(i) $(ValueName) == "Radio4Flag" ifstr(i) $(ValueData) == "1" set Radio4Flag = $(!True) else set Radio4Flag = $(!False) endif else-ifstr(i) $(ValueName) == "DialerPort" set ComVal = $(ValueData) ifstr(i) $(ComVal) == "" set ComPort = "0" else Split-String $(ComVal) "M" ComList QueryListSize ComSize $(ComList) set ComPort = *( $(ComList), $(ComSize) ) set ComList = {} endif else-ifstr(i) $(ValueName) == "DialerBaudRate" set BaudRate = $(ValueData) else-ifstr(i) $(ValueName) == "DialerIncomingString" set DialInStr = $(ValueData) else-ifstr(i) $(ValueName) == "DialerOutgoingString" set DialOutStr = $(ValueData) else-ifstr(i) $(ValueName) == "DeviceName" set DeviceName = $(ValueData) else-ifstr(i) $(ValueName) == "DeviceId" set DeviceId = $(ValueData) endif goto finish_assign_value ;++++++++++++++++++++++++++++++++++++ ; ; assign_value_MGATEXDD: ; ;++++++++++++++++++++++++++++++++++++ assign_value_MGATEXDD = + goto finish_assign_value ;++++++++++++++++++++++++++++++++++++ ; ; finish_assign_value: ; ;++++++++++++++++++++++++++++++++++++ finish_assign_value = + EndForListDo ifstr(i) $(Option) == MGATEXLS set DriverInfo = $(!DefDriverInfo) install LoadSvcLibrary ifstr(i) $(!SVCHANDLE) != "" LibraryProcedure CfgArray $(!SVCHANDLE) + SNAReadSyncConfig $(!SNARootDir)\system install FreeSvcLibrary ifstr(i) $(CfgArray) != {} set DeviceIndex = 1 set Found = $(!False) ForListDo $(CfgArray) ifstr(i) $(Found) == $(!False) Split-String *( $($), 2 ) "\" DIList QueryListSize DISize $(DIList) ifstr(i) *( $(DIList), $(DISize) ) == $(DeviceName) set DriverInfo = $($) set DeviceIndex = $(#) set DeviceId = *(*($(DriverInfo),1),1) set Found = $(!True) endif endif EndForListDo endif endif endif goto assign_extra_$(Option) ;++++++++++++++++++++++++++++++++++++ ; ; assign_extra_MGATEXLS: ; ;++++++++++++++++++++++++++++++++++++ assign_extra_MGATEXLS = + goto finish_assign_extra ;++++++++++++++++++++++++++++++++++++ ; ; assign_extra_MGATEXDD: ; ;++++++++++++++++++++++++++++++++++++ assign_extra_MGATEXDD = + goto finish_assign_extra ;++++++++++++++++++++++++++++++++++++ ; ; finish_assign_extra: ; ;++++++++++++++++++++++++++++++++++++ finish_assign_extra = + goto modify_params ;++++++++++++++++++++++++++++++++++++ ; ; modify_params: ; allow the user to bang away at the parameters until they are happy ; ;++++++++++++++++++++++++++++++++++++ modify_params = + set from = modify_params goto modify_params_$(Option) ;++++++++++++++++++++++++++++++++++++ ; ; modify_params_MGATEXLS: ; ;++++++++++++++++++++++++++++++++++++ modify_params_MGATEXLS = + ; ; Find the ID and CfgIndex of the current card. ; set OldCfgId = *(*($(DriverInfo),1),1) set OldCfgIndex = 0 ForListDo $(CfgArray) ifint $(OldCfgIndex) == 0 ifstr(i) $(OldCfgId) == *(*($($),1),1) set OldCfgIndex = $(#) endif endif EndForListDo shell "" DoMGATEXLSConfig $(ServiceName), $(ServiceTitle), + $(DriverInfo), $(LNUA), $(L3Window), + $(L3PktSz),$(L2Window), $(T1Timeout), + $(N2Retry), $(AcceptRevCh), $(Restart), + $(Standby), $(OSVCRng), $(2SVCRng), + $(ISVCRng), $(PVCRng), $(DataRate), $(NRZI), + $(FilterIncoming), $(LineType), $(Radio4Flag), + $(ComPort), $(BaudRate), $(DialInStr), $(DialOutStr) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) ifstr(i) $(Status) != STATUS_SUCCESSFUL goto end else set Changes = $($R1) set ServiceTitle = $($R2) set DriverInfo = $($R3) set LNUA = $($R4) set L3Window = $($R5) set L3PktSz = $($R6) set L2Window = $($R7) set T1Timeout = $($R8) set N2Retry = $($R9) set AcceptRevCh = $($R10) set Restart = $($R11) set Standby = $($R12) set OSVCRng = $($R13) set 2SVCRng = $($R14) set ISVCRng = $($R15) set PVCRng = $($R16) set DataRate = $($R17) set NRZI = $($R18) set FilterIncoming = $($R19) set LineType = $($R20) set Radio4Flag = $($R21) set ComPort = $($R22) set BaudRate = $($R23) set DialInStr = $($R24) set DialOutStr = $($R25) set DName = *( $(DriverInfo), 2 ) Split-String $(DName) "\" DNList QueryListSize DNSize $(DNList) set DeviceName = *( $(DNList), $(DNSize) ) set DeviceId = *( *( $(DriverInfo), 1), 1) endif goto finish_modify_params ;++++++++++++++++++++++++++++++++++++ ; ; modify_params_MGATEXDD: ; ;++++++++++++++++++++++++++++++++++++ modify_params_MGATEXDD = + goto finish_modify_params ;++++++++++++++++++++++++++++++++++++ ; ; finish_modify_params: ; ;++++++++++++++++++++++++++++++++++++ finish_modify_params = + goto adjust_params ;++++++++++++++++++++++++++++++++++++ ; ; adjust_params: ; if there is an old version, the registry keys and values exist and all we ; have to do is modify them. otherwise, if we're installing from scratch, ; we have to create those keys and values. ; ;++++++++++++++++++++++++++++++++++++ adjust_params = + ifint $(OldVersionExisted) == $(!True) ifstr(i) $(!NTN_InstallMode) == "configure" goto write_params endif endif ;++++++++++++++++++++++++++++++++++++ ; ; create_regvals: ; create the necessary parts of the registry ; ;++++++++++++++++++++++++++++++++++++ create_regvals = + Shell $(UtilityInf) + CreateSNAService, + $(ServiceName), + $(SNAServiceType), + $(ProductImagePath), + $(ProductDepends), + $(ProductParams), + $(ProductExtraParams), + $(!SNARootDir)"\System\"$(ProductImagePath), + 7 ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set KeyService = $($R1) set KeyParameters = $($R2) set KeyExtraParams = $($R3) ifstr(i) $(Status) != STATUS_SUCCESSFUL CloseRegKey $(KeyService) CloseRegKey $(KeyParameters) CloseRegKey $(KeyExtraParams) set ErrMesg = "Can't Create Service Entry For Instance." set ErrProc = "create_regvals" set ErrFunc = "CreateSNAService" goto fatal_registry endif Shell $(UtilityInf) CreateSNARegEntry, $(ProductRegBase), + $(ProductFullName) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set KeyProductBase = $($R1) set KeyProduct = $($R2) set KeyServiceIndex = $($R3) set KeyNetRules = $($R4) ifstr(i) $(Status) != STATUS_SUCCESSFUL CloseRegKey $(KeyProductBase) CloseRegKey $(KeyProduct) CloseRegKey $(KeyServiceIndex) CloseRegKey $(KeyNetRules) set ErrMesg = "Can't Create Product Entry For Instance." set ErrProc = "create_regvals" set ErrFunc = "CreateSNARegEntry" goto fatal_registry endif shell $(UtilityInf) AddValueList, $(KeyServiceIndex), + { { ServiceName , $(NoTitle), $(!REG_VT_SZ), $(ServiceName) }, + { InfName , $(NoTitle), $(!REG_VT_SZ), $(FullInfName) }, + { SoftwareType, $(NoTitle), $(!REG_VT_SZ), $(SoftwareType) }, + { SNAVersion , $(NoTitle), $(!REG_VT_SZ), $(!SNAVersion) } } set NROption = $(Option)"_"$(Instance) set NRTitle = $(NetRulesTitle) set NRClass = { $(NetRulesClass) } set NRBindForm = $(ServiceName)" yes yes container" set NRUse = $(NetRulesUse) set NRBindable = { $(NetRulesBindable) } set NetRulesValues = { + { InfName , $(NoTitle), $(!REG_VT_SZ), $(FullInfName) }, + { InfOption, $(NoTitle), $(!REG_VT_SZ), $(NROption) }, + { title , $(NoTitle), $(!REG_VT_SZ), $(NRTitle) }, + { use , $(NoTitle), $(!REG_VT_SZ), $(NRUse) }, + { bindform , $(NoTitle), $(!REG_VT_SZ), $(NRBindForm) }, + { type , $(NoTitle), $(!REG_VT_SZ), $(NetRulesType) }, + } ; ; Here we enumerate all installed link services of this type, looking ; for the "class" and "bindable" regvals. We only write these values ; if we have no other installed links of this type, or we don't find ; these two values among the links we examine. ; ; Enum on KeyProductBase, SplitString each on "_", compare first string ; with ProductName, if match look in CurrentVersion\NetRules for these ; two values. ; set Found = $(!False) EnumRegKey $(KeyProductBase) TmpList ForListDo $(TmpList) set TmpName = *( $($), 1 ) Split-String $(TmpName) "_" TmpSplit ifstr(i) *( $(TmpSplit), 1 ) == $(ProductName) OpenRegKey $(KeyProductBase), "", + $(TmpName)"\CurrentVersion\NetRules", + $(!REG_KEY_READ), TmpNRKey ifstr(i) $(TmpNRKey) != $(KeyNull) EnumRegValue $(TmpNRKey) TmpNRList ForListDo $(TmpNRList) ifstr(i) *($($),1) == "class" set Found = $(!True) endif EndForListDo CloseRegKey $(TmpNRKey) endif endif EndForListDo set TmpList = {} set TmpName = {} set TmpSplit = {} set TmpNRList = {} ifstr(i) $(Found) == $(!False) set NetRulesValues = >( $(NetRulesValues), + { class, $(NoTitle), $(!REG_VT_MULTI_SZ), $(NRClass) } ) set NetRulesValues = >( $(NetRulesValues), + { bindable, $(NoTitle), $(!REG_VT_MULTI_SZ), $(NRBindable) } ) endif shell $(UtilityInf) AddValueList $(KeyNetRules) $(NetRulesValues) ifint $(ProductExists) == $(!False) read-syms ProgressCopyVars install InstallRemove endif goto write_params ;++++++++++++++++++++++++++++++++++++ ; ; write_params: ; ;++++++++++++++++++++++++++++++++++++ write_params = + ifstr $(KeyProductBase) == $(KeyNull) shell $(UtilityInf) FindSNARegEntry, + $(ProductRegBase), + $(ProductFullName) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set KeyProductBase = $($R1) set KeyProduct = $($R2) set KeyServiceIndex = $($R3) set KeyNetRules = $($R4) ifstr(i) $(Status) != STATUS_SUCCESSFUL CloseRegKey $(KeyProductBase) CloseRegKey $(KeyProduct) CloseRegKey $(KeyServiceIndex) CloseRegKey $(KeyNetRules) set ErrMesg = "Can't Find Product Entry For Instance." set ErrProc = "write_params" set ErrFunc = "FindSNARegEntry" goto fatal_registry endif endif ifstr $(KeyService) == $(KeyNull) shell $(UtilityInf) FindSNAService, $(ServiceName) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set KeyService = $($R1) set KeyParameters = $($R2) set KeyExtraParams = $($R3) ifstr(i) $(Status) != STATUS_SUCCESSFUL CloseRegKey $(KeyService) CloseRegKey $(KeyParameters) CloseRegKey $(KeyExtraParams) set ErrMesg = "Can't Find Service Entry For Instance." set ErrProc = "write_params" set ErrFunc = "FindSNAService" goto fatal_registry endif endif goto write_params_$(Option) ;++++++++++++++++++++++++++++++++++++ ; ; write_params_MGATEXLS: ; ;++++++++++++++++++++++++++++++++++++ write_params_MGATEXLS = + ifstr(i) $(Radio4Flag) == $(!True) set RadioVal = "1" else set RadioVal = "0" endif set FullOption = $(Option)"_"$(Instance) set ProductParams = { + { IHVDLL , $(NoTitle), $(!REG_VT_SZ), $(ProductDLL) },+ { InfName , $(NoTitle), $(!REG_VT_SZ), $(FullInfName) },+ { InfOption , $(NoTitle), $(!REG_VT_SZ), $(FullOption) },+ { DriverName , $(NoTitle), $(!REG_VT_SZ), "IBMSYNC" } + } ifstr(i) $(ComPort) == "0" set ComString = "" else set ComString = COM$(ComPort) endif set ProductExtraParams = { + { DeviceName , $(NoTitle),$(!REG_VT_SZ) , $(DeviceName) },+ { DeviceId , $(NoTitle),$(!REG_VT_DWORD), $(DeviceId) },+ { LNUA , $(NoTitle),$(!REG_VT_SZ) , $(LNUA) },+ { L1Init , $(NoTitle),$(!REG_VT_DWORD), 1 },+ { L2Start , $(NoTitle),$(!REG_VT_DWORD), 1 },+ { L3Window , $(NoTitle),$(!REG_VT_DWORD), $(L3Window) },+ { L3PktSz , $(NoTitle),$(!REG_VT_DWORD), $(L3PktSz) },+ { L2Window , $(NoTitle),$(!REG_VT_DWORD), $(L2Window) },+ { DiscAction , $(NoTitle),$(!REG_VT_DWORD), 2 },+ { T1Timeout , $(NoTitle),$(!REG_VT_DWORD), $(T1Timeout) },+ { N2Retry , $(NoTitle),$(!REG_VT_DWORD), $(N2Retry) },+ { AcceptRevCh , $(NoTitle),$(!REG_VT_DWORD), $(AcceptRevCh) },+ { Restart , $(NoTitle),$(!REG_VT_DWORD), $(Restart) },+ { Standby , $(NoTitle),$(!REG_VT_DWORD), $(Standby) },+ { OSVCRng , $(NoTitle),$(!REG_VT_SZ) , $(OSVCRng) },+ { 2SVCRng , $(NoTitle),$(!REG_VT_SZ) , $(2SVCRng) },+ { ISVCRng , $(NoTitle),$(!REG_VT_SZ) , $(ISVCRng) },+ { PVCRng , $(NoTitle),$(!REG_VT_SZ) , $(PVCRng) },+ { DataRate , $(NoTitle),$(!REG_VT_DWORD), $(DataRate) },+ { NRZI , $(NoTitle),$(!REG_VT_DWORD), $(NRZI) },+ { FilterIncoming, $(NoTitle),$(!REG_VT_DWORD), $(FilterIncoming)},+ { LineType , $(NoTitle),$(!REG_VT_DWORD), $(LineType) },+ { Radio4Flag , $(NoTitle),$(!REG_VT_DWORD), $(RadioVal) },+ { DialerPort , $(NoTitle),$(!REG_VT_SZ), $(ComString) },+ { DialerBaudRate, $(NoTitle),$(!REG_VT_DWORD), $(BaudRate) },+ { DialerIncomingString,$(NoTitle),$(!REG_VT_SZ),$(DialInStr) },+ { DialerOutgoingString,$(NoTitle),$(!REG_VT_SZ),$(DialOutStr) } + } goto finish_write_params ;++++++++++++++++++++++++++++++++++++ ; ; write_params_MGATEXDD: ; ;++++++++++++++++++++++++++++++++++++ write_params_MGATEXDD = + set FullOption = $(Option)"_"$(Instance) set ProductParams = { + { InfName , $(NoTitle), $(!REG_VT_SZ) , $(FullInfName) },+ { InfOption , $(NoTitle), $(!REG_VT_SZ) , $(FullOption) } + } set ProductExtraParams = {} goto finish_write_params ;++++++++++++++++++++++++++++++++++++ ; ; finish_write_params: ; ;++++++++++++++++++++++++++++++++++++ finish_write_params = + shell $(UtilityInf) AddValueList, $(KeyServiceIndex), + { + { Title , $(NoTitle), $(!REG_VT_SZ), $(ServiceTitle) }, + { Description, $(NoTitle), $(!REG_VT_SZ), $(ServiceDesc) } + } ifint $($ShellCode) != 0 goto ShellCodeError endif shell $(UtilityInf) AddValueList, $(KeyParameters), + { + { Title , $(NoTitle), $(!REG_VT_SZ), $(ServiceTitle) }, + { Description, $(NoTitle), $(!REG_VT_SZ), $(ServiceDesc) } + } ifint $($ShellCode) != 0 goto ShellCodeError endif ifstr(i) $(ProductParams) != {} shell $(UtilityInf) AddValueList, $(KeyParameters), + $(ProductParams) ifint $($ShellCode) != 0 goto ShellCodeError endif endif ifstr(i) $(ProductExtraParams) != {} shell $(UtilityInf) AddValueList, $(KeyExtraParams), + $(ProductExtraParams) ifint $($ShellCode) != 0 goto ShellCodeError endif endif set RetData = >( $(RetData), { $(Instance), + $(ServiceName), + $(ServiceTitle), + $(ServiceDesc), + $(!NTN_InstallMode), + } ) CloseRegKey $(KeyProductBase) CloseRegKey $(KeyProduct) CloseRegKey $(KeyServiceIndex) CloseRegKey $(KeyNetRules) CloseRegKey $(KeyService) CloseRegKey $(KeyParameters) CloseRegKey $(KeyExtraParams) ifstr(i) $(Option) == MGATEXLS ; ; Go through current CfgArray, looking for an ID that ; matches the one in DriverInfo. If we find one, we ; increment its UseCount. If not, we add DriverInfo ; to the CfgArray. If the user didn't change cards, ; we don't bother with any of this. ; set FoundX = 0 set MatchId = *(*($(DriverInfo),1),1) set TmpCfgArray = $(CfgArray) ; ; Find our index into CfgArray. ; ForListDo $(CfgArray) ifint $(FoundX) == 0 ifstr(i) $(MatchId) == *(*($($),1),1) set FoundX = $(#) endif endif EndForListDo ; ; If we're installing a new link service, we always ; check for having to bump the use count. If we're ; configuring, we only need to do this if the user ; changed cards. ; set DoCount = $(!False) ifstr(i) $(!NTN_InstallMode) == "install" set DoCount = $(!True) else ;$(!NTN_InstallMode) == "configure" ifstr(i) $(OldCfgId) != $(MatchId) set DoCount = $(!True) endif endif ifstr(i) $(DoCount) == $(!True) ifint $(FoundX) > 0 shell $(UtilityInf) BumpUseCount UP $(CfgArray) $(FoundX) ifstr(i) $($R0) == STATUS_SUCCESSFUL set TmpCfgArray = $($R1) endif else ; not found set TmpCfgArray = >( $(TmpCfgArray), $(DriverInfo) ) endif endif ; DoCount ifstr(i) $(!NTN_InstallMode) == "configure" ; ; If the user changed cards on us, we must decrement ; the use count of the old one. ; ifstr(i) $(OldCfgId) != $(MatchId) shell $(UtilityInf) BumpUseCount DOWN $(TmpCfgArray) $(OldCfgIndex) ifstr(i) $($R0) == STATUS_ZERO ; ; Rebuild CfgArray, removing items with use count of 0. ; set TmpArray = {} set Flag = $(!False) ForListDo $($R1) ifint *(*($($),1),2) > 0 set TmpArray = >( $(TmpArray), $($) ) endif EndForListDo set TmpCfgArray = $(TmpArray) else-ifstr(i) $($R0) == STATUS_SUCCESSFUL set TmpCfgArray = $($R1) endif else ; ; If the user DIDN'T change cards, we need to replace ; the current CfgArray entry with the new DriverInfo in ; order to pick up changes in DMA settings, etc. ; set TmpCfgArray = {} ForListDo $(CfgArray) ifint $(#) == $(FoundX) set TmpCfgArray = >( $(TmpCfgArray), $(DriverInfo) ) else set TmpCfgArray = >( $(TmpCfgArray), $($) ) endif EndForListDo endif ; OldCfgId != MatchId endif ; InstallMode == configure ; ; Write the new value (TmpCfgArray). ; install LoadSvcLibrary ifstr(i) $(!SVCHANDLE) != "" LibraryProcedure RetVal $(!SVCHANDLE) + SNAWriteSyncConfig $(!SNARootDir)\system $(TmpCfgArray) install FreeSvcLibrary endif endif ; $(Option) == MGATEXLS goto successful ;++++++++++++++++++++++++++++++++++++ ; ; getbind_component: ; ;++++++++++++++++++++++++++++++++++++ getbind_component = + goto getbind_$(Option) ;++++++++++++++++++++++++++++++++++++ ; ; getbind_MGATEXLS: ; ;++++++++++++++++++++++++++++++++++++ getbind_MGATEXLS = + set RetData = { {"01", "MGATEXDD", "", "", "getbindings"} } goto finish_getbind_component ;++++++++++++++++++++++++++++++++++++ ; ; getbind_MGATEXDD: ; ;++++++++++++++++++++++++++++++++++++ getbind_MGATEXDD = + goto finish_getbind_component ;++++++++++++++++++++++++++++++++++++ ; ; finish_getbind_component: ; ;++++++++++++++++++++++++++++++++++++ finish_getbind_component = + goto successful ;++++++++++++++++++++++++++++++++++++ ; ; bind_component: ; ;++++++++++++++++++++++++++++++++++++ bind_component = + set Error = "Sorry. No Bindings Feature Yet." goto fatal_msg ;++++++++++++++++++++++++++++++++++++ ; ; remove_component: ; ;++++++++++++++++++++++++++++++++++++ remove_component = + read-syms FileConstants$(Option) ; ; we need to set ourselved up with these variables for later use ; shell $(UtilityInf) FindSNAProductServices $(ProductRegBase), + $(ProductFullName) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set SvcIndexList = $($R1) set SvcNameList = $($R2) set SvcTitleList = $($R3) set SvcDescList = $($R4) ifstr(i) $(Status) == STATUS_NOSUCHPRODUCT goto successful endif ifstr(i) $(Status) == STATUS_FAILED set ErrMesg = "Can't Open Product Entry In Registry." set ErrProc = "remove_component" set ErrFunc = "FindSNAProductServices" goto fatal_registry endif ; ; This will be a counter that will be used to decide whether or not ; the product key should be removed at the end ; QueryListSize SvcIndexListSize $(SvcIndexList) ifstr(i) $(!NTN_InstallMode) == "fullremove" set RemoveMode = "Full" goto remove_all_pieces endif set RemoveMode = "Partial" ifstr(i) $(!NTN_InstallMode) == "snaremove" ; Hack. Here we search for bindings and remove only if nothing ; else needs this piece. ifstr(i) $(Option) == "MGATEXDD" set PN = #( FileConstantsMGATEXLS, ProductName, 1) set PV = #( FileConstantsMGATEXLS, ProductVersion, 1) shell $(UtilityInf) FindSNAProductServices $(ProductRegBase) + $(PN)"_"$(PV) set _Status = $($R0) set _List = $($R1) ifstr(i) $(_List) != {} goto successful endif shell $(UtilityInf) FindSNAProductServices $(ProductRegBase) + "IBMSDLCLS_1.0" set _Status = $($R0) set _List = $($R1) ifstr(i) $(_Status) == STATUS_FAILED goto set_status_failed endif ifstr(i) $(_List) != {} goto successful endif endif endif shell $(UtilityInf) GrepUniqueServiceInfo "Index", + $(Instance), + $(SvcIndexList), + $(SvcNameList), + $(SvcTitleList), + $(SvcDescList) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set RemoveIndex = $($R1) set RemoveName = $($R2) set RemoveTitle = $($R3) set RemoveDesc = $($R4) goto remove_one_piece ;++++++++++++++++++++++++++++++++++++ ; ; remove_all_pieces: ; ;++++++++++++++++++++++++++++++++++++ remove_all_pieces = + ForListDo $(SvcIndexList) ifstr(i) $(KeyProductBase) != $(KeyNull) CloseRegKey $(KeyProductBase) endif set RemoveIndex = $($) shell $(UtilityInf) GrepUniqueServiceInfo "Index", + $(RemoveIndex), + $(SvcIndexList), + $(SvcNameList), + $(SvcTitleList), + $(SvcDescList) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set RemoveIndex = $($R1) set RemoveName = $($R2) set RemoveTitle = $($R3) set RemoveDesc = $($R4) ifstr(i) $(Status) != STATUS_SUCCESSFUL goto end endif set TInstance = $(Instance) set Instance = $(RemoveIndex) read-syms FileConstants$(Option) set Instance = $(TInstance) goto remove_one_piece ;++++++++++++++++++++++++++++++++++++ ; ; remove_next_piece: ; ;++++++++++++++++++++++++++++++++++++ remove_next_piece = + EndForListDo goto remove_product ;++++++++++++++++++++++++++++++++++++ ; ; remove_one_piece: ; ;++++++++++++++++++++++++++++++++++++ remove_one_piece = + shell $(UtilityInf) FindSNARegEntry, $(ProductRegBase), + $(ProductFullName) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) set KeyProductBase = $($R1) set KeyProduct = $($R2) set KeyServiceIndex = $($R3) set KeyNetRules = $($R4) ifstr(i) $(Status) != STATUS_SUCCESSFUL CloseRegKey $(KeyProductBase) CloseRegKey $(KeyProduct) CloseRegKey $(KeyProductVer) CloseRegKey $(KeyNetRules) set ErrMesg = "Can't Find Product Entry For Instance." set ErrProc = "remove_one_piece" set ErrFunc = "FindSNARegEntry" goto fatal_registry endif ; ; If we're coming in as the link service (IBMSDLCLS), ; decrement the reference count in the CardCfg structure ; to which we belong. If the ref count goes to zero, ; remove the entry. ; ifstr(i) $(Option) == "MGATEXLS" ; ; Get our Device ID out of the registry, but first, ; we need this link service's ServiceName. ; ifstr(i) $(KeyServiceIndex) != $(KeyNull) GetRegValue $(KeyServiceIndex) "ServiceName" SvcNameValue ifstr(i) $(SvcNameValue) != "" set SvcName = *($(SvcNameValue),4) endif endif ifstr(i) $(SvcName) == "" goto EndLScheck endif OpenRegKey $(!REG_H_LOCAL), "", + "System\CurrentControlSet\Services\"$(SvcName)"\Parameters\ExtraParameters", + $(!REG_KEY_READ), KeyEP ifstr(i) $(KeyEP) == "" goto EndLScheck endif set DeviceId = 0 GetRegValue $(KeyEP) "DeviceId" DevIdValue ifstr(i) $(DevIdValue) != "" set DeviceId = *($(DevIdValue),4) endif set DevIndex = 0 ForListDo $(CfgArray) ifint $(DevIndex) == 0 ifint *( *($($),1) ,1) == $(DeviceId) set DevIndex = $(#) endif endif EndForListDo ifint $(DevIndex) == 0 goto EndLScheck endif ; ; Do the ref count thing. ; shell $(UtilityInf) BumpUseCount DOWN $(CfgArray) $(DevIndex) ifstr(i) $($R0) == STATUS_FAILED goto EndLScheck else-ifstr(i) $($R0) == STATUS_ZERO ; ; Rebuild CfgArray, removing items with use count of 0. ; set TmpCfgArray = {} set Flag = $(!False) ForListDo $($R1) ifint *(*($($),1),2) > 0 set TmpCfgArray = >( $(TmpCfgArray), $($) ) endif EndForListDo else ; STATUS_SUCCESSFUL set TmpCfgArray = $($R1) endif install LoadSvcLibrary ifstr(i) $(!SVCHANDLE) != "" LibraryProcedure RetVal $(!SVCHANDLE) + SNAWriteSyncConfig $(!SNARootDir)\system $(TmpCfgArray) install FreeSvcLibrary endif EndLScheck =+ endif ; Option == MGATEXLS ; ; If we're coming in as the device driver, check to see if ; any other SNA components (i.e., other sync link services) ; are bound to it -- if so, don't remove the driver! ; ifstr(i) $(Option) == "MGATEXDD" set Another = $(!False) set KeySM = $(KeyNull) OpenRegKey $(!REG_H_LOCAL) "" "Software\Microsoft" $(!REG_KEY_READ) KeySM ifstr(i) $(KeySM) != $(KeyNull) EnumRegKey $(KeySM) TmpList ForListDo $(TmpList) ; look at every key under Software\Microsoft ifstr(i) $(Another) == $(!False) ; skip the rest if we found one set KeyCV = $(KeyNull) OpenRegKey $(KeySM) "" *($($),1)"\CurrentVersion" $(!REG_KEY_READ) KeyCV ifstr(i) $(KeyCV) != $(KeyNull) set SnaVerValue = "" GetRegValue $(KeyCV) "SNAVersion" SnaVerValue ifstr(i) $(SnaVerValue) != "" ; it's an SNA component set SWTypeValue = "" GetRegValue $(KeyCV) "SoftwareType" SWTypeValue ifstr(i) $(SWTypeValue) != "" ; it's an SNA component ifstr(i) *($(SWTypeValue),4) == "service" ; link service set SvcNameValue = "" GetRegValue $(KeyCV) "ServiceName" SvcNameValue ifstr(i) $(SvcNameValue) != "" set LoopSvcName = *($(SvcNameValue),4) ifstr(i) $(LoopSvcName) != $(ServiceName) ; REVIEW: must be link service svcname ifstr(i) $(LoopSvcName) != "SnaServr" ; Now we know we're a link service and we're not the ; same one we're trying to remove. Let's see what ; we're bound to. set KeyLnk = $(KeyNull) OpenRegKey $(!REG_H_LOCAL) "" + "System\CurrentControlSet\Services\"$(LoopSvcName)"\Linkage" + $(!REG_KEY_READ) KeyLnk ifstr(i) $(KeyLnk) != $(KeyNull) set BindValue = "" GetRegValue $(KeyLnk) "Bind" BindValue ifstr(i) $(BindValue) != "" set BindList = *($(BindValue),4) ForListDo $(BindList) Split-String $($) "\" BindStr QueryListSize BindSize $(BindStr) set BindCmp = *($(BindStr),$(BindSize)) ; The acid test... ifstr(i) $(BindCmp) == $(ProductServicePrefix) set Another = $(!True) endif EndForListDo endif CloseRegKey $(KeyLnk) endif ; KeyLnk endif ; SvcName != SNA Server endif ; SvcName != this link SvcName endif ; SvcNameValue endif ; SWType == service endif ; SWTypeValue endif ; SNAVersion exists CloseRegKey $(KeyCV) endif ; KeyCV endif ; Another == False EndForListDo CloseRegKey $(KeySM) endif ; KeySM ifstr(i) $(Another) == $(!True) goto successful ; Bail out, don't remove this component! endif endif ; MGATEXDD ; ; Get rid of this service instance in the product keys ; CloseRegKey $(KeyServiceIndex) CloseRegKey $(KeyNetRules) DeleteRegTree $(KeyProduct) $(RemoveIndex) CloseRegKey $(KeyProduct) shell $(UtilityInf) DeleteSNAService $(RemoveName) ; ; Special Hack Alert: ; ; When we have multiple instances of the same type of link ; service installed, only ONE of those instances may have ; the "class" and "bindable" values present under their ; NetRules key. If the link service we've just deleted ; was the one that had those values, we need to search the ; remaining instances (if any) for those values, and if not ; found, we must add them to the first instance we find. ; What a hassle. ; set Found = $(!False) set SaveName = "" OpenRegKey $(!REG_H_LOCAL), "", "Software\Microsoft", + $(!REG_KEY_READ), KeySM ifstr(i) $(KeySM) != $(KeyNull) EnumRegKey $(KeySM) TmpList ForListDo $(TmpList) ifstr(i) $(Found) == $(!False) set TmpName = *( $($), 1 ) Split-String $(TmpName) "_" TmpSplit ifstr(i) *( $(TmpSplit), 1 ) == $(ProductName) ifstr(i) $(TmpName) != $(ProductFullName) OpenRegKey $(KeySM), "", + $(TmpName)"\CurrentVersion\NetRules", + $(!REG_KEY_READ), TmpNRKey ifstr(i) $(TmpNRKey) != $(KeyNull) ifstr(i) $(SaveName) == "" set SaveName = $(TmpName) endif EnumRegValue $(TmpNRKey) TmpNRList ForListDo $(TmpNRList) ifstr(i) *( $($), 1 ) == "class" set Found = $(!True) endif EndForListDo CloseRegKey $(TmpNRKey) endif endif endif endif EndForListDo set TmpList = {} set TmpName = "" set TmpSplit = "" set TmpNRList = {} ifstr(i) $(Found) == $(!False) ifstr(i) $(SaveName) != "" OpenRegKey $(KeySM), "", + $(SaveName)"\CurrentVersion\NetRules", + $(!REG_KEY_READWRITE), TmpNRKey ifstr(i) $(TmpNRKey) != $(KeyNull) shell $(UtilityInf) AddValueList $(TmpNRKey), + {{ class, $(NoTitle), $(!REG_VT_MULTI_SZ), {$(NetRulesClass)}}, + { bindable, $(NoTitle), $(!REG_VT_MULTI_SZ), {$(NetRulesBindable)}}} CloseRegKey $(TmpNRKey) endif endif endif CloseRegKey $(KeySM) endif ; ; Done with that NetRules weirdness. Let's get on with it: ; set-sub SvcIndexListSize = $(SvcIndexListSize), 1 OpenRegKey $(!REG_H_LOCAL), "", $(ProductRegBase), + $(!REG_KEY_READWRITE), KeyProductTemp ifstr(i) $(KeyProductTemp) != "" DeleteRegTree $(KeyProductTemp) $(ProductFullName) CloseRegKey $(KeyProductTemp) endif ; ; ; ; Delete the EventLog entry for the device driver. ; ; ; OpenRegKey $(!REG_H_LOCAL), "", + ; "System\CurrentControlSet\Services\EventLog\System", + ; $(!REG_KEY_READWRITE), KeyProduct ; ifstr(i) $(!NTN_InstallMode) == "fullremove" ; ifstr(i) $(KeyProduct) != $(KeyNull) ; DeleteRegTree $(KeyProduct), "IBMSYNCDD" ; endif ; endif ; CloseRegKey $(KeyProduct) ifstr(i) $(!NTN_InstallMode) == "fullremove" install InstallRemove endif set RetData = >( $(RetData), { $(RemoveIndex), + $(RemoveName), + $(RemoveTitle), + $(RemoveDesc), + $(!NTN_InstallMode), + } ) ifstr(i) $(RemoveMode) == "Full" goto remove_next_piece endif ;++++++++++++++++++++++++++++++++++++ ; ; remove_product: ; ;++++++++++++++++++++++++++++++++++++ remove_product = + goto finish_remove_component ;++++++++++++++++++++++++++++++++++++ ; ; finish_remove_component: ; ;++++++++++++++++++++++++++++++++++++ finish_remove_component = + goto successful ;++++++++++++++++++++++++++++++++++++ ;++++++++++++++++++++++++++++++++++++ ; ; Escape Hatches: ; ;++++++++++++++++++++++++++++++++++++ ;++++++++++++++++++++++++++++++++++++ ;++++++++++++++++++++++++++++++++++++ ; ; successful: ; this part actually copies the files if the DoCopy variable is on ; ;++++++++++++++++++++++++++++++++++++ successful = + set Status = STATUS_SUCCESSFUL goto end ;++++++++++++++++++++++++++++++++++++ ; ; warning_msg: ; a warning display ; ;++++++++++++++++++++++++++++++++++++ warning_msg = + shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error) ifint $($ShellCode) != 0 goto ShellCodeError endif set DLGEVENT = $($R1) ifstr(i) $(DLGEVENT) == "OK" goto $(to) else-ifstr(i) $(DLGEVENT) == "CANCEL" goto $(from) else set Status = STATUS_FAILED goto end endif ;++++++++++++++++++++++++++++++++++++ ; ; nonfatal_msg: ; a non-fatal display ; ;++++++++++++++++++++++++++++++++++++ nonfatal_msg = + ; TODO: See CODENAME: WARNINGS Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(Error) ifint $($ShellCode) != 0 goto ShellCodeError endif set DLGEVENT = $($R1) ifstr(i) $(DLGEVENT) == "OK" goto $(from) else goto "end" endif ;++++++++++++++++++++++++++++++++++++ ; ; fatal_registry: ; something failed in the registry access ; ;++++++++++++++++++++++++++++++++++++ fatal_registry = + set Error = + "Fatal Registry Error:"$(!LF)+ $(ErrMesg)$(!LF)+ "File: "$(ThisInf)$(!LF)+ "Procedure: "$(ErrProc)$(!LF)+ "Function: "$(ErrFunc) goto fatal_msg ;++++++++++++++++++++++++++++++++++++ ; ; fatal_msg: ; a fatal error display ; ;++++++++++++++++++++++++++++++++++++ fatal_msg = + ; TODO: See CODENAME: WARNINGS Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error) ifint $($ShellCode) != 0 goto ShellCodeError endif goto set_status_failed ;++++++++++++++++++++++++++++++++++++ ; ; ShellCodeError: ; a shell error to be displayed ; ;++++++++++++++++++++++++++++++++++++ ShellCodeError = + ; TODO: See CODENAME: WARNINGS set DlgType = "MessageBox" set STF_MB_TITLE = "Error: "$(SetupTitle) set STF_MB_TEXT = "Shell Code Error" set STF_MB_TYPE = 1 set STF_MB_ICON = 3 set STF_MB_DEF = 1 ui start "Error Message" goto set_status_failed ;++++++++++++++++++++++++++++++++++++ ; ; set_status_failed: ; last step before exiting ; ;++++++++++++++++++++++++++++++++++++ set_status_failed = + set Status = STATUS_FAILED goto end ;++++++++++++++++++++++++++++++++++++ ; ; end: ; this exit point sets the CommonStatus to the current status ; then returns the status and return data ; ;++++++++++++++++++++++++++++++++++++ end = + ifstr(i) $(!IHVDLGHANDLE) != "" FreeLibrary $(!IHVDLGHANDLE) set !IHVDLGHANDLE = "" endif set CommonStatus = $(Status) Return $(CommonStatus) $(RetData) $(Changes) ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; INSTALLATION AND FILE SECTION ; ----------------------------- ; This section is responsible for installing the component and listing all ; the necessary files etc. ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ;======================================================================== ; ; INSTALL ; ------- ; The IHV should follow the following template for this section. It is ; responsible for file copying and registry initialization. ; ;======================================================================== [InstallRemove] set STF_OVERWRITE = "ALWAYS" set SNADirList = { "hwsetup", "system" } set SNAToList = { "system\hwsetup", "system" } ifstr(i) $(!NTN_InstallMode) == "install" ifstr(i) $(!AddCopy) == "YES" ForListDo $(SNADirList) ifstr(i) $($) != "hwsetup" set Ext = $(ThisFile) else set Ext = "" endif set To = *( $(SNAToList), $(#) ) AddSectionFilesToCopyList "FilesFor_"$($)"_"$(Option) + $(!DriverDir)$(Ext), + $(!SNARootDir)"\"$(To) EndForListDo else AddSectionFilesToCopyList "FilesFor_system_"$(Option) + $(!DriverDir)"mgatex\"$(Ext), + $(!SNARootDir)"\system" CopyFilesInCopyList endif ifstr(i) $(!DoCopy) == "YES" CopyFilesInCopyList endif else set !_FileRemoveList = {} ForListDo $(SNADirList) set SNADir = *( $(SNAToList), $(#) ) set FullPath = $(!SNARootDir)"\"$(SNADir) set FileList = ^( "FilesFor_"$($)"_"$(Option), 2 ) ForListDo $(FileList) set !_FileRemoveList = >( $(!_FileRemoveList), + $(FullPath)"\"$($) ) EndForListDo EndForListDo endif exit ;======================================================================== ; ; FILES ; ----- ; These should list the files to be installed for each particular option. ; ; FORMAT: ; The format is "FilesFor_" concatenated with the directory where they will ; end up, another underscore, and the option whose files these are. ; Currently, directories that can take files are: ; ihvinf - the inf file, its help and libraries ; ntbin - executables ; ntsys - system files ; The format includes an enumeration constant and a name for each file, as well ; as a number of possible flags ; 1, file1.spu ; 1, file2.spu ; ... ; ;======================================================================== [FilesFor_hwsetup_MGATEXLS] 1, mgatex.inf 1, mgatex.hlp 1, mgatex.srl [FilesFor_system_MGATEXLS] [FilesFor_system_MGATEXDD] 1, ibmsync.sys