📄 oemsetnt.inf
字号:
Debug-Output $(InfName)": ShellCode error."
GoTo ShellCodeError
EndIf
Set RegistryErrorIndex = $($R0)
IfStr(i) $(RegistryErrorIndex) != NO_ERROR
EndWait
Debug-Output $(InfName)": Resgitry error: add value list."
CloseRegKey $(KeyParameters)
CloseRegKey $(KeyAdapterRules)
GoTo FatalRegistry
EndIf
CloseRegKey $(KeyAdapterRules)
GoTo WriteParameters
;***********************************************************************
;
;***********************************************************************
WriteParameters = +
;;; You need one address entry in the list for each channel on your device.
;;; FIXME - at this point RAS requires there to be one logical line per address
;;; FIXME - so the address (channel) number is ignored and the line number is used
Set TapiAddressList = {$(AdapterNumber)" 1 0"}
IfStr(i) $(Option) == HTDSU42
Set TapiAddressList = >($(TapiAddressList),$(AdapterNumber)" 2 0")
EndIf
Set NewValueList = {+
{AddressList,$(NoTitle),$(!REG_VT_MULTI_SZ),$(TapiAddressList)},+
{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
{BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusType)},+
{DeviceName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
{InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(InterruptNumber)},+
{LineType,$(NoTitle),$(!REG_VT_DWORD),$(LineType)},+
{MediaType,$(NoTitle),$(!REG_VT_SZ),$(TapiMediaType)},+
{RamBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(RamBaseAddress)}+
}
;;; {DebugFlags,$(NoTitle),$(!REG_VT_DWORD),$(DebugFlags)},+
Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
CloseRegKey $(KeyParameters)
IfInt $($ShellCode) != $(!SHELL_CODE_OK)
Debug-Output $(InfName)": ShellCode error."
GoTo ShellCodeError
EndIf
Set RegistryErrorIndex = $($R0)
IfStr(i) $(RegistryErrorIndex) != NO_ERROR
Debug-Output $(InfName)": Registry error: Add value list"
GoTo FatalRegistry
EndIf
;
; Skip TAPI/RAS setup if already installed.
;
IfStr(i) $(!NTN_InstallMode) == configure
GoTo SuccessfulOption
EndIf
;
; Create the HARDWARE\DEVICEMAP\TAPI DEVICES\HTDSU41 key
;
OpenRegKey $(!REG_H_LOCAL) "" "HARDWARE\DEVICEMAP" $(MAXIMUM_ALLOWED) BaseKey
shell "" HtCreateRegKey $(BaseKey) "TAPI DEVICES\HTDSU41"
IfStr(i) $($R0) != NO_ERROR
Debug-Output $(InfName)": Error creating registry key!"
GoTo FatalRegistry
EndIf
Set TapiDeviceKey = $($R1)
Set NewValueList = {+
{Address,$(NoTitle),$(!REG_VT_MULTI_SZ),$(TapiAddressList)},+
{"Media Type",$(NoTitle),$(!REG_VT_SZ),$(TapiMediaType)}}
Shell $(UtilityInf), AddValueList, $(TapiDeviceKey), $(NewValueList)
IfInt $($ShellCode) != $(!SHELL_CODE_OK)
Debug-Output $(InfName)": ShellCode error."
GoTo ShellCodeError
EndIf
Set RegistryErrorIndex = $($R0)
IfStr(i) $(RegistryErrorIndex) != NO_ERROR
Debug-Output $(InfName)": Registry error: Add value list"
GoTo FatalRegistry
EndIf
CloseRegKey $(TapiDeviceKey)
CloseRegKey $(BaseKey)
;
; if RAS is not installed, then shell ras setup INF file to install RAS
; else invoke RAS to allow user to configure RAS for Switch56.
;
Read-Syms InvokeRasDlg$(!STF_LANGUAGE)
Shell "oemnsvra.inf" CheckRasInstalled
IfInt $($ShellCode) != $(!SHELL_CODE_OK)
Debug-Output $(InfName)": Error Shelling the RAS INF file oemnsvra.inf"
Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), +
"STATUS", $(InvokeRasError)
IfInt $($ShellCode) != $(!SHELL_CODE_OK)
GoTo ShellCodeError
EndIf
GoTo SuccessfulOption
EndIf
Set RasInstalled = $($R0)
Debug-Output $(InfName)": Is RAS Installed? "$(RasInstalled)
;
; display a message to the user that RAS setup will now be invoked
;
IfStr(i) $(RasInstalled) == FALSE
Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", +
$(InvokeRasSetupMsg)
IfInt $($ShellCode) != $(!SHELL_CODE_OK)
GoTo SuccessfulOption
EndIf
Else
Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", +
$(InvokeRasConfigMsg)
IfInt $($ShellCode) != $(!SHELL_CODE_OK)
GoTo SuccessfulOption
EndIf
EndIf
;
; FIXME - RAS INF will not locate the files if it is spawned here.
;
EndWait
GoTo SuccessfulOption
;
; Set the flags based on whether this is an IDW installation
;
IfStr(i) $(!STF_IDW) == TRUE
Set AddCopy = NO
Set DoCopy = NO
Set DoConfig = NO
Else
Set AddCopy = YES
Set DoCopy = YES
Set DoConfig = YES
EndIf
;
; change the global install mode flag to configure if RAS is already installed
;
IfStr(i) $(RasInstalled) == TRUE
Set SaveNTN_InstallMode = $(!NTN_InstallMode)
Set !NTN_InstallMode = configure
EndIf
;
; now invoke RAS setup to do the right thing
;
Shell "oemnsvra.inf" InstallOption $(!STF_LANGUAGE) "RAS" $(RasDir) $(AddCopy) $(DoCopy) $(DoConfig)
;
; restore the global instal mode flag if it was changed
;
IfStr(i) $(RasInstalled) == TRUE
Set !NTN_InstallMode = $(SaveNTN_InstallMode)
EndIf
IfInt $($ShellCode) != $(!SHELL_CODE_OK)
Debug-Output $(InfName)": Error Shelling the RAS INF file oemnsvra.inf"
Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", +
$(InvokeRasError)
IfInt $($ShellCode) != $(!SHELL_CODE_OK)
GoTo ShellCodeError
EndIf
GoTo SuccessfulOption
EndIf
EndWait
GoTo SuccessfulOption
;***********************************************************************
;
;***********************************************************************
BindingAdapter =+
Set Error = "Binding: Sorry, not yet implemented."
GoTo FatalError
;***********************************************************************
;
;***********************************************************************
RemoveAdapter = +
IfStr(i) $(ProductKeyName) == $(!NTN_RegBase)
Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
$(ProductSoftwareName)
IfInt $($ShellCode) != $(!SHELL_CODE_OK)
Debug-Output $(InfName)": 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 $(InfName)": ShellCode error"
GoTo ShellCodeError
EndIf
Set RegistryErrorIndex = $($R0)
IfStr(i) $(RegistryErrorIndex) != NO_ERROR
GoTo FatalRegistry
EndIf
EndIf
GoTo end
;***********************************************************************
;
;***********************************************************************
UpgradeSoftware = +
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)
Debug-Output $(InfName)": ShellCode error"
GoTo ShellCodeError
EndIf
Set !UG_Filename = $($R0)
IfStr(i) $(!UG_Filename) != ""
install "Install-Update"
IfStr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
GoTo FatalError
EndIf
EndIf
SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
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
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
;***********************************************************************
;
;***********************************************************************
SuccessfulOption = +
GoTo end
;***********************************************************************
;
;***********************************************************************
Abandon = +
ForListDo $(OEM_ABANDON_OPTIONS)
Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
$(ProductSoftwareName), $($)
IfInt $($ShellCode) != $(!SHELL_CODE_OK)
Debug-Output $(InfName)": 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 $(InfName)": ShellCode error"
GoTo ShellCodeError
EndIf
Set RegistryErrorIndex = $($R0)
IfStr(i) $(RegistryErrorIndex) != NO_ERROR
GoTo FatalRegistry
EndIf
EndIf
GoTo end
;***********************************************************************
;
;***********************************************************************
WarningMsg = +
Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
IfInt $($ShellCode) != $(!SHELL_CODE_OK)
GoTo ShellCodeError
EndIf
IfStr(i) $($R1) == "OK"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -