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.

1150 lines
35 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNSVSV.INF
  4. ;
  5. ; Server 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 server 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. SRV
  46. ; XACTSRV
  47. ;***********************************************************************
  48. ; CONSTANTS FOR USING DIALOGS
  49. ;***********************************************************************
  50. [FileConstants]
  51. ;
  52. ; File names, etc.
  53. ;
  54. UtilityInf = "UTILITY.INF"
  55. subroutineinf = "SUBROUTN.INF"
  56. SoftwareType = "service"
  57. Exit_Code = 0
  58. ;ShellCode = 0
  59. ;
  60. ; EventLog Message File
  61. ;
  62. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  63. IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
  64. ;
  65. ; Product Info
  66. ;
  67. Manufacturer = "Microsoft"
  68. ProductMajorVersion = "4"
  69. ProductMinorVersion = "0"
  70. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  71. ProductOpSupportWKSTA = 132 ; 0x0084 ; Display,Removable,NOT Properties,Not Updatable
  72. ProductOpSupportSERVER = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  73. ;
  74. ; Software
  75. ;
  76. ProductSRVName = "LanmanServer"
  77. ProductSRVImagePath = "%SystemRoot%\System32\services.exe"
  78. NetRuleSRVType = "srv lmNetService lanmanServer"
  79. NetRuleSRVClass = {"lanmanServer lmNetService"}
  80. NetRuleSRVUse = $(SoftwareType)" yes yes"
  81. NetRuleSRVBindForm = """LanmanServer"" yes yes container"
  82. ;
  83. ProductXACTSRVName = "XactSrv"
  84. ProductXACTSRVImagePath = "%SystemRoot%\System32\services.exe"
  85. ProductSRVSRVName = "Srv"
  86. ; DavidHov,6/11: Use NT-style name for ImagePath
  87. ProductSRVSRVImagePath = "\SystemRoot\System32\drivers\srv.sys"
  88. ;
  89. ; Registry Key
  90. ;
  91. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(Product$(Option)Name)"\CurrentVersion"
  92. ParamKeyName = $(!NTN_ServiceBase)"\"$(Product$(Option)Name)"\Parameters"
  93. SessMgrMemMgtKeyName = "SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management"
  94. [GeneralConstants]
  95. ;
  96. ; Program flow control variables.
  97. ;
  98. from = ""
  99. to = ""
  100. ;
  101. ; Return codes; Exit_Code is set to one of these
  102. ;
  103. ExitCodeOk = 0
  104. ExitCodeCancel = 1
  105. ExitCodeFatal = 2
  106. KeyNull = ""
  107. MAXIMUM_ALLOWED = 33554432
  108. SERVICE_NO_CHANGE = 4294967295
  109. RegistryErrorIndex = NO_ERROR
  110. KeyProduct = ""
  111. KeyParameters = ""
  112. TRUE = 1
  113. FALSE = 0
  114. NoTitle = 0
  115. ExitState = "Active"
  116. OldVersionExisted = $(FALSE)
  117. DriverPath = $(!STF_NTPATH)\drivers
  118. [date]
  119. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  120. ; Minute, Second }
  121. Now = {} ? $(!LIBHANDLE) GetSystemDate
  122. [DetectSystemMemory]
  123. SystemMemory = "" ? $(!LIBHANDLE) GetMemorySize
  124. ;---------------------------------------------------------------------------
  125. ; 1. Identify
  126. ;
  127. ; DESCRIPTION: To verify that this INF deals with the same type of options
  128. ; as we are choosing currently.
  129. ;
  130. ; INPUT: None
  131. ;
  132. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  133. ; $($R1): Option Type (COMPUTER ...)
  134. ; $($R2): Diskette description
  135. ;---------------------------------------------------------------------------
  136. [Identify]
  137. ;
  138. ;
  139. read-syms Identification
  140. set Status = STATUS_SUCCESSFUL
  141. set Identifier = $(OptionType)
  142. set Media = #("Source Media Descriptions", 1, 1)
  143. Return $(Status) $(Identifier) $(Media)
  144. ;------------------------------------------------------------------------
  145. ; 2. ReturnOptions:
  146. ;
  147. ; DESCRIPTION: To return the option list supported by this INF and the
  148. ; localised text list representing the options.
  149. ;
  150. ;
  151. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  152. ;
  153. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  154. ; STATUS_NOLANGUAGE
  155. ; STATUS_FAILED
  156. ;
  157. ; $($R1): Option List
  158. ; $($R2): Option Text List
  159. ;------------------------------------------------------------------------
  160. [ReturnOptions]
  161. ;
  162. ;
  163. set Status = STATUS_FAILED
  164. set OptionList = {}
  165. set OptionTextList = {}
  166. ;
  167. ; Check if the language requested is supported
  168. ;
  169. set LanguageList = ^(LanguagesSupported, 1)
  170. Ifcontains(i) $($0) in $(LanguageList)
  171. goto returnoptions
  172. else
  173. set Status = STATUS_NOLANGUAGE
  174. goto finish_ReturnOptions
  175. endif
  176. ;
  177. ; form a list of all the options and another of the text representing
  178. ;
  179. returnoptions = +
  180. set OptionList = ^(Options, 1)
  181. set OptionTextList = ^(OptionsText$($0), 1)
  182. set Status = STATUS_SUCCESSFUL
  183. finish_ReturnOptions = +
  184. Return $(Status) $(OptionList) $(OptionTextList)
  185. ;----------InstallOption-------------------------------------------------
  186. ;
  187. ; InstallOption:
  188. ;
  189. ; This section is shelled to by main installation processing
  190. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  191. ;
  192. ;
  193. ; FUNCTION: To copy files representing Options
  194. ; To configure the installed option
  195. ; To update the registry for the installed option
  196. ;
  197. ; INPUT: $($0): Language to use
  198. ; $($1): OptionID to install
  199. ; $($2): SourceDirectory
  200. ; $($3): AddCopy (YES | NO)
  201. ; $($4): DoCopy (YES | NO)
  202. ; $($5): DoConfig (YES | NO)
  203. ;
  204. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  205. ; STATUS_NOLANGUAGE |
  206. ; STATUS_USERCANCEL |
  207. ; STATUS_FAILED
  208. ;
  209. ;------------------------------------------------------------------------
  210. [InstallOption]
  211. ;
  212. ; extract parameters
  213. ;
  214. set Option = $($1)
  215. set SrcDir = $($2)
  216. set AddCopy = $($3)
  217. set DoCopy = $($4)
  218. set DoConfig = $($5)
  219. ;
  220. ; Check if the language requested is supported
  221. ;
  222. set LanguageList = ^(LanguagesSupported, 1)
  223. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  224. Return STATUS_NOLANGUAGE
  225. endif
  226. Debug-Output "OEMNSVSV.INF: STF_CWDDIR is: "$(!STF_CWDDIR)
  227. Debug-Output "OEMNSVSV.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  228. ; define all the constants
  229. set-subst LF = "\n"
  230. read-syms GeneralConstants
  231. read-syms FileConstants
  232. read-syms DialogConstants$(!STF_LANGUAGE)
  233. ifstr(i) $(!NTN_Origination) == "NCPA"
  234. set Continue = $(OK)
  235. endif
  236. read-syms FileConstants$(!STF_LANGUAGE)
  237. detect date
  238. detect DetectSystemMemory
  239. set-title $(FunctionTitle)
  240. set to = Begin
  241. set from = Begin
  242. ;
  243. ; Assume all is well.
  244. ;
  245. set CommonStatus = STATUS_SUCCESSFUL
  246. EndWait
  247. ;
  248. ; Set up the operation-mode-based variables and gaily welcome
  249. ; the user. If the "install mode" variable is improperly set,
  250. ; assume this is a new installation.
  251. ;
  252. Begin = +
  253. Ifstr(i) $(!NTN_InstallMode) == deinstall
  254. set StartLabel = removeadapter
  255. set OEM_ABANDON_OPTIONS = { $(ProductSRVName), +
  256. $(ProductXACTSRVName), $(ProductSRVSRVName)}
  257. else-Ifstr(i) $(!NTN_InstallMode) == Update
  258. set StartLabel = UpgradeSoftware
  259. else-Ifstr(i) $(!NTN_InstallMode) == bind
  260. set StartLabel = bindingadapter
  261. else-Ifstr(i) $(!NTN_InstallMode) == configure
  262. ifstr(i) $(!STF_PRODUCT) != "WINNT"
  263. set CommonStatus = STATUS_REBOOT
  264. set StartLabel = configureadapter
  265. else
  266. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  267. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  268. Debug-Output "OEMNSVSV.INF: ShellCode error: cannot get an error string."
  269. goto ShellCodeError
  270. endif
  271. set CommonStatus = STATUS_USERCANCEL
  272. set Error = $($R0)
  273. set from = end
  274. set to = end
  275. goto nonfatal
  276. endif
  277. else
  278. set StartLabel = installadapter
  279. set OEM_ABANDON_OPTIONS = {}
  280. endif
  281. ;
  282. ; set up default parameter
  283. ;
  284. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  285. set Size = 1
  286. else
  287. set Size = 3
  288. endif
  289. set RadioDefault = $(Size)
  290. set RadioIn = {$(RadioDefault)}
  291. set Lmannounce = 0
  292. set CheckItemsIn = {OFF}
  293. set DoSRV = FALSE
  294. set DoXACTSRV = FALSE
  295. set DoSRVSRV = FALSE
  296. ifstr(i) $(Option) == SRV
  297. set DoSRV = TRUE
  298. ; set DoXACTSRV = TRUE
  299. set DoSRVSRV = TRUE
  300. else-ifstr(i) $(Option) == XACTSRV
  301. set DoXACTSRV = TRUE
  302. endif
  303. set from = $(fatal)
  304. set to = $(fatal)
  305. goto $(StartLabel)
  306. ;-----------------------------------------------
  307. ; Installation Section
  308. ;-----------------------------------------------
  309. installadapter = +
  310. ;
  311. ; First, check whether the same version of the software exists
  312. ;
  313. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  314. Ifstr $(KeyProduct) != $(KeyNull)
  315. ;
  316. ; Same version already existed in the local machine
  317. ; Popup the dialog and ask the user whether he wants to continue
  318. ;
  319. CloseRegKey $(KeyProduct)
  320. Shell $(UtilityInf), VerExistedDlg, $(Product$(Option)Title),+
  321. $(ProductVersion)
  322. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  323. Debug-Output "ShellCode error: cannot get an error string."
  324. goto ShellCodeError
  325. endif
  326. goto end
  327. endif
  328. goto adapteroptions
  329. ;-----------------------------------------------
  330. ; Configuration Section
  331. ;-----------------------------------------------
  332. ;
  333. ; Get the current values of all the parameters
  334. ;
  335. configureadapter = +
  336. ;
  337. ; Get the other parameters; they're attached to the service parameters key
  338. ;
  339. OpenRegKey $(!REG_H_LOCAL) "" $(ParamKeyName) $(MAXIMUM_ALLOWED) KeyParameters
  340. Ifstr $(KeyParameters) == $(KeyNull)
  341. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  342. Debug-Output "Cannot find component service"
  343. goto fatalregistry
  344. endif
  345. set OldVersionExisted = $(TRUE )
  346. set ValueName = ""
  347. set ValueData = ""
  348. set ValueStr = ""
  349. set ValueList = {}
  350. ;
  351. ; Get the old values
  352. ;
  353. EnumRegValue $(KeyParameters) ValueList
  354. ForListDo $(ValueList)
  355. set ValueItem = $($)
  356. set ValueName = *($(ValueItem),1)
  357. set ValueData = *($(ValueItem),4)
  358. Ifstr(i) $(ValueName) == "Size"
  359. set Size = $(ValueData)
  360. else-ifstr(i) $(ValueName) == "Lmannounce"
  361. set Lmannounce = $(ValueData)
  362. endif
  363. EndForListDo
  364. ;
  365. ; Adjust Size for LargeSystemCache setting
  366. ;
  367. ; first set LargeSystemCache to something invalid
  368. set LargeSystemCacheOrg = 2
  369. OpenRegKey $(!REG_H_LOCAL) "" $(SessMgrMemMgtKeyName) $(MAXIMUM_ALLOWED) KeySessMgrMemMgt
  370. Ifstr $(KeySessMgrMemMgt) != $(KeyNull)
  371. GetRegValue $(KeySessMgrMemMgt), "LargeSystemCache", LSCInfo
  372. Debug-Output "GetRegValue returned "$(RegLastError)
  373. ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  374. Debug-Output "GetRegValue of LargeSystemCache successful"
  375. set LargeSystemCacheOrg = *($(LSCInfo), 4)
  376. Debug-Output "LargeSystemCacheOrg ="$(LargeSystemCacheOrg)
  377. ifint $(Size) == 3
  378. ifint $(LargeSystemCacheOrg) == 0
  379. set Size = 4
  380. endif
  381. endif
  382. endif
  383. CloseRegKey $(KeySessMgrMemMgt)
  384. endif
  385. set RadioDefault = $(Size)
  386. set RadioIn = {$(RadioDefault)}
  387. ifint $(Lmannounce) == 1
  388. set CheckItemsIn = {ON}
  389. else
  390. set CheckItemsIn = {OFF}
  391. endif
  392. CloseRegKey $(KeyParameters)
  393. goto adapteroptions
  394. ;
  395. ; Let the user bang on the options until satisfied.
  396. ;
  397. adapteroptions = +
  398. ifstr(i) $(DoSRV) == TRUE
  399. Ifstr(i) $(!NTN_InstallMode) == "configure"
  400. set from = adapteroptions
  401. read-syms FileDependentDlg$(!STF_LANGUAGE)
  402. ui start "InputDlg"
  403. ifstr(i) $(DLGEVENT) == "CONTINUE"
  404. set Size = *($(RadioOut),1)
  405. Debug-Output "OEMNSVSV.INF: Size = "$(Size)
  406. set Lmannounce = *($(CheckItemsOut),1)
  407. Debug-Output "OEMNSVSV.INF: Lmannounce = "$(Lmannounce)
  408. ui pop 1
  409. goto nextstep
  410. else-ifstr(i) $(DLGEVENT) == "BACK"
  411. set CommonStatus = STATUS_USERCANCEL
  412. Debug-Output "Action: exit. Bye."
  413. ui pop 1
  414. goto end
  415. else
  416. ;
  417. ; Unknown command
  418. ;
  419. ui pop 1
  420. Debug-Output "OEMNSVSV.INF: Action unknown. Bye."
  421. goto end
  422. endif
  423. endif
  424. endif
  425. ;
  426. ; If installing, go create the necessary keys;
  427. ; if configuring, they're already open.
  428. ;
  429. nextstep = +
  430. StartWait
  431. ifstr(i) $(!NTN_InstallMode) == "install"
  432. Ifstr(i) $(DoCopy) == "YES"
  433. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  434. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  435. Goto ShellCodeError
  436. Else-Ifstr(i) $($R0) == STATUS_FAILED
  437. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  438. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  439. goto ShellCodeError
  440. endif
  441. set Error = $($R0)
  442. Goto fatal
  443. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  444. Goto successful
  445. Endif
  446. Set SrcDir = $($R1)
  447. Endif
  448. install "Install-Option"
  449. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  450. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  451. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  452. goto ShellCodeError
  453. endif
  454. set Error = $($R0)
  455. goto fatal
  456. endif
  457. endif
  458. set OEM_ABANDON_ON = TRUE
  459. ifstr(i) $(DoSRV) == TRUE
  460. ifint $(OldVersionExisted) == $(FALSE)
  461. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(ProductSRVName))
  462. Set SrvServiceType = "autoserviceshare"
  463. Ifint $(SystemMemory) < 12287
  464. Set SrvServiceType = "serviceshare"
  465. Endif
  466. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  467. $(ProductSRVName), +
  468. $(ProductSRVName), +
  469. $(ProductSRVDisplayName), $(STF_CONTEXTINFNAME), +
  470. $(ProductSRVImagePath), $(SrvServiceType), "", {}, "", +
  471. $(NetEventDLL),"","","","server"
  472. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  473. Debug-Output "ShellCode error"
  474. goto ShellCodeError
  475. endif
  476. set RegistryErrorIndex = $($R0)
  477. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  478. EndWait
  479. Debug-Output "Registry error: add software components"
  480. CloseRegKey $($R1)
  481. CloseRegKey $($R2)
  482. CloseRegKey $($R3)
  483. CloseRegKey $($R4)
  484. goto fatalregistry
  485. endif
  486. ;
  487. ; At this point:
  488. ; $R1 contains the product version key handle;
  489. ; $R2 contains the NetRules subkey handle;
  490. ; $R3 contains the new Services key handle; and
  491. ; $R4 contains the Parameters key
  492. ;
  493. Set SoftProductKey = $($R1)
  494. Set SoftNetRuleKey = $($R2)
  495. Set SoftServiceKey = $($R3)
  496. set KeyParameters = $($R4)
  497. Set SoftLinkageKey = $($R5)
  498. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  499. set ProductOpSupport = $(ProductOpSupportWKSTA)
  500. else
  501. set ProductOpSupport = $(ProductOpSupportSERVER)
  502. endif
  503. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  504. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  505. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  506. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSRVTitle)},+
  507. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSRVDescription)},+
  508. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSRVName)},+
  509. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  510. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  511. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  512. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  513. Debug-Output "ShellCode error."
  514. goto ShellCodeError
  515. endif
  516. set RegistryErrorIndex = $($R0)
  517. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  518. EndWait
  519. Debug-Output "Resgitry error: add value list."
  520. CloseRegKey $(SoftProductKey)
  521. CloseRegKey $(SoftNetRuleKey)
  522. CloseRegKey $(SoftServiceKey)
  523. CloseRegKey $(KeyParameters)
  524. CloseRegKey $(SoftLinkageKey)
  525. goto fatalregistry
  526. endif
  527. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSRVType)},+
  528. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSRVClass)}, +
  529. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSRVUse)}, +
  530. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSRVBindForm)}, +
  531. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  532. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  533. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  534. Debug-Output "ShellCode error."
  535. goto ShellCodeError
  536. endif
  537. set RegistryErrorIndex = $($R0)
  538. CloseRegKey $(SoftProductKey)
  539. CloseRegKey $(SoftNetRuleKey)
  540. CloseRegKey $(SoftLinkageKey)
  541. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  542. EndWait
  543. Debug-Output "OEMNSVSV.INF: Registry error: add value list."
  544. CloseRegKey $(KeyParameters)
  545. goto fatalregistry
  546. endif
  547. CreateRegKey $(SoftServiceKey) {"AutotunedParameters",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" AutoTunedKey
  548. CreateRegKey $(SoftServiceKey) {"Shares",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" SharesKey
  549. set NewValueList = {{NullSessionPipes,$(NoTitle),$(!REG_VT_MULTI_SZ),{"COMNAP","COMNODE","SQL\QUERY","SPOOLSS","LLSRPC","EPMAPPER","LOCATOR"}},+
  550. {NullSessionShares,$(NoTitle),$(!REG_VT_MULTI_SZ),{"COMCFG", "DFS$"}} }
  551. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  552. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  553. Debug-Output "ShellCode error."
  554. goto ShellCodeError
  555. endif
  556. set RegistryErrorIndex = $($R0)
  557. CloseRegKey $(SoftServiceKey)
  558. CloseRegKey $(AutoTunedKey)
  559. CloseRegKey $(SharesKey)
  560. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  561. EndWait
  562. Debug-Output "OEMNSVSV.INF: Registry error: add value list."
  563. CloseRegKey $(KeyParameters)
  564. goto fatalregistry
  565. endif
  566. ;
  567. ; make sure license service is now autostarted if it is installed
  568. ;
  569. OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\LicenseService" +
  570. $(!REG_KEY_ALL_ACCESS) LICENSESERVICEKEY
  571. Ifstr(i) $(LICENSESERVICEKEY) != ""
  572. shell "registry.inf" ModifyServicesEntry "LicenseService" $(!SERVICE_AUTO_START)
  573. Endif
  574. CloseRegKey $(LICENSESERVICEKEY)
  575. endif
  576. goto writeparameters
  577. ;
  578. ; REQUIRED: $(KeyParameters) contains service Parameters key handle
  579. ;
  580. writeparameters = +
  581. ;
  582. ; Add the rest of the parameters to the Services area
  583. ;
  584. ifstr(i) $(Lmannounce) == "ON"
  585. set LmannounceValue = 1
  586. else
  587. set LmannounceValue = 0
  588. endif
  589. ifint $(Size) == 4
  590. set LargeSystemCache = 0
  591. set Size = 3
  592. else-ifint $(Size) == 3
  593. set LargeSystemCache = 1
  594. else
  595. set LargeSystemCache = 0
  596. endif
  597. set NewValueList = {{Size,$(NoTitle),$(!REG_VT_DWORD),$(Size)},+
  598. {Lmannounce,$(NoTitle),$(!REG_VT_DWORD),$(LmannounceValue)} }
  599. ifint $(OldVersionExisted) == $(TRUE)
  600. OpenRegKey $(!REG_H_LOCAL) "" $(ParamKeyName) $(MAXIMUM_ALLOWED) KeyParameters
  601. endif
  602. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  603. set RegistryErrorIndex = $($R0)
  604. CloseRegKey $(KeyParameters)
  605. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  606. goto fatalregistry
  607. endif
  608. ;
  609. ; Set the LargeSystemCache parameter if installing a large server
  610. ;
  611. ifint $(LargeSystemCache) != $(LargeSystemCacheOrg)
  612. OpenRegKey $(!REG_H_LOCAL) "" $(SessMgrMemMgtKeyName) $(MAXIMUM_ALLOWED) KeySessMgrMemMgt
  613. SetRegValue $(KeySessMgrMemMgt) {LargeSystemCache,$(NoTitle),$(!REG_VT_DWORD),$(LargeSystemCache)}
  614. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  615. set RegistryErrorIndex = UNABLE_WRITE_REGISTRY
  616. CloseRegKey $(KeySessMgrMemMgt)
  617. goto fatalregistry
  618. endif
  619. CloseRegKey $(KeySessMgrMemMgt)
  620. endif
  621. endif
  622. ;
  623. ; Install the XactSrv service
  624. ;
  625. ifstr(i) $(DoXACTSRV) == TRUE
  626. ifint $(OldVersionExisted) == $(FALSE)
  627. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(ProductXACTSRVName))
  628. Shell $(UtilityInf), CreateService, $(ProductXACTSRVName), +
  629. $(ProductXACTDisplayName), $(ProductXACTSRVImagePath), "serviceshare", "", +
  630. {"LanmanServer"}, ""
  631. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  632. Debug-Output "ShellCode error"
  633. goto ShellCodeError
  634. endif
  635. set RegistryErrorIndex = $($R0)
  636. CloseRegKey $($R1)
  637. CloseRegKey $($R2)
  638. CloseRegKey $($R3)
  639. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  640. EndWait
  641. Debug-Output "Registry error: adding XACTSRV service"
  642. goto fatalregistry
  643. endif
  644. endif
  645. endif
  646. ;
  647. ; Handle the server base service driver
  648. ;
  649. ifstr(i) $(DoSRVSRV) == TRUE
  650. ifint $(OldVersionExisted) == $(FALSE)
  651. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(ProductSRVSRVName))
  652. Shell $(UtilityInf), CreateService, $(ProductSRVSRVName), +
  653. $(ProductSRVSRVDisplayName), $(ProductSRVSRVImagePath), "system", "Network", {}, "",+
  654. $(NetEventDLL)
  655. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  656. Debug-Output "ShellCode error"
  657. goto ShellCodeError
  658. endif
  659. set RegistryErrorIndex = $($R0)
  660. CloseRegKey $($R1)
  661. CloseRegKey $($R2)
  662. CloseRegKey $($R3)
  663. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  664. EndWait
  665. Debug-Output "Registry error: adding Srv service"
  666. goto fatalregistry
  667. endif
  668. endif
  669. endif
  670. ;
  671. ;
  672. EndWait
  673. goto successful
  674. ;-----------------------------------------------
  675. ; Binding section
  676. ;-----------------------------------------------
  677. bindingadapter =+
  678. set Error = "Binding: Sorry, not yet implemented."
  679. goto fatal
  680. ;-----------------------------------------------
  681. ; Removeadapter section
  682. ;-----------------------------------------------
  683. removeadapter = +
  684. ;
  685. ; Don't allow removal on NTAS
  686. ifstr(i) $(!STF_PRODUCT) == "LANMANNT"
  687. set RegistryErrorIndex = CANT_REMOVE_SERVER_NTAS
  688. goto fatalregistry
  689. endif
  690. ;
  691. ; Remove Server service
  692. ;
  693. ifcontains(i) $(ProductSRVName) in $(OEM_ABANDON_OPTIONS)
  694. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  695. $(ProductSRVName)
  696. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  697. Debug-Output "ShellCode error"
  698. goto ShellCodeError
  699. endif
  700. set RegistryErrorIndex = $($R0)
  701. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  702. goto fatalregistry
  703. endif
  704. endif
  705. ;
  706. ; remove XactSrv and SrvSrv service
  707. ;
  708. ForListDo {$(ProductXACTSRVName), $(ProductSRVSRVName)}
  709. ifcontains(i) $($) in $(OEM_ABANDON_OPTIONS)
  710. Shell $(UtilityInf), RemoveService, $($), "YES"
  711. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  712. Debug-Output "ShellCode error"
  713. goto ShellCodeError
  714. endif
  715. set RegistryErrorIndex = $($R0)
  716. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  717. goto fatalregistry
  718. endif
  719. endif
  720. EndForListDo
  721. goto end
  722. ;-----------------------------------------------
  723. ; Upgrade Software section
  724. ;-----------------------------------------------
  725. UpgradeSoftware = +
  726. ; Upgrade software component
  727. ;
  728. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  729. Ifstr $(KeyProduct) != $(KeyNull)
  730. install "Install-Update"
  731. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  732. goto fatal
  733. endif
  734. ; Upgrade the version number
  735. ;
  736. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  737. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  738. ;
  739. ; Update description and op support
  740. ;
  741. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  742. set ProductOpSupport = $(ProductOpSupportWKSTA)
  743. else
  744. set ProductOpSupport = $(ProductOpSupportSERVER)
  745. endif
  746. SetRegValue $(KeyProduct) {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSRVDescription)}
  747. SetRegValue $(KeyProduct) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  748. CloseRegKey $(KeyProduct)
  749. ;
  750. ; Change image path
  751. ;
  752. LibraryProcedure Result, $(!LIBHANDLE), SetupChangeServiceConfig, "LanmanServer", $(SERVICE_NO_CHANGE), $(SERVICE_NO_CHANGE), $(SERVICE_NO_CHANGE), "%SystemRoot%\System32\services.exe", "", "", "", "", ""
  753. ;
  754. ; Remove Otherdependencies "Srv"
  755. ;
  756. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\LanmanServer\Linkage" $(MAXIMUM_ALLOWED) KeyLinkage
  757. ; If OtherDependencies does not exist, create it
  758. ; else remove srv from the list
  759. set NewList = {}
  760. GetRegValue $(KeyLinkage) "OtherDependencies" Dependencies
  761. ifint $(RegLastError) == 0
  762. set OldList = *($(Dependencies),4)
  763. Debug-Output "Old value for OtherDependencies = "$(OldList)
  764. ForListDo $(OldList)
  765. ifstr(i) $($) != "Srv"
  766. set NewList = >($(NewList), $($))
  767. Endif
  768. EndForListDo
  769. endif
  770. SetRegValue $(KeyLinkage) {OtherDependencies, 0, $(!REG_VT_MULTI_SZ), $(NewList)}
  771. Debug-Output "New value for OtherDependencies = "$(NewList)
  772. CloseRegKey $(KeyLinkage)
  773. ;
  774. ; Add NullSessionShares and NullSessionPipes
  775. ;
  776. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\LanmanServer\Parameters" $(MAXIMUM_ALLOWED) KeyParameters
  777. GetRegValue $(KeyParameters), "NullSessionPipes", PipesInfo
  778. GetRegValue $(KeyParameters), "NullSessionShares", SharesInfo
  779. set Pipes = *($(PipesInfo),4)
  780. set Shares = *($(SharesInfo),4)
  781. ForListDo {"COMNAP","COMNODE","SQL\QUERY","SPOOLSS","LLSRPC","EPMAPPER","LOCATOR"}
  782. Ifcontains(i) $($) NOT-IN $(Pipes)
  783. ifstr(i) $(Pipes) == ""
  784. set Pipes = $($)
  785. else
  786. set Pipes = >($(Pipes),$($))
  787. endif
  788. endif
  789. EndForListDo
  790. ForListDo {"COMCFG"}
  791. Ifcontains(i) $($) NOT-IN $(Shares)
  792. ifstr(i) $(Shares) == ""
  793. set Shares = {$($)}
  794. else
  795. set Shares = >($(Shares),$($))
  796. endif
  797. endif
  798. EndForListDo
  799. set NewValueList = {{NullSessionPipes,$(NoTitle),$(!REG_VT_MULTI_SZ), $(Pipes)},+
  800. {NullSessionShares,$(NoTitle),$(!REG_VT_MULTI_SZ),$(Shares)} }
  801. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  802. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  803. Debug-Output "ShellCode error."
  804. goto ShellCodeError
  805. endif
  806. ;
  807. ; Remove Disc and Comment value
  808. ;
  809. GetRegValue $(KeyParameters), "Disc", DiscInfo
  810. Debug-Output "GetRegValue returned "$(RegLastError)
  811. ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  812. GetRegValue $(KeyParameters), "AutoDisconnect", DisconnectInfo
  813. Debug-Output "GetRegValue returned "$(RegLastError)
  814. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  815. SetRegValue $(KeyParameters) {AutoDisconnect,$(NoTitle),$(!REG_VT_SZ),*($(DiscInfo),4)}
  816. endif
  817. DeleteRegValue $(KeyParameters) "Disc"
  818. endif
  819. GetRegValue $(KeyParameters), "Comment", CommentInfo
  820. Debug-Output "GetRegValue returned "$(RegLastError)
  821. ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  822. GetRegValue $(KeyParameters), "SrvComment", SrvCommentInfo
  823. Debug-Output "GetRegValue returned "$(RegLastError)
  824. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  825. SetRegValue $(KeyParameters) {SrvComment,$(NoTitle),$(!REG_VT_SZ),*($(CommentInfo),4)}
  826. endif
  827. DeleteRegValue $(KeyParameters) "Comment"
  828. endif
  829. GetRegValue $(KeyParameters), "Open", OpenInfo
  830. Debug-Output "GetRegValue returned "$(RegLastError)
  831. ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  832. ifint *($(OpenInfo),4) == 10
  833. DeleteRegValue $(KeyParameters) "Open"
  834. endif
  835. endif
  836. CloseRegKey $(KeyParameters)
  837. else
  838. ;
  839. ; Cannot Open software key, goto ERROR
  840. ;
  841. goto fatalregistry
  842. endif
  843. goto end
  844. ;
  845. ; End of Upgrade Software
  846. ;
  847. ;
  848. ; Escape hatches
  849. ;
  850. successful = +
  851. goto end
  852. ;
  853. ; warning display
  854. ;
  855. warning = +
  856. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  857. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  858. goto ShellCodeError
  859. endif
  860. ifstr(i) $($R1) == "OK"
  861. goto $(to)
  862. else-ifstr(i) $($R1) == "CANCEL"
  863. goto $(from)
  864. else
  865. ; Debug-Msg "Error Error Bad DLGEVENT"
  866. goto "end"
  867. endif
  868. ;
  869. ; non fatal error display
  870. ;
  871. nonfatal = +
  872. ifstr(i) $(Error) == ""
  873. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  874. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  875. goto ShellCodeError
  876. endif
  877. set Error = $($R0)
  878. endif
  879. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(Error)
  880. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  881. goto ShellCodeError
  882. endif
  883. ifstr(i) $($R1) == "OK"
  884. goto $(from)
  885. else
  886. goto "end"
  887. endif
  888. ;
  889. ; Registry is broken
  890. ;
  891. fatalregistry = +
  892. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  893. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  894. goto ShellCodeError
  895. endif
  896. set Error = $($R0)
  897. goto fatal
  898. ;
  899. ; fatal error display
  900. ;
  901. fatal = +
  902. ifstr(i) $(Error) == ""
  903. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  904. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  905. goto ShellCodeError
  906. endif
  907. set Error = $($R0)
  908. endif
  909. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  910. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  911. goto ShellCodeError
  912. endif
  913. goto setfailed
  914. ;
  915. ; Shelling error
  916. ;
  917. ShellCodeError = +
  918. set DlgType = "MessageBox"
  919. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  920. set STF_MB_TEXT = $(ShellCodeErrorText)
  921. set STF_MB_TYPE = 1
  922. set STF_MB_ICON = 3
  923. set STF_MB_DEF = 1
  924. ui start "Error Message"
  925. goto setfailed
  926. setfailed = +
  927. set CommonStatus = STATUS_FAILED
  928. Ifint $(RegistryErrorIndex) == CANT_REMOVE_SERVER_NTAS
  929. set CommonStatus = STATUS_USERCANCEL
  930. endif
  931. ;
  932. ; If OEM_ABANDON_ON, we need to clean up the registry
  933. ;
  934. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  935. set OEM_ABANDON_ON = FALSE
  936. goto removeadapter
  937. endif
  938. goto end
  939. end = +
  940. goto term
  941. term = +
  942. Return $(CommonStatus)
  943. ;***************************************************************
  944. ; INSTALL SECTIONS
  945. ;***************************************************************
  946. [Install-Option]
  947. set STF_VITAL = ""
  948. ifstr(i) $(AddCopy) == "YES"
  949. ;
  950. ; Add the files to the copy list
  951. ;
  952. ; BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  953. ; the other INF files
  954. ;
  955. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  956. endif
  957. ifstr(i) $(DoCopy) == "YES"
  958. ;
  959. ; Copy files in the copy list
  960. ;
  961. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  962. CopyFilesInCopyList
  963. endif
  964. ifstr(i) $(DoConfig) == "YES"
  965. ;
  966. ; Add product to registry
  967. ;
  968. ;
  969. ; Finish up
  970. endif
  971. Exit
  972. [Install-Update]
  973. set STF_VITAL = ""
  974. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  975. ;set STF_VERSION = "YES"
  976. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  977. exit