;************************************************************************ ;************************************************************************ ; ; SNADLC.INF ; ; Ethernet and IBM Token Ring Link Service and Device Driver INF ; ; History: ; t-danfr Jul 23, 92 Initial Design ; ; Notes: ; 1) This file is based on the template.inf file that is distributed ; to IHV/ISV's. ; ;************************************************************************ ;************************************************************************ ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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] IBMTRLS DLCDD ;======================================================================== ; ; 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] IBMTRLS = "DLC 802.2 Link Service" DLCDD = "DLC 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] IBMTRLS ;======================================================================== ; ; 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 ; ;======================================================================== [SNAOptionAddsIBMTRLS] DLCDD ;======================================================================== ; ; 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] ; ... ; ;======================================================================== [InstallStepsIBMTRLS] AddFilesToCopyList = YES CopyFilesInCopyList = YES [InstallStepsDLCDD] 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] IDD_IBMTRLSCONFIG = 101 IDD_IBMTRLSCONFIGNOADDR = 102 IDD_ASKDLC = 103 ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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 = "SNADLC" 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. ; ;++++++++++++++++++++++++++++++++++++ [FileConstantsIBMTRLS] ; ; Product Info ; ProductVersion = "1.0" ProductName = "NDISTokenRingLS" ; The Instance value is set in [CommonSection]: ProductFullName = $(ProductName)"_"$(ProductVersion)"_"$(Instance) ProductRegBase = $(!NTN_SoftwareBase)"\Microsoft" ProductType = "Link" ProductImagePath = "SNALINK.EXE" ProductDepends = {} ProductParams = {} ProductExtraParams = {} ProductExclusive = $(!False) ProductDLL = "SNADLC.DLL" ProductServicePrefix = "SnaDlc" ProductServiceQuery = $(!True) ; ; Registry Key Information ; SNAServiceType = "CESTR" ; ; NetRules Stuff ; NetRulesClass = "snadlclink snalink" NetRulesTitle = "DLC 802.2 Link Service" NetRulesUse = "service yes yes" NetRulesBindable = "snadlclink dlcDriver non non 100" NetRulesType = "snadlc_"$(Instance)" snadlclink" FullInfName = $(!SNARootDir)"\system\hwsetup\"$(ThisInf) SoftwareType = "service" [FileConstantsDLCDD] ; ; Product Info ; ProductVersion = "1.0" ProductName = "DLCDeviceDriver" ProductFullName = $(ProductName)"_"$(ProductVersion)"_"$(Instance) ProductRegBase = $(!NTN_SoftwareBase)"\Microsoft" ProductType = "Driver" ProductImagePath = "DLC.SYS" ProductDepends = {} ProductParams = {} ProductExtraParams = {} ProductExclusive = $(!True) ProductDLL = "" ProductServicePrefix = "DLC" ProductServiceQuery = $(!False) ; ; Registry Key Information ; SNAServiceType = "DRIVER" ; ; NetRules Stuff (this isn't used for the DLC device driver) ; NetRulesClass = dlcdevdriver 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. ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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 = "" KeyInfo = {} 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 = "" ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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 = "DLC 802.2 Link Service Setup" [FileConstantsIBMTRLS_ENG] ProductTitle = "DLC 802.2 Link Service" ProductDesc = "DLC 802.2 Link Service" [FileConstantsDLCDD_ENG] ProductTitle = "DLC Device Driver" ProductDesc = "DLC Device Driver" ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; 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] LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\setupdll.dll !LIBHANDLE exit [date] Now = {} ? $(!LIBHANDLE) GetSystemDate [FreeSetupLibrary] FreeLibrary $(!LIBHANDLE) exit [LoadNCPALibrary] set !NCPA_HANDLE = "" LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\NCPA.CPL !NCPA_HANDLE exit [FreeNCPALibrary] FreeLibrary $(!NCPA_HANDLE) set !NCPA_HANDLE = "" exit [InstallDLC] read-syms GeneralConstants OpenRegKey $(!REG_H_LOCAL) "" $(ServicesBaseName)"\DLC" + $(MAXIMUM_ALLOWED) KeyServices ifstr(i) $(KeyServices) != $(KeyNull) CloseRegKey $(KeyServices) else shell "" DoAskInstallDLC ifstr(i) $($R0) == "YES" set OldOption = $(!NTN_InfOption) set !NTN_InfOption = DLC install LoadNCPALibrary install LoadSetupLibrary shell $(!STF_WINDOWSSYSPATH)\oemnxpdl.inf InstallOption $(!STF_LANGUAGE) + DLC "" YES YES YES set DLCStatus = $($R0) LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance + $(!STF_WINDOWSSYSPATH)"\drivers\dlc.sys" set !NTN_InfOption = $(OldOption) install FreeSetupLibrary ifstr(i) $(DLCStatus) != STATUS_SUCCESSFUL return $($DLCStatus) endif ifstr(i) $(ExistStatus) == "NO" shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + "The DLC 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 DLC software, then try reinstalling it"+ " using a different path."$(!LF)$(!LF)+ "You must have successfully installed the DLC software"+ " before you can install this SNA 802.2 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 endif endif endif shell $(UtilityInf) IncrementRefCount "Software\Microsoft\DLC\CurrentVersion" return STATUS_SUCCESSFUL [DoAskInstallDLC] read-syms AskDLCInstall$(!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] ; ... ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: [DoTokrLSConfigENG] DlgTemplate = IDD_IBMTRLSCONFIGNOADDR DlgType = "RadioCombination" Caption = $(!P:SetupTitle) DlgText1 = "Service Name: "$(ServiceName) EditLabel1 = "&Title:" EditLabel2 = "Local &SAP:" ComboLabel1 = "Ada&pter:" EditTextIn = { $(ServiceTitle), $(LocalSAP), $(NetworkAddr) } EditTextLim = { 40, 4, 12 } RadioOptionsGreyed = {} NotifyFields = { "NO" } HelpContext = #( HelpContextIDs, $(DlgTemplate), 1 ) [AskDLCInstallENG] DlgTemplate = IDD_ASKDLC DlgType = "Info" Caption = "Install DLC Software?" DlgText1 = "The DLC software has not yet been installed on this computer." DlgText2 = "Before Setup can install your 802.2 link service, you must use "+ "the Network Control Panel Applet to install and bind the DLC "+ "software from your original Windows NT distribution files (on "+ "floppy disks, CD-ROM, or over the network)." DlgText3 = "If you have your Windows NT distribution handy, Setup "+ "can do this for you right now. If you don't have your Windows "+ "NT distribution, you wll be unable to install an 802.2 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 ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; DoTokrLSConfig: ; ; DESCRIPTION: This shell script pops up a dialog to get the configuration ; of this product. ; ; INPUT: $($0) : Service Name ; $($1) : Current Title ; $($2) : Current Adapter Name ; $($3) : Current Local SAP ; $($4) : Current Network Address ; $($5) : Current MAC Type (0=TokenRing, 1=EtherNet, etc.) ; ; OUTPUT: $($R0): STATUS: One of the above ; $($R1): Change flag: 0=no changes, 1=changes, 2=reboot req'd ; $($R2): New Title ; $($R3): New Adapter Name ; $($R4): New Local SAP ; $($R5): New Network Address ("" - no override, "..." override) ; $($R6): New MAC Type ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [DoTokrLSConfig] set ServiceName = $($0) set ServiceTitle = $($1) set AdapterName = $($2) set LocalSAP = $($3) set NetworkAddr = $($4) set MACType = $($5) set SvServiceTitle = $($1) set SvAdapterName = $($2) set SvLocalSAP = $($3) set SvNetworkAddr = $($4) set SvMACType = $($5) set Changes = 0 read-syms DialogConstants read-syms DialogConstants$(!STF_LANGUAGE) read-syms DoTokrLSConfig$(!STF_LANGUAGE) ; ; To fill in the list box for the available adapters, we first determine ; what device drivers DLC is currently bound by looking at the "Bind" line ; in LocalMachine\System\CurrentControlSet\Services\DLC\Linkage, which ; gives us a list of the form { "\Device\Elnkii01", "\Device\IbmTok02", ... }. ; ; We then go through each key under LocalMachine\Software\Microsoft\- ; Windows NT\CurrentVersion\NetworkCards ( 01, 02, ... ) and get the ; value of "ServiceName", and if that value matches one of the netcard ; names in the binding list, we get the value of "Title" and add an entry ; to our "available adapters" list as: { "TitleValue", "AdapterName" } ; where AdapterName is the entire binding string whose netcard name matched ; the service name. The netcard name is just the last word in the binding ; string, e.g., "Elnkii01" or "IbmTok02" above. ; set DLCAdapterList = {} set ComboListIn1 = {} shell "" InstallDLC set-title $(!SNA_ProductFlavor)" Setup" ; DLC install changes this ifstr(i) $($R0) != STATUS_SUCCESSFUL return $($R0) endif OpenRegKey $(!REG_H_LOCAL), "", + "System\CurrentControlSet\Services\DLC\Linkage", + $(!REG_KEY_READ), KeyDLCLink ifstr(i) $(KeyDLCLink) == $(KeyNull) shell $(!SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", + "The NDIS 802.2 link service requires that the DLC protocol"$(!LF)+ "software be installed by the Windows NT Network Control"$(!LF)+ "Panel (NCPA). For this release of "$(!SNA_ProductName)", you must"$(!LF)+ "do this manually using the Windows NT Network Control Panel"$(!LF)+ "(NCPA) before installing the 802.2 link service."$(!LF)$(!LF)+ "Directions: start Control Panel, choose Networks, click"$(!LF)+ "Add Software, select DLC Protocol." return STATUS_SOSO $(Changes) "" "" "" "" "" endif GetRegValue $(KeyDLCLink) "Bind" DLCBindValue ifstr(i) $(DLCBindValue) != {} ifstr(i) *( $(DLCBindValue), 4 ) != {} goto getDLCstrings endif endif shell $(!SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", + "The NDIS 802.2 link service requires that the DLC protocol"$(!LF)+ "software on your computer must be 'bound' to one or more of"$(!LF)+ "the computer's network adapters. For this release of SNA"$(!LF)+ "Server, you must do this manually using the Windows NT"$(!LF)+ "Network Control Panel (NCPA) before installing this link service."$(!LF)$(!LF)+ "Directions: start Control Panel, choose Networks, click"$(!LF)+ "Bindings, and turn on the binding between DLC and the"$(!LF)+ "network adapter you wish to use with your 802.2 link service." return STATUS_SOSO $(Changes) "" "" "" "" "" getDLCstrings =+ CloseRegKey $(KeyDLCLink) set DLCBindStrings = *( $(DLCBindValue), 4 ) OpenRegKey $(!REG_H_LOCAL), "", + "Software\Microsoft\Windows NT\CurrentVersion\NetworkCards", + $(!REG_KEY_READ), KeyNetCards ; better not be null EnumRegKey $(KeyNetCards) AdapterNumList set MatchTitle = "" ForListDo $(AdapterNumList) set TmpAdapterNum = *( $($), 1 ) OpenRegKey $(KeyNetCards), "", $(TmpAdapterNum), + $(!REG_KEY_READ), KeyAdapterNum ; better not be null GetRegValue $(KeyAdapterNum), "ServiceName", ServiceNameValue set ServiceNameString = *( $(ServiceNameValue), 4 ) ForListDo $(DLCBindStrings) Split-String $($) "\" TmpList QueryListSize TmpIndex $(TmpList) set NetCardName = *( $(TmpList), $(TmpIndex) ) ifstr(i) $(ServiceNameString) == $(NetCardName) ; Found one! GetRegValue $(KeyAdapterNum) "Title" TitleValue set TitleValueString = *( $(TitleValue), 4 ) set DLCAdapterList = >( $(DLCAdapterList), + { $(TitleValueString), $($) } ) set ComboListIn1 = >( $(ComboListIn1), $(TitleValueString) ) ifstr(i) $($) == $(AdapterName) set MatchTitle = $(TitleValueString) set MatchSvcName = $(ServiceNameString) endif endif EndForListDo CloseRegKey $(KeyAdapterNum) EndForListDo CloseRegKey $(KeyNetCards) ; ; Get the NetworkAddress parameter from \Parameters ; and set up the default editbox text ; ; (Actually, we no longer worry about this, since the Network ; Address is now set with the NCPA. Skip this stuff.) ; goto skipit1 ifstr(i) $(MatchSvcName) != "" ; pull out the network address OpenRegKey $(!REG_H_LOCAL), "", + "System\CurrentControlSet\Services\"$(MatchSvcName)"\Parameters", + $(!REG_KEY_READ), KeyParams ifstr(i) $(KeyParams) == $(!KeyNull) return STATUS_FAILED $(Changes) "" "" "" "" "" "" endif GetRegValue $(KeyParams) "NetworkAddress", NetAddrInfo ifstr(i) $(NetAddrInfo) != {} set NetworkAddr = *( $(NetAddrInfo), 4 ) endif CloseRegKey $(KeyParams) endif ; ; Set up the list box ; skipit1 =+ set ComboListOut1 = $(MatchTitle) ; should be highlighted set ComboListItemsIn = { ComboListIn1 } set ComboListItemsOut = { ComboListOut1 } set-dectohex SAPStr = $(LocalSAP) set EditTextIn = { $(ServiceTitle), $(SAPStr), $(NetworkAddr) } ifstr(i) $(NetworkAddr) == "" set RadioIn = { $(Radio1) } else set RadioIn = { $(Radio2) } endif DTRLSCbegin = + set Status = STATUS_SUCCESSFUL RefreshDlg =+ ui start $(DlgTemplate) $(!IHVDLGHANDLE) ifstr(i) $(DLGEVENT) == "Exit" set Status = STATUS_USERCANCEL else set Status = STATUS_SUCCESSFUL set ErrorList = {} set ServiceTitle = *( $(EditTextOut), 1 ) ForListDo $(DLCAdapterList) ifstr(i) $(ComboListOut1) == *( $($), 1 ) set AdapterName = *( $($), 2 ) endif EndForListDo Split-String $(AdapterName) "\" TmpList QueryListSize TmpIndex $(TmpList) set AdapterShortName = *( $(TmpList), $(TmpIndex) ) ifstr(i) $(AdapterName) != $(!SvAdapterName) set Changes = 1 endif OpenRegKey $(!REG_H_LOCAL), "", + "SYSTEM\CurrentControlSet\Services\"$(AdapterShortName)"\Parameters",+ $(!REG_KEY_READ), KeyAdapter ifstr(i) $(KeyAdapter) == $(KeyNull) set ErrorList = >( $(ErrorList), + "Adapter specified does not exist." ) else set MediaType = 2 ;default=Token Ring GetRegValue $(KeyAdapter) "MediaType" MediaTypeValue ifstr(i) $(MediaTypeValue) != {} set MediaType = *( $(MediaTypeValue), 4 ) set MacIndList = { 1, 0 } set MACType = *( $(MacIndList), $(MediaType) ) endif ifstr(i) $(MACType) != $(SvMACType) set Changes = 1 endif CloseRegKey $(KeyAdapter) 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." ui pop 1 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)"." ui pop 1 goto RefreshDlg endif ; ; Check SAP ; set SAPVal = 0 set Error = 0 set SAPVal = *( $(EditTextOut), 2 ) ; ; Prepend "0x" if necessary. ; Split-String $(SAPVal) "x" SAPList QueryListSize SAPSize $(SAPList) ifint $(SAPSize) == 1 Split-String $(SAPVal) "X" SAPList QueryListSize SAPSize $(SAPList) endif ifint $(SAPSize) > 1 set SAPVal = *( $(SAPList), $(SAPSize) ) endif set SAPVal = "0x"$(SAPVal) set-hextodec LocalSAP = $(SAPVal) ; ; LocalSAP now has decimal equivalent. ; ifint $(LocalSAP) < 4 set Error = 1 else-ifint $(LocalSAP) > 252 set Error = 1 else set-div Temp1 = $(LocalSAP), 4 set-mul Temp2 = $(Temp1), 4 ifint $(Temp2) != $(LocalSAP) set Error = 1 endif endif ifint $(Error) == 1 set ErrorList = >( $(ErrorList), + "Local SAP is not a hexadecimal multiple of four between 0x4 and 0xFC." ) endif ; ; Check local SAP against other link services on this same ; adapter. We look at everything under Software\Microsoft, ; and anything with a SnaVersion key has its service name ; saved in a list. Later, we go through this list and for ; each of the service names, look its ExtraParameters key ; for LocalSAP and DeviceName values. ; set SvcList = {} OpenRegKey $(!REG_H_LOCAL), "", Software\Microsoft, $(!REG_KEY_READ), KeyMS ifstr(i) $(KeyMS) != $(KeyNull) EnumRegKey $(KeyMS) MSList ForListDo $(MSList) OpenRegKey $(KeyMS), "", *($($),1)\CurrentVersion, $(!REG_KEY_READ), KeyCV ifstr(i) $(KeyCV) != $(KeyNull) set VerItem = "" GetRegValue $(KeyCV) "SNAVersion" VerItem ifstr(i) $(VerItem) != "" set NameItem = "" GetRegValue $(KeyCV) "ServiceName" NameItem GetRegValue $(KeyCV) "Title" TitleItem ifstr(i) $(NameItem) != "" ifstr(i) $(TitleItem) != "" set TmpItem = {*($(NameItem),4),*($(TitleItem),4)} else set TmpItem = {*($(NameItem),4),"Unknown Title"} endif set SvcList = >( $(SvcList), $(TmpItem) ) endif endif CloseRegKey $(KeyCV) endif EndForListDo CloseRegKey $(KeyMS) ; ; We now have the list of services that we're going to check for ; identical LocalSAP and AdapterName values. ; OpenRegKey $(!REG_H_LOCAL), "", System\CurrentControlSet\Services, $(!REG_KEY_READ), KeySvc ifstr(i) $(KeySvc) != $(KeyNull) set Flag = $(!False) ForListDo $(SvcList) ifstr(i) $(Flag) == $(!False) OpenRegKey $(KeySvc), "", *($($),1)\Parameters, $(!REG_KEY_READ), KeyP ifstr(i) $(KeyP) != $(KeyNull) GetRegValue $(KeyP) "SNAServiceType" STItem ifstr(i) $(STItem) != "" ifstr(i) *($(STItem),4) == "11" ; 802.2 link OpenRegKey $(KeyP), "", ExtraParameters, $(!REG_KEY_READ), KeyEP ifstr(i) $(KeyEP) != $(KeyNull) GetRegValue $(KeyEP) "AdapterName" AdaptItem GetRegValue $(KeyEP) "LocalSAP" SAPItem ifstr(i) *($(AdaptItem),4) == $(AdapterName) ifstr(i) *($(SAPItem),4) == $(LocalSAP) set LSTitle = *($($),2) ifstr(i) $(LSTitle) != $(SvServiceTitle) set Flag = $(!True) endif endif endif CloseRegKey $(KeyEP) endif ; ExtraParameters endif ; 802.2 link endif ; SNAServiceType CloseRegKey $(KeyP) endif ; Parameters endif ; Flag EndForListDo CloseRegKey $(KeySvc) endif ; Sys\Services endif ; SW\Microsoft ifstr(i) $(Flag) == $(!True) ; found a match, SAP is invalid shell $(!SubroutineInf) SetupMessage $(!STF_LANGUAGE) NONFATAL + "The same SAP cannot be used on two different link services"$(!LF)+ "which are sharing the same network adapter."$(!LF)$(!LF)+ "The link service """$(LSTitle)""""$(!LF)+ " already has its SAP set to "$(LocalSAP)"." ui pop 1 goto RefreshDlg endif ifstr(i) $(LocalSAP) != $(SvLocalSAP) set Changes = 1 endif goto skipit2 ; we no longer handle net address ifstr(i) *( $(RadioOut), 1 ) == $(Radio1) set NetworkAddr = "" else set NetworkAddr = *( $(EditTextOut), 3 ) ; ; If they select to override, there must be an address there. ; ifstr(i) $(NetworkAddr) == "" set ErrorList = >( $(ErrorList), + "No override address specified." ) endif ; ; Reject invalid addresses. ; ifstr(i) $(NetworkAddr) != "000000000000" ifstr(i) $(NetworkAddr) != "FFFFFFFFFFFF" goto TokrAddrValid endif endif set ErrorList = >( $(ErrorList), + "Network Address must not be 000000000000 or FFFFFFFFFFFF." ) TokrAddrValid =+ endif ifstr(i) $(NetworkAddr) != $(SvNetworkAddr) set Changes = 2 shell $(!P:SubroutineInf) SetupMessage $(!STF_LANGUAGE) STATUS + "For the new Local Network Address to be recognized,"$(!LF)+ "this machine must be rebooted once." endif skipit2 =+ ifstr(i) $(ErrorList) != {} set ErrorMsg = "The configuration you have entered is invalid"$(!LF)+ "for the following reasons:"$(!LF)$(!LF) ForListDo $(ErrorList) set ErrorMsg = $(ErrorMsg)$(#)") "$($)$(!LF) EndForListDo set ErrorMsg = $(ErrorMsg)$(!LF)"Please reconfigure." shell $(!P:SubroutineInf) SetupMessage, $(!STF_LANGUAGE), + "NONFATAL", $(ErrorMsg) set Status = STATUS_REPEAT endif endif ifstr(i) $(Status) == STATUS_REPEAT goto DTRLSCbegin endif ui pop 1 Return $(Status), $(Changes), $(ServiceTitle), $(AdapterName), + $(LocalSAP), $(NetworkAddr), $(MACType) ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() ; ; 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 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 ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [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) 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\" 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"$(!LF)+ "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 ; NTN_InstallMode ; $0: Option to be used ; $1: Instance to be used ; ; OUTPUT: R0: STATUS: STATUS_SUCCESSFUL | ; STATUS_NOLANGUAGE | ; STATUS_EXISTS | ; STATUS_USERCANCEL | ; STATUS_FAILED ; R1: List of other returned items ; R2: 0 if no changes, 1 if changes, 2 if reboot req'd ; ;()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [CommonSection] StartWait set Option = $($0) set Instance = $($1) set Index = "CurrentVersion" set RetData = {} set Changes = 0 ; ; 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_IBMTRLS ; ;++++++++++++++++++++++++++++++++++++ set_defaults_IBMTRLS = + set ServiceName = $(Option) set ServiceTitle = $(ProductTitle) set ServiceDesc = $(ProductDesc) set LocalSAP = "4" set NetworkAddr = "" set MediaType = 0 set MACType = 2 goto finish_defaults ;++++++++++++++++++++++++++++++++++++ ; ; set_defaults_DLCDD ; ;++++++++++++++++++++++++++++++++++++ set_defaults_DLCDD = + 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 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) 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) ifstr(i) $(Option) != "DLCDD" 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) ; ; 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_IBMTRLS: ; ;++++++++++++++++++++++++++++++++++++ assign_value_IBMTRLS = + ifstr(i) $(ValueName) == "AdapterName" set AdapterName = $(ValueData) else-ifstr(i) $(ValueName) == "LocalSAP" set LocalSAP = $(ValueData) else-ifstr(i) $(ValueName) == "MACType" set MACType = $(ValueData) endif goto finish_assign_value ;++++++++++++++++++++++++++++++++++++ ; ; assign_value_DLCDD: ; ;++++++++++++++++++++++++++++++++++++ assign_value_DLCDD = + goto finish_assign_value ;++++++++++++++++++++++++++++++++++++ ; ; finish_assign_value: ; ;++++++++++++++++++++++++++++++++++++ finish_assign_value = + EndForListDo goto assign_extra_$(Option) ;++++++++++++++++++++++++++++++++++++ ; ; assign_extra_IBMTRLS: ; ;++++++++++++++++++++++++++++++++++++ assign_extra_IBMTRLS = + goto finish_assign_extra ;++++++++++++++++++++++++++++++++++++ ; ; assign_extra_DLCDD: ; ;++++++++++++++++++++++++++++++++++++ assign_extra_DLCDD = + 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_IBMTRLS: ; ;++++++++++++++++++++++++++++++++++++ modify_params_IBMTRLS = + shell "" DoTokrLSConfig $(ServiceName), + $(ServiceTitle), + $(AdapterName), + $(LocalSAP), + $(NetworkAddr), + $(MACType) ifint $($ShellCode) != 0 goto ShellCodeError endif set Status = $($R0) ifstr(i) $(Status) != STATUS_SUCCESSFUL goto end else set Changes = $($R1) set ServiceTitle = $($R2) set AdapterName = $($R3) set LocalSAP = $($R4) set NetworkAddr = $($R5) set MACType = $($R6) endif goto finish_modify_params ;++++++++++++++++++++++++++++++++++++ ; ; modify_params_DLCDD: ; ;++++++++++++++++++++++++++++++++++++ modify_params_DLCDD = + 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" ifstr(i) $(Option) == "DLCDD" goto successful else goto write_params endif endif endif ;++++++++++++++++++++++++++++++++++++ ; ; create_regvals: ; create the necessary parts of the registry ; ;++++++++++++++++++++++++++++++++++++ create_regvals = + ifstr(i) $(Option) == "DLCDD" read-syms ProgressCopyVars install InstallRemove goto successful endif Shell $(UtilityInf) + CreateSNAService, $(ServiceName), + $(SNAServiceType), + $(ProductImagePath), + $(ProductDepends), + $(ProductParams), + $(ProductExtraParams) 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 Registry 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 Registry 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_IBMTRLS: ; ;++++++++++++++++++++++++++++++++++++ write_params_IBMTRLS = + 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), "" } + } set ProductExtraParams = { + { AdapterName, $(NoTitle), $(!REG_VT_SZ), $(AdapterName) },+ { LocalSAP , $(NoTitle), $(!REG_VT_DWORD), $(LocalSAP) },+ { MACType , $(NoTitle), $(!REG_VT_DWORD), $(MACType) } + } Split-String $(AdapterName) "\" TmpList QueryListSize TmpIndex $(TmpList) set AdapterShortName = *( $(TmpList), $(TmpIndex) ) OpenRegKey $(!REG_H_LOCAL), "", + "SYSTEM\CurrentControlSet\Services\"$(AdapterShortName)"\Parameters",+ $(!REG_KEY_READWRITE), KeyAdapter ifstr(i) $(KeyAdapter) == $(KeyNull) set ErrMesg = "Can't Find Service Entry For Adapter." set ErrProc = "write_params_IBMTRLS" set ErrFunc = "OpenRegKey" goto fatal_registry endif ; we no longer write the net address ourselves ; ; ifstr(i) $(NetworkAddr) != "" ; SetRegValue $(KeyAdapter), + ; { NetworkAddress, $(NoTitle), $(!REG_VT_SZ), $(NetworkAddr) } ; else ; DeleteRegValue $(KeyAdapter) "NetworkAddress" ; endif ; CloseRegKey $(KeyAdapter) ; ; To properly bind the link service to the DLC driver, we must work around ; a bug in the class definition for DLC. It's classified as a "dlcDriver" ; on its bottom layer (correct), but as an "lmNetService" on its top layer ; (incorrect). We can fix this by changing the "type" value for DLC from ; "type dlc lmNetService dlcDriver" to "type dlc dlcDriver". The net team ; knows of this problem and will get it fixed ASAP (meaning in NT build ; 363/4/5/... or so). (AG, 1/21/92) ; OpenRegKey $(!REG_H_LOCAL), "", + "SOFTWARE\Microsoft\DLC\CurrentVersion\NetRules", + $(!REG_KEY_READWRITE), KeyNetRules ifstr(i) $(KeyNetRules) != $(KeyNull) SetRegValue $(KeyNetRules), + { "type", $(NoTitle), $(!REG_VT_SZ), "dlc dlcDriver" } CloseRegKey $(KeyNetRules) endif goto finish_write_params ;++++++++++++++++++++++++++++++++++++ ; ; write_params_DLCDD: ; ;++++++++++++++++++++++++++++++++++++ write_params_DLCDD = + set FullOption = $(Option)"_"$(Instance) set ProductParams = { + { InfName , $(NoTitle), $(!REG_VT_SZ) , $(FullInfName) },+ { InfOption , $(NoTitle), $(!REG_VT_SZ) , $(FullOption) } + } set ProductExtraParams = {} shell $(UtilityInf) AddValueList $(KeyService), + { + { Group , $(NoTitle), $(!REG_VT_SZ) , "TDI" },+ { Dependencies , $(NoTitle), $(!REG_VT_MULTI_SZ), { "NDIS" } } + } 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) $(ProductParams) != {} 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) ; ; The DLC device driver already has an entry in EventLog\System, ; so we don't need to create one here as we do for most other ; drivers. ; goto successful ;++++++++++++++++++++++++++++++++++++ ; ; getbind_component: ; ;++++++++++++++++++++++++++++++++++++ getbind_component = + goto getbind_$(Option) ;++++++++++++++++++++++++++++++++++++ ; ; getbind_IBMTRLS: ; ;++++++++++++++++++++++++++++++++++++ getbind_IBMTRLS = + set RetData = { {"01", "DLCDD", "", "", "getbindings"} } goto finish_getbind_component ;++++++++++++++++++++++++++++++++++++ ; ; getbind_DLCDD: ; ;++++++++++++++++++++++++++++++++++++ getbind_DLCDD = + 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 ourselves 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) == "DLCDD" set PN = #( FileConstantsIBMTRLS, ProductName, 1) set PV = #( FileConstantsIBMTRLS, ProductVersion, 1) shell $(UtilityInf) FindSNAProductServices $(ProductRegBase) + $(PN)"_"$(PV) set _Status = $($R0) set _List = $($R1) 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 Registry 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 $(KeyNetRules) DeleteRegKey $(KeyServiceIndex) "NetRules" CloseRegKey $(KeyServiceIndex) DeleteRegKey $(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 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 $(KeyProductBase) $(ProductFullName) CloseRegKey $(KeyProductBase) endif 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 = + ; TODO: This is how the template does warnings. Do we have a better way? ; Do we want to do it differently? ; CODENAME: WARNINGS 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" } set SNAToList = { "system\hwsetup" } ifstr(i) $(!NTN_InstallMode) == "install" ifstr(i) $(!AddCopy) == "YES" ForListDo $(SNADirList) ifstr(i) $($) != "hwsetup" set Ext = $(ThisFile) else set Ext = "" endif set To = *( $(SNAToList), $(#) ) ifstr(i) $(Option) != "DLCDD" AddSectionFilesToCopyList "FilesFor_"$($)"_"$(Option) + $(!DriverDir)$(Ext), + $(!SNARootDir)"\"$(To) endif EndForListDo ;; ifstr(i) $(Option) == "DLCDD" ;; AddSectionFilesToCopyList "NTSystemDriverFiles"$(Option), + ;; $(!DriverDir)$(ThisFile), + ;; $(!STF_WINDOWSSYSPATH)"\drivers" ;; endif else ifstr(i) $(Option) != "DLCDD" AddSectionFilesToCopyList "FilesFor_system_"$(Option) + $(!DriverDir)"snadlc\"$(Ext), + $(!SNARootDir)"\system" endif ;; ifstr(i) $(Option) == "DLCDD" ;; ;; ifint $(!STF_NTBUILDNUM) == 404 ;; ; ;; ; BETA2: if DLC.SYS exists in %systemroot%\system32, rename ;; ; to DLC.404 before copying the updated DLC.SYS. This ;; ; allows the update even if DLC is running at the time. ;; ; ;; LoadLibrary "x" $(!STF_WINDOWSSYSPATH)\setupdll.dll !LIBHANDLE ;; ;; LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance + ;; $(!STF_WINDOWSSYSPATH)"\drivers\dlc.sys" ;; ifstr(i) $(ExistStatus) == "YES" ;; LibraryProcedure ExistStatus $(!LIBHANDLE) CheckFileExistance + ;; $(!STF_WINDOWSSYSPATH)"\drivers\dlc.404" ;; ifstr(i) $(ExistStatus) == "NO" ;; LibraryProcedure ExistStatus $(!LIBHANDLE) RenFile + ;; $(!STF_WINDOWSSYSPATH)"\drivers\dlc.sys" + ;; $(!STF_WINDOWSSYSPATH)"\drivers\dlc.404" ;; endif ;; endif ;; ;; FreeLibrary $(!LIBHANDLE) ;; endif ;STF_NTBUILDNUM==404 ;; ;; AddSectionFilesToCopyList "NTSystemDriverFiles"$(Option), + ;; $(!DriverDir)"snadlc", + ;; $(!STF_WINDOWSSYSPATH)"\drivers" ;; endif ; $(Option) == DLCDD 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 - ntsys 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_IBMTRLS] 1, snadlc.inf 1, snadlc.hlp 1, snadlc.srl [FilesFor_system_IBMTRLS] 1, snadlc.dll [FilesFor_system_DLCDD] 1, dlc.sys [NtSystemDriverFilesDLCDD] 1, dlc.sys