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.

1114 lines
37 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNSVRR.INF
  4. ;
  5. ; NWLNK RIP service
  6. ;
  7. ; History:
  8. ; ramc 02-20-95 Created
  9. ;***********************************************************************
  10. ;-----------------------------------------------------------------------
  11. ; OPTION TYPE
  12. ; -----------
  13. ; This identifies the Option type we are dealing with. The different
  14. ; possible types are:
  15. ;
  16. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  17. ;
  18. ; Types specific to networking:
  19. ;
  20. ; NetAdapter, a netcard / adapter combination or just a netcard
  21. ; NetDriver, just a netcard driver
  22. ; NetTransport, a complete NDIS-compliant TDI transport stack
  23. ; NetService, an NT networking service
  24. ; NetWork, a complete network ensemble.
  25. ; NetProvider a complete network which supports NT MPR protocol
  26. ;-----------------------------------------------------------------------
  27. [Identification]
  28. OptionType = NetService
  29. ;-----------------------------------------------------------------------
  30. ; OPTION LIST
  31. ; -----------
  32. ; This section lists the OEM Option key names. These keys are locale
  33. ; independent and used to represent the option in a locale independent
  34. ; manner.
  35. ;
  36. ;-----------------------------------------------------------------------
  37. [Options]
  38. NWLNKRIP
  39. ;***********************************************************************
  40. ; CONSTANTS FOR USING DIALOGS
  41. ;***********************************************************************
  42. [FileConstants]
  43. ;
  44. ; Product Info
  45. ;
  46. Manufacturer = "Microsoft"
  47. ProductMajorVersion = "4"
  48. ProductMinorVersion = "0"
  49. SoftwareType = "service"
  50. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  51. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  52. ;================================================================
  53. ; Service Information
  54. ;
  55. ;================================================================
  56. ;
  57. ProductNWLNKRIPName = "NwlnkRip"
  58. ProductNWLNKRIPImagePath = "%SystemRoot%\system32\drivers\nwlnkrip.sys"
  59. ProductSAPName = "SAP"
  60. ;
  61. ; Registry Key Names
  62. ;
  63. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\NwlnkRip\CurrentVersion"
  64. ProductSAPKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\NwSapAgent"
  65. [GeneralConstants]
  66. ;
  67. ; File names, etc.
  68. ;
  69. UtilityInf = "UTILITY.INF"
  70. subroutineinf = "SUBROUTN.INF"
  71. Exit_Code = 0
  72. ;ShellCode = 0
  73. BillboardVisible = 0
  74. ;
  75. ; Program flow control variables.
  76. ;
  77. from = ""
  78. to = ""
  79. ;
  80. ; Return codes; Exit_Code is set to one of these
  81. ;
  82. ExitCodeOk = 0
  83. ExitCodeCancel = 1
  84. ExitCodeFatal = 2
  85. KeyNull = ""
  86. MAXIMUM_ALLOWED = 33554432
  87. SERVICE_NO_CHANGE = 4294967295
  88. RegistryErrorIndex = NO_ERROR
  89. KeyProduct = ""
  90. KeyParameters = ""
  91. TRUE = 1
  92. FALSE = 0
  93. NoTitle = 0
  94. ExitState = "Active"
  95. OldVersionExisted = $(FALSE)
  96. ; !DebugOutputControl = 0
  97. [date]
  98. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  99. ; Minute, Second }
  100. Now = {} ? $(!LIBHANDLE) GetSystemDate
  101. ;---------------------------------------------------------------------------
  102. ; 1. Identify
  103. ;
  104. ; DESCRIPTION: To verify that this INF deals with the same type of options
  105. ; as we are choosing currently.
  106. ;
  107. ; INPUT: None
  108. ;
  109. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  110. ; $($R1): Option Type (COMPUTER ...)
  111. ; $($R2): Diskette description
  112. ;---------------------------------------------------------------------------
  113. [Identify]
  114. ;
  115. ;
  116. read-syms Identification
  117. set Status = STATUS_SUCCESSFUL
  118. set Identifier = $(OptionType)
  119. set Media = #("Source Media Descriptions", 1, 1)
  120. Return $(Status) $(Identifier) $(Media)
  121. ;------------------------------------------------------------------------
  122. ; 2. ReturnOptions:
  123. ;
  124. ; DESCRIPTION: To return the option list supported by this INF and the
  125. ; localised text list representing the options.
  126. ;
  127. ;
  128. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  129. ;
  130. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  131. ; STATUS_NOLANGUAGE
  132. ; STATUS_FAILED
  133. ;
  134. ; $($R1): Option List
  135. ; $($R2): Option Text List
  136. ;------------------------------------------------------------------------
  137. [ReturnOptions]
  138. ;
  139. ;
  140. set Status = STATUS_FAILED
  141. set OptionList = {}
  142. set OptionTextList = {}
  143. ;
  144. ; Check if the language requested is supported
  145. ;
  146. set LanguageList = ^(LanguagesSupported, 1)
  147. Ifcontains(i) $($0) in $(LanguageList)
  148. goto returnoptions
  149. else
  150. set Status = STATUS_NOLANGUAGE
  151. goto finish_ReturnOptions
  152. endif
  153. ;
  154. ; form a list of all the options and another of the text representing
  155. ;
  156. returnoptions = +
  157. ; allow installation only on Advanced server
  158. ifstr(i) $(!STF_PRODUCT) != WINNT
  159. set OptionList = ^(Options, 1)
  160. set OptionTextList = ^(OptionsText$($0), 1)
  161. endif
  162. set Status = STATUS_SUCCESSFUL
  163. finish_ReturnOptions = +
  164. Return $(Status) $(OptionList) $(OptionTextList)
  165. ;----------InstallOption-------------------------------------------------
  166. ;
  167. ; InstallOption:
  168. ;
  169. ; This section is shelled to by main installation processing
  170. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  171. ;
  172. ;
  173. ; FUNCTION: To copy files representing Options
  174. ; To configure the installed option
  175. ; To update the registry for the installed option
  176. ;
  177. ; INPUT: $($0): Language to use
  178. ; $($1): OptionID to install
  179. ; $($2): SourceDirectory
  180. ; $($3): AddCopy (YES | NO)
  181. ; $($4): DoCopy (YES | NO)
  182. ; $($5): DoConfig (YES | NO)
  183. ;
  184. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  185. ; STATUS_NOLANGUAGE |
  186. ; STATUS_USERCANCEL |
  187. ; STATUS_FAILED
  188. ;
  189. ;------------------------------------------------------------------------
  190. [InstallOption]
  191. ;
  192. ; extract parameters
  193. ;
  194. set Option = $($1)
  195. set SrcDir = $($2)
  196. set AddCopy = $($3)
  197. set DoCopy = $($4)
  198. set DoConfig = $($5)
  199. set InstallFrom = $($6)
  200. ifstr(i) $(InstallFrom) == ""
  201. set InstallFrom = "NWLNKRIP"
  202. endif
  203. ;
  204. ; Check if the language requested is supported
  205. ;
  206. set LanguageList = ^(LanguagesSupported, 1)
  207. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  208. Return STATUS_NOLANGUAGE
  209. endif
  210. ; define all the constants
  211. set-subst LF = "\n"
  212. read-syms GeneralConstants
  213. read-syms FileConstants
  214. read-syms DialogConstants$(!STF_LANGUAGE)
  215. ifstr(i) $(!NTN_Origination) == "NCPA"
  216. set Continue = $(OK)
  217. endif
  218. read-syms FileConstants$(!STF_LANGUAGE)
  219. detect date
  220. set-title $(FunctionTitle)
  221. set to = Begin
  222. set from = Begin
  223. ;
  224. ; Assume all is well.
  225. ;
  226. set CommonStatus = STATUS_SUCCESSFUL
  227. EndWait
  228. ;
  229. ; Set up the operation-mode-based variables and gaily welcome
  230. ; the user. If the "install mode" variable is improperly set,
  231. ; assume this is a new installation.
  232. ;
  233. Begin = +
  234. Ifstr(i) $(!NTN_InstallMode) == deinstall
  235. set StartLabel = removeadapter
  236. else-Ifstr(i) $(!NTN_InstallMode) == Update
  237. set StartLabel = UpgradeSoftware
  238. else-Ifstr(i) $(!NTN_InstallMode) == configure
  239. set StartLabel = configureadapter
  240. else-Ifstr(i) $(!NTN_InstallMode) == bind
  241. set StartLabel = bindingadapter
  242. else
  243. set StartLabel = installadapter
  244. set OEM_ABANDON_SOFTWARE = {}
  245. set OEM_ABANDON_OPTIONS = {}
  246. endif
  247. set from = $(fatal)
  248. set to = $(fatal)
  249. goto $(StartLabel)
  250. ;-----------------------------------------------
  251. ; Installation Section
  252. ;-----------------------------------------------
  253. installadapter = +
  254. set OEM_ABANDON_ON = TRUE
  255. StartWait
  256. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeySoftware
  257. Ifstr(i) $(KeySoftware) == $(KeyNull)
  258. ifstr(i) $(!NTN_InstallMode) == "install"
  259. Ifstr(i) $(DoCopy) == "YES"
  260. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  261. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  262. Goto ShellCodeError
  263. Else-Ifstr(i) $($R0) == STATUS_FAILED
  264. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  265. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  266. goto ShellCodeError
  267. endif
  268. set Error = $($R0)
  269. Goto fatal
  270. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  271. Goto successful
  272. Endif
  273. Set SrcDir = $($R1)
  274. Endif
  275. set NwlnkName = "NWLINKIPX"
  276. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\NWLINKIPX" $(MAXIMUM_ALLOWED) BS_KeyServices
  277. Ifstr $(BS_KeyServices) == $(KeyNull)
  278. ;
  279. ;Check for new NWLNKIPX
  280. ;
  281. set NwlnkName = "NWLNKIPX"
  282. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\NWLNKIPX" $(MAXIMUM_ALLOWED) BS_KeyServices
  283. Ifstr $(BS_KeyServices) == $(KeyNull)
  284. ;
  285. ; Set up nwlink for the user
  286. ;
  287. Shell "oemnxpip.inf" ReturnOptions $(!STF_LANGUAGE)
  288. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  289. set OldStfSrcDir = $(!STF_SRCDIR_OVERRIDE)
  290. set !STF_SRCDIR_OVERRIDE = ""
  291. set NwlnkName = *($($R1),1)
  292. Shell "oemnxpip.inf" InstallOption $(!STF_LANGUAGE), *($($R1),1),+
  293. $(SrcDir), $(AddCopy), "NO", $(DoConfig)
  294. set !STF_SRCDIR_OVERRIDE = $(OldStfSrcDir)
  295. else
  296. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(InstallNWLINKFirst)
  297. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  298. goto ShellCodeError
  299. endif
  300. goto end
  301. endif
  302. else
  303. CloseRegKey $(BS_KeyServices)
  304. endif
  305. else
  306. CloseRegKey $(BS_KeyServices)
  307. endif
  308. Debug-Output "OEMNSVRR.INF: installadapter: installing [Install-Option]"
  309. install "Install-Option"
  310. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  311. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  312. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  313. goto ShellCodeError
  314. endif
  315. set Error = $($R0)
  316. goto fatal
  317. endif
  318. endif
  319. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\NWLNKRIP" $(MAXIMUM_ALLOWED) KeyService
  320. Ifstr(i) $(KeyService) == $(KeyNull)
  321. Shell $(UtilityInf), AddSoftwareComponent, "Microsoft", +
  322. $(ProductNWLNKRIPName), +
  323. $(ProductNWLNKRIPName), +
  324. $(ProductNWLNKRIPDisplayName), +
  325. $(STF_CONTEXTINFNAME),+
  326. $(ProductNWLNKRIPImagePath), +
  327. "kernelautostart" , "", {"NWLNKIPX"}, ""
  328. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  329. Debug-Output "OEMNSVRR.INF: ShellCode error"
  330. return STATUS_FAILED
  331. endif
  332. set RegistryErrorIndex = $($R0)
  333. set ProductKey = $($R1)
  334. set RuleKey = $($R2)
  335. CloseRegKey $($R3)
  336. set ParamKey = $($R4)
  337. CloseRegKey $($R5)
  338. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  339. EndWait
  340. Debug-Output "OEMNSVRR.INF: Registry Error "$(RegistryErrorIndex)
  341. CloseRegKey $($R1)
  342. CloseRegKey $($R2)
  343. CloseRegKey $($R4)
  344. goto fatalregistry
  345. endif
  346. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  347. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  348. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductNWLNKRIPTitle)},+
  349. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductNWLNKRIPDescription)},+
  350. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  351. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}, +
  352. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  353. Shell $(UtilityInf), AddValueList, $(ProductKey), $(NewValueList)
  354. CloseRegKey $(ProductKey)
  355. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  356. Debug-Output "utility.INF: ShellCode error. Cannot add NWLNKRIP router service"
  357. goto ShellCodeError
  358. endif
  359. set RegistryErrorIndex = $($R0)
  360. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  361. EndWait
  362. Debug-Output "OEMNSVRR.INF: error: create service"
  363. set Status = STATUS_FAILED
  364. endif
  365. set NewValueList = {{InfOption,$(NoTitle),$(!REG_VT_SZ),"NWLNKRIP"}}
  366. Shell $(UtilityInf), AddValueList, $(RuleKey), $(NewValueList)
  367. CloseRegKey $(RuleKey)
  368. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  369. Debug-Output "utility.INF: ShellCode error. Cannot add NWLNKRIP service"
  370. goto ShellCodeError
  371. endif
  372. set RegistryErrorIndex = $($R0)
  373. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  374. EndWait
  375. Debug-Output "OEMNSVRR.INF: Registry error: create service"
  376. set Status = STATUS_FAILED
  377. endif
  378. ; by default disable "Netbios broadcast propogation" - type 20 pkts
  379. ; and enable the lan to lan routing
  380. SetRegValue $(ParamKey) {NetbiosRouting, $(NoTitle), $(!REG_VT_DWORD), 0}
  381. SetRegValue $(ParamKey) {EnableLanRouting, $(NoTitle), $(!REG_VT_DWORD), 1}
  382. CloseRegKey $(ParamKey)
  383. else
  384. ; we got here because the SOFTWARE key is not present, but the
  385. ; NWLNKRIP service is already installed. This can happen only
  386. ; if RAS installed NWLNKRIP by itself.
  387. ; This should be fixed to ensure that NWLNKRIP service
  388. ; doesn't get blown away if RAS is removed while other
  389. ; consumers of this service are still around.
  390. ; This is done by installing the software component and
  391. ; adding the useref reference count mechanism.
  392. ; RAS installer used the old style UseRef mechanism, so set the
  393. ; UseRef to 1 for the component we are installing.
  394. OpenRegKey $(KeyService) "" "Parameters\UseRef" $(MAXIMUM_ALLOWED) KeyUseRef
  395. Ifstr(i) $(KeyUseRef) != $(KeyNull)
  396. SetRegValue $(KeyUseRef) {$(InstallFrom) , 0, $(!REG_VT_SZ), "1"}
  397. CloseRegKey $(KeyUseRef)
  398. Endif
  399. OpenRegKey $(KeyService) "" "Parameters" $(MAXIMUM_ALLOWED) KeyParam
  400. Ifstr(i) $(KeyParam) != $(KeyNull)
  401. GetRegValue $(KeyParam),"NetbiosRouting", NetbiosRoutingInfo
  402. Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  403. ; if this parameter is not present, default to
  404. ; disable "Netbios broadcast propogation" - type 20 pkts
  405. SetRegValue $(KeyParam) {NetbiosRouting, $(NoTitle), $(!REG_VT_DWORD), 0}
  406. endif
  407. GetRegValue $(KeyParam),"EnableLanRouting", EnableLanRoutingInfo
  408. Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  409. ; if this parameter is not present, default to 1
  410. SetRegValue $(ParamKey) {EnableLanRouting, $(NoTitle), $(!REG_VT_DWORD), 1}
  411. endif
  412. CloseRegKey $(KeyParam)
  413. endif
  414. CloseRegKey $(KeyService)
  415. ; now install the software key and add other values
  416. Shell $(UtilityInf), InstallSoftwareProduct, $(Manufacturer), $(ProductNWLNKRIPName), $(STF_CONTEXTINFNAME)
  417. set RegistryErrorIndex = $($R0)
  418. Ifstr(i) $(RegistryErrorIndex) == NO_ERROR
  419. set KeyVersion = $($R1)
  420. set KeyRules = $($R2)
  421. set NewValueList = {{MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  422. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductNWLNKRIPTitle)},+
  423. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductNWLNKRIPDescription)},+
  424. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  425. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  426. Shell $(UtilityInf), AddValueList, $(KeyVersion), $(NewValueList)
  427. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  428. Debug-Output "utility.INF: ShellCode error. Cannot add NWLNKRIP router service"
  429. goto ShellCodeError
  430. endif
  431. set RegistryErrorIndex = $($R0)
  432. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  433. EndWait
  434. Debug-Output "OEMNSVRR.INF: error: Add values to version key"
  435. set Status = STATUS_FAILED
  436. endif
  437. set NewValueList = {{InfOption,$(NoTitle),$(!REG_VT_SZ),"NWLNKRIP"}}
  438. Shell $(UtilityInf), AddValueList, $(KeyRules), $(NewValueList)
  439. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  440. Debug-Output "utility.INF: ShellCode error. Cannot add NWLNKRIP netrule value"
  441. goto ShellCodeError
  442. endif
  443. set RegistryErrorIndex = $($R0)
  444. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  445. EndWait
  446. Debug-Output "OEMNSVRR.INF: Registry error: Add netrule"
  447. set Status = STATUS_FAILED
  448. endif
  449. ; establish the link to the NWLNKRIP service
  450. Shell $(UtilityInf), LinkToService, $(KeyVersion), "NWLNKRIP", service
  451. set RegistryErrorIndex = $($R0)
  452. Ifstr(i) $(RegistryErrorIndex) == NO_ERROR
  453. ;
  454. ; Add Reference Counter
  455. ;
  456. GetRegValue $(KeyVersion),"RefCount", RefCountInfo
  457. Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  458. ; no RefCount variable
  459. SetRegValue $(KeyVersion) {RefCount,$(NoTitle),$(!REG_VT_DWORD),0}
  460. endif
  461. ; Add RAS to the new UseRef mechanism
  462. Shell "" AddNWLNKRIPUsed "RAS"
  463. endif
  464. ifstr $(KeyVersion) != $(KeyNull)
  465. CloseRegKey $(KeyVersion)
  466. endif
  467. ifstr $(KeyRules) != $(KeyNull)
  468. CloseRegKey $(KeyRules)
  469. endif
  470. endif
  471. endif
  472. Else
  473. GetRegValue $(KeySoftware) "MajorVersion" VersionInfo
  474. set VersionMajor = *($(VersionInfo), 4)
  475. GetRegValue $(KeySoftware) "MinorVersion" VersionInfo
  476. set VersionMinor = *($(VersionInfo), 4)
  477. set InstalledVersion = $(VersionMajor)"."$(VersionMinor)
  478. ; display the VerExists dialog only if the RIP router is installed
  479. ; from NCPA directly - not if some other component is installing us
  480. ifstr(i) $(InstallFrom) == "NWLNKRIP"
  481. read-syms VerExists$(!STF_LANGUAGE)
  482. set Text = $(Product$(Option)Title)$(Ver)$(ProductVersion)+
  483. $(Text1)
  484. Shell $(subroutineinf), SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(Text)
  485. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  486. Goto fatal
  487. Else-Ifstr(i) $($R0) == STATUS_FAILED
  488. Goto fatal
  489. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  490. Goto end
  491. Endif
  492. else
  493. Shell "" AddNWLNKRIPUsed $(InstallFrom)
  494. endif
  495. goto end
  496. EndIf
  497. Ifstr(i) $(KeySoftware) != $(KeyNull)
  498. CloseRegKey $(KeySoftware)
  499. endif
  500. ; Add the name of the component installing NWLNKRIP to UseRef
  501. Shell "" AddNWLNKRIPUsed $(InstallFrom)
  502. OpenRegKey $(!REG_H_LOCAL) "" $(ProductSAPKeyName) $(MAXIMUM_ALLOWED) SAPKeyProduct
  503. ifstr(i) $(SAPKeyProduct) == ""
  504. set !STF_SRCDIR_OVERRIDE = $(SrcDir)
  505. Shell "oemnsvsa.inf" InstallOption $(!STF_LANGUAGE) "SAP" +
  506. $(SrcDir) $(AddCopy) $(DoCopy) $(DoConfig) "NWLNKRIP"
  507. endif
  508. ;In current IPX stack the size of routing table hash is 7. With RAS or FPNW installed and IPX routing
  509. ;enabled by use of nwlnkrip driver this severely decreases the performance:
  510. ;for each packet forwarded or even sent from the machine the hash table has to be scanned to
  511. ;confirm existence of the route.
  512. ;In fact this may be the main reason of bad performance results for NT RAS over IPX.
  513. ; Upon installation of nwlnkrip.sys, setup should add a value
  514. ;\\HKLM\System\CurrentControlSet\Services\NwLnkIpx\Parameters\RipTableSize = 255.
  515. OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\NwLnkIpx\Parameters" $(MAXIMUM_ALLOWED) KeyIpx
  516. IfStr(i) $(KeyIpx) != ""
  517. GetRegValue $(KeyIpx), "RipTableSize", RipTableInfo
  518. Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  519. ; not defined, so set value to 255
  520. SetRegValue $(KeyIpx) {RipTableSize, $(NoTitle), $(!REG_VT_DWORD), 255}
  521. endif
  522. CloseRegKey $(KeyIpx)
  523. EndIf
  524. EndWait
  525. ; allow the user to configure the router
  526. goto configureadapter
  527. ;-----------------------------------------------
  528. ; Configuration Section
  529. ;-----------------------------------------------
  530. configureadapter = +
  531. ; default is user doesn't change anything
  532. ifstr(i) $(!NTN_InstallMode) == configure
  533. set CommonStatus = STATUS_NO_EFFECT
  534. endif
  535. ; Do this only if this is an attended install
  536. ; (note that RAS and other installers can call this inf file to
  537. ; install during upgrade and we don't want to throw a dialog if the
  538. ; install is being done during unattended upgrade).
  539. Debug-Output "OEMNSVRR.INF: !STF_UNATTENDED = "$(!STF_UNATTENDED)
  540. set Unattended = NO
  541. ifstr(i) $(!STF_UNATTENDED) == "YES"
  542. set Unattended = "YES"
  543. else-ifstr(i) $(!STF_UNATTENDED) != ""
  544. set Unattended = "YES"
  545. else-ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  546. set Unattended = "YES"
  547. endif
  548. ifstr(i) $(Unattended) == NO
  549. ; default to disable "Netbios broadcast propogation"
  550. set NetbiosRouting = 0
  551. ; find out what the current setting is
  552. set ServiceName = $(!NTN_ServiceBase)"\NWLNKRIP\Parameters"
  553. OpenRegKey $(!REG_H_LOCAL) "" $(ServiceName) $(MAXIMUM_ALLOWED) KeyParam
  554. Ifstr(i) $(KeyParam) != $(KeyNull)
  555. GetRegValue $(KeyParam),"NetbiosRouting", NetbiosRoutingInfo
  556. Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  557. set NetbiosRouting = *($(NetbiosRoutingInfo), 4)
  558. else
  559. ; not defined, so set the default value
  560. SetRegValue $(KeyParam) {NetbiosRouting, $(NoTitle), $(!REG_VT_DWORD), 0}
  561. endif
  562. else
  563. ; let the user know there is a problem
  564. read-syms ConfigErrorTxt$(!STF_LANGUAGE)
  565. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) WARNING $(Error)
  566. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  567. goto ShellCodeError
  568. endif
  569. goto end
  570. endif
  571. ; display an appropriate message depending on whether Netbios broadcast
  572. ; propogation is enabled or disabled.
  573. read-syms EnableNetbiosRoutingDlg$(!STF_LANGUAGE)
  574. ifint $(NetbiosRouting) == 0
  575. set STF_MB_TEXT = $(Disabled)
  576. else-ifint $(NetbiosRouting) == 2
  577. set STF_MB_TEXT = $(Disabled)
  578. else
  579. set STF_MB_TEXT = $(Enabled)
  580. endif
  581. ui start "EnableNetbiosDlg"
  582. ifstr(i) $(DLGEVENT) == "YES"
  583. ; yes the user wants to change the current setting
  584. ; both lan to lan and lan to wan are disabled, so enable
  585. ; lan to lan routing
  586. ifint $(NetbiosRouting) == 0
  587. set NetbiosRouting = 1
  588. ; Lan to Lan routing is enabled, so disable
  589. else-ifint $(NetbiosRouting) == 1
  590. set NetbiosRouting = 0
  591. ; lan to wan is enabled, but lan to lan is disabled, so enable
  592. ; lan to lan
  593. else-ifint $(NetbiosRouting) == 2
  594. set NetbiosRouting = 3
  595. ; both lan to lan and lan to wan are enabled, only disable lan to lan
  596. else-ifint $(NetbiosRouting) == 3
  597. set NetbiosRouting = 2
  598. endif
  599. ifstr(i) $(KeyParam) != $(KeyNull)
  600. SetRegValue $(KeyParam) {NetbiosRouting, $(NoTitle), $(!REG_VT_DWORD), $(NetbiosRouting)}
  601. CloseRegKey $(KeyParam)
  602. set CommonStatus = STATUS_SUCCESSFUL
  603. endif
  604. endif
  605. endif
  606. goto end
  607. ;-----------------------------------------------
  608. ; Binding section
  609. ;-----------------------------------------------
  610. bindingadapter =+
  611. goto end
  612. ;-----------------------------------------------
  613. ; Removeadapter section
  614. ;
  615. ;
  616. ; Removal errors are ignored, since we want to
  617. ; try to remove as much as possible.
  618. ;-----------------------------------------------
  619. removeadapter = +
  620. set NwlnkRipKeyName = "System\CurrentControlSet\Services\NwlnkRip"
  621. set ProductNWLNKRIPName = "NwlnkRip"
  622. Shell "" RemoveNWLNKRIPUsed $(InstallFrom)
  623. OpenRegKey $(!REG_H_LOCAL) "" $(NwlnkRipKeyName) $(MAXIMUM_ALLOWED) BS_KeyServices
  624. Ifstr $(BS_KeyServices) != $(KeyNull)
  625. CloseRegKey $(BS_KeyServices)
  626. Shell "" NumOfUsed
  627. set NumOfUsed = $($R0)
  628. ; if the number of consumers using NWLNKRIP is 1 AND
  629. ; if the only consumer is RAS AND
  630. ; if RAS is not installed, change NumOfUsed to 0 so
  631. ; that the NWLNKRIP service can be removed.
  632. ; This needs to be done because, RAS installed NWLNKRIP in
  633. ; the old way and so the reference counting is kind of wacky.
  634. ifint $(NumOfUsed) == 1
  635. Shell "" FindUsed "RAS"
  636. set RasUsing = $($R0)
  637. ifstr(i) $(RasUsing) == TRUE
  638. Shell "oemnsvra.inf" CheckRasInstalled
  639. set RasInstalled = $($R0)
  640. ifstr(i) $(RasInstalled) == FALSE
  641. Debug-Output "OEMNSVRR.INF: The only consumer RAS is not installed, so removing NWLNKRIP service"
  642. set NumOfUsed = 0
  643. endif
  644. endif
  645. ; if the only consumer is NWLNKRIP, that means all other
  646. ; consumers have since been removed. So NWLNKRIP should
  647. ; be removed as well.
  648. Shell "" FindUsed "NWLNKRIP"
  649. ifstr(i) $($R0) == TRUE
  650. set NumOfUsed = 0
  651. endif
  652. endif
  653. ifint $(NumOfUsed) == 0
  654. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), $(ProductNWLNKRIPName)
  655. ; Remove the value that we added from the registry
  656. OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\NwLnkIpx\Parameters" $(MAXIMUM_ALLOWED) KeyIpx
  657. IfStr(i) $(KeyIpx) != ""
  658. GetRegValue $(KeyIpx), "RipTableSize", RipTableInfo
  659. Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  660. set RipTableSizeValue = *($(RipTableInfo), 4)
  661. ifint $(RipTableSizeValue) == 255
  662. ; most likely set by us, so remove this value now
  663. DeleteRegValue $(KeyIpx) "RipTableSize"
  664. endif
  665. endif
  666. CloseRegKey $(KeyIpx)
  667. EndIf
  668. else
  669. ifstr(i) $(InstallFrom) == "NWLNKRIP"
  670. read-syms InUse$(!STF_LANGUAGE)
  671. set from = end
  672. set to = end
  673. goto warning
  674. endif
  675. endif
  676. endif
  677. OpenRegKey $(!REG_H_LOCAL) "" $(ProductSAPKeyName) $(MAXIMUM_ALLOWED) SAPKeyProduct
  678. ifstr(i) $(SAPKeyProduct) != ""
  679. set OldInstallMode = $(!NTN_InstallMode)
  680. set !NTN_InstallMode = deinstall
  681. Shell "oemnsvsa.inf" InstallOption $(!STF_LANGUAGE) "SAP" +
  682. $(SrcDir) $(AddCopy) $(DoCopy) $(DoConfig) "NWLNKRIP"
  683. set !NTN_InstallMode = $(OldInstallMode)
  684. endif
  685. goto end
  686. ;-----------------------------------------------
  687. ; Upgrade Software section
  688. ;-----------------------------------------------
  689. UpgradeSoftware = +
  690. ; Upgrade software component
  691. ;
  692. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  693. Ifstr(i) $(KeyProduct) != $(KeyNull)
  694. install "Install-Update"
  695. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  696. goto fatal
  697. endif
  698. OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\NwLnkIpx\Parameters" $(MAXIMUM_ALLOWED) KeyIpx
  699. IfStr(i) $(KeyIpx) != ""
  700. GetRegValue $(KeyIpx), "RipTableSize", RipTableInfo
  701. Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  702. ; not defined, so set value to 255
  703. SetRegValue $(KeyIpx) {RipTableSize, $(NoTitle), $(!REG_VT_DWORD), 255}
  704. endif
  705. CloseRegKey $(KeyIpx)
  706. EndIf
  707. ;
  708. ; makesure a software type is defined
  709. ;
  710. SetRegValue $(KeyProduct) {SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)}
  711. ; Upgrade the version number
  712. ;
  713. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  714. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  715. ;
  716. ; Update description and op support
  717. ;
  718. SetRegValue $(KeyProduct) {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductNWLNKRIPDescription)}
  719. SetRegValue $(KeyProduct) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  720. ;
  721. ; do nothing for update
  722. ;
  723. CloseRegKey $(KeyProduct)
  724. endif
  725. goto end
  726. ;
  727. ; End of Upgrade Software
  728. ;
  729. ;
  730. ; Escape hatches
  731. ;
  732. successful = +
  733. goto end
  734. ;
  735. ; info display
  736. ;
  737. infomsg =+
  738. read-syms InfoDlg
  739. ui start "Warning"
  740. set CommonStatus = STATUS_USERCANCEL
  741. goto end
  742. ;
  743. ; warning display
  744. ;
  745. warning = +
  746. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "STATUS", $(Error)
  747. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  748. goto ShellCodeError
  749. endif
  750. ifstr(i) $($R1) == "OK"
  751. goto $(to)
  752. else-ifstr(i) $($R1) == "CANCEL"
  753. goto $(from)
  754. else
  755. ; Debug-Msg "Error Error Bad DLGEVENT"
  756. goto "end"
  757. endif
  758. ;
  759. ; non fatal error display
  760. ;
  761. nonfatalinfo = +
  762. Set CommonStatus = STATUS_USERCANCEL
  763. Set Severity = STATUS
  764. goto nonfatalmsg
  765. nonfatal = +
  766. Set Severity = NONFATAL
  767. goto nonfatalmsg
  768. nonfatalmsg = +
  769. ifstr(i) $(Error) == ""
  770. Set Severity = NONFATAL
  771. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  772. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  773. goto ShellCodeError
  774. endif
  775. set Error = $($R0)
  776. endif
  777. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  778. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  779. goto ShellCodeError
  780. endif
  781. ifstr(i) $($R1) == "OK"
  782. goto $(from)
  783. else
  784. goto "end"
  785. endif
  786. ;
  787. ; Registry is broken
  788. ;
  789. fatalregistry = +
  790. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  791. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  792. goto ShellCodeError
  793. endif
  794. set Error = $($R0)
  795. goto fatal
  796. ;
  797. ; fatal error display
  798. ;
  799. fatal = +
  800. ifstr(i) $(Error) == ""
  801. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  802. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  803. goto ShellCodeError
  804. endif
  805. set Error = $($R0)
  806. endif
  807. Ifint $(BillboardVisible) != 0
  808. Shell "subroutn.inf" PopBillboard
  809. Set BillboardVisible = 0
  810. Endif
  811. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  812. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  813. goto ShellCodeError
  814. endif
  815. goto setfailed
  816. ;
  817. ; Shelling error
  818. ;
  819. ShellCodeError = +
  820. set DlgType = "MessageBox"
  821. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  822. set STF_MB_TEXT = $(ShellCodeErrorText)
  823. set STF_MB_TYPE = 1
  824. set STF_MB_ICON = 3
  825. set STF_MB_DEF = 1
  826. ui start "Error Message"
  827. goto setfailed
  828. setfailed = +
  829. set CommonStatus = STATUS_FAILED
  830. ;
  831. ; If OEM_ABANDON_ON, we need to clean up the registry
  832. ;
  833. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  834. set OEM_ABANDON_ON = FALSE
  835. goto removeadapter
  836. endif
  837. goto end
  838. end = +
  839. goto term
  840. term = +
  841. Return $(CommonStatus)
  842. ;***************************************************************
  843. ; INSTALL SECTIONS
  844. ;***************************************************************
  845. [Install-Option]
  846. set STF_VITAL = "NO"
  847. ifstr(i) $(AddCopy) == "YES"
  848. ;
  849. ; Add the files to the copy list
  850. ;
  851. AddSectionFilesToCopyList Files-NWLNKRIP $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  852. endif
  853. ifstr(i) $(DoCopy) == "YES"
  854. ;
  855. ; Copy files in the copy list
  856. ;
  857. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  858. CopyFilesInCopyList
  859. endif
  860. ifstr(i) $(DoConfig) == "YES"
  861. ;
  862. ; Add product to registry
  863. ;
  864. ;
  865. ; Finish up
  866. endif
  867. Exit
  868. [Install-Update]
  869. set STF_VITAL = "NO"
  870. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  871. ;set STF_VERSION = "YES"
  872. AddSectionFilesToCopyList Files-NWLNKRIP $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  873. Exit
  874. [AddNWLNKRIPUsed]
  875. read-syms GeneralConstants
  876. read-syms FileConstants
  877. read-syms FileConstants$(!STF_LANGUAGE)
  878. set KeyName = $($0)
  879. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyService
  880. ifstr(i) $(KeyService) != ""
  881. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName)"\UseRef" $(MAXIMUM_ALLOWED) KeyUseRef
  882. ifstr(i) $(KeyUseRef) == ""
  883. CreateRegKey $(KeyService) {"UseRef",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyUseRef
  884. endif
  885. ifstr(i) $(KeyUseRef) != ""
  886. ;
  887. ; Set up the usage reference
  888. ;
  889. SetRegValue $(KeyUseRef) {$(KeyName),$(NoTitle),$(!REG_VT_SZ),"1"}
  890. CloseRegKey $(KeyUseRef)
  891. endif
  892. CloseRegKey $(KeyService)
  893. else
  894. ; debug-output "error: cannot open product key"
  895. endif
  896. return
  897. [RemoveNWLNKRIPUsed]
  898. read-syms GeneralConstants
  899. read-syms FileConstants
  900. read-syms FileConstants$(!STF_LANGUAGE)
  901. set KeyName = $($0)
  902. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyService
  903. ifstr(i) $(KeyService) != ""
  904. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName)"\UseRef" $(MAXIMUM_ALLOWED) KeyUseRef
  905. ifstr(i) $(KeyUseRef) == ""
  906. CreateRegKey $(KeyService) {"UseRef",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyUseRef
  907. endif
  908. ifstr(i) $(KeyUseRef) != ""
  909. ;
  910. ; Delete the usage reference
  911. ;
  912. DeleteRegValue $(KeyUseRef) $(KeyName)
  913. CloseRegKey $(KeyUseRef)
  914. endif
  915. CloseRegKey $(KeyService)
  916. else
  917. ; debug-output "error: cannot open product key"
  918. endif
  919. return
  920. [NumOfUsed]
  921. read-syms GeneralConstants
  922. read-syms FileConstants
  923. read-syms FileConstants$(!STF_LANGUAGE)
  924. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyService
  925. ifstr(i) $(KeyService) != ""
  926. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName)"\UseRef" $(MAXIMUM_ALLOWED) KeyUseRef
  927. ifstr(i) $(KeyUseRef) == ""
  928. CreateRegKey $(KeyService) {"UseRef",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyUseRef
  929. endif
  930. ifstr(i) $(KeyUseRef) != ""
  931. ;
  932. ; enumerate the usage reference
  933. ;
  934. EnumRegValue $(KeyUseRef) UsageList
  935. set Num = 0
  936. ForListDo $(UsageList)
  937. set-add Num = $(Num), 1
  938. EndForListDo
  939. CloseRegKey $(KeyUseRef)
  940. endif
  941. CloseRegKey $(KeyService)
  942. else
  943. ; debug-output "error: cannot open product key"
  944. endif
  945. return $(Num)
  946. [FindUsed]
  947. read-syms GeneralConstants
  948. read-syms FileConstants
  949. read-syms FileConstants$(!STF_LANGUAGE)
  950. set KeyName = $($0)
  951. set Find = FALSE
  952. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyService
  953. ifstr(i) $(KeyService) != ""
  954. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName)"\UseRef" $(MAXIMUM_ALLOWED) KeyUseRef
  955. ifstr(i) $(KeyUseRef) == ""
  956. CreateRegKey $(KeyService) {"UseRef",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyUseRef
  957. endif
  958. ifstr(i) $(KeyUseRef) != ""
  959. ;
  960. ; Find the vairable
  961. ;
  962. GetRegValue $(KeyUseRef),$(KeyName), KeyInfo
  963. ifstr(i) $(RegLastError) == $(!REG_ERROR_SUCCESS)
  964. set Find = TRUE
  965. endif
  966. CloseRegKey $(KeyUseRef)
  967. endif
  968. CloseRegKey $(KeyService)
  969. else
  970. ; debug-output "error: cannot open product key"
  971. endif
  972. return $(Find)
  973.