Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

859 lines
24 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNSVNB.INF
  4. ;
  5. ; NETBIOS driver SETUP INF file.
  6. ;
  7. ; History:
  8. ; davidhov 00-Feb-1992 Created
  9. ; terryk 27-Feb-1992 Reorganize section location
  10. ; added comment
  11. ; terryk 03-Mar-1992 Changed to NETBIOS setup
  12. ; terryk 02-Apr-1992 Code review changed
  13. ; davidhov 03-Apr-1992 Enhanced to use new INF section
  14. ; structure from SunilP, et al.
  15. ;
  16. ;***********************************************************************
  17. ;-----------------------------------------------------------------------
  18. ; OPTION TYPE
  19. ; -----------
  20. ; This identifies the Option type we are dealing with. The different
  21. ; possible types are:
  22. ;
  23. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  24. ;
  25. ; Types specific to networking:
  26. ;
  27. ; NetAdapter, a netcard / adapter combination or just a netcard
  28. ; NetDriver, just a netcard driver
  29. ; NetTransport, a complete NDIS-compliant TDI transport stack
  30. ; NetService, an NT networking service
  31. ; NetWork, a complete network ensemble.
  32. ; NetProvider a complete network which supports NT MPR protocol
  33. ;-----------------------------------------------------------------------
  34. [Identification]
  35. OptionType = NetService
  36. ;-----------------------------------------------------------------------
  37. ; OPTION LIST
  38. ; -----------
  39. ; This section lists the OEM Option key names. These keys are locale
  40. ; independent and used to represent the option in a locale independent
  41. ; manner.
  42. ;
  43. ;-----------------------------------------------------------------------
  44. [Options]
  45. NETBIOS
  46. ;***********************************************************************
  47. ; CONSTANTS FOR USING DIALOGS
  48. ;***********************************************************************
  49. [FileConstants]
  50. ;
  51. ; File names, etc.
  52. ;
  53. UtilityInf = "UTILITY.INF"
  54. subroutineinf = "SUBROUTN.INF"
  55. SoftwareType = "service"
  56. Exit_Code = 0
  57. ;ShellCode = 0
  58. ;
  59. ; EventLog Message File
  60. ;
  61. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  62. IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
  63. ;
  64. ; Product Info
  65. ;
  66. Manufacturer = "Microsoft"
  67. ProductMajorVersion = "4"
  68. ProductMinorVersion = "0"
  69. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  70. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  71. ;
  72. ; Software
  73. ;
  74. ProductSoftwareName = "NetBIOS"
  75. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\netbios.sys"
  76. NetRuleSoftwareType = "netbios lmNetService"
  77. NetRuleSoftwareUse = $(SoftwareType)" yes yes"
  78. NetRuleSoftwareBindForm = """Netbios"" yes yes container"
  79. ;
  80. ; Registry Key
  81. ;
  82. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  83. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductSoftwareName)"\Parameters"
  84. NETBIOSInfoName = $(!NTN_ServiceBase)"\NetbiosInformation\Parameters"
  85. [GeneralConstants]
  86. ;
  87. ; Program flow control variables.
  88. ;
  89. from = ""
  90. to = ""
  91. ;
  92. ; Return codes; Exit_Code is set to one of these
  93. ;
  94. ExitCodeOk = 0
  95. ExitCodeCancel = 1
  96. ExitCodeFatal = 2
  97. KeyNull = ""
  98. MAXIMUM_ALLOWED = 33554432
  99. RegistryErrorIndex = NO_ERROR
  100. KeyProduct = ""
  101. KeyParameters = ""
  102. TRUE = 1
  103. FALSE = 0
  104. NoTitle = 0
  105. ExitState = "Active"
  106. OldVersionExisted = $(FALSE)
  107. DriverPath = $(!STF_NTPATH)\drivers
  108. [date]
  109. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  110. ; Minute, Second }
  111. Now = {} ? $(!LIBHANDLE) GetSystemDate
  112. ;----------------------------------------------
  113. ; INFO DIALOG
  114. ;----------------------------------------------
  115. [InfoDlg]
  116. DlgType = "MessageBox"
  117. STF_MB_TITLE = $(InfoMsgTitle)
  118. STF_MB_TEXT = $(InfoMsgText)
  119. STF_MB_TYPE = 1
  120. STF_MB_ICON = 5
  121. STF_MB_DEF = 1
  122. ;---------------------------------------------------------------------------
  123. ; 1. Identify
  124. ;
  125. ; DESCRIPTION: To verify that this INF deals with the same type of options
  126. ; as we are choosing currently.
  127. ;
  128. ; INPUT: None
  129. ;
  130. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  131. ; $($R1): Option Type (COMPUTER ...)
  132. ; $($R2): Diskette description
  133. ;---------------------------------------------------------------------------
  134. [Identify]
  135. ;
  136. ;
  137. read-syms Identification
  138. set Status = STATUS_SUCCESSFUL
  139. set Identifier = $(OptionType)
  140. set Media = #("Source Media Descriptions", 1, 1)
  141. Return $(Status) $(Identifier) $(Media)
  142. ;------------------------------------------------------------------------
  143. ; 2. ReturnOptions:
  144. ;
  145. ; DESCRIPTION: To return the option list supported by this INF and the
  146. ; localised text list representing the options.
  147. ;
  148. ;
  149. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  150. ;
  151. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  152. ; STATUS_NOLANGUAGE
  153. ; STATUS_FAILED
  154. ;
  155. ; $($R1): Option List
  156. ; $($R2): Option Text List
  157. ;------------------------------------------------------------------------
  158. [ReturnOptions]
  159. ;
  160. ;
  161. set Status = STATUS_FAILED
  162. set OptionList = {}
  163. set OptionTextList = {}
  164. ;
  165. ; Check if the language requested is supported
  166. ;
  167. set LanguageList = ^(LanguagesSupported, 1)
  168. Ifcontains(i) $($0) in $(LanguageList)
  169. goto returnoptions
  170. else
  171. set Status = STATUS_NOLANGUAGE
  172. goto finish_ReturnOptions
  173. endif
  174. ;
  175. ; form a list of all the options and another of the text representing
  176. ;
  177. returnoptions = +
  178. set OptionList = ^(Options, 1)
  179. set OptionTextList = ^(OptionsText$($0), 1)
  180. set Status = STATUS_SUCCESSFUL
  181. finish_ReturnOptions = +
  182. Return $(Status) $(OptionList) $(OptionTextList)
  183. ;----------InstallOption-------------------------------------------------
  184. ;
  185. ; InstallOption:
  186. ;
  187. ; This section is shelled to by main installation processing
  188. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  189. ;
  190. ;
  191. ; FUNCTION: To copy files representing Options
  192. ; To configure the installed option
  193. ; To update the registry for the installed option
  194. ;
  195. ; INPUT: $($0): Language to use
  196. ; $($1): OptionID to install
  197. ; $($2): SourceDirectory
  198. ; $($3): AddCopy (YES | NO)
  199. ; $($4): DoCopy (YES | NO)
  200. ; $($5): DoConfig (YES | NO)
  201. ;
  202. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  203. ; STATUS_NOLANGUAGE |
  204. ; STATUS_USERCANCEL |
  205. ; STATUS_FAILED
  206. ;
  207. ;------------------------------------------------------------------------
  208. [InstallOption]
  209. ;
  210. ; extract parameters
  211. ;
  212. set Option = $($1)
  213. set SrcDir = $($2)
  214. set AddCopy = $($3)
  215. set DoCopy = $($4)
  216. set DoConfig = $($5)
  217. ;
  218. ; Check if the language requested is supported
  219. ;
  220. set LanguageList = ^(LanguagesSupported, 1)
  221. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  222. Return STATUS_NOLANGUAGE
  223. endif
  224. Debug-Output "OEMNSVNB.INF: STF_CWDDIR is: "$(!STF_CWDDIR)
  225. Debug-Output "OEMNSVNB.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  226. ; define all the constants
  227. set-subst LF = "\n"
  228. read-syms GeneralConstants
  229. read-syms FileConstants
  230. read-syms DialogConstants$(!STF_LANGUAGE)
  231. ifstr(i) $(!NTN_Origination) == "NCPA"
  232. set Continue = $(OK)
  233. endif
  234. read-syms FileConstants$(!STF_LANGUAGE)
  235. detect date
  236. set-title $(FunctionTitle)
  237. set to = Begin
  238. set from = Begin
  239. ;
  240. ; Assume all is well.
  241. ;
  242. set CommonStatus = STATUS_SUCCESSFUL
  243. EndWait
  244. ;
  245. ; Set up the operation-mode-based variables and gaily welcome
  246. ; the user. If the "install mode" variable is improperly set,
  247. ; assume this is a new installation.
  248. ;
  249. Begin = +
  250. Ifstr(i) $(!NTN_InstallMode) == deinstall
  251. set StartLabel = removeadapter
  252. else-Ifstr(i) $(!NTN_InstallMode) == Update
  253. set StartLabel = UpgradeSoftware
  254. else-Ifstr(i) $(!NTN_InstallMode) == bind
  255. set StartLabel = bindingadapter
  256. else-Ifstr(i) $(!NTN_InstallMode) == configure
  257. set StartLabel = configureadapter
  258. else
  259. set StartLabel = installadapter
  260. endif
  261. set from = $(fatal)
  262. set to = $(fatal)
  263. goto $(StartLabel)
  264. ;-----------------------------------------------
  265. ; Installation Section
  266. ;-----------------------------------------------
  267. installadapter = +
  268. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  269. Ifstr $(KeyProduct) != $(KeyNull)
  270. ;
  271. ; Same version already existed in the local machine
  272. ; Popup the dialog and ask the user whether he wants to continue
  273. ;
  274. CloseRegKey $(KeyProduct)
  275. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  276. $(ProductVersion)
  277. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  278. Debug-Output "ShellCode error: cannot get an error string."
  279. goto ShellCodeError
  280. endif
  281. goto end
  282. endif
  283. CloseRegKey $(KeyProduct)
  284. goto nextstep
  285. ;-----------------------------------------------
  286. ; Configuration Section
  287. ;-----------------------------------------------
  288. configureadapter = +
  289. ; Make sure that we have the information...
  290. OpenRegKey $(!REG_H_LOCAL) "" $(NETBIOSInfoName) $(MAXIMUM_ALLOWED) KeyNETBIOSInfo
  291. ifstr(i) $(KeyNETBIOSInfo) == ""
  292. debug-output "no binding information"
  293. read-syms InfoDlgCantConfigure
  294. goto infomsg
  295. else
  296. Set FLibraryErrCtl = 1
  297. LibraryProcedure ResultList $(!NCPA_HANDLE), CPlNETBIOS, $(!STF_HWND)
  298. Set FLibraryErrCtl = 0
  299. Set Result = *($(ResultList),1)
  300. Ifint $(Result) == 0
  301. set CommonStatus = STATUS_SUCCESSFUL
  302. Else-ifint $(Result) == 1223
  303. set CommonStatus = STATUS_USERCANCEL
  304. Else
  305. set CommonStatus = STATUS_FAILED
  306. Endif
  307. endif
  308. CloseRegKey $(KeyNETBIOSInfo)
  309. goto successful
  310. ;
  311. ; If installing, go create the necessary keys;
  312. ; if configuring, they're already open.
  313. ;
  314. nextstep = +
  315. StartWait
  316. ifstr(i) $(!NTN_InstallMode) == "install"
  317. Ifstr(i) $(DoCopy) == "YES"
  318. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  319. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  320. Goto ShellCodeError
  321. Else-Ifstr(i) $($R0) == STATUS_FAILED
  322. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  323. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  324. goto ShellCodeError
  325. endif
  326. set Error = $($R0)
  327. Goto fatal
  328. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  329. Goto successful
  330. Endif
  331. Set SrcDir = $($R1)
  332. Endif
  333. install "Install-Option"
  334. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  335. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  336. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  337. goto ShellCodeError
  338. endif
  339. set Error = $($R0)
  340. goto fatal
  341. endif
  342. endif
  343. ifint $(OldVersionExisted) == $(FALSE)
  344. set OEM_ABANDON_ON = TRUE
  345. Shell $(UtilityInf), AddSoftwareComponent, +
  346. $(Manufacturer), $(ProductSoftwareName), +
  347. $(ProductSoftwareName), +
  348. $(ProductSoftwareDisplayName), +
  349. $(STF_CONTEXTINFNAME), $(ProductSoftwareImagePath), "system",+
  350. "NetBIOSGroup", {"+TDI"}, "", $(IoLogMsgDLL)
  351. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  352. goto ShellCodeError
  353. endif
  354. set RegistryErrorIndex = $($R0)
  355. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  356. EndWait
  357. CloseRegKey $($R1)
  358. CloseRegKey $($R2)
  359. CloseRegKey $($R3)
  360. CloseRegKey $($R4)
  361. CloseRegKey $($R5)
  362. goto fatalregistry
  363. endif
  364. ;
  365. ; At this point:
  366. ; $R1 contains the product version key handle;
  367. ; $R2 contains the NetRules subkey handle;
  368. ; $R3 contains the new Services key handle; and
  369. ; $R4 contains the Parameters key
  370. ; $R5 contains the Linkage key
  371. ;
  372. Set SoftProductKey = $($R1)
  373. Set SoftNetRuleKey = $($R2)
  374. CloseRegKey $($R3)
  375. CloseRegKey $($R4)
  376. CloseRegKey $($R5)
  377. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  378. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  379. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  380. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  381. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  382. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  383. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}, +
  384. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  385. ;
  386. ; MS in-house special: Set this service for bindings review; this allows us
  387. ; to sort the bindings such that the XNS stack, if present, is on LanaNum 0.
  388. ;
  389. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  390. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  391. goto ShellCodeError
  392. endif
  393. set RegistryErrorIndex = $($R0)
  394. CloseRegKey $(SoftProductKey)
  395. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  396. EndWait
  397. CloseRegKey $(SoftNetRuleKey)
  398. goto fatalregistry
  399. endif
  400. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  401. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  402. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  403. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  404. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  405. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  406. goto ShellCodeError
  407. endif
  408. set RegistryErrorIndex = $($R0)
  409. CloseRegKey $(SoftNetRuleKey)
  410. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  411. EndWait
  412. goto fatalregistry
  413. endif
  414. ;
  415. ; Set proper security on the NetBIOS service so that normal users can
  416. ; start the service. Ignore any error; it's not fatal.
  417. ;
  418. LibraryProcedure DontCare $(!NCPA_HANDLE), CPlSetup $(!STF_HWND),+
  419. SECURESVC, $(ProductSoftwareName), 3
  420. ;
  421. ; Create the NetBIOSInformation key and subkeys for LANAnum handling.
  422. ; First, we delete it in case an old version is present.
  423. ;
  424. Shell $(UtilityInf), RemoveService, "NetBIOSInformation", NO
  425. Shell $(UtilityInf), CreateService, "NetBIOSInformation", "NetBIOSInformation", +
  426. "", "adapter", "", {}, ""
  427. Set RegistryErrorIndex = $($R0)
  428. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  429. Debug-Output "OEMNSVNB.INF: ERROR creating NetBIOSInformation keys"
  430. EndWait
  431. goto fatalregistry
  432. Endif
  433. CloseRegKey $($R1)
  434. CloseRegKey $($R2)
  435. CloseRegKey $($R3)
  436. ;
  437. ; Add Dependence to Messenger
  438. ;
  439. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\Messenger" $(MAXIMUM_ALLOWED) KeyMessenger
  440. ifstr(i) $(KeyMessenger) != ""
  441. GetRegValue $(KeyMessenger) "DependOnService" DependInfo
  442. set Dependencies = *($(DependInfo),4)
  443. ifcontains(i) "netbios" not-in $(Dependencies)
  444. ifstr(i) $(Dependencies) == {}
  445. set Dependencies = "NetBios"
  446. else
  447. set Dependencies = >($(Dependencies),"NetBios")
  448. endif
  449. SetRegValue $(KeyMessenger) {"DependOnService",$(NoTitle),$(!REG_VT_MULTI_SZ),$(Dependencies)}
  450. endif
  451. endif
  452. ;
  453. ; Add the RPC NetBIOS provider information
  454. ;
  455. Shell $(UtilityInf) AddMixRpcProtocol "Netbios" "nbf" "ncacn_nb_nb" "rpclt1.dll" "rpclt1.dll"
  456. Shell $(UtilityInf) AddMixRpcProtocol "Netbios" "nwlnkipx" "ncacn_nb_ipx" "rpclt1.dll" "rpclt1.dll"
  457. Shell $(UtilityInf) AddMixRpcProtocol "Netbios" "tcpip" "ncacn_nb_tcp" "rpclt1.dll" "rpclt1.dll"
  458. Shell $(UtilityInf), AddWinsockInfo, +
  459. "NetBIOS", +
  460. "%SystemRoot%\system32\wshnetbs.dll", +
  461. 20,20
  462. set RegistryErrorIndex = $($R0)
  463. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  464. Debug-Output "OEMNSVNB.INF: Registry error: Add Winsock Info."
  465. Endif
  466. endif
  467. goto writeparameters
  468. writeparameters = +
  469. EndWait
  470. goto successful
  471. ;-----------------------------------------------
  472. ; Binding section
  473. ;-----------------------------------------------
  474. bindingadapter =+
  475. Debug-Output "OEMNSVNB.INF: for bindings review"
  476. Goto successful
  477. ;-----------------------------------------------
  478. ; Removeadapter section
  479. ;-----------------------------------------------
  480. removeadapter = +
  481. ;
  482. ; Remove NETBIOS service
  483. ;
  484. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  485. $(ProductSoftwareName)
  486. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  487. Debug-Output "ShellCode error"
  488. goto ShellCodeError
  489. endif
  490. set RegistryErrorIndex = $($R0)
  491. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  492. goto fatalregistry
  493. endif
  494. Shell $(UtilityInf) RemoveRpcProtocol "ncacn_nb_nb"
  495. Shell $(UtilityInf) RemoveRpcProtocol "ncacn_nb_ipx"
  496. Shell $(UtilityInf) RemoveRpcProtocol "ncacn_nb_tcp"
  497. Shell $(UtilityInf) RemoveRpcProtocol "ncacn_nb_xns"
  498. ;
  499. ; Remove the NetBIOSInformation keys
  500. ;
  501. Shell $(UtilityInf), RemoveService, "NetBIOSInformation", NO
  502. Shell $(UtilityInf), RemoveWinsockInfo, "NetBIOS"
  503. ;
  504. ; Remove Dependence to Messenger
  505. ;
  506. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\Messenger" $(MAXIMUM_ALLOWED) KeyMessenger
  507. ifstr(i) $(KeyMessenger) != ""
  508. GetRegValue $(KeyMessenger) "DependOnService" DependInfo
  509. set Dependencies = *($(DependInfo),4)
  510. ifcontains(i) "netbios" in $(Dependencies)
  511. set newDependencies = {}
  512. ForListDo $(Dependencies)
  513. ifstr(i) $($) != "netbios"
  514. ifstr(i) $(newDependencies) == {}
  515. set newDependencies = {$($)}
  516. else
  517. set newDependencies = >($(newDependencies),$($))
  518. endif
  519. endif
  520. EndForListDo
  521. SetRegValue $(KeyMessenger) {"DependOnService",$(NoTitle),$(!REG_VT_MULTI_SZ),$(newDependencies)}
  522. endif
  523. endif
  524. goto end
  525. ;-----------------------------------------------
  526. ; Upgrade Software section
  527. ;-----------------------------------------------
  528. UpgradeSoftware = +
  529. ; Upgrade software component
  530. ;
  531. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  532. Ifstr $(KeyProduct) != $(KeyNull)
  533. install "Install-Update"
  534. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  535. goto fatal
  536. endif
  537. ; Upgrade the version number
  538. ;
  539. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  540. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  541. ;
  542. ; Update description and op support
  543. ;
  544. SetRegValue $(KeyProduct) {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)}
  545. SetRegValue $(KeyProduct) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  546. ;
  547. ; Update the RPC NetBIOS provider information
  548. ;
  549. Shell $(UtilityInf) AddMixRpcProtocol "Netbios" "nbf" "ncacn_nb_nb" "rpclt1.dll" "rpclt1.dll"
  550. Shell $(UtilityInf) AddMixRpcProtocol "Netbios" "nwlnkipx" "ncacn_nb_ipx" "rpclt1.dll" "rpclt1.dll"
  551. Shell $(UtilityInf) AddMixRpcProtocol "Netbios" "tcpip" "ncacn_nb_tcp" "rpclt1.dll" "rpclt1.dll"
  552. ;
  553. ; do nothing for update
  554. ;
  555. LibraryProcedure Result, $(!LIBHANDLE), SetupChangeServiceStart, NetBIOS, 3
  556. CloseRegKey $(KeyProduct)
  557. OpenRegKey $(!REG_H_LOCAL) "" $(ParamKeyName)"\Winsock" $(MAXIMUM_ALLOWED) WinsockKey
  558. Ifstr $(WinsockKey) != $(KeyNull)
  559. CloseRegKey $(WinsockKey)
  560. ; Update winsock mappings
  561. Shell $(UtilityInf) UpdateWinsockMappings "NetBIOS" "%SystemRoot%\system32\wshnetbs.dll"
  562. ifstr(i) $($R0) != NO_ERROR
  563. goto fatalregistry
  564. endif
  565. else
  566. Shell $(UtilityInf), AddWinsockInfo, +
  567. "NetBIOS", +
  568. "%SystemRoot%\system32\wshnetbs.dll", +
  569. 20,20
  570. set RegistryErrorIndex = $($R0)
  571. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  572. Debug-Output "OEMNSVNB.INF: Registry error: Add Winsock Info."
  573. Endif
  574. Endif
  575. else
  576. ;
  577. ; Cannot Open software key, goto ERROR
  578. ;
  579. goto fatalregistry
  580. endif
  581. goto end
  582. ;
  583. ; End of Upgrade Software
  584. ;
  585. ;
  586. ; Escape hatches
  587. ;
  588. successful = +
  589. goto end
  590. ;
  591. ; info display
  592. ;
  593. infomsg =+
  594. read-syms InfoDlg
  595. ui start "Warning"
  596. set CommonStatus = STATUS_USERCANCEL
  597. goto end
  598. ;
  599. ; warning display
  600. ;
  601. warning = +
  602. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  603. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  604. goto ShellCodeError
  605. endif
  606. ifstr(i) $($R1) == "OK"
  607. goto $(to)
  608. else-ifstr(i) $($R1) == "CANCEL"
  609. goto $(from)
  610. else
  611. ; Debug-Msg "Error Error Bad DLGEVENT"
  612. goto "end"
  613. endif
  614. ;
  615. ; non fatal error display
  616. ;
  617. nonfatal = +
  618. ifstr(i) $(Error) == ""
  619. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  620. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  621. goto ShellCodeError
  622. endif
  623. set Error = $($R0)
  624. endif
  625. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(Error)
  626. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  627. goto ShellCodeError
  628. endif
  629. ifstr(i) $($R1) == "OK"
  630. goto $(from)
  631. else
  632. goto "end"
  633. endif
  634. ;
  635. ; Registry is broken
  636. ;
  637. fatalregistry = +
  638. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  639. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  640. goto ShellCodeError
  641. endif
  642. set Error = $($R0)
  643. goto fatal
  644. ;
  645. ; fatal error display
  646. ;
  647. fatal = +
  648. ifstr(i) $(Error) == ""
  649. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  650. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  651. goto ShellCodeError
  652. endif
  653. set Error = $($R0)
  654. endif
  655. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  656. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  657. goto ShellCodeError
  658. endif
  659. goto setfailed
  660. ;
  661. ; Shelling error
  662. ;
  663. ShellCodeError = +
  664. set DlgType = "MessageBox"
  665. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  666. set STF_MB_TEXT = $(ShellCodeErrorText)
  667. set STF_MB_TYPE = 1
  668. set STF_MB_ICON = 3
  669. set STF_MB_DEF = 1
  670. ui start "Error Message"
  671. goto setfailed
  672. setfailed = +
  673. set CommonStatus = STATUS_FAILED
  674. ;
  675. ; If OEM_ABANDON_ON, we need to clean up the registry
  676. ;
  677. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  678. set OEM_ABANDON_ON = FALSE
  679. goto removeadapter
  680. endif
  681. goto end
  682. end = +
  683. goto term
  684. term = +
  685. Return $(CommonStatus)
  686. ;***************************************************************
  687. ; INSTALL SECTIONS
  688. ;***************************************************************
  689. [Install-Option]
  690. set STF_VITAL = ""
  691. ifstr(i) $(AddCopy) == "YES"
  692. ;
  693. ; Add the files to the copy list
  694. ;
  695. ; BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  696. ; the other INF files
  697. ;
  698. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  699. endif
  700. ifstr(i) $(DoCopy) == "YES"
  701. ;
  702. ; Copy files in the copy list
  703. ;
  704. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  705. CopyFilesInCopyList
  706. endif
  707. ifstr(i) $(DoConfig) == "YES"
  708. ;
  709. ; Add product to registry
  710. ;
  711. ;
  712. ; Finish up
  713. endif
  714. Exit
  715. [Install-Update]
  716. set STF_VITAL = ""
  717. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  718. ;set STF_VERSION = "YES"
  719. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  720. exit