; ; Copyright 2001, Agere Systems ; ; DATE : $Date: 21 Mar 2001 10:25:36 $ $Revision: 1.19 $ [Identification] OptionType = NetAdapter [Options] WaveLAN_PCMCIA [OptionsText-ENG] WaveLAN_PCMCIA = "Avaya Wireless PC Card" [ProductConstants] Manufacturer = "Avaya Communication" FunctionTitle = "Avaya Wireless Adapter Setup" SWProductDescription = "Avaya Wireless NDIS 4 Miniport Driver" HWProductDescription = "Avaya Wireless Wireless Network Adapter" [ProductConstants-WaveLAN_PCMCIA] ConfigFileName = "WNAVA52.CPL" HelpFileName = "WNAVA.HLP" HelpCntName = "WNAVA.CNT" DriverFileName = "WLAVA52.SYS" PcmciaProductName = "Avaya Wireless PC Card" HWProductName = "WLAVA52" HWProductTitle = "Avaya Wireless PC Card" DLL_Caption = $(PcmciaProductName)" Settings" DLL_Network = "Wireless Network Name" VendorDescription = "Avaya Wireless PC Card" SWProductVersionVariant = "1" SWProductVersionMajor = "6" SWProductVersionMinor = "42" SWProductName = $(HWProductName) SWProductTitle = $(HWProductTitle)" Driver" SWProductPath = "\SystemRoot\System32\drivers\"$(DriverFileName) SWProductVersion = $(SWProductVersionMajor)"."$(SWProductVersionMinor) SWProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(SWProductName)"\CurrentVersion" PcmciaKeyName = $(!NTN_ServiceBase)"\PCMCIA\DataBase" DPPCMCIA = 1 [NetRuleConstants] SoftwareType = "driver" NetRuleSoftwareType = $(HWProductName)"Sys ndisDriver "$(HWProductName)"Driver" NetRuleSoftwareUse = $(SoftwareType) NetRuleSoftwareBindForm = """"$(HWProductName)"Sys"" yes no container" NetRuleSoftwareClass = {$(HWProductName)"Driver basic"} NetRuleSoftwareBindable = {$(HWProductName)"Driver "$(HWProductName)"Adapter non exclusive 100"} NetRuleHardwareType = $(HWProductName)" "$(HWProductName)"Adapter" NetRuleHardwareBindForm = " yes yes container" NetRuleHardwareClass = {$(HWProductName)"Adapter basic"} NetworkCardsKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Define parameters which will be conditionally added as ; values in the device parameters section. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [DriverParameters] BusType = 1 BusNumber = 0 MediaType = 1 PortType = 1 IoBaseAddress = 1024 InterruptNumber = 10 DPDebugFlags = 0 DriverVariant = $(SWProductVersionVariant) DriverMajor = $(SWProductVersionMajor) DriverMinor = $(SWProductVersionMinor) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Get id string parameters ; Sets Identifier to OptionType string from above. ; Sets Media to installation disk identifier ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [Identify] ; Set !DebugOutputControl = 1 Debug-Output "WVLANINF: Identify" Read-Syms Identification Set Status = STATUS_SUCCESSFUL Set Identifier = $(OptionType) Set Media = #("Source Media Descriptions", 1, 1) Return $(Status) $(Identifier) $(Media) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Determine if the language and platform specified is ; supported by this install file. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [ReturnOptions] ; Set !DebugOutputControl = 1 Debug-Output "WVLANINF: ReturnOptions" Set Status = STATUS_FAILED Set OptionList = {} Set OptionTextList = {} Set LanguageList = ^(LanguagesSupported, 1) IfContains(i) $($0) in $(LanguageList) IfStr(i) $($1) == "" Goto ReturnOptions_Success EndIf Set PlatformList = ^(PlatformsSupported, 1) IfContains(i) $($1) in $(PlatformList) Goto ReturnOptions_Success Else Set Status = STATUS_NOTSUPPORTED Goto ReturnOptions_Failure EndIf Else Set Status = STATUS_NOLANGUAGE Goto ReturnOptions_Failure EndIf ReturnOptions_Success = + Set OptionList = ^(Options, 1) Set OptionTextList = ^(OptionsText-$($0), 1) Set Status = STATUS_SUCCESSFUL ReturnOptions_Failure = + Return $(Status) $(OptionList) $(OptionTextList) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; MAIN ENTRY POINT ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [InstallOption] ;;; ;;; FIXME - Turn off debug messages before shipping ;;; Set SaveDebugOutputControl = $(!DebugOutputControl) ; Set !DebugOutputControl = 1 Debug-Output "WVLANINF: InstallOption" ;;; ;;; Get parameters from calling routine ;;; Set Option = $($1) Set SrcDir = $($2) Set AddCopy = $($3) Set DoCopy = $($4) Set DoConfig = $($5) Set LanguageList = ^(LanguagesSupported, 1) ;;; ;;; Check that language is supported, and abort if it is not. ;;; IfContains(i) $($0) NOT-IN $(LanguageList) Return STATUS_NOLANGUAGE EndIf ;;; ;;; Get defined strings. ;;; Read-Syms GeneralConstants Read-Syms FileConstants Read-Syms FileConstants-$(!STF_LANGUAGE) Read-Syms ProductConstants Read-Syms ProductConstants-$(Option) Read-Syms NetRuleConstants Read-Syms DriverParameters Read-Syms DialogConstants-$(!STF_LANGUAGE) ;;; ;;; Get date ;;; Detect Date Set-Subst LF = "\n" ;;; ;;; Set title for this procedure ;;; Set-Title $(FunctionTitle) Set GoToLabel = Begin Set ComeFromLabel = Begin Set CommonStatus = STATUS_SUCCESSFUL ;;; ;;; Determine mode selected by user in NCPA ;;; Begin = + EndWait IfStr(i) $(!NTN_InstallMode) == "Deinstall" Set StartLabel = RemoveAdapter Else-IfStr(i) $(!NTN_InstallMode) == "Update" Set StartLabel = UpgradeSoftware Else-IfStr(i) $(!NTN_InstallMode) == "Bind" Set StartLabel = BindingAdapter Else-IfStr(i) $(!NTN_InstallMode) == "Configure" Set StartLabel = ConfigureAdapter Else Set StartLabel = InstallAdapter EndIf Debug-Output $(SWProductName)": =============================================" Debug-Output $(SWProductName)": Option = "$(Option) Debug-Output $(SWProductName)": SrcDir = "$(SrcDir) Debug-Output $(SWProductName)": AddCopy = "$(AddCopy) Debug-Output $(SWProductName)": DoCopy = "$(DoCopy) Debug-Output $(SWProductName)": DoConfig = "$(DoConfig) Debug-Output $(SWProductName)": STF_LANGUAGE = "$(!STF_LANGUAGE) Debug-Output $(SWProductName)": STF_CWDIR = "$(!STF_CWDIR) Debug-Output $(SWProductName)": NTN_InstallMode = "$(!NTN_InstallMode) Debug-Output $(SWProductName)": NTN_RegBase = "$(!NTN_RegBase) Debug-Output $(SWProductName)": =============================================" Set ComeFromLabel = fatal Set GoToLabel = fatal Goto $(StartLabel) InstallAdapter = + Debug-Output $(SWProductName)": InstallAdapter: "$(SWProductKeyName) ;;; ;;; See if the software has already been installed. ;;; StartWait OpenRegKey $(!REG_H_LOCAL) "" $(SWProductKeyName) $(MAXIMUM_ALLOWED) + hKeySWProduct IfStr $(hKeySWProduct) != $(hKeyNull) Debug-Output $(SWProductName)": Already Installed: "$(SWProductKeyName) IfStr(i) $(SWProductKeyName) == $(!NTN_RegBase) ;;; ;;; The software is already installed, don't do it again. ;;; Shell $(UtilityInf), VerExistedDlg, + $(SWProductTitle), + $(SWProductVersion) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run VerExistedDlg" Goto ShellCodeError EndIf Debug-Output $(SWProductName)": Software already installed" Goto end Else ;;; ;;; The software is already installed, now the user is adding ;;; a new hardware instance. Let's make sure it's okay. ;;; Shell $(UtilityInf), CardExistedDlg IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run CardExistedDlg" Goto ShellCodeError EndIf IfStr(i) $($R1) != "OK" Debug-Output $(SWProductName)": User cancelled install" Goto end EndIf EndIf Else ;;; ;;; The software is not installed, so do it now. ;;; Start by copying the files to the system disk. ;;; Debug-Output $(SWProductName)": First Time Install: "$(SWProductKeyName) ; If this is not running via the NCPA, we need to change the ; SrcDir since DoAskSource won't prompt for the disk. If the ; NCPA is not used, the files should be copied before launching ; the INF install, and you should do no file copies from the INF. IfStr(i) $(!NTN_InstallPhase) == "primary" Set SrcDir = "A:\" EndIf ;;; ;;; If SrcDir is not set, ask the user to locate it for us. ;;; Set STF_INSTALL_OUTCOME = STF_SUCCESS IfStr(i) $(SrcDir) == "" Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), "A:\", "NO" IfInt $($ShellCode) != $(!SHELL_CODE_OK) Set STF_INSTALL_OUTCOME = STATUS_SHELL_FAILED Else-IfStr(i) $($R0) == STATUS_FAILED Set STF_INSTALL_OUTCOME = STATUS_FAILED Else-IfStr(i) $($R0) == STATUS_USERCANCEL Set STF_INSTALL_OUTCOME = STATUS_USERCANCEL Else Set SrcDir = $($R1) EndIf EndIf IfStr(i) $(STF_INSTALL_OUTCOME) == STF_SUCCESS Install "Install-Software" Endif IfStr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS Debug-Output $(SWProductName)": Install-Software ERROR="$(STF_INSTALL_OUTCOME) Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE" IfInt $($ShellCode) != $(!SHELL_CODE_OK) Goto ShellCodeError EndIf Set Error = $($R0) Goto fatal EndIf ;;; ;;; Now add the software component to the registry. ;;; Debug-Output $(SWProductName)": AddSoftwareComponent" Debug-Output $(SWProductName)": Manufacturer = "$(Manufacturer) Debug-Output $(SWProductName)": SWProductName = "$(SWProductName) Debug-Output $(SWProductName)": SWProductTitle = "$(SWProductTitle) Debug-Output $(SWProductName)": STF_CONTEXTINFNAME = "$(STF_CONTEXTINFNAME) Debug-Output $(SWProductName)": SWProductPath = "$(SWProductPath) Set OEM_ABANDON_SOFTWARE = TRUE Shell $(UtilityInf), AddSoftwareComponent, + $(Manufacturer), + $(SWProductName), + $(SWProductName), + $(SWProductTitle), + $(STF_CONTEXTINFNAME), + $(SWProductPath), + "kernel", "NDIS", {}, "", + $(NetEventDLL) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run AddSoftwareComponent" Goto ShellCodeError EndIf Set RegistryErrorIndex = $($R0) Set hKeySWProduct = $($R1) Set hKeySWNetRules = $($R2) Set hKeySWService = $($R3) Set hKeySWParameter = $($R4) Set hKeySWLinkage = $($R5) IfStr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output $(SWProductName)": AddSoftwareComponent ERROR="$(RegistryErrorIndex) Goto fatalRegistry EndIf ;;; ;;; Write the values to the software product key. ;;; Debug-Output $(SWProductName)": AddValueList hKeySWProduct" Set NewValueList = {+ {Description,$(NoTitle),$(!REG_VT_SZ),$(SWProductDescription)}, + {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}, + {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(SWProductVersionMajor)}, + {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(SWProductVersionMinor)}, + {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(SWProductName)}, + {SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)}, + {Title,$(NoTitle),$(!REG_VT_SZ),$(SWProductTitle)} + } Shell $(UtilityInf), AddValueList, $(hKeySWProduct), $(NewValueList) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run AddValueList: hKeySWProduct" Goto ShellCodeError EndIf Set RegistryErrorIndex = $($R0) IfStr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output $(SWProductName)": AddValueList hKeySWProduct ERROR="$(RegistryErrorIndex) Goto fatalRegistry EndIf ;;; ;;; Write the values to the software NetRules key. ;;; Debug-Output $(SWProductName)": AddValueList hKeySWNetRules" Set NewValueList = {+ {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, + {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, + {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, + {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}, + {type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)}, + {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)} + } Shell $(UtilityInf), AddValueList, $(hKeySWNetRules), $(NewValueList) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run AddValueList: hKeySWNetRules" Goto ShellCodeError EndIf Set RegistryErrorIndex = $($R0) IfStr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output $(SWProductName)": AddValueList hKeySWNetRules ERROR="$(RegistryErrorIndex) Goto fatalRegistry EndIf ;;; ;;; If this is just a software install, we're done. ;;; Debug-Output $(SWProductName)": Software install complete" EndIf ;;; ;;; Okay, if we're here, it must be time to install a new hardware device. ;;; Debug-Output $(SWProductName)": AddHardwareComponent" Set OEM_ABANDON_HARDWARE = TRUE Shell $(UtilityInf), AddHardwareComponent, $(HWProductName), + $(STF_CONTEXTINFNAME), $(SWProductKeyName) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run AddHardwareComponent" Goto ShellCodeError EndIf Set RegistryErrorIndex = $($R0) Set hKeyNetCard = $($R1) Set hKeyNetCardRules = $($R2) Set hKeyDeviceParameters = $($R3) Set NetCardNumber = $($R4) Set ServiceName = $($R5) IfInt $(NetCardNumber) != -1 Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), + $(NetworkCardsKeyName)$(NetCardNumber)) EndIf IfStr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output $(SWProductName)": AddHardwareComponent ERROR="$($R0) Goto fatalRegistry EndIf ;;; ;;; Now add the values to the NetworkCards\N subkey. ;;; Debug-Output $(SWProductName)": AddValueList hKeyNetCard" Set NewValueList = {+ {Description,$(NoTitle),$(!REG_VT_SZ),$(HWProductDescription)}, + {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}, + {Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)}, + {ProductName,$(NoTitle),$(!REG_VT_SZ),$(HWProductName)}, + {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ServiceName)}, + {Title,$(NoTitle),$(!REG_VT_SZ),"["$(NetCardNumber)"] "$(HWProductTitle)} + } Shell $(UtilityInf), AddValueList, $(hKeyNetCard), $(NewValueList) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run AddValueList: hKeyNetCard" Goto ShellCodeError EndIf ;;; ;;; Now add the values to the NetworkCards\N\NetRules subkey. ;;; Set TempBindForm = """"$(ServiceName)""""$(NetRuleHardwareBindForm) Set NewValueList = {+ {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, + {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, + {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}, + {type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)}+ } Shell $(UtilityInf), AddValueList, $(hKeyNetCardRules), $(NewValueList) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run AddValueList: hKeyNetCardRules" Goto ShellCodeError EndIf Set RegistryErrorIndex = $($R0) IfStr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output $(SWProductName)": AddValueList: hKeyNetCardRules ERROR="$(RegistryErrorIndex) Goto fatalRegistry EndIf ;;; ;;; Now add the fixed values to the adapter parameters subkey. ;;; Set NewValueList = {+ {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)}, + {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusType)}, + {MediaType,$(NoTitle),$(!REG_VT_DWORD),$(MediaType)} + } Shell $(UtilityInf), AddValueList, $(hKeyDeviceParameters), $(NewValueList) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run AddValueList: hKeyDeviceParameters" Goto ShellCodeError EndIf Set RegistryErrorIndex = $($R0) IfStr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output $(SWProductName)": AddValueList: hKeyDeviceParameters ERROR="$(RegistryErrorIndex) Goto fatalRegistry EndIf IfStr(i) $(Option) == "WaveLAN_PCMCIA" ;;; ;;; If PCMCIA adapter, add keys and values to allow NT to create ;;; attribute window when the system boots. ;;; OpenRegKey $(!REG_H_LOCAL) "" $(PcmciaKeyName) $(MAXIMUM_ALLOWED) + hKeyPcmciaDatabase IfStr $(hKeyPcmciaDatabase) == $(hKeyNull) Debug-Output $(SWProductName)": OpenRegKey failed to open: "$(PcmciaKeyName) Goto fatalRegistry EndIf ;;; ;;; ;;; Try to create the keys in PCMCIA database, but don't fail if they're already there. ;;; CreateRegKey $(hKeyPcmciaDatabase) {$(Manufacturer), 0, GenericClass} + "" $(MAXIMUM_ALLOWED) "" hKeyPcmciaManufacturer IfStr $(hKeyPcmciaManufacturer) == $(hKeyNull) OpenRegKey $(hKeyPcmciaDatabase) "" $(Manufacturer) $(MAXIMUM_ALLOWED) + hKeyPcmciaManufacturer IfStr $(hKeyPcmciaManufacturer) == $(hKeyNull) Debug-Output $(SWProductName)": OpenRegKey failed to open: " + $(PcmciaKeyName)"\"$(Manufacturer) Goto fatalRegistry EndIf EndIf ;;; ;;; Try to create product key under manufacturer key, but don't fail if it's already there. ;;; CreateRegKey $(hKeyPcmciaManufacturer) { $(PcmciaProductName), 0, GenericClass } "" + $(MAXIMUM_ALLOWED) "" hKeyPcmciaProduct IfStr $(hKeyPcmciaProduct) == $(hKeyNull) OpenRegKey $(hKeyPcmciaManufacturer) "" $(PcmciaProductName) $(MAXIMUM_ALLOWED) + hKeyPcmciaProduct IfStr $(hKeyPcmciaProduct) == $(hKeyNull) Debug-Output $(SWProductName)": OpenRegKey failed to open: " $(PcmciaKeyName)"\"$(Manufacturer)"\"$(PcmciaProductName) Goto fatalRegistry EndIf Endif ;;; ;;; Now write the values to the registry. ;;; Set NewValueList = {+ {DeviceType,$(NoTitle),$(!REG_VT_SZ),"NET"}, + {Driver,$(NoTitle),$(!REG_VT_SZ), $(SWProductName)}, + {InfFileName,$(NoTitle),$(!REG_VT_SZ),$(!UG_Filename)}, + {Option,$(NoTitle),$(!REG_VT_SZ),$(Option)}+ } Shell $(UtilityInf), AddValueList, $(hKeyPcmciaProduct), $(NewValueList) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run AddValueList: hKeyPcmciaProduct (Lucent)" Goto ShellCodeError EndIf EndIf EndWait Goto ConfigureHardware ConfigureAdapter = + IfStr(i) $(SWProductKeyName) == $(!NTN_RegBase) ;;; ;;; Cannot configure software component ;;; Debug-Output $(SWProductName)": Can't configure software component: "$(SWProductKeyName) Shell $(UtilityInf), RegistryErrorString, CANNOT_CONFIGURE_SOFTWARE IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)":ShellCode: RegistryErrorString: "$($ShellCode) Goto ShellCodeError EndIf Set Error = $($R0) Set ComeFromLabel = end Set GoToLabel = end Goto nonFatalInfo EndIf ;;; ;;; Configure hardware component ;;; Debug-Output $(SWProductName)": ConfigureAdapter" ;;; ;;; Open the hardware device key and parameters key ;;; OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) + hKeyNetCard IfStr $(hKeyNetCard) == $(hKeyNull) Debug-Output $(SWProductName)": OpenRegKey failed to open: "$(!NTN_RegBase) Set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE Goto fatalRegistry EndIf Shell $(UtilityInf) FindService, $(hKeyNetCard) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run FindService" Goto ShellCodeError EndIf IfStr(i) $($R0) != NO_ERROR Debug-Output $(SWProductName)": FindService ERROR="$($R0) Goto fatalRegistry EndIf Set hKeyDevice = $($R1) Set hKeyDeviceParameters = $($R2) GetRegValue $(hKeyNetCard),"ServiceName", ServiceNameInfo Set ServiceName = *($(ServiceNameInfo), 4) ConfigureHardware = + Debug-Output $(SWProductName)": ConfigureHardware" ;;; ;;; Make sure the device key has been found ;;; IfStr $(ServiceName) == "" Debug-Output $(SWProductName)": ServiceName not found" Set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE Goto fatalRegistry EndIf IfStr $(hKeyDeviceParameters) == $(hKeyNull) Debug-Output $(SWProductName)": Service\Parameters does not exist" Set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE Goto fatalRegistry EndIf ;;; ;;; Read the existing parameters from the registry ;;; Debug-Output $(SWProductName)": Reading parameters from registry" Set ValueName = "" Set ValueData = "" Set ValueStr = "" Set ValueList = {} EnumRegValue $(hKeyDeviceParameters) ValueList ForListDo $(ValueList) Set ValueItem = $($) Set ValueName = *($(ValueItem),1) Set ValueData = *($(ValueItem),4) IfStr(i) $(ValueName) == "DebugFlags" Set DPDebugFlags = $(ValueData) Else-IfStr(i) $(ValueName) == "PCMCIA" Set DPPCMCIA = $(ValueData) Else-IfStr(i) $(ValueName) == "PortType" Set PortType = $(ValueData) Else-IfStr(i) $(ValueName) == "IoBaseAddress" Set IoBaseAddress = $(ValueData) Else-IfStr(i) $(ValueName) == "InterruptNumber" Set InterruptNumber = $(ValueData) Endif EndForListDo writeParameters = + Debug-Output $(SWProductName)": writeParameters" IfStr(i) $(Option) == "WaveLAN_ISA" Set NewValueList = {+ {DebugFlags,$(NoTitle),$(!REG_VT_DWORD),$(DPDebugFlags)}, + {PortType,$(NoTitle),$(!REG_VT_DWORD),$(PortType)} + } Else-IfStr(i) $(Option) == "WaveLAN_PCMCIA" Set NewValueList = {+ {DebugFlags,$(NoTitle),$(!REG_VT_DWORD),$(DPDebugFlags)}, + {PCMCIA,$(NoTitle),$(!REG_VT_DWORD),$(DPPCMCIA)}, + {PortType,$(NoTitle),$(!REG_VT_DWORD),$(PortType)} + {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IoBaseAddress)} + {InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(InterruptNumber)} + {DLL_Caption,$(NoTitle),$(!REG_VT_SZ),$(DLL_Caption)} + {DLL_Network,$(NoTitle),$(!REG_VT_SZ),$(DLL_Network)} + {VendorDescription,$(NoTitle),$(!REG_VT_SZ),$(VendorDescription)} + ;;; {DriverVariant,$(NoTitle),$(!REG_VT_DWORD),$(DriverVariant)} + {DriverMajor,$(NoTitle),$(!REG_VT_DWORD),$(DriverMajor)} + {DriverMinor,$(NoTitle),$(!REG_VT_DWORD),$(DriverMinor)} + ;;; } EndIf Shell $(UtilityInf), AddValueList, $(hKeyDeviceParameters), $(NewValueList) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run AddValueList: hKeyDeviceParameters" Goto ShellCodeError EndIf Set RegistryErrorIndex = $($R0) IfStr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output $(SWProductName)": AddValueList: hKeyDeviceParameters ERROR="$(RegistryErrorIndex) Goto fatalRegistry EndIf configureDialog = + Debug-Output $(SWProductName)": WavelanConfigure("$(Option)", "$(ServiceName)")" LoadLibrary "" $(ConfigFileName) hLibrary LibraryProcedure ConfigResult $(hLibrary) WavelanConfigure + $(Option), $(ServiceName) FreeLibrary $(hLibrary) Debug-Output $(SWProductName)": WavelanConfigure Result="$(ConfigResult) Set CommonStatus = $(ConfigResult) IfStr(i) $(CommonStatus) == "STATUS_USERCANCEL" Goto end Else-IfStr(i) $(ConfigResult) != "STATUS_SUCCESSFUL" GoTo fatal EndIf Goto end BindingAdapter = + Set Error = $(SWProductName)": Setup does not support binding." Debug-Output $(Error) Goto fatal RemoveAdapter = + Debug-Output $(SWProductName)": RemoveAdapter" IfStr(i) $(SWProductKeyName) == $(!NTN_RegBase) ;;; ;;; Remove the software component only after all devices are removed. ;;; Debug-Output $(SWProductName)": Calling RemoveSoftwareComponent" Shell $(UtilityInf), RemoveSoftwareComponent, + $(Manufacturer), + $(SWProductName) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run RemoveSoftwareComponent" Goto ShellCodeError EndIf Set RegistryErrorIndex = $($R0) IfStr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output $(SWProductName)": RemoveSoftwareComponent ERROR="$($R0) Goto fatalRegistry EndIf Else ;;; ;;; Remove the specified device ;;; Debug-Output $(SWProductName)": Calling RemoveHardwareComponent" Shell $(UtilityInf), RemoveHardwareComponent, + $(Manufacturer), + $(HWProductName), + $(!NTN_RegBase) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run RemoveHardwareComponent" Goto ShellCodeError EndIf Set RegistryErrorIndex = $($R0) IfStr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output $(SWProductName)": RemoveHardwareComponent ERROR="$($R0) Goto fatalRegistry EndIf EndIf Goto end UpgradeSoftware = + Debug-Output $(SWProductName)": UpgradeSoftware" ;;; ;;; For software upgrade, copy new files to the system directory. ;;; Debug-Output $(SWProductName)": Upgrade Software Component" OpenRegKey $(!REG_H_LOCAL) "" $(SWProductKeyName) $(MAXIMUM_ALLOWED) + hKeySWProduct IfStr $(hKeySWProduct) != $(hKeyNull) GetRegValue $(hKeySWProduct),"MajorVersion", VersionInfo Set MajorVersion = *($(VersionInfo), 4) GetRegValue $(hKeySWProduct),"MinorVersion", VersionInfo Set MinorVersion = *($(VersionInfo), 4) Set NeedUpgrade = FALSE IfInt $(MajorVersion) < $(SWProductVersionMajor) Set NeedUpgrade = TRUE Else-IfInt $(MajorVersion) == $(SWProductVersionMajor) IfInt $(MinorVersion) < $(SWProductVersionMinor) Set NeedUpgrade = TRUE Endif Endif IfStr(i) $(NeedUpgrade) == TRUE Shell $(UtilityInf), GetInfFileNameFromRegistry, $(hKeySWProduct) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run GetInfFileNameFromRegistry" Goto ShellCodeError EndIf Set !UG_Filename = $($R0) IfStr(i) $(!UG_Filename) != "" Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir), "YES" IfInt $($ShellCode) != $(!SHELL_CODE_OK) Set STF_INSTALL_OUTCOME = STATUS_SHELL_FAILED Else-IfStr(i) $($R0) == STATUS_FAILED Set STF_INSTALL_OUTCOME = STATUS_FAILED Else-IfStr(i) $($R0) == STATUS_USERCANCEL Set STF_INSTALL_OUTCOME = STATUS_USERCANCEL Else Set SrcDir = $($R1) Install "Install-Update" Endif IfStr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS Debug-Output $(SWProductName)": Install ERROR="$(STF_INSTALL_OUTCOME) Goto fatal EndIf Else Debug-Output $(SWProductName)": InfFileName is NULL" EndIf SetRegValue $(hKeySWProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(SWProductVersionMajor)} SetRegValue $(hKeySWProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(SWProductVersionMinor)} EndIf ;;; ;;; I found the stuff I was looking for, so I finished now, goto end ! ;;; Goto end Else ;;; ;;; this really means there is a problem ;;; Debug-Output $(SWProductName)": Cannot upgrade -- software was never installed" Goto fatalRegistry EndIf Goto end ;;; abandon = + ForListDo $(OEM_ABANDON_OPTIONS) Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), + $(SWProductName), $($) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run RemoveHardwareComponent" Goto ShellCodeError EndIf Set RegistryErrorIndex = $($R0) IfStr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output $(SWProductName)": RemoveHardwareComponent ERROR="$(RegistryErrorIndex) Goto fatalRegistry EndIf EndForListDo IfStr(i) $(OEM_ABANDON_SOFTWARE) == TRUE Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), + $(SWProductName), FALSE IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run RemoveSoftwareComponent" Goto ShellCodeError EndIf Set RegistryErrorIndex = $($R0) IfStr(i) $(RegistryErrorIndex) != NO_ERROR Debug-Output $(SWProductName)": RemoveSoftwareComponent ERROR="$(RegistryErrorIndex) Goto fatalRegistry EndIf EndIf Goto end warning = + EndWait Shell $(SubRoutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run SetupMessage" Goto ShellCodeError EndIf IfStr(i) $($R1) == "OK" Debug-Output $(SWProductName)": WARNING goto "$(GoToLabel) Goto $(GoToLabel) Else-IfStr(i) $($R1) == "CANCEL" Debug-Output $(SWProductName)": WARNING goto "$(ComeFromLabel) Goto $(ComeFromLabel) Else Debug-Output $(SWProductName)": WARNING goto end" Goto end EndIf nonFatalInfo = + Set CommonStatus = STATUS_USERCANCEL Set Severity = STATUS Goto nonFatalMsg nonFatal = + Set Severity = nonFatal Goto nonFatalMsg nonFatalMsg = + EndWait IfStr(i) $(Error) == "" Set Severity = nonFatal Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL" IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run RegistryErrorString" Goto ShellCodeError EndIf Set Error = $($R0) EndIf Shell $(SubRoutineInf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run SetupMessage" Goto ShellCodeError EndIf IfStr(i) $($R1) == "OK" Debug-Output $(SWProductName)": NONFATAL goto "$(ComeFromLabel) Goto $(ComeFromLabel) Else Debug-Output $(SWProductName)": NONFATAL goto end" Goto end EndIf fatalRegistry = + Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run RegistryErrorString" Goto ShellCodeError EndIf Set Error = $($R0) Goto fatal fatal = + IfStr(i) $(Error) == "" Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL" IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run RegistryErrorString" Goto ShellCodeError EndIf Set Error = $($R0) EndIf Shell $(SubRoutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error) IfInt $($ShellCode) != $(!SHELL_CODE_OK) Debug-Output $(SWProductName)": Cannot run SetupMessage" Goto ShellCodeError EndIf Goto SetFailed ShellCodeError = + Set DlgType = "MessageBox" Set STF_MB_TITLE = "Error: "$(FunctionTitle) 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 SetFailed SetFailed = + Set CommonStatus = STATUS_FAILED IfStr(i) $(OEM_ABANDON_HARDWARE) == TRUE Set OEM_ABANDON_HARDWARE = FALSE Goto abandon EndIf Goto end end = + ;;; ;;; All done, close all open handles and return to setup program ;;; IfStr $(hKeySWProduct) != $(hKeyNull) CloseRegKey $(hKeySWProduct) EndIf IfStr $(hKeyDevice) != $(hKeyNull) CloseRegKey $(hKeyDevice) EndIf IfStr $(hKeyDeviceParameters) != $(hKeyNull) CloseRegKey $(hKeyDeviceParameters) EndIf IfStr $(hKeyNetCard) != $(hKeyNull) CloseRegKey $(hKeyNetCard) EndIf IfStr $(hKeyNetCardRules) != $(hKeyNull) CloseRegKey $(hKeyNetCardRules) EndIf IfStr $(hKeySWProduct) != $(hKeyNull) CloseRegKey $(hKeySWProduct) EndIf IfStr $(hKeySWNetRules) != $(hKeyNull) CloseRegKey $(hKeySWNetRules) EndIf IfStr $(hKeySWService) != $(hKeyNull) CloseRegKey $(hKeySWService) EndIf IfStr $(hKeySWParameter) != $(hKeyNull) CloseRegKey $(hKeySWParameter) EndIf IfStr $(hKeySWLinkage) != $(hKeyNull) CloseRegKey $(hKeySWLinkage) EndIf IfStr $(hKeyPcmciaDatabase) != $(hKeyNull) CloseRegKey $(hKeyPcmciaDatabase) EndIf IfStr $(hKeyPcmciaManufacturer) != $(hKeyNull) CloseRegKey $(hKeyPcmciaManufacturer) EndIf IfStr $(hKeyPcmciaProduct) != $(hKeyNull) CloseRegKey $(hKeyPcmciaProduct) EndIf IfStr $(hKeyService) != $(hKeyNull) CloseRegKey $(hKeyService) EndIf Set !DebugOutputControl = $(SaveDebugOutputControl) EndWait Return $(CommonStatus) [Install-Software] ; If this is an initial network install, DoCopy will be set to NO. ; So we must ignore this directive and copy our DLL to the system ; disk so we can run our configuration DLL. Debug-Output $(SWProductName)": Install-Software" Set STF_VITAL = "" Set STF_OVERWRITE = "VERIFYSOURCEOLDER" AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH) AddSectionFilesToCopyList Files-Driver $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers Set !STF_NCPA_FLUSH_COPYLIST = TRUE CopyFilesInCopyList Exit [Install-Update] Debug-Output $(SWProductName)": Install-Update" Set STF_VITAL = "" Set STF_OVERWRITE = "VERIFYSOURCEOLDER" AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH) AddSectionFilesToCopyList Files-Driver $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH) Set !STF_NCPA_FLUSH_COPYLIST = TRUE CopyFilesInCopyList Exit [Date] Now = {} ? $(!LIBHANDLE) GetSystemDate [Source Media Descriptions] 1 = "Avaya Wireless Setup Disk" [Files-Inf] 1, OEMSETUP.INF, SIZE=99999, RENAME=$(!UG_Filename) [Files-Dll] 1, $(ConfigFileName), SIZE=199999 OVERWRITE=ALWAYS 1, $(HelpFileName), SIZE=99999 OVERWRITE=ALWAYS 1, $(HelpCntName), SIZE=99999 OVERWRITE=ALWAYS 1, Wcava52.exe, SIZE=99999 OVERWRITE=ALWAYS [Files-Driver] 1, $(DriverFileName), SIZE=99999 OVERWRITE=ALWAYS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Define the environment supported by this installer ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [ProductType] STF_PRODUCT = winNT STF_PLATFORM = i386 [LanguagesSupported] ENG [PlatformsSupported] ISA EISA PCI PCMCIA "Jazz-Internal Bus" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Define commonly used constants, values, and strings ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [GeneralConstants] MAXIMUM_ALLOWED = 33554432 NoTitle = 0 ExitCodeOk = 0 ExitCodeCancel = 1 ExitCodeFatal = 2 RegistryErrorIndex = NO_ERROR DriverPath = $(!STF_NTPATH)\drivers hKeyNull = "" hKeySWProduct = $(hKeyNull) hKeyDevice = $(hKeyNull) hKeyDeviceParameters = $(hKeyNull) hKeyNetCard = $(hKeyNull) hKeyNetCardRules = $(hKeyNull) hKeySWProduct = $(hKeyNull) hKeySWNetRules = $(hKeyNull) hKeySWService = $(hKeyNull) hKeySWParameter = $(hKeyNull) hKeySWLinkage = $(hKeyNull) hKeyPcmciaDatabase = $(hKeyNull) hKeyPcmciaManufacturer = $(hKeyNull) hKeyPcmciaProduct = $(hKeyNull) hKeyService = $(hKeyNull) ServiceName = "" NetCardNumber = -1 OEM_ABANDON_OPTIONS = {} OEM_ABANDON_SOFTWARE = FALSE OEM_ABANDON_HARDWARE = FALSE [FileConstants] UtilityInf = "UTILITY.INF" SubRoutineInf = "SUBROUTN.INF" ParamInf = "NCPARAM.INF" NetEventDLL = "%SystemRoot%\System32\netevent.dll" IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll" [FileConstants-ENG] ProCaption = "Windows NT Setup" ProCancel = "Cancel" ProCancelMsg = "Windows NT Networking is not correctly installed. " + "Are you sure you want to cancel copying files?" ProCancelCap = "Network Setup Message" ProText1 = "Copying:" ProText2 = "To:" [DialogConstants-ENG] Help = "&Help" Exit = "Cancel" OK = "OK" HelpContext = "" Continue = "Continue" Cancel = "Cancel"