;Modified by for ; 13-dec-95 rmh Link service name; find btilink.dll in right place ; Don't remove hwsetupfiles on remove link service ; ; All rights reserved. ; Copyright (c) 1994 by Bus-Tech, Inc. ; ; This program is an unpublished work fully protected by the United ; States copyright laws and is considered a trade secret belonging to ; the copyright holder. ; ; File: btilink.inf ; Facility: nt/btilink ; Author: Chun Zhang, ; Description: This file is based on template.inf provided by Microsoft ; SNA Server SDK. The original comments are intentionally ; left in the file for guidance. ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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). ; NOTE: TAGFILE and other flags must be all caps (bogus!) and the white ; space must be exactly as shown. ; ; 1 = "Diskette 1 Label", TAGFILE = "Disk1.Tag" ; 2 = "Diskette 2 Label", TAGFILE = "Disk2.Tag" ; ... ; ;======================================================================== [Source Media Descriptions] 1 = "SNA Link Support Diskette" ;======================================================================== ; ; OPTION TYPE ; ----------- ; This identifies the Option type we are dealing with. Most SNA link ; services should have "NetService" as the option type. The list of ; option types for 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 ; ;======================================================================== [Identification] OptionType = NetService ;======================================================================== ; ; LANGUAGES SUPPORTED ; ------------------- ; The human languages supported by this script. Each dialog to be presented ; to the user must have a separate text section for each language supported. ; These sections will be indexed by the three-letter code for the language ; in use. ; ;======================================================================== [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. ; ; You should go through this script and do a global search/replace on ; IHVLINK and IHVDDRV so that they reflect the true names of the IHV ; components. ; ;======================================================================== [Options] BTILINK ;======================================================================== ; ; OPTION TEXT SECTION ; ------------------- ; These are text strings used to identify the option to the user. There ; are separate sections for each language supported. ; ; You should set these strings to describe the IHV link service you're ; writing the setup script for. ; ; FORMAT: ; The format of the section name is "OptionsText" concatenated with the ; Language represented by the section. ; [OptionsTextLNG1] ; ... ; [OptionsTextLNG2] ; ... ; ;======================================================================== [OptionsTextENG] BTILINK = "Bus-Tech Channel Link Service" ;======================================================================== ; ; SNA OPTION LIST ; --------------- ; This is the list of options available to the SNA Services user. This list ; is presented to the user in a list box in the SNA Services Setup program. ; ;======================================================================== [SNAOptions] BTILINK ;======================================================================== ; ; SNA OPTION ADDITIONALS ; ---------------------- ; This section specifies the additional options that should be installed for ; each of the main options. The SNA Services 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] ; ... ; ;======================================================================== [SNAOptionAddsBTILINK] ;======================================================================== ; ; INSTALLATION STEPS SECTION ; -------------------------- ; In this section, you define which steps will be taken in the installation ; procedure. ; ; FORMAT: ; The format is "InstallSteps" concatenated with the option name ; [InstallStepsOPT1] ; ... ; ;======================================================================== [InstallStepsBTILINK] AddFilesToCopyList = YES CopyFilesInCopyList = YES ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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" ;++++++++++++++++++++++++++++++++++++ ; ; 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: ; These variables specify which help topic to bring up when the ; user clicks the Help button. There should be one of these for ; each dialog box with a Help button. Look in the main SNA Setup ; .INF files for lots of examples. ; ;++++++++++++++++++++++++++++++++++++ [HelpContextIDs] IDD_BTILINKCONFIG = 102 IDD_ASKBTIAPCA = 100 ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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 as macros. ; HlpMin and HlpMax should be set to one less and one more than ; the least and greatest HelpContextID. ; ;++++++++++++++++++++++++++++++++++++ [FileConstants] UtilityInf = $(!SNARootDir)"\SETUPUTL.INF" ;BETA2 change SubroutineInf = $(!STF_WINDOWSSYSPATH)"\SUBROUTN.INF" DialogLibrary = $(!SNARootDir)"\SETUP.SRL" ;BETA2 change ThisFile = "BTILINK" ThisInf = $(ThisFile)".INF" ThisSrl = $(ThisFile)".SRL" ThisHlp = $(ThisFile)".HLP" FullInfName = $(!SNARootDir)"\system\hwsetup\"$(ThisInf) FullSrlName = $(!SNARootDir)"\system\hwsetup\"$(ThisSrl) FullHlpName = $(!SNARootDir)"\system\hwsetup\"$(ThisHlp) FullDllName = $(!SNARootDir)"\system\btilink.dll" HlpMin = "100" HlpMax = "103" $ShellCode = 0 ;++++++++++++++++++++++++++++++++++++ ; ; Product Information Subsection: ; This subsection contains lots of product information that will be used ; in the registry. ; ; For the SNAServiceType value, please refer to the "SNAServiceTypes" section ; in the SETUPUTL.INF file. Also, only Link Supports have this value, all ; others should have a NULL string ("") for this value. Again, look at the ; existing link support setup .INF files for examples. ; ;++++++++++++++++++++++++++++++++++++ [FileConstantsBTILINK] ; ; Product Info ; ProductVersion = "1.0" ProductName = "BTILINK" ;BETA2 change ProductFullName = $(ProductName)"_"$(ProductVersion)"_"$(Instance) ProductRegBase = $(!NTN_SoftwareBase)"\Microsoft" ProductType = "Link" ProductImagePath = "SNALINK.EXE" ProductDepends = {} ProductParams = {} ProductExtraParams = {} ProductExclusive = $(!FALSE) ProductDLL = "BTILINK.DLL" ProductServicePrefix = "BtiChan" ProductServiceQuery = $(TRUE) ; ; Registry Key Information ; ; SNAServiceType should be: CESDFT for a DFT link, CESX25 for an X.25 link, ; CESTR for Token Ring, CESLINK for a SDLC link. ; SNAServiceType = "CESCHANNEL" ; Channel ; ; NetRules Stuff ; ;NetRulesClass = dftlinkservice ;FullInfName = $(!SNARootDir)"\system\hwsetup\"$(ThisInf) ;ServiceType = "service" NetRulesClass = "snabtilink snalink" NetRulesTitle = "Bus-Tech Channel Link Service" NetRulesUse = "service yes yes" NetRulesBindable = "snabtilink snabtidriver non non 100" NetRulesType = "btilink_"$(Instance)" snabtilink" FullInfName = $(!SNARootDir)"\system\hwsetup\"$(ThisInf) SoftwareType = "service" ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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 toward. ; ;++++++++++++++++++++++++++++++++++++ from = "" to = "" ;++++++++++++++++++++++++++++++++++++ ; ; Booleans: ; ;++++++++++++++++++++++++++++++++++++ FALSE = 0 TRUE = 1 ;++++++++++++++++++++++++++++++++++++ ; ; Other values ; ;++++++++++++++++++++++++++++++++++++ NOTIFY = 2 ;++++++++++++++++++++++++++++++++++++ ; ; Registry Initialization Parameters: ; ;++++++++++++++++++++++++++++++++++++ NoTitle = 0 KeyNull = "" KeyProduct = "" KeyParameters = "" MAXIMUM_ALLOWED = 33554432 RegistryErrorIndex = NO_ERROR CurrentControlSet = "SYSTEM\CurrentControlSet" ServicesBaseName = $(CurrentControlSet)"\Services" NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards" !RegLastError = 0 ;++++++++++++++++++++++++++++++++++++ ; ; 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 = "" [DisketteDlgENG] Caption = "Insert Disk" DlgText = "Insert disk labeled "$(OemDiskette)" provided by Bus-Tech "+ "Inc. If the files can be found at a different location, "+ "for example on another drive, type a new path." Continue = "OK" Cancel = "Cancel" DlgType = "Edit" DlgTemplate = "DISKETTE" Edit1Label = "" EditTextIn = $(OemDisketteSrc) EditFocus = "ALL" ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; LANGUAGE-DEPENDENT FILE CONSTANTS SECTION ; ----------------------------------------- ; This section is responsible for defining language dependent information. ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; The following name should include the name of the IHV as per the example ; [FileConstantsENG] SetupTitle = "Bus-Tech Channel Link Service Setup" [FileConstantsBTILINK_ENG] ProductTitle = "Bus-Tech Channel Link Service" ProductDesc = "Bus-Tech Channel Link Service" ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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 } ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ;BETA2 additions begin [LoadSetupLibrary] LoadLibrary "x" $(!STF_WINDOWSSYSPATH)"\setupdll.dll" !LIBHANDLE exit [LoadSvcLibrary] set !SVCLIBHANDLE = "" LoadLibrary "x" $(!SNARootDir)\SETUPSVC.DLL !SVCLIBHANDLE exit [LoadBTIDtectLibrary] set !BTIDTECTHANDLE = "" LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\..\..\bti\btidtect.dll !BTIDTECTHANDLE exit [FreeSetupLibrary] FreeLibrary $(!LIBHANDLE) exit [FreeSvcLibrary] FreeLibrary $(!SVCLIBHANDLE) set !SVCLIBHANDLE = "" exit [FreeBTIDtectLibrary] FreeLibrary $(!BTIDTECTHANDLE) set !BTIDTECTHANDLE = "" exit ;BETA2 additions end [Date] Now = {} ? $(!LIBHANDLE) GetSystemDate [LoadNCPALibrary] set !NCPA_HANDLE = "" LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\NCPA.CPL !NCPA_HANDLE exit [FreeNCPALibrary] FreeLibrary $(!NCPA_HANDLE) set !NCPA_HANDLE = "" exit [DoDiskette] set Status = STATUS_FAILED set OemDiskette = $($1) set OemDisketteSrc = $($2) Debug-Output $(STF_CONTEXTINFNAME)": DoDiskette called" read-syms DisketteDlg$($0) ui start "Diskette" ifstr(i) $(DLGEVENT) == "CONTINUE" set OemDisketteSrc = $(EditTextOut) ui pop 1 set Status = STATUS_SUCCESSFUL goto finish_dodiskette else-ifstr(i) $(DLGEVENT) == "BACK" ui pop 1 set Status = STATUS_USERCANCEL goto finish_dodiskette else ui pop 1 goto finish_dodiskette endif finish_dodiskette = + Return $(Status) $(OemDisketteSrc) [InstallBTIAPCA] read-syms GeneralConstants OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)"\BTIAPCA" + $(MAXIMUM_ALLOWED) KeyServices ifstr(i) $(KeyServices) != $(KeyNull) CloseRegKey $(KeyServices) else shell "" DoAskInstallBTIAPCA ifstr(i) $($R0) == "YES" set OldOption = $(!NTN_InfOption) set !NTN_InfOption = BTIAPCA install LoadNCPALibrary install LoadSetupLibrary shell "" DoDiskette $(!STF_LANGUAGE) "Bus-Tech Channel Adapter Driver" "A:\" set Status = STATUS_FAILED ifstr(i) $($R0) == STATUS_USERCANCEL return $($R0) else-ifstr(i) $($R0) == STATUS_FAILED return $($R0) endif set SrcDir = $($R1) shell $(SrcDir)\oemsetup.inf InstallOption $(!STF_LANGUAGE) + BTIAPCA $(SrcDir) YES YES YES set BTIAPCAStatus = $($R0) LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance + $(!STF_WINDOWSSYSPATH)"\drivers\BTIAPCA.sys" set !NTN_InfOption = $(OldOption) install FreeSetupLibrary ifstr(i) $(BTIAPCAStatus) != STATUS_SUCCESSFUL return $($BTIAPCAStatus) endif ifstr(i) $(ExistStatus) == "NO" shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + "The BTIAPCA files were not copied to your Windows NT system32"+ " directory, probably because they didn't exist on the path"+ " you entered."$(!LF)$(!LF)+ "Please run the Network Control Panel Applet to remove the"+ " partially-installed BTIAPCA software, then try reinstalling it"+ " using a different path."$(!LF)$(!LF)+ "You must have successfully installed the BTIAPCA software"+ " before you can install this SNA Channel link service." return STATUS_FAILED endif ; ; Cause NCPA to recalc network bindings ; ifstr(i) $(!NCPA_HANDLE) != "" set NCPA_CMD_LINE = " /t STF_INSTALL_MODE = EXPRESS" set NCPA_FUNC = "NCPA" LibraryProcedure NcpaResult, $(!NCPA_HANDLE), CPlSetup, + $(!STF_HWND), $(NCPA_FUNC), $(NCPA_CMD_LINE) install FreeNCPALibrary shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + "If you are installing from the floppy, Please insert the"+ " Bus-Tech Channel Link Service Disk back." endif else return STATUS_USERCANCEL endif endif shell $(!UtilityInf) IncrementRefCount "Software\Bus-Tech\BTIAPCA\CurrentVersion" return STATUS_SUCCESSFUL [DoAskInstallBTIAPCA] read-syms AskBTIAPCAInstall$(!STF_LANGUAGE) ; read-syms DoBTILinkConfig$(!STF_LANGUAGE) ui start $(DlgTemplate) $(!IHVDLGHANDLE) ui pop 1 ifstr(i) $(DLGEVENT) == "Exit" set RetStr = "NO" else set RetStr = "YES" endif return $(RetStr) ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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] ; ... ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: [DoBTILinkConfigENG] DlgTemplate = IDD_BTILINKCONFIG DlgType = "RadioCombination" EditTextIn = { $(ServiceTitle) } EditTextLim = { 40 } ComboListIn1= { "BTI MCCA adapter card " } ComboListOut1 = $(AdapterCombo) HelpContext = #( HelpContextIDs, $(DlgTemplate), 1 ) [AskBTIAPCAInstallENG] DlgTemplate = IDD_ASKBTIAPCA DlgType = "Info" Caption = "No Channel Driver ( BTIAPCA )!" DlgText1 = "The BTIAPCA software has not yet been installed on this computer." DlgText2 = "Before Setup can install your channel link service, you must use "+ "Add Adapter option from Network Control Panel Applet to install "+ "the Bus-Tech Channel Adapter Driver." DlgText3 = "If you have your distribution disk handy, Setup "+ "can do this for you right now. If you don't have your "+ "distribution, you wll be unable to install a channel link "+ "service at this time." Continue = "&Install Now" Exit = "&Cancel" ;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 ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; The following section was lifted from IBMDFT.INF, and shows the way to ; configure the IBM DFT link service. It's really meant as a guideline ; for you to examine and follow when writing your own install script. ; You might also want to look at the other link service install scripts, ; notably IBMX25.INF as it has lots of parameters, and SNADLC.INF as it ; interacts with the NCPA and network bindings a little differently. ; ; DoDFTLSConfig ; ; DESCRIPTION: This shell script pops up a dialog to get the configuration ; of this product. ; ; INPUT: $($0) : Service Name ; $($1) : Current Title ; $($2) : Current Base Address 1 ; $($3) : Current Base Address 2 ; $($4) : Current Base Address 3 ; $($5) : Current Base Address 4 ; ; OUTPUT: $($R0): STATUS: One of the above ; $($R1): New Title ; $($R2): New Base Address 1 ; $($R3): New Base Address 2 ; $($R4): New Base Address 3 ; $($R5): New Base Address 4 ; ; NOTES: A Base Address of "0" represents an unused card. ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [DoBTILinkConfig] set ServiceTitle = $($0) set AdapterCombo = $($1) set DriverIndex = $($2) ; read-syms DialogConstants read-syms DialogConstants$(!STF_LANGUAGE) read-syms DoBTILinkConfig$(!STF_LANGUAGE) shell "" InstallBTIAPCA ifstr(i) $($R0) != STATUS_SUCCESSFUL return $($R0) endif ; ; See what cards we can support ; install LoadBTIDtectLibrary ifstr(i) $(!BTIDTECTHANDLE) == "" set Status = STATUS_FAILED goto BTIConfReturn endif LibraryProcedure RetVal $(!BTIDTECTHANDLE) findAdapters ; set RetVal = {"2", "8"} 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 BTIConfReturn endif set PCardList = $(RetVal) ; set PCardList = {"2", "8"} ; ; Fill in list box with driver title strings. ; set ComboListIn1 = { } ForListDo $(PCardList) set slot = *($($), 1) set ComboListIn1 = >( $(ComboListIn1), "BTI Adapter Card in slot #"$(slot) ) EndForListdo set ComboListOut1 = *($(ComboListIn1), 1) set ComboListItemsIn = { ComboListIn1 } set ComboListItemsOut = { ComboListOut1 } restart =+ set Status = STATUS_SUCCESSFUL ui start $(DlgTemplate) $(!IHVDLGHANDLE) ifstr(i) $(DLGEVENT) == "Exit" set Status = STATUS_USERCANCEL else set Status = STATUS_SUCCESSFUL set ServiceTitle = *( $(EditTextOut), 1) split-string $(ComboListOut1) "#" SlotNum set AdapterCombo = *($(SlotNum), 3) set index = "0" ForListDo $(PCardList) ifstr(i) $($) == $(AdapterCombo) set DriverIndex = $($) ;$(index) endif ; set-add index = $(index), "1" EndForListdo endif ui pop 1 ; set the defaults BTIConfReturn =+ ifstr(i) $(!BTIDTECTHANDLE) != "" install FreeBTIDtectLibrary endif Return $(Status), $(ServiceTitle), + $(AdapterCombo) $(DriverIndex) ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; Identify ; ; DESCRIPTION: To verify that this INF deals with the same type of options ; as we are about to use. ; ; INPUT: None ; ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL ; $($R1): Option Type (NetService...) ; $($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 ; localized 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 an ; appropriate return value. ; ;++++++++++++++++++++++++++++++++++++ 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 Services. 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 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 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] ;BETA2 changes begin 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, and ; 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) ;BETA2 changes end ;************************************************************************ ;************************************************************************ ; NCPA INVOCATION SECTION ;************************************************************************ ;************************************************************************ ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; InstallOption (BETA2 change) ; ; 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 ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ;BETA2 changes begin [InstallOption] set LongOption = $(!NTN_InfOption) set Changes = 0 set Instance = "xx" Split-String $(LongOption) "_" OptionListbtidtect QueryListSize OptionSize $(OptionList) ifint $(OptionSize) == 3 set Option = *( $(OptionList), 1 ) set Instance = *( $(OptionList), 3 ) else set Option = $(LongOption) endif ; ; Set SNA Root Directory before reading File Constants ; OpenRegKey $(!REG_H_LOCAL), "", + "Software\Microsoft\SNA Services\2.0\Setup", + $(!REG_KEY_READ), KeySNAServices ifstr(i) $(KeySNAServices) != {} GetRegValue $(KeySNAServices) "RootDir" RootDirValue ifstr(i) $(RootDirValue) != "" set !SNARootDir = *( $(RootDirValue), 4 ) endif 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 ifstr(i) $(!NTN_InstallMode) != "install" read-syms FileConstants read-syms FileConstants$(Option) ; BETA2 change: OpenRegKey $(!REG_H_LOCAL), "", + $(ProductRegBase)"\"$(ProductFullName)"\CurrentVersion", + $(!REG_KEY_READWRITE), KeyServiceIndex ifstr(i) $(KeyServiceIndex) == "" set ErrMesg = "Can't Find This Product Instance." set ErrProc = "NcpaInvocation" set ErrFunc = "OpenRegKey (1)" goto fatal_registry endif GetRegValue $(KeyServiceIndex), "SNAVersion", SNAVersionInfo set !SNAVersion = *( $(SNAVersionInfo), 4 ) CloseRegKey $(KeyServiceIndex) ; ; This is a Hack. ; Since the NCPA can (now) only configure and remove components, we'll ; assume that it's going to access them inside the SNA Services ; root directory and not in floppy like install would. Therefore, ; DriverDir = SNARootDir. ; At some future point in time, we might consider putting a path in the ; registry. ; set !DriverDir = $(!SNARootDir)"\system\hwsetup\" else ; ; This case shouldn't happen, but I honestly don't know how to deal ; with it when it does. I guess I can check if SNA Services is ; installed, and if it's not, tell the user that it must be installed ; before link supports can be installed. ; set Hosed = "Probably" endif LoadLibrary "" $(DialogLibrary) !DLGHANDLE shell "" CommonSection $(Option) $(Instance) set Status = $($R0) ;BETA2 addition: ifint $($R2) == 1 shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + "For the changed parameters to be noticed, you must stop and"$(!LF)+ "restart this link service with the SNA Server Admin program." else-ifint $($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) ;BETA2 changes end ;************************************************************************ ;************************************************************************ ; 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) ;BETA2 change set Index = "CurrentVersion" ;BETA2 change set RetData = {} set Changes = 0 ;BETA2 change ; ; 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 ;BETA2 change detect Date install FreeSetupLibrary ;BETA2 change 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_IHVLINK ; ;++++++++++++++++++++++++++++++++++++ set_defaults_BTILINK =+ set ServiceName = $(Option) set ServiceTitle = $(ProductTitle) set ServiceDesc = $(ProductDesc) set AdapterCombo = "BTI MCCA adapter card" goto finish_defaults ;++++++++++++++++++++++++++++++++++++ ; ; set_defaults_IHVDDRV ; ;++++++++++++++++++++++++++++++++++++ ;++++++++++++++++++++++++++++++++++++ ; ; 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" ;BETA2 change goto install_nextstep endif ; ; 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"$(!LF)+ "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) ;BETA2 change 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 = "" 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 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 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) 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), + ;BETA2 change $(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_IHVLINK: ; ;++++++++++++++++++++++++++++++++++++ assign_value_BTILINK =+ ifstr(i) $(ValueName) == "ServiceTitle" set ServiceTitle = $(ValueData) else-ifstr(i) $(ValueName) == "AdapterCombo" set AdapterCombo = $(ValueData) else-ifstr(i) $(ValueName) == "DriverIndex" set DriverIndex = $(ValueData) endif goto finish_assign_value ;++++++++++++++++++++++++++++++++++++ ; ; assign_value_IHVDDRV: ; ;++++++++++++++++++++++++++++++++++++ ;++++++++++++++++++++++++++++++++++++ ; ; finish_assign_value: ; ;++++++++++++++++++++++++++++++++++++ finish_assign_value =+ EndForListDo goto assign_extra_$(Option) ;++++++++++++++++++++++++++++++++++++ ; ; assign_extra_IHVLINK: ; ;++++++++++++++++++++++++++++++++++++ assign_extra_BTILINK =+ goto finish_assign_extra ;++++++++++++++++++++++++++++++++++++ ; ; assign_extra_IHVDDRV: ; ;++++++++++++++++++++++++++++++++++++ ;++++++++++++++++++++++++++++++++++++ ; ; 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_BTILINK: ; ;++++++++++++++++++++++++++++++++++++ modify_params_BTILINK = + shell "" DoBTILinkConfig $(ServiceTitle), + $(AdapterCombo), + $(DriverIndex) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) ifstr(i) $(Status) != STATUS_SUCCESSFUL goto end else set ServiceTitle = $($R1) set AdapterCombo = $($R2) set DriverIndex = $($R3) endif goto finish_modify_params ;+++++++++++++++++++++++++++++++++++ ; ; modify_params_BtiMcca: ; ;++++++++++++++++++++++++++++++++++++ ;++++++++++++++++++++++++++++++++++++ ; ; 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 ;BETA2 change 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) }, + { ServiceType, $(NoTitle), $(!REG_VT_SZ), $(ServiceType) }, + { 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) ;BETA2 change 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 Open 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_IHVLINK: ; ;++++++++++++++++++++++++++++++++++++ write_params_BTILINK =+ set FullOption = $(Option)"_"$(Instance) ;BETA2 change set ProductParams = { + { IHVDLL , $(NoTitle), $(!REG_VT_SZ) , $(ProductDLL) },+ { InfName , $(NoTitle), $(!REG_VT_SZ) , $(FullInfName) },+ { InfOption , $(NoTitle), $(!REG_VT_SZ) , $(FullOption) } + } set ProductExtraParams = { + { ServiceTitle , $(NoTitle), $(!REG_VT_SZ), $(ServiceTitle) }, + { AdapterCombo , $(NoTitle), $(!REG_VT_DWORD), $(AdapterCombo) }, + { DriverIndex, $(NoTitle), $(!REG_VT_DWORD), $(DriverIndex) } + } goto finish_write_params ;++++++++++++++++++++++++++++++++++++ ; ; write_params_IHVDDRV: ; ;++++++++++++++++++++++++++++++++++++ ;++++++++++++++++++++++++++++++++++++ ; ; 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), + ;BETA2 change $(ServiceName), + $(ServiceTitle), + $(ServiceDesc), + $(!NTN_InstallMode), + } ) CloseRegKey $(KeyProductBase) CloseRegKey $(KeyProduct) CloseRegKey $(KeyServiceIndex) CloseRegKey $(KeyNetRules) CloseRegKey $(KeyService) CloseRegKey $(KeyParameters) CloseRegKey $(KeyExtraParams) goto successful ;++++++++++++++++++++++++++++++++++++ ; ; getbind_component: ; ;++++++++++++++++++++++++++++++++++++ getbind_component =+ goto getbind_$(Option) ;++++++++++++++++++++++++++++++++++++ ; ; getbind_IHVLINK: ; ;++++++++++++++++++++++++++++++++++++ getbind_BTILINK =+ goto finish_getbind_component ;++++++++++++++++++++++++++++++++++++ ; ; getbind_IHVDDRV: ; ;++++++++++++++++++++++++++++++++++++ ;++++++++++++++++++++++++++++++++++++ ; ; finish_getbind_component: ; ;++++++++++++++++++++++++++++++++++++ finish_getbind_component =+ goto successful ;++++++++++++++++++++++++++++++++++++ ; ; bind_component: ; ;++++++++++++++++++++++++++++++++++++ bind_component =+ set Error = "Network bindings aren't implemented yet." goto fatal_msg ;++++++++++++++++++++++++++++++++++++ ; ; remove_component: ; ;++++++++++++++++++++++++++++++++++++ remove_component =+ read-syms FileConstants$(Option) ;BETA2 change ; ; 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" shell $(UtilityInf) GrepUniqueServiceInfo "Index", + $(Instance), + ;BETA2 change $(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 ;BETA2 changes begin set TInstance = $(Instance) set Instance = $(RemoveIndex) read-syms FileConstants$(Option) set Instance = $(TInstance) ;BETA2 changes end goto remove_one_piece ;++++++++++++++++++++++++++++++++++++ ; ; remove_next_piece: ; ;++++++++++++++++++++++++++++++++++++ remove_next_piece =+ EndForListDo goto remove_product ;++++++++++++++++++++++++++++++++++++ ; ; remove_one_piece: ; ;++++++++++++++++++++++++++++++++++++ remove_one_piece =+ ;BETA2 change 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 ; ; Get rid of this service instance in the product keys ; CloseRegKey $(KeyServiceIndex) CloseRegKey $(KeyNetRules) DeleteRegTree $(KeyProduct) $(RemoveIndex) CloseRegKey $(KeyProduct) shell $(UtilityInf) DeleteSNAService $(RemoveName) ; if this is the last instance, delete all the installed ; components set-sub SvcIndexListSize = $(SvcIndexListSize), 1 ifint $(SvcIndexListSize) == 0 install InstallRemove shell $(UtilityInf) RemoveFileList $(!_FileRemoveList) ; shell $(UtilityInf) RemoveDirTree $(!SNARootDir)"\..\bti" endif ;BETA2 changes begin OpenRegKey $(!REG_H_LOCAL), "", $(ProductRegBase), + $(!REG_KEY_READWRITE), KeyProductTemp ifstr(i) $(KeyProductTemp) != "" DeleteRegTree $(KeyProductBase) $(ProductFullName) CloseRegKey $(KeyProductBase) endif ifstr(i) $(!NTN_InstallMode) == "fullremove" install InstallRemove endif ;BETA2 changes end 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 ;BETA2 deletions ;++++++++++++++++++++++++++++++++++++ ;++++++++++++++++++++++++++++++++++++ ; ; 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 =+ 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 =+ shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error) ifint $($ShellCode) != 0 goto ShellCodeError endif goto set_status_failed ;++++++++++++++++++++++++++++++++++++ ; ; 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) ;++++++++++++++++++++++++++++++++++++ ; ; ShellCodeError: ; a shell error to be displayed ; ;++++++++++++++++++++++++++++++++++++ ShellCodeError =+ 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 ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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 SNADirList = { "hwsetup", "system", "bti" } set SNAToList = { "system\hwsetup", "system", "bti" } ifstr(i) $(!NTN_InstallMode) == "install" set Ext = $(ThisFile) ;;rmh ifstr(i) $(!AddCopy) == "YES" ForListDo $(SNADirList) ifstr(i) $($) != "hwsetup" set Ext = $(ThisFile) else set Ext = "" endif set To = *( $(SNAToList), $(#) ) ifstr(i) $($) != "bti" AddSectionFilesToCopyList "FilesFor_"$($)"_"$(Option) + $(!DriverDir)$(Ext), + $(!SNARootDir)"\"$(To) else AddSectionFilesToCopyList "FilesFor_"$($)"_"$(Option) + $(!DriverDir)$(Ext), + $(!SNARootDir)"\..\"$(To) endif EndForListDo else AddSectionFilesToCopyList "FilesFor_system_"$(Option) + $(!DriverDir)$(Ext), + $(!SNARootDir)"\system" ifstr(i) $(!IHVDLGHANDLE) != "" FreeLibrary $(!IHVDLGHANDLE) set !IHVDLGHANDLE = "" endif CopyFilesInCopyList endif ifstr(i) $(!DoCopy) == "YES" ifstr(i) $(!IHVDLGHANDLE) != "" FreeLibrary $(!IHVDLGHANDLE) set !IHVDLGHANDLE = "" endif CopyFilesInCopyList endif else set !_FileRemoveList = {} ForListDo $(SNADirList) set SNADir = *( $(SNAToList), $(#) ) ifstr(i) $($) != "bti" set FullPath = $(!SNARootDir)"\"$(SNADir) else set FullPath = $(!SNARootDir)"\..\"$(SNADir) endif set FileList = ^( "FilesFor_"$($)"_"$(Option), 2 ) ;;rmh v ifstr(i) $($) != "hwsetup" ForListDo $(FileList) set !_FileRemoveList = >( $(!_FileRemoveList), + $(FullPath)"\"$($) ) EndForListDo endif 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: ; hwsetup - the inf file, its help and libraries ; ntbin - executables ; ntsys - system files ; ; The format includes the disk number and a name for each file, as well ; as a number of possible flags. ; 1, file1.foo ; 1, file2.foo ; ... ; ;======================================================================== [FilesFor_hwsetup_BTILINK] 1, btilink.inf 1, btilink.hlp 1, btilink.srl [FilesFor_system_BTILINK] 1, btilink.dll [FilesFor_bti_BTILINK]