;***********************************************************************
;
; OEMSETUP.INF
;
;       Cisco Systems Wireless LAN Adapter Setup for NT 4.0/3.51
;
; History:
;       09/28/97 Initial version written by Ned Nassar
;
;*******************************************************************************
									 
[Identification]
    OptionType = NetAdapter

[PlatformsSupported]
    PCI

[Options]
    PCI504

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[FileConstants]
	UtilityInf      		= "UTILITY.INF"
	ParamInf        		= "NCPARAM.INF"
	subroutineinf   		= "SUBROUTN.INF"
	SoftwareType    		= "driver"
	Exit_Code       		= 0
	NetEventDLL     		= "%SystemRoot%\System32\netevent.dll"
	IoLogMsgDLL     		= "%SystemRoot%\System32\IoLogMsg.dll"
	Manufacturer    		= "Cisco"
	ProductMajorVersion             = "1"
	ProductMinorVersion             = "00"

	ProductVersion                  = $(ProductMajorVersion)"."$(ProductMinorVersion)
	ProductSoftwareName             = "PCX504"
	ProductSoftwareImagePath        = "\SystemRoot\System32\drivers\PCX504.sys"
	NetRuleSoftwareType             = "PCX504Sys ndisDriver PCX504Driver"
	NetRuleSoftwareUse              = $(SoftwareType)
	NetRuleSoftwareBindForm         = """PCX504Sys"" yes no container"
	NetRuleSoftwareClass    	= {"PCX504Driver basic"}
	NetRuleSoftwareBindable 	= {"PCX504Driver PCX504Adapter non exclusive 100"}
	ProductHardwareName     	= "PCX504"
	RadioName					= "PCX504"
	NetRuleHardwareBindForm 	= " yes yes container"
	ProductKeyName  		= $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
	ParamKeyName    		= $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
 ;
	NetRuleHardwareType             = "PCX504 PCX504Adapter"
	NetRuleHardwareClass            = {"PCX504Adapter basic"}
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[GeneralConstants]
	from      			= ""
	to        			= ""
	ExitCodeOk     			= 0
	ExitCodeCancel 			= 1
	ExitCodeFatal  			= 2
	KeyNull         		= ""
	MAXIMUM_ALLOWED 		= 33554432
	RegistryErrorIndex 		= NO_ERROR
	KeyProduct      		= ""
	KeyParameters   		= ""		   
	TRUE            		= 1
	FALSE           		= 0
	NoTitle     			= 0
	ExitState   			= "Active"
	OldVersionExisted 		= $(FALSE)
	DriverPath      		= a:\
	NT350VersionConstant	        = "3.50"
	NT310VersionConstant	        = "3.10"
	NDIS4FOLDER			= NDIS4
	ManufacturerName		= "Cisco Systems"

[PCX504Defaults]
	InfrastructureModeValue       = 1
	NetworkAddressValue           = ""
	NodeNameValue                 = ""
	PSPValue                      = 0
       	SSIDValue1                    = ""
	SuppRatesValue                = 0

[PCX504PMDefaults]
	InstallPMDriver               = 0

 
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[date]
    Now 				= {} ? $(!LIBHANDLE) GetSystemDate

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[Identify]
    read-syms Identification
    set Status     		= STATUS_SUCCESSFUL
    set Identifier 		= $(OptionType)
    set Media      		= #("Source Media Descriptions", 1, 1)
    Return $(Status) $(Identifier) $(Media)

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[ReturnOptions]
    set Status        	= STATUS_FAILED
    set OptionList     	= {}
    set OptionTextList 	= {}
    set LanguageList 	= ^(LanguagesSupported, 1)
;
    Ifcontains(i) $($0) in $(LanguageList)
;
		ifstr(i) $($1) == ""
			goto returnoptions
		endif
;
	set PlatformList 	= ^(PlatformsSupported, 1)
;
		Ifcontains(i) $($1) in $(PlatformList)
			goto returnoptions
		else
			set Status 	= STATUS_NOTSUPPORTED
			goto finish_ReturnOptions
		endif
;
    else
		set Status 		= STATUS_NOLANGUAGE
		goto finish_ReturnOptions
    endif
;------------------------------------------------------------------------------    
returnoptions = +
	Debug-Output "-------------------------returnoptions ------------------------"
    set OptionList     	= ^(Options, 1)
    set OptionTextList 	= ^(OptionsText$($0), 1)
    set Status         	= STATUS_SUCCESSFUL

;------------------------------------------------------------------------------    
finish_ReturnOptions 	= +
	Debug-Output "-------------------------finish_ReturnOptions 	------------------------"
    Return $(Status) $(OptionList) $(OptionTextList)

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[InstallOption]
    set Status   		= STATUS_FAILED
    set Option   		= $($1)
    set SrcDir   		= $($2)
    set AddCopy  		= $($3)
    set DoCopy   		= $($4)
    set DoConfig 		= $($5)
    Set !DebugOutputControl = 1 ;REN REN REN
    set LanguageList 	= ^(LanguagesSupported, 1)
;
    Ifcontains(i) $($0) NOT-IN $(LanguageList)
		Return STATUS_NOLANGUAGE
    endif
;
    set-subst LF 		= "\n"
    read-syms GeneralConstants
	
    Ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
      set NDIS4FOLDER = ""    ;for unattended--no directory structure needed
    endif

    read-syms FileConstants
    read-syms DialogConstants$(!STF_LANGUAGE)
;
    ifstr(i) $(!NTN_Origination) == "NCPA"
		set Continue = $(OK)
    endif
;
    read-syms FileConstants$(!STF_LANGUAGE)
    detect date
    set-title  $(FunctionTitle)
    set to   			= Begin
    set from 			= Begin
    set CommonStatus 	= STATUS_SUCCESSFUL
	set PCMCIA			= 0
	set PCI				= 0
	set PNPISA			= 0
	
	set DialogDllName	= "pcx500.dll"
	
	Ifstr(i) $($1) == "PCI504"	;===================================================
		set	CFID								= 42244        ;; 0xA504
;		set	CFID								= 20480        ;; 0x5000
		set Vendor								= 5305			;; 14B9 i;;---------
		set ProductHardwarePCI504Title			= "Cisco Systems mini-PCI Wireless LAN Adapter"
		set ProductHardwarePCI504Description	= "Cisco Systems mini-PCI Wireless LAN Adapter" 
		set NetRuleHardwarePCI504Type			= "PCX504 PCX504Adapter"
		set NetRuleHardwarePCI504Class			= {"PCX504Adapter basic"}
		set AdapterPCI504Type					= 5             ;; PCI board
		set CardOption							= "PCI4800"
		set DLLBUSTYPE							= 5
		set PCI									= 1
		set BusInterfaceType					= 5
	    set CardType							= 3
	    set FormFactorValue						= "PCI"
    endif
	;
  EndWait
;------------------------------------------------------------------------------    
Begin = +
	Debug-Output "-------------------------Begin ------------------------"
    Set ActivateDetection = FALSE
    OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Windows Nt\CurrentVersion" $(!REG_KEY_READ) KeyNt
    Ifstr(i) $(KeyNt) != ""
		GetRegValue $(KeyNt) "CurrentVersion" CurrentVersionValue
		Debug-Output "$(InfFile) $(Option): WinNT CurrentVersion ="$(CurrentVersionValue)
	    CloseRegKey $(KeyNt)
    Endif
    
    ifstr(i) (*($(CurrentVersionValue),4)) == $(NT310VersionConstant)    ;; NT v3.10 not supported!
        Debug-Output "$(InfFile) $(Option): Configureadapter"
		set Error = "Windows NT v3.10 is not support by this product"
    goto fatal
    endif
;
    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 CommonStatus = STATUS_REBOOT
		; set ActivateDetection = TRUE
		set StartLabel 	= configureadapter
;		
		Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
		    Debug-Output "Cannot configure the PCX504 driver software."
	    	Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
;
		    ifint $($ShellCode) != $(!SHELL_CODE_OK)
				Debug-Output "ShellCode error: cannot get an error string."
				goto ShellCodeError
	    	endif
;	    	
		    set Error	= $($R0)
		    set from 	= end
	    	set to 		= end
	   	 	goto nonfatalinfo
		endif
   	else		; set ActivateDetection = TRUE
		set StartLabel 	= installadapter
		set OEM_ABANDON_OPTIONS = {}
		set OEM_ABANDON_SOFTWARE = FALSE
		set OEM_ABANDON_ON = TRUE
    endif
;    	
	Debug-Output "PCX504.INF: =================================================="
    Debug-Output "PCX504.INF: STF_CWDIR is: "$(!STF_CWDIR)
    Debug-Output "PCX504.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
    Debug-Output "PCX504.INF: Option is: "$(Option)
    Debug-Output "PCX504.INF: !STF_NCDETECT  is: "$(!STF_NCDETECT)
    Debug-Output "PCX504.INF: !STF_NCOPTION  is: "$(!STF_NCOPTION)
    Debug-Output "PCX504.INF: !STF_NCDETCARD is: "$(!STF_NCDETCARD)
    Debug-Output "PCX504.INF: !STF_NCDETINFO is: "$(!STF_NCDETINFO)
    Debug-Output "PCX504.INF: =================================================="
    ; set the default values
;
;

    set ATTRIBMEMSIZE				= 0x0400
    set COMNMEMSIZE					= 0x0000

		 
    Shell "" DebugConfiguration "After parameter default setting"
    Set from 			= $(fatal)
    Set to 				= $(fatal)
    Goto $(StartLabel)
    
;------------------------------------------------------------------------------    
installadapter = +
	Debug-Output "-------------------------installadapter ------------------------"
    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
    Ifstr $(KeyProduct) != $(KeyNull)
	CloseRegKey $(KeyProduct)
	ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
	   Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
	       $(ProductVersion)
	   ifint $($ShellCode) != $(!SHELL_CODE_OK)
	       Debug-Output "ShellCode error: cannot get an error string."
	       goto ShellCodeError
	   endif
	   goto end
	else    ; Adding a new adapter is no problem, so don't bug the user
	   ; Shell $(UtilityInf), CardExistedDlg
	   ; ifint $($ShellCode) != $(!SHELL_CODE_OK)
	   ;     Debug-Output "ShellCode error: cannot get an error string."
	   ;     goto ShellCodeError
	   ; endif
	   ; ifstr(i) $($R1) != "OK"
	   ;     set CommonStatus = STATUS_USERCANCEL
	   ;     goto end
	   ; endif
	   set OldVersionExisted = $(TRUE)
	endif
    endif

    Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
;
    Ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Goto ShellCodeError
;
    Else-Ifstr(i) $($R0) == STATUS_FAILED
		Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
		endif
		set Error = $($R0)
		Goto fatal
;
    Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
		Goto successful
    Endif
;
    Set SrcDir = $($R1)
    install "Install-Dll"

	      
    Ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
      shell $(!STF_WINDOWSPATH)\inf\cadvals.inf SectionPCI504PM
      ifint $($ShellCode) == $(!SHELL_CODE_OK)
        set InstallPMDriver       = $($R0)
      else
        read-syms PCX504PMDefaults
      endif
    else
        read-syms PCX504PMDefaults
    endif  
    
    ifint $(InstallPMDriver) == $(TRUE)
      install "Install-PmDriver"

      OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\ciscotp" $(MAXIMUM_ALLOWED) CiscoTpKey
      ifstr $(CiscoTpKey) != $(NULL) ; open succeeded, so delete it
       	CloseRegKey $(CiscoTpKey)
	DeleteRegTree $(!REG_H_LOCAL) "SYSTEM\CurrentControlSet\Services\ciscotp"
      endif
      CreateRegKey $(!REG_H_LOCAL) {"SYSTEM\CurrentControlSet\Services\ciscotp", 0, GenericClass} "" $(!REG_KEY_SET_VALUE) "" CiscoTpKey
      SetRegValue $(CiscoTpKey) {ErrorControl, 0, $(!REG_VT_DWORD), 1}
      SetRegValue $(CiscoTpKey) {Group, 0, $(!REG_VT_SZ), "Extended Base"}
      SetRegValue $(CiscoTpKey) {Start, 0, $(!REG_VT_DWORD), 2}
      SetRegValue $(CiscoTpKey) {Type, 0, $(!REG_VT_DWORD), 1}
      CloseRegKey $(CiscoTpKey)
      
    endif
    

    goto adaptersetup

;------------------------------------------------------------------------------    
configureadapter = +
	Debug-Output "-------------------------configureadapter ------------------------"

    Ifstr $(KeyProduct) == $(KeyNull)
		OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
;
		Ifstr $(KeyProduct) == $(KeyNull)
	    	set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
	    	Debug-Output "Cannot find component product key"
	    	goto fatalregistry
		Endif
;		
    Endif
;
    Debug-Output "INF: Shelling to FindService"
    Shell $(UtilityInf) FindService, $(KeyProduct)
;
    Ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "PCX504.INF: FindService shell failure"
		Goto ShellCodeError
    Endif
;
    Ifstr(i) $($R0) != NO_ERROR
		Debug-Output "PCX504.INF: FindService Shell error: "$($R0)
		Goto fatalregistry
    endif
;
    Set KeyParameters = $($R2)
    CloseRegKey $($R1)
;
    Ifstr $(KeyParameters) == $(KeyNull)
		set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
		Debug-Output "Cannot find component service"
		goto fatalregistry
    endif
    set OldVersionExisted = $(TRUE)
;
;------------------------------------------------------------------------------    
adaptersetup = +
	Debug-Output "-------------------------adaptersetup ------------------------"
    Shell "" DebugConfiguration "before displaying dialog"
    Set from = adapteroptions

adapteroptions = +
	Debug-Output "-------------------------adapteroptions ------------------------"
 
;; raf   
	    Ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
	      set Result                        = "CONTINUE"
	      shell $(!STF_WINDOWSPATH)\inf\cadvals.inf SectionPCI504
		  ifint $($ShellCode) == $(!SHELL_CODE_OK)
		    
		    set InfrastructureModeValue       = $($R0)
		    set NetworkAddressValue           = $($R3)
		    set NodeNameValue                 = $($R4)
		    set PSPValue                      = $($R5)
       	            set SSIDValue1                    = $($R6)
		    set SuppRatesValue                = $($R7)
	
		    goto foundINF
		  else
		    read-syms PCX504Defaults
		    goto foundINF  
		  endif
	    endif  
    
    LoadLibrary "" $(!STF_WINDOWSSYSPATH)\$(DialogDllName) hLib
    read-syms FileDependentDlg$(!STF_LANGUAGE)

	;;;------------------------------------------new
	Ifstr(i) $(StartLabel) == configureadapter
		
		Debug-Output "adaptersetup:configureadapter"

	    set OldVersionExisted = $(TRUE)
		set ValueName = ""
		set ValueData = ""
		set ValueStr  = ""
	    set ValueList = {}
		EnumRegValue $(KeyParameters) ValueList
;
		ForListDo $(ValueList)
			set ValueItem = $($)
			set ValueName = *($(ValueItem),1)
			set ValueData = *($(ValueItem),4)
		
			ifstr(i) $(ValueName) == "SoftexPcmcia"
				set SoftexPcmcia = $(ValueData)
			endif
						
			ifstr(i) $(ValueName) == "FormFactor"

			     ;   ifstr(i) $(ValueData) == "ISA"								
			     ;   	set CardOption = "ISA4800"
			     ;   else-ifstr(i) $(ValueData) == "PCI"								
	    		     ;   set CardOption = "PCI4800"
			     ;   else
	    		     ;   set CardOption = "PCMCIA4800"
			     ;  endif
				
			     set CardOption = "PCI4800"
				
			     LibraryProcedure Result $(hLib) SetCardOption $(CardOption)
			endif
		EndForListDo
		
		ForListDo $(ValueList)
			set ValueItem = $($)
			set ValueName = *($(ValueItem),1)
			set ValueData = *($(ValueItem),4)
		
			ifstr(i) $(ValueName) == "BusType"
	    		set BusInterfaceType = $(ValueData)
			endif

			ifstr(i) $(ValueName) == "NetworkAddress"
				set NetworkAddressValue = $(ValueData)
			endif
						
			Debug-Output "SetValue---> "$(ValueName)" = "$(ValueData)
			LibraryProcedure Result $(hLib) SetValue $(ValueName) $(ValueData)

		EndForListDo
	    
	 	  LibraryProcedure Result $(hLib) AdapterReconfig $(CardOption)
	else
		  LibraryProcedure Result $(hLib) AdapterSetup $(CardOption)
	Endif

  	ifint $(PCI) != 1
		LibraryProcedure IoBaseAddressValue		$(hLib) GetValue IoBaseAddress
		LibraryProcedure IRQValue				$(hLib) GetValue InterruptNumber
	endif
	;	
	LibraryProcedure InfrastructureModeValue	$(hLib) GetValue InfrastructureMode
	LibraryProcedure PSPValue	       			$(hLib) GetValue PowerSaveMode		
	LibraryProcedure SuppRatesValue	       		$(hLib) GetValue SupportedRates,	
	LibraryProcedure SSIDValue1					$(hLib) GetValue SSID1				
	;;LibraryProcedure NetworkAddressValue		$(hLib) GetValue NetworkAddress
	LibraryProcedure NodeNameValue				$(hLib) GetValue NodeName
	;
	Debug-Output "PcmciaDriverValue"
	LibraryProcedure PcmciaDriverValue			$(hLib) IsSoftexPcmcia 			
;;;-------------------------------------------end of new

	FreeLibrary $(hLib)
;

foundINF = +

   ifstr(i) $(Result) == "CONTINUE"

		Debug-Output "CONTINUE"
 
   else-ifstr(i) $(Result) == "EXIT"
		set CommonStatus = STATUS_USERCANCEL
		goto end

   else
		goto end
   endif
   	
	ifint $(PCMCIA) == 0
	    ifint $(OldVersionExisted) == $(TRUE)
			ifstr(i) $(!NTN_InstallMode) == configure
			    goto writeparameters
			endif
		endif
		goto installnonpcmcia
	endif
;
;------------------------------------------------------------------------------    
skipoptions =+
	Debug-Output "-------------------------skipoptions ------------------------"
    ifint $(OldVersionExisted) == $(TRUE)
;
		ifstr(i) $(!NTN_InstallMode) == configure
		    goto writeparameters
		endif
;
    endif
;    
    StartWait
;
    ifint $(OldVersionExisted) == $(FALSE)
;
		ifstr(i) $(!NTN_InstallMode) == "install"
;
			Ifstr(i) $(DoCopy) == "YES"
	      		Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
	      		Ifint $($ShellCode) != $(!SHELL_CODE_OK)
		  			Goto ShellCodeError
;		  			
			   	Else-Ifstr(i) $($R0) == STATUS_FAILED
		  			Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
;
		  			ifint $($ShellCode) != $(!SHELL_CODE_OK)
		      			goto ShellCodeError
			  		endif
;		  		
			  		set Error = $($R0)
			  		Goto fatal
;		  		
			    Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
			  		Goto successful
	    	  	Endif
;	      	
		    	Set SrcDir = $($R1)
	   		Endif
	   		install "Install-Option"
;	   	
	   		ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
	      		Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
;
	      		ifint $($ShellCode) != $(!SHELL_CODE_OK)
				 	goto ShellCodeError
	    		endif
;
		      	set Error = $($R0)
			   	goto fatal
	   		endif
		endif
;
		Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
		$(ProductSoftwareName), +
		$(ProductSoftwareName), +
		$(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
		$(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
		$(NetEventDLL)
		Set OEM_ABANDON_SOFTWARE = TRUE
;	
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    	Debug-Output "ShellCode error"
	    	goto ShellCodeError
		endif
;
		set RegistryErrorIndex = $($R0)
		set KeyProduct      = $($R1)
		Set SoftNetRulesKey = $($R2)
		CloseRegKey $($R3)
		CloseRegKey $($R4)
		CloseRegKey $($R5)
;
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    	EndWait
	    	Debug-Output "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"
	    	Debug-Output "Registry error: add software components"
	    	CloseRegKey $(KeyProduct)
	    	CloseRegKey $(SoftNetRulesKey)
	    	goto fatalregistry
		endif
;
		set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
			   {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
			   {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
			   {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
			   {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
			   {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
			   {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
		Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
;
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    	Debug-Output "ShellCode error."
	    	goto ShellCodeError
		endif
;
		set RegistryErrorIndex = $($R0)
;
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    	EndWait
	    	Debug-Output "Registry error: add value list."
	    	CloseRegKey $(KeyProduct)
	    	CloseRegKey $(SoftNetRulesKey)
	    	goto fatalregistry
		endif
		set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
			    {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
			    {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
			    {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
			    {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
			    {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
		Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
;
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    	Debug-Output "ShellCode error."
	    	goto ShellCodeError
		endif
;
		set RegistryErrorIndex = $($R0)
		CloseRegKey $(KeyProduct)
		CloseRegKey $(SoftNetRulesKey)
;
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    	EndWait
	    	Debug-Output "Resgitry error: add value list."
	    	goto fatalregistry
		endif
;
    endif
;
    Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
    ifint $($R4) != -1
		Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
    endif
;
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "Cannot add hardware component"
		goto ShellCodeError
    endif
;
    set RegistryErrorIndex = $($R0)
;
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
		EndWait
		Debug-Output "Registry error: add hardware component"
		CloseRegKey $($R1)
		CloseRegKey $($R2)
		CloseRegKey $($R3)
		goto fatalregistry
    endif
;
    set KeyParameters = $($R3)
    set KeyAdapterRules = $($R2)
    set AdapterNumber = $($R4)
    set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
		       {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
		       {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
		       {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
		       {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
		       {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
    Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
;
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "ShellCode error"
		goto ShellCodeError
   	endif
;
    CloseRegKey $($R1)
    set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
    set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
    set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
			{bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
			{class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
			{InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
    Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
;
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "ShellCode error."
		goto ShellCodeError
    endif
;
    set RegistryErrorIndex = $($R0)
;
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
		EndWait
		Debug-Output "Resgitry error: add value list."
		CloseRegKey $(KeyParameters)
		CloseRegKey $(KeyAdapterRules)
		goto fatalregistry
    endif
;
    CloseRegKey $(KeyAdapterRules)
	goto writeparameters


;-------------------------------------------------------------------------------
;    Set MemSizeValue = 8192
;    Set MemOffsetValue = 0
;    Set	AttributeMemSize = 128
;    Set AttributeMemAddress = 851968 
;    Set AttributeMemOffset = 0 
writeparameters = +
	Debug-Output "-------------------------writeparameters ------------------------"
;wtf    set CardType = 3
    Set NewValueList = {+
   		       	{BusType,			$(NoTitle),$(!REG_VT_DWORD),	$(BusInterfaceType)},+ 
		       	{CardType,			$(NoTitle),$(!REG_VT_DWORD),	$(CardType)},+
				{FormFactor,		$(NoTitle),$(!REG_VT_SZ),		$(FormFactorValue)},+
		       	{IoBaseAddress,		$(NoTitle),$(!REG_VT_DWORD),	$(IoBaseAddressValue)},+
		       	{InterruptNumber,	$(NoTitle),$(!REG_VT_DWORD),	$(IRQValue)},+
		       	{InfrastructureMode,$(NoTitle),$(!REG_VT_DWORD),	$(InfrastructureModeValue)},+
		       	{PowerSaveMode,		$(NoTitle),$(!REG_VT_DWORD),	$(PSPValue)},+
		       	{SupportedRates,	$(NoTitle),$(!REG_VT_DWORD),	$(SuppRatesValue)},+
				{SSID1,				$(NoTitle),$(!REG_VT_SZ),		$(SSIDValue1)},+
				{RadioName,	  		$(NoTitle),$(!REG_VT_SZ),		$(RadioName)},+
				{NetworkAddress,	$(NoTitle),$(!REG_VT_SZ),		$(NetworkAddressValue)},+
				{NodeName,			$(NoTitle),$(!REG_VT_SZ),		$(NodeNameValue)}}

    Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
	endif

	set RegistryErrorIndex = $($R0)
	Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
		goto fatalregistry
	endif

	ifint $(PCMCIA) == 0
		goto successful
	endif

	;;ifint $(SoftexPcmcia) == 1
	;;	Set NewValueList = {+
	;;		{SoftexPcmcia,					$(NoTitle),$(!REG_VT_DWORD),	$(PCMCIA)}}
	;;else
	;;	Set NewValueList = {+
	;;		{Pcmcia,						$(NoTitle),$(!REG_VT_DWORD),	$(PCMCIA)}}
	;;endif
	;;;;Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)

;----------------------
	Set NewValueList = {+
			{$(PcmciaDriverValue),			$(NoTitle),$(!REG_VT_DWORD),	$(PCMCIA)}}
	Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
;----------------------

	;;Set NewValueList = {+
	;;		{SoftexPcmcia,					$(NoTitle),$(!REG_VT_DWORD),	$(PCMCIA)}}
	;;Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)

;++++++++++++++++++++++
	Set NewValueList =  {+
		{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
		}
	Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
	endif
;++++++++++++++++++++++

	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
	endif

	set RegistryErrorIndex = $($R0)
	Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
		goto fatalregistry
	endif
;
    set PCMCIADatabaseKeyName = $(!NTN_ServiceBase)"\Pcmcia\DataBase"
	Debug-Output "Opening PCMICA database key "$(PCMCIADatabaseKeyName)
    OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseKeyName) $(MAXIMUM_ALLOWED) PCMCIADatabaseKey
;
	ifstr $(PCMCIADatabaseKey) == $(NULL)    
		Debug-Output "Pcmcia\DataBase not present"
	else ; PCMCIA.sys is installed and registry has database section in it.
		; Try to open Aironet section.  Delete it if found
		;;OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseKeyName)"\Aironet" $(MAXIMUM_ALLOWED) PCMCIADatabaseAironetKey
		OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseKeyName)\$(ManufacturerName) $(MAXIMUM_ALLOWED) PCMCIADatabaseAironetKey
		ifstr $(PCMCIADatabaseAironetKey) != $(NULL) ; 
			;-----------------------------------------------------------------------------------------------
			;;OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseAironetKey)"\PCX504" $(MAXIMUM_ALLOWED) PCMCIADatabaseAironetPCX504Key
			OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseAironetKey)\$(CISProductName) $(MAXIMUM_ALLOWED) PCMCIADatabaseAironetPCX504Key
			ifstr $(PCMCIADatabaseAironetPCX504Key) != $(NULL) ; open succeeded, so delete it
				CloseRegKey $(PCMCIADatabaseAironetPCX504Key)
				;;DeleteRegTree $(PCMCIADatabaseAironetKey) "PCX504"   ; bye bye!
				DeleteRegTree $(PCMCIADatabaseAironetKey) $(CISProductName)   ; bye bye!
			endif	
			;;CreateRegKey $(PCMCIADatabaseAironetKey) {"PCX504", 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseAironetPCX504Key
			CreateRegKey $(PCMCIADatabaseAironetKey) {$(CISProductName), 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseAironetPCX504Key
				SetRegValue $(PCMCIADatabaseAironetPCX504Key) {DeviceType, 0, $(!REG_VT_SZ),"NET"}
				SetRegValue $(PCMCIADatabaseAironetPCX504Key) {Driver, 0, $(!REG_VT_SZ),"PCX504"}
			CloseRegKey $(PCMCIADatabaseAironetPCX504Key)
			;-----------------------------------------------------------------------------------------------
			CloseRegKey $(PCMCIADatabaseAironetKey)
		;endif
	else
		;;CreateRegKey $(PCMCIADatabaseKey) {"Aironet", 0, 0} "" $(MAXIMUM_ALLOWED) "" PCMCIADatabaseAironetKey
		CreateRegKey $(PCMCIADatabaseKey) { $(ManufacturerName), 0, 0} "" $(MAXIMUM_ALLOWED) "" PCMCIADatabaseAironetKey
			;;CreateRegKey $(PCMCIADatabaseAironetKey) {"PCX504", 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseAironetPCX504Key
			CreateRegKey $(PCMCIADatabaseAironetKey) {$(CISProductName), 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseAironetPCX504Key
				SetRegValue $(PCMCIADatabaseAironetPCX504Key) {DeviceType, 0, $(!REG_VT_SZ),"NET"}
				SetRegValue $(PCMCIADatabaseAironetPCX504Key) {Driver, 0, $(!REG_VT_SZ),"PCX504"}
			CloseRegKey $(PCMCIADatabaseAironetPCX504Key)
	    CloseRegKey $(PCMCIADatabaseAironetKey)
	endif
	CloseRegKey $(PCMCIADatabaseKey)
;
;
;;;raf	
;	ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
;		Shell $(UtilityInf),AddDefaultNetCardParameters,$(KeyParameters)
;    endif

;
    CloseRegKey $(KeyParameters)
;
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "ShellCode error."
		goto ShellCodeError
    endif
;
    set RegistryErrorIndex = $($R0)
;
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
		Debug-Output "Registry error: Add value list"
		goto fatalregistry
    endif
;
    EndWait
	goto successful
;-------------------------------------------------------------------------------
;;installproduct =+
installnonpcmcia = +
	Debug-Output "-------------------------installnonpcmcia ------------------------"
	Debug-Output "$(InfFile) $(Option): installproduct"
    StartWait 
    set AdapterList = $($R1)
    ifint $(OldVersionExisted) == $(FALSE)
        Ifstr(i) $(DoCopy) == "YES"
            Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                Goto ShellCodeError
            Else-Ifstr(i) $($R0) == STATUS_FAILED
                Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
                ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    goto ShellCodeError
                endif
                set Error = $($R0)
                Goto fatal
            Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
                Goto successful
            Endif
            Set SrcDir = $($R1)
        Endif
        install "Install-Option"
        ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
            Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif
            set Error = $($R0)
            goto fatal
        endif
    endif

    ;
    ; Check to see if the Product Software key exists already in the system service keys
    ; before we try to add the software component.
    ; 
    OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductHardwareName) $(!REG_KEY_READ) KeyNt
    CloseRegKey $(KeyNt)

    Ifstr(i) $(KeyNt) == ""
        
		Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
        $(ProductSoftwareName), +
        $(ProductSoftwareName), +
        $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
        $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
        $(NetEventDLL)
        
        Set OEM_ABANDON_SOFTWARE = TRUE
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
            EndWait
            CloseRegKey $($R1)
            CloseRegKey $($R2)
            CloseRegKey $($R3)
            CloseRegKey $($R4)
            CloseRegKey $($R5)
            goto fatalregistry
        endif
        Set SoftProductKey      = $($R1)
        Set SoftNetRuleKey      = $($R2)
        Set SoftServiceKey      = $($R3)
        Set SoftParameterKey    = $($R4)
        Set SoftLinkageKey      = $($R5)
        set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
               {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
               {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
               {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
               {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
               {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
               {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
        Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
            EndWait
            CloseRegKey $(SoftProductKey)
            CloseRegKey $(SoftNetRuleKey)
            CloseRegKey $(SoftServiceKey)
            CloseRegKey $(SoftParameterKey)
            CloseRegKey $(SoftLinkageKey)
            goto fatalregistry
        endif
        set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
                {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
                {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
                {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
                {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
                {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
        Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
            goto ShellCodeError
        endif
        set RegistryErrorIndex = $($R0)
        CloseRegKey $(SoftProductKey)
        CloseRegKey $(SoftNetRuleKey)
        CloseRegKey $(SoftServiceKey)
        CloseRegKey $(SoftParameterKey)
        CloseRegKey $(SoftLinkageKey)
        Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
            EndWait
            goto fatalregistry
        endif
    endif ;;	Does Services\PCX504 exist?
    
    ;;***************************************************************************************************
    ;; If we are eisa, then use the EISA Enum routines to figure out how many boards we have in 
    ;; the system.
    ;;
    ;; If we are PCI and we are v3.51 and above, we can use the PCI dection routines to figure
    ;; out where all the boards are (hopefully including different buses) and generate the correct 
    ;; reg. entries.
    ;;
    ;;***************************************************************************************************
    ;;
    ;; Are we installing an ISA , PCI or PCMCIA
    ;;
	set NTDetected = $(FALSE)
	ifint $(ISA) == 1
		;;ISA_BEGIN..........................................................................
		Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(DetectedBusNum), +
        $(DetectedSlotNum), $(ProductHardware$(Option)Description), $(ProductHardwareName)
            
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
			goto ShellCodeError
        endif
        ifstr $($R0) != "NO_ERROR"
			set Error = $($R0)
            goto fatal
        endif
        ifstr(i) $($R1) == "YES"
			set InstallCard = "NO"  ;; Don't want to re-install, it's there already
		endif    
        ifstr(i) $(InstallCard) == "NO"
            Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
			goto copyInstallationFiles
		endif
		;------------------------------------------------------------------------
		Debug-Output "$(InfFile) $(Option): Installing Card at $(DetectedBusNum):$(DetectedSlotNum)!"
		Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
        ifint $($R4) != -1
			Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
		endif
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
			goto ShellCodeError
        endif
        set RegistryErrorIndex = $($R0)
        Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
			EndWait
            CloseRegKey $($R1)
            CloseRegKey $($R2)
            CloseRegKey $($R3)
            goto fatalregistry
		endif
        Set HardNetCardKey      = $($R1)
        Set HardNetRuleKey      = $($R2)
        ;Set HardParameterKey    = $($R3)
		Set	KeyParameters		= $($R3)
        set AdapterNumber = $($R4)
        set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
			{Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
            {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
		Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
			goto ShellCodeError
		endif
        ;
		;
		Set NewValueList =  {+
			{BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusInterfaceType)},+
            {CardType,$(NoTitle),$(!REG_VT_DWORD),$(CardType)},+
            {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
            }

		Debug-Output "$(InfFile) $(Option): Set HardwareParameterKey = $(NewValueList)"
        ;;Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
        Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
			goto ShellCodeError
		endif

        set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
        set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
        set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardware$(Option)Type)},+
			{bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
            {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardware$(Option)Class)}, +
            {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
		
		Debug-Output "$(InfFile) $(Option): HardwareRuleKey = $(NewValueList)"
        Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
        ifint $($ShellCode) != $(!SHELL_CODE_OK)
			goto ShellCodeError
		endif

        CloseRegKey $(HardNetCardKey)
		CloseRegKey $(HardNetRuleKey)
		goto copyInstallationFiles
		;;ISA_END..........................................................................
	else-ifint $(PCI) == 1
        ;;
        ;; No, Then we must be installing a PCI card.
        ;; 
        ;; Note: If we are are on WinNT v3.51 and above, we have PCI detection support 
        ;; and are able to setup the adapter without user intervention. Otherwise, we can 
        ;; only do one card at a time.
        ;;
        set TargetVersion = *($(CurrentVersionValue),4)
        Debug-Output "$(InfFile) $(Option): Current Version:"$(TargetVersion)

        ifstr $(TargetVersion) == $(NT350VersionConstant)   ;; We need to ask on v3.50
            Debug-Output "Running on WindowsNT 3.50"
            set Version350 = $(TRUE)
        else
            Debug-Output "Running on WindowsNT 3.51"
            set Version350 = $(FALSE)
        endif

        ifint $(Version350) == $(TRUE)
	        Debug-Output "Running on WindowsNT v3.50, Not using PCI Detection!!!"
            
	    ifstr $(!STF_GUI_UNATTENDED) == "YES"
                Debug-Output "$(InfFile) $(Option): Running in GUI unattended mode"
                ifstr(i) $(!AutoNetInterfaceType) != ""
                    set BusInterfaceType = $(!AutoNetInterfaceType)
                else
                    set BusInterfaceType = 5
                endif
                ifstr(i) $(!AutoNetBusNumber) != ""
                    set BusNumber = $(!AutoNetBusNumber)
                else
                    set BusNumber = 0
                endif
                set NTDetected = $(FALSE)
                set AdapterList = $(Option)   ;; 1 Item to install
                Debug-Output "$(InfFile) $(Option): BusInterfaceType = $(BusInterfaceType)"
                Debug-Output "$(InfFile) $(Option): BusNumber = $(BusNumber)"
            else        
                Debug-Output "$(InfFile) $(Option): Running 3.50 Bus Dialog"
                set BusInterfaceType = 5
                set BusNumber = 0
                set NTDetected = $(FALSE)
                Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardware$(Option)Description) $(BusInterfaceType) $(BusNumber)
                ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    Debug-Output "ShellCode error."
                    goto ShellCodeError
                endif
                set BusInterfaceType = $($R1)
                set BusNumber = $($R2)
                set AdapterList = $(Option)   ;; 1 Item to install
                Debug-Output "$(InfFile) $(Option): BusInterfaceType = $(BusInterfaceType)"
                Debug-Output "$(InfFile) $(Option): BusNumber = $(BusNumber)"
            endif    
        else
            Debug-Output "$(InfFile) $(Option): Running 3.51 using PCI Dectection"
            ;;
            ;; v3.51 has PCI detection code built in.
            ;;
            ;;set BusInterfaceType = 5
            ;;set BusNumber = 0
            ;; Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardware$(Option)Description) $(BusInterfaceType) $(BusNumber)
            
            set NTDetected = $(TRUE)
            Debug-Output "$(InfFile) $(Option): VendorID = $(Vendor)"
            Debug-Output "$(InfFile) $(Option): CFID = $(CFID)"
            Shell $(UtilityInf), GetPCIInformation, $(Vendor) $(CFID)

 
			ifint $($ShellCode) != $(!SHELL_CODE_OK)
                            goto ShellCodeError
			endif
			
			Debug-Output "DetectedBusNum: "*($($),1)
			Debug-Output "DetectedSlotNum:"*($($),2)
 			  
            ifstr(i) $($R0) == {}
			  
			set CFID =  20480        ;; 0x5000
                        Shell $(UtilityInf), GetPCIInformation, $(Vendor) $(CFID)
			ifint $($ShellCode) != $(!SHELL_CODE_OK)
                            goto ShellCodeError
			endif
 			  
                    ifstr(i) $($R0) == {}

 				;;;----
	            Shell $(UtilityInf), GetPCIInformation, $(Vendor) 1	;;generic id
				ifstr(i) $($R0) == {}
				;;;----
	                set Error = $(CANNOT_FIND_ANY_CARD)
		            set CommonStatus = USER_CANCEL
			        set from = end
				    goto nonfatal
				endif
			endif
	    endif    	
			Debug-Output "DetectedBusNum: "*($($),1)
			Debug-Output "DetectedSlotNum:"*($($),2)
			
             set AdapterList = $($R0)
        endif   ;;; NT v3.50
	endif  ;;; Looking for PCI cards in Option.

    ; "AdapterList" has the list of currently installed adatpers in the system!
    ; 
    Debug-Output "$(InfFile) $(Option): Adapterlist = $(AdatperList)"
    ForListDo $(AdapterList)
        Set InstallCard = "YES"
        ifint $(NTDetected) == $(TRUE)
            set DetectedBusNum = *($($),1)
            set DetectedSlotNum = *($($),2)
            Debug-Output "$(InfFile) $(Option): DetectedBusNumber = $(DetectedBusNum)"
            Debug-Output "$(InfFile) $(Option): DetectedSlotNum = $(DetectedSlotNum)"

            Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(DetectedBusNum), +
            $(DetectedSlotNum), $(ProductHardware$(Option)Description), $(ProductHardwareName)
            
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif
            ifstr $($R0) != "NO_ERROR"
                set Error = $($R0)
                goto fatal
            endif
            ifstr(i) $($R1) == "YES"
                set InstallCard = "NO"  ;; Don't want to re-install, it's there already
            endif    
        endif
        ;;
        ;; Are we installing the card?
        ;;
        ifstr(i) $(InstallCard) == "NO"
            Debug-Output "$(InfFile) $(Option): Card Already at $(DetectedBusNum):$(DetectedSlotNum) already installed!"
            set Error = "An adapter at $(DetectedBusNum):$(DetectedSlotNum) is already installed!"
            Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif
        else
            Debug-Output "$(InfFile) $(Option): Installing Card at $(DetectedBusNum):$(DetectedSlotNum)!"
            Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
            ifint $($R4) != -1
                Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
            endif
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif
            set RegistryErrorIndex = $($R0)
            Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
                EndWait
                CloseRegKey $($R1)
                CloseRegKey $($R2)
                CloseRegKey $($R3)
                goto fatalregistry
            endif
            Set HardNetCardKey      = $($R1)
            Set HardNetRuleKey      = $($R2)
            ;Set HardParameterKey    = $($R3)
			Set	KeyParameters		= $($R3)
            set AdapterNumber = $($R4)
            set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
                    {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
                    {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
                    {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
                    {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
                    {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
            Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif
            ;
            ; Are we installing ISA, PCI, PCMCIA?
            ;
            ifint $(ISA) == 1
                set CardType = 1
                set BusTypeNum = 1      
                set Bus = "ISA"        

            else-ifint $(PCI) == 1
;                set CardType = 2
                set CardType = 3
                set BusTypeNum = 5   
                set Bus = "PCI"    

            endif
            ;;
            ;; If we used the OS to dected the card, then we already know bus and slot information.
            ;;        
            ifint $(NTDetected) == $(TRUE)

                set BusNumber = $(DetectedBusNum)
                set SlotNum = $(DetectedSlotNum)    
                set BusInterfaceType = $(BusTypeNum)
                ;
                ; Note: we need to record SlotNumber too so that we can use the 
                ; "IsNetCardAlreadyInstalled" routine.
                ;
                Set NewValueList =  {+
                    {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
					{SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)}+
                    }
				
                ;;Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
                Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)

                ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    goto ShellCodeError
                endif

            else
                Set NewValueList =  {+
                    {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
                    }
                ;;Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
                Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
                ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    goto ShellCodeError
                endif
            endif

			Set NewValueList =  {+
                {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusInterfaceType)},+
                {CardType,$(NoTitle),$(!REG_VT_DWORD),$(CardType)},+
                {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
                }

            Debug-Output "$(InfFile) $(Option): Set HardwareParameterKey = $(NewValueList)"
            ;;Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
            Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif


            set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
            set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
            set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardware$(Option)Type)},+
                    {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
                    {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardware$(Option)Class)}, +
                    {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
    
            Debug-Output "$(InfFile) $(Option): HardwareRuleKey = $(NewValueList)"
            Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                goto ShellCodeError
            endif
            CloseRegKey $(HardNetCardKey)
            CloseRegKey $(HardNetRuleKey)
        endif    
    EndForListDo
    EndWait
;---------------------------------------------------------------------------
;;ISA_BEGIN.............
copyInstallationFiles =+
;;ISA_END...............
;---------------------------------------------------------------------------
	Debug-Output "-------------------------copyInstallationFiles-------------------"
    ifint $(OldVersionExisted) == $(TRUE)
		ifstr(i) $(!NTN_InstallMode) == configure
		    goto writeparameters
		endif
		;;ISA_BEGIN.....................
		ifstr(i) $(!NTN_InstallMode) == "install"
		    goto writeparameters
		endif
		;;ISA_END.......................
    endif
;    
    StartWait
    ifint $(OldVersionExisted) == $(FALSE)
		ifstr(i) $(!NTN_InstallMode) == "install"
			Ifstr(i) $(DoCopy) == "YES"
	      		Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
	      		Ifint $($ShellCode) != $(!SHELL_CODE_OK)
		  			Goto ShellCodeError
			   	Else-Ifstr(i) $($R0) == STATUS_FAILED
		  			Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
		  			ifint $($ShellCode) != $(!SHELL_CODE_OK)
		      			goto ShellCodeError
			  		endif
			  		set Error = $($R0)
			  		Goto fatal
			    Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
			  		Goto successful
	    	  	Endif
		    	Set SrcDir = $($R1)
	   		Endif
	   		install "Install-Option"
	   		ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
	      		Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
	      		ifint $($ShellCode) != $(!SHELL_CODE_OK)
				 	goto ShellCodeError
	    		endif
		      	set Error = $($R0)
			   	goto fatal
	   		endif
		endif
		goto writeparameters
	endif
;-------------------------------------------------------------------------------
bindingadapter =+
    set Error = "Binding: Sorry, not yet implemented."
    goto fatal

;-------------------------------------------------------------------------------
removeadapter = +
    Debug-Output "-------------------removeadapter-----------------------"
    Ifstr $(KeyProduct) == $(KeyNull)
		OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
;
		Ifstr $(KeyProduct) == $(KeyNull)
	    	set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
	    	Debug-Output "Cannot find component product key"
	    	goto fatalregistry
		Endif
;		
    Endif
;
    Shell $(UtilityInf) FindService, $(KeyProduct)
;
    Ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "PCX504.INF: FindService shell failure"
		Goto ShellCodeError
    Endif
;
    Ifstr(i) $($R0) != NO_ERROR
		Debug-Output "PCX504.INF: FindService Shell error: "$($R0)
		Goto fatalregistry
    endif
;
    Set KeyParameters = $($R2)
    CloseRegKey $($R1)
;
    Ifstr $(KeyParameters) == $(KeyNull)
		set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
		Debug-Output "Cannot find component service"
		goto fatalregistry
    endif

    Set from = adapteroptions

    LoadLibrary "" $(!STF_WINDOWSSYSPATH)\$(DialogDllName) hLib
    read-syms FileDependentDlg$(!STF_LANGUAGE)

	set ValueName = ""
	set ValueData = ""
	set ValueStr  = ""
    set ValueList = {}
	EnumRegValue $(KeyParameters) ValueList
;
	ForListDo $(ValueList)

		set ValueItem = $($)
		set ValueName = *($(ValueItem),1)
		set ValueData = *($(ValueItem),4)

		ifstr(i) $(ValueName) == "FormFactor"
		
			ifstr(i) $(ValueData) == "ISA"								
				set	FormFactor = "ISA"
			else-ifstr(i) $(ValueData) == "PCI"								
				set	FormFactor = "PCI"
			else
				set FormFactor = "PCMCIA"
			endif
		endif
		
	EndForListDo

	
    Debug-Output "+++++++++++++++++removeadapter+++++++++++++++++"
	Debug-Output ""
    Debug-Output "FormFactor= "$(FormFactor)
	Debug-Output "ProductKeyName= "$(ProductKeyName)
	Debug-Output "NTN_RegBase= "$(!NTN_RegBase)  ; \\\\NetworkCard\1
	Debug-Output ""
    Debug-Output "=============removeadapter====================="

;;	LibraryProcedure Result $(hLib) RemoveAdapterSetVars "PCX504" $(FormFactor) $(!NTN_RegBase)

    Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
	
	
		Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
	    $(ProductSoftwareName)
;
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
		    Debug-Output "ShellCode error"
		    goto ShellCodeError
		endif
;
		set RegistryErrorIndex = $($R0)
;
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    	goto fatalregistry
		endif
;
   	else

		Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
	    $(ProductSoftwareName), $(!NTN_RegBase)
;
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
		    Debug-Output "ShellCode error"
	    	goto ShellCodeError
		endif
;
		set RegistryErrorIndex = $($R0)
;
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
		    goto fatalregistry
		endif
    endif
    
    OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\ciscotp" $(MAXIMUM_ALLOWED) CiscoTpKey
      ifstr $(CiscoTpKey) != $(NULL) ; open succeeded, so delete it
       	CloseRegKey $(CiscoTpKey)
	DeleteRegTree $(!REG_H_LOCAL) "SYSTEM\CurrentControlSet\Services\ciscotp"
      endif

;;	LibraryProcedure Result $(hLib) RemoveAdapterRemoveKeys 

    goto end
;-------------------------------------------------------------------------------
UpgradeSoftware = +
;   OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
;   Ifstr $(KeyProduct) != $(KeyNull)
;       install "Install-Update"
;       ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
;           goto fatal
;       endif
;       SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
;       SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
;       CloseRegKey $(KeyProduct)
;   else
;       goto fatalregistry
;   endif
;   goto end
;	Set DlgText = "UPDATE not supported. Please remove this NIC and reinstall it"       
;	Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(DlgText) 

    Debug-Output "-------------------UpgradeSoftware-----------------------"
	Debug-Output ";;;;;;;;;;;;;;;;;;;((((((())))))))));;;;;;;;;;;;;;"

    Ifstr $(KeyProduct) == $(KeyNull)
		OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
		Ifstr $(KeyProduct) == $(KeyNull)
	    	set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
	    	Debug-Output "Cannot find component product key"
	    	goto fatalregistry
		Endif
    Endif
;
    Shell $(UtilityInf) FindService, $(KeyProduct)
	Set KeyParameters = $($R2)
    CloseRegKey $($R1)

	;; get the card name amd make sure it is PCX504
	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyCardName ;;;SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\1
	GetRegValue	$(KeyCardName) "ProductName" CardNameList 
    set CardName = *($(CardNameList), 4)
;
	Ifstr(i) $(ProductSoftwareName) != "PCX504"
		set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
		Debug-Output "ShellCode error"
		goto ShellCodeError
	endif

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase)\NetRules $(MAXIMUM_ALLOWED) KeyNetRules
	GetRegValue	$(KeyNetRules) "InfName" InfNameList 
    set InfName = *($(InfNameList), 4)
	set !UG_Filename = $(InfName)
    Set SrcDir = $($2)

	Debug-Output "..............................."
	Debug-Output "ProductKeyName= "$(ProductKeyName)	;=SOFTWARE\Aironet\PCX504\CurrentVersion
	Debug-Output "NTN_RegBase= "$(!NTN_RegBase)			;=SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\1
	Debug-Output $(ProductSoftwareName)					;=PCX504
	Debug-Output $(RegistryErrorIndex)
	Debug-Output "InfNameList "$(InfNameList)
	Debug-Output "InfName "$(InfName)
	Debug-Output "SrcDir "$(SrcDir)
	Debug-Output "CardName "$(CardName)
	Debug-Output "..............................."

	Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
		    Debug-Output "ShellCode error"
		    goto ShellCodeError
		endif
		set RegistryErrorIndex = $($R0)
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    	goto fatalregistry
		endif
	else
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
		    Debug-Output "ShellCode error"
	    	goto ShellCodeError
		endif
		set RegistryErrorIndex = $($R0)
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
		    goto fatalregistry
		endif
    endif
;
	Ifstr $(KeyProduct) == $(KeyNull)
		set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
	    Debug-Output "Cannot find component product key"
		goto fatalregistry
	Endif
;		
    install "Install-update"

	Set DlgText = "Updated your PCX504 driver software successfully"       
	Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "STATUS" $(DlgText) 
	Debug-Output ";;;;;;;;;;;;;;;;;;;((((((())))))))));;;;;;;;;;;;;;end"
    goto successful
;
;
    ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
		OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
;
		Ifstr $(KeyProduct) != $(KeyNull)
		    GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
	    	set Version = *($(VersionInfo), 4)
	    	Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
;
		    ifint $($ShellCode) != $(!SHELL_CODE_OK)
				goto ShellCodeError
	    	endif
;
		    set !UG_Filename = $($R0)
;
		    ifstr(i) $(!UG_Filename) != ""
				install "Install-Update"
;
				ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
				    goto fatal
				endif
	    	endif
;
		    SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
		    SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$( roductMinorVersion)}
	    	ifint $(Version) != $(ProductVersion)
			endif
	    	CloseRegKey $(KeyProduct)
		else
	    	goto fatalregistry
		endif
    else
		OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) NetworkCardKey
;
		Ifstr(i) $(NetworkCardKey) != $(KeyNull)
	    	GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
	    	set ServiceName = *($(ServiceNameInfo), 4)
	    	OpenRegKey $(NetworkCardKey) "" "NetRules" $(MAXIMUM_ALLOWED) NetRuleKey
;
			Debug-Output $(ServiceName)
	    	Ifstr(i) $(NetRuleKey) != $(KeyNull)
	    	else
				goto fatalregistry
	    	endif
	    	CloseRegKey $(NetRules)
	    	CloseRegKey $(NetworkCardKey)
		else
	    	goto fatalregistry
		endif
		OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName) +
						$(MAXIMUM_ALLOWED) ServiceKey
;
		Ifstr(i) $(ServiceKey) != $(KeyNull)
		    CloseRegKey $(ServiceKey)
		else
	    	goto fatalregistry
		endif
    endif
    goto end
;
;-------------------------------------------------------------------------------
;
successful = +
	Debug-Output "-------------------------successful ------------------------"
    goto end
;
;-------------------------------------------------------------------------------
;
abandon = +
	Debug-Output "-------------------------abandon ------------------------"
    ForListDo $(OEM_ABANDON_OPTIONS)
		Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
	    $(ProductSoftwareName), $($)
;
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
		    Debug-Output "ShellCode error"
		    goto ShellCodeError
		endif
;
		set RegistryErrorIndex = $($R0)
;
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
		    goto fatalregistry
		endif
;
    EndForListDo
;
	Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
		Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
	    $(ProductSoftwareName), FALSE
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    	Debug-Output "ShellCode error"
	   		goto ShellCodeError
		endif
;
		set RegistryErrorIndex = $($R0)
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    	goto fatalregistry
		endif
    endif
    goto end
;
;-------------------------------------------------------------------------------
;
warning = +
	Debug-Output "-------------------------warning ------------------------"
    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
    endif
    ifstr(i) $($R1) == "OK"
		goto $(to)
    else-ifstr(i) $($R1) == "CANCEL"
		goto $(from)
    else
		goto "end"
    endif
;
;-------------------------------------------------------------------------------
;
nonfatalinfo = +
	Debug-Output "-------------------------nonfatalinfo ------------------------"
    Set Severity = STATUS
    Set CommonStatus = STATUS_USERCANCEL
    goto nonfatalmsg
;
;-------------------------------------------------------------------------------
;
nonfatal = +
	Debug-Output "-------------------------nonfatal ------------------------"
    Set Severity = NONFATAL
    goto nonfatalmsg
;
;-------------------------------------------------------------------------------
;
nonfatalmsg = +
	Debug-Output "-------------------------nonfatalmsg ------------------------"
;
    ifstr(i) $(Error) == ""
		Set Severity = NONFATAL
		Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
;
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    	goto ShellCodeError
		endif
		set Error = $($R0)
    endif
;
    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
    endif
;
    ifstr(i) $($R1) == "OK"
		goto $(from)
    else
		goto "end"
    endif
;
;-------------------------------------------------------------------------------
;
fatalregistry = +
	Debug-Output "-------------------------fatalregistry ------------------------"
    Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
;
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
    endif
;
    set Error = $($R0)
    goto fatal
;
;-------------------------------------------------------------------------------
;
fataldetect = +
	Debug-Output "-------------------------fataldetect ------------------------"
    Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
;
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "ShellCode error: cannot get an error string."
		goto ShellCodeError
    endif
    set Error = $($R0)
    Goto fatal
;
;-------------------------------------------------------------------------------
;
fatal = +
	Debug-Output "-------------------------fatal ------------------------"
;
    ifstr(i) $(Error) == ""
		Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
;
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    	goto ShellCodeError
		endif
;
		set Error = $($R0)
    endif
;
    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
;
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
    endif
;
    goto setfailed
;
;-------------------------------------------------------------------------------
;
ShellCodeError = +
	Debug-Output "-------------------------ShellCodeError ------------------------"
    set DlgType      = "MessageBox"
    set STF_MB_TITLE = $(ShellCodeErrorTitle)
    set STF_MB_TEXT  = $(ShellCodeErrorText)
    set STF_MB_TYPE  = 1
    set STF_MB_ICON  = 3
    set STF_MB_DEF   = 1
;
    ui start "Error Message"
    goto setfailed
;
;-------------------------------------------------------------------------------
;
setfailed = +
	Debug-Output "-------------------------setfailed ------------------------"
    set CommonStatus = STATUS_FAILED
    ifstr(i) $(OEM_ABANDON_ON) == TRUE
	set OEM_ABANDON_ON = FALSE
	goto abandon
    endif
    goto end
;
;-------------------------------------------------------------------------------
;
end = +
	Debug-Output "-------------------------end ------------------------"
    goto term
;
;-------------------------------------------------------------------------------
;
term = +
	Debug-Output "-------------------------term ------------------------"
    Return $(CommonStatus)

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[DebugConfiguration]
    Set InfName = "PCX504.INF"
    Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
    return

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[Install-Option]
    set STF_VITAL = ""
    ifstr(i) $(AddCopy) == "YES"
	AddSectionFilesToCopyList Files-Sys $(SrcDir)$(NDIS4FOLDER) $(!STF_WINDOWSSYSPATH)\drivers
	AddSectionFilesToCopyList Files-Img $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
    endif
;
    ifstr(i) $(DoCopy) == "YES"
       set !STF_NCPA_FLUSH_COPYLIST = TRUE
       CopyFilesInCopyList
    endif
;
    Exit
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
[Install-Update]
	set STF_VITAL        = ""
	set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
	;
	AddSectionFilesToCopyList Files-Sys $(SrcDir)$(NDIS4FOLDER) $(!STF_WINDOWSSYSPATH)\drivers
	;	
	AddSectionFilesToCopyList Files-Img $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers

	AddSectionFilesToCopyList Files-Dll $(SrcDir)$(NDIS4FOLDER) $(!STF_WINDOWSSYSPATH)
	;
	AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
	;
	set !STF_NCPA_FLUSH_COPYLIST = TRUE
	Debug-Output "Install-Update "$(SrcDir)
	CopyFilesInCopyList
  Exit
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
[Install-Dll]
   set STF_VITAL        = ""
   AddSectionFilesToCopyList Files-Dll $(SrcDir)$(NDIS4FOLDER) $(!STF_WINDOWSSYSPATH)
   set !STF_NCPA_FLUSH_COPYLIST = TRUE
   CopyFilesInCopyList
   exit
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
[Install-PmDriver]
   set STF_VITAL        = ""
   AddSectionFilesToCopyList Files-PmDriver $(SrcDir)$(NDIS4FOLDER) $(!STF_WINDOWSSYSPATH)\drivers
   set !STF_NCPA_FLUSH_COPYLIST = TRUE
   CopyFilesInCopyList
   exit
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
[Source Media Descriptions]
    1  = "Cisco Aironet PCX504 Setup Disk for NT" 
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
[ProductType]
STF_PRODUCT  = Winnt
STF_PLATFORM = I386
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
[Files-Inf]
1,oemsetup.inf,SIZE=32044, RENAME=$(!UG_Filename)
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
[Files-Sys]
1, PCX504.SYS, SIZE=94988
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
[Files-Img]
1, pcx504b.img,  SIZE=131328
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
[Files-Dll]
1, pcx500.dll,  SIZE=17408
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
[Files-PmDriver]
1, ciscotp.sys,  SIZE=8192
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

;
[LanguagesSupported]
    ENG
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[OptionsTextENG]
    PCI504       = "Cisco Systems mini-PCI Wireless LAN Adapter"
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[FileConstantsENG]
;
	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:"
	FunctionTitle		  = "Cisco Systems Wireless LAN Adapter Setup"
	ProductSoftwareDescription  = "Cisco Systems PCX504 Wireless LAN Adapter Driver"
	ProductSoftwareTitle	    = "Cisco Systems PCX504 Wireless LAN Adapter Driver"
	ShellCodeErrorTitle         = "Error: "$(FunctionTitle)
	ShellCodeErrorText          = "Shell Code Error."
	DialogDllName     	    = "pcx500.dll"

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
[DialogConstantsENG]
	Help						= "&Help"
	Exit						= "Cancel"
	OK							= "OK"
	HelpContext					= ""
	Continue					= "Continue"
	Cancel						= "Cancel"
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[FileDependentDlgENG]
	DlgType						= "RadioCombination"
	DlgTemplate					= "PCX504"
	Caption						= $(FunctionTitle)
	HelpContext					= $(!IDH_DB_OEMNADE2_INS)
	CBOptionsGreyed				= {}
	NotifyFields				= {NO, NO, NO, NO}


