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.

1392 lines
43 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNSVRP.INF
  4. ;
  5. ; RPC Installer
  6. ;
  7. ; History:
  8. ; davidhov 00-Feb-1992 Created
  9. ; structure from SunilP, et al.
  10. ;
  11. ;***********************************************************************
  12. ;-----------------------------------------------------------------------
  13. ; OPTION TYPE
  14. ; -----------
  15. ; This identifies the Option type we are dealing with. The different
  16. ; possible types are:
  17. ;
  18. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  19. ;
  20. ; Types specific to networking:
  21. ;
  22. ; NetAdapter, a netcard / adapter combination or just a netcard
  23. ; NetDriver, just a netcard driver
  24. ; NetTransport, a complete NDIS-compliant TDI transport stack
  25. ; NetService, an NT networking service
  26. ; NetWork, a complete network ensemble.
  27. ; NetProvider a complete network which supports NT MPR protocol
  28. ;-----------------------------------------------------------------------
  29. [Identification]
  30. OptionType = NetService
  31. ;-----------------------------------------------------------------------
  32. ; OPTION LIST
  33. ; -----------
  34. ; This section lists the OEM Option key names. These keys are locale
  35. ; independent and used to represent the option in a locale independent
  36. ; manner.
  37. ;
  38. ;-----------------------------------------------------------------------
  39. [Options]
  40. RPCLOCATE
  41. RPCBANYAN
  42. ;***********************************************************************
  43. ; CONSTANTS FOR USING DIALOGS
  44. ;***********************************************************************
  45. [FileConstants]
  46. ;
  47. ; File names, etc.
  48. ;
  49. UtilityInf = "UTILITY.INF"
  50. subroutineinf = "SUBROUTN.INF"
  51. SoftwareType = "service"
  52. Exit_Code = 0
  53. ;ShellCode = 0
  54. ;
  55. ; EventLog Message File
  56. ;
  57. ; NONE as of yet
  58. [GeneralConstants]
  59. ;
  60. ; Program flow control variables.
  61. ;
  62. from = ""
  63. to = ""
  64. ;
  65. ; Return codes; Exit_Code is set to one of these
  66. ;
  67. ExitCodeOk = 0
  68. ExitCodeCancel = 1
  69. ExitCodeFatal = 2
  70. KeyNull = ""
  71. MAXIMUM_ALLOWED = 33554432
  72. RegistryErrorIndex = NO_ERROR
  73. KeyProduct = ""
  74. KeyParameters = ""
  75. TRUE = 1
  76. FALSE = 0
  77. NoTitle = 0
  78. ExitState = "Active"
  79. OldVersionExisted = $(FALSE)
  80. ;
  81. ; Product Info
  82. ;
  83. Manufacturer = "Microsoft"
  84. ProductMajorVersion = "4"
  85. ProductMinorVersion = "0"
  86. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  87. ProductOpSupportRPC = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  88. ProductOpSupportRPCBANYAN = 132 ; 0x0084 ; Display,Removable,NOT Properties,Not Updatable
  89. ;
  90. ; Software
  91. ;
  92. RpcBanyanSoftKeyName = "SOFTWARE\Microsoft\RpcBanyan"
  93. RpcSoftKeyName = "SOFTWARE\Microsoft\Rpc"
  94. RpcSrvKeyName = "Software\Microsoft\RPCLOCATOR"
  95. RpcSecurityKeyName = "Software\Microsoft\Rpc\SecurityService"
  96. RpcSrvNameRpcss = "RPCSS"
  97. RpcSrvNameLocator = "RPCLOCATOR"
  98. RpcSrvNameBanyan = "RpcBanyan"
  99. RpcSrvNameSSP = "NtLmSsp"
  100. RpcSrvExeRpcss = "%SystemRoot%\System32\RPCSS.EXE"
  101. RpcSrvExeLocator = "%SystemRoot%\System32\LOCATOR.EXE"
  102. RpcSrvExeSSP = "%SystemRoot%\System32\LSASS.EXE"
  103. RpcSrvSSPKeyName = $(!NTN_ServiceBase)"\"$(RpcSrvNameSSP)
  104. ProductKeyName = $(RpcSrvKeyName)"\CurrentVersion"
  105. ServerProto = "\ServerProtocols"
  106. ClientProto = "\ClientProtocols"
  107. #if defined( CAIRO_INF )
  108. RpcSrvDepend= {"LanmanWorkstation","Rdr"}
  109. #else
  110. RpcSrvDepend= {}
  111. #endif
  112. MSSecurityDLL = "security.dll"
  113. ;
  114. ; Dialog and Registry data
  115. ;
  116. LocatorChoiceList = ^(LocatorData,1)
  117. LocatorEndPointList = ^(LocatorData,2)
  118. LocatorProtocolList = ^(LocatorData,3)
  119. NameServiceKeyName = "Software\Microsoft\Rpc\NameService"
  120. SecurityKeyName = "Software\Microsoft\Rpc\SecurityService"
  121. SecurityChoiceList = ^(SecurityData,1)
  122. SecurityDllList = ^(SecurityData,2)
  123. [LocatorData]
  124. LD_1 = "LocatorWINNT","\pipe\locator","ncacn_np"
  125. LD_2 = "LocatorDCE","","ncacn_ip_tcp"
  126. [SecurityData]
  127. SD_1 = "SecurityWINNT","security.dll"
  128. SD_2 = "SecurityDCE","dcesec.dll"
  129. ;
  130. ; WARNING: If you change the lists below, you will need to modify Utility.INF lists
  131. ; also. See AddMixRpcProtocol
  132. ;
  133. [UpgradeMapConstants]
  134. ; must be changed to rpclt1.dll
  135. DLLClientList = { "rpcltc3.dll", "rpcltc6.dll", "rpcltc5.dll", "rpcltc7.dll", "rpcdgc3.dll", "rpcltccm.dll", "rpcltc1.dll" }
  136. ; must be changed to rpclt1.dll
  137. DLLServerList = { "rpclts3.dll", "rpclts6.dll", "rpclts5.dll", "rpclts7.dll", "rpcdgs3.dll", "rpcltscm.dll", "rpclts1.dll" }
  138. [date]
  139. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  140. ; Minute, Second }
  141. Now = {} ? $(!LIBHANDLE) GetSystemDate
  142. ;---------------------------------------------------------------------------
  143. ; 1. Identify
  144. ;
  145. ; DESCRIPTION: To verify that this INF deals with the same type of options
  146. ; as we are choosing currently.
  147. ;
  148. ; INPUT: None
  149. ;
  150. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  151. ; $($R1): Option Type (COMPUTER ...)
  152. ; $($R2): Diskette description
  153. ;---------------------------------------------------------------------------
  154. [Identify]
  155. ;
  156. ;
  157. read-syms Identification
  158. set Status = STATUS_SUCCESSFUL
  159. set Identifier = $(OptionType)
  160. set Media = #("Source Media Descriptions", 1, 1)
  161. Return $(Status) $(Identifier) $(Media)
  162. ;------------------------------------------------------------------------
  163. ; 2. ReturnOptions:
  164. ;
  165. ; DESCRIPTION: To return the option list supported by this INF and the
  166. ; localised text list representing the options.
  167. ;
  168. ;
  169. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  170. ;
  171. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  172. ; STATUS_NOLANGUAGE
  173. ; STATUS_FAILED
  174. ;
  175. ; $($R1): Option List
  176. ; $($R2): Option Text List
  177. ;------------------------------------------------------------------------
  178. [ReturnOptions]
  179. ;
  180. ;
  181. set Status = STATUS_FAILED
  182. set OptionList = {}
  183. set OptionTextList = {}
  184. ;
  185. ; Check if the language requested is supported
  186. ;
  187. set LanguageList = ^(LanguagesSupported, 1)
  188. Ifcontains(i) $($0) in $(LanguageList)
  189. goto returnoptions
  190. else
  191. set Status = STATUS_NOLANGUAGE
  192. goto finish_ReturnOptions
  193. endif
  194. ;
  195. ; form a list of all the options and another of the text representing
  196. ;
  197. returnoptions = +
  198. set OptionList = ^(Options, 1)
  199. set OptionTextList = ^(OptionsText$($0), 1)
  200. set Status = STATUS_SUCCESSFUL
  201. finish_ReturnOptions = +
  202. Return $(Status) $(OptionList) $(OptionTextList)
  203. ;----------InstallOption-------------------------------------------------
  204. ;
  205. ; InstallOption:
  206. ;
  207. ; This section is shelled to by main installation processing
  208. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  209. ;
  210. ;
  211. ; FUNCTION: To copy files representing Options
  212. ; To configure the installed option
  213. ; To update the registry for the installed option
  214. ;
  215. ; INPUT: $($0): Language to use
  216. ; $($1): OptionID to install
  217. ; $($2): SourceDirectory
  218. ; $($3): AddCopy (YES | NO)
  219. ; $($4): DoCopy (YES | NO)
  220. ; $($5): DoConfig (YES | NO)
  221. ;
  222. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  223. ; STATUS_NOLANGUAGE |
  224. ; STATUS_USERCANCEL |
  225. ; STATUS_FAILED
  226. ;
  227. ;------------------------------------------------------------------------
  228. [InstallOption]
  229. ;
  230. ; extract parameters
  231. ;
  232. set Option = $($1)
  233. set SrcDir = $($2)
  234. set AddCopy = $($3)
  235. set DoCopy = $($4)
  236. set DoConfig = $($5)
  237. ;
  238. ; Check if the language requested is supported
  239. ;
  240. set LanguageList = ^(LanguagesSupported, 1)
  241. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  242. Return STATUS_NOLANGUAGE
  243. endif
  244. ; define all the constants
  245. set-subst LF = "\n"
  246. Debug-Output "OEMNSVRP.INF: active"
  247. read-syms GeneralConstants
  248. read-syms FileConstants
  249. read-syms UpgradeMapConstants
  250. detect date
  251. read-syms DialogConstants$(!STF_LANGUAGE)
  252. read-syms $(Option)Constants$(!STF_LANGUAGE)
  253. read-syms FileConstants$(!STF_LANGUAGE)
  254. set-title $(FunctionTitle)
  255. set to = Begin
  256. set from = Begin
  257. ;
  258. ; Assume all is well.
  259. ;
  260. set CommonStatus = STATUS_SUCCESSFUL
  261. EndWait
  262. ;
  263. ; Set up the operation-mode-based variables and gaily welcome
  264. ; the user. If the "install mode" variable is improperly set,
  265. ; assume this is a new installation.
  266. ;
  267. Begin = +
  268. Ifstr(i) $(!NTN_InstallMode) == deinstall
  269. set StartLabel = removeadapter
  270. else-Ifstr(i) $(!NTN_InstallMode) == update
  271. set StartLabel = UpgradeSoftware
  272. else-Ifstr(i) $(!NTN_InstallMode) == bind
  273. set StartLabel = bindingadapter
  274. else-Ifstr(i) $(!NTN_InstallMode) == configure
  275. set StartLabel = configureadapter
  276. else
  277. set StartLabel = installadapter
  278. endif
  279. set from = $(fatal)
  280. set to = $(fatal)
  281. goto $(StartLabel)
  282. ;-----------------------------------------------
  283. ; Configuration Section
  284. ;-----------------------------------------------
  285. configureadapter = +
  286. ifstr(i) $(Option) == "RPCBANYAN"
  287. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  288. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  289. Debug-Output "OEMNSVBH.INF: ShellCode error: cannot get an error string."
  290. goto ShellCodeError
  291. endif
  292. set Error = $($R0)
  293. Set CommonStatus = STATUS_USERCANCEL
  294. Set Severity = STATUS
  295. set from = "end"
  296. set to = "end"
  297. goto nonfatal
  298. endif
  299. set CommonStatus = STATUS_REBOOT
  300. OpenRegKey $(!REG_H_LOCAL) "" $(NameServiceKeyName) $(MAXIMUM_ALLOWED) KeyNameService
  301. Ifstr(i) $(KeyNameService) == ""
  302. Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  303. Goto fatalregistry
  304. Endif
  305. Set OldVersionExisted = $(TRUE)
  306. ;
  307. ; Determine which locator is currently in use by matching the
  308. ; name of the protocol.
  309. ;
  310. GetRegValue $(KeyNameService),"Protocol", ProtocolNameValue
  311. Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  312. CloseRegKey $(KeyNameService)
  313. Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  314. Goto fatalregistry
  315. Endif
  316. ;
  317. ; Determine which security service is currently in use by matching the
  318. ; dll name.
  319. ;
  320. OpenRegKey $(!REG_H_LOCAL) "" $(SecurityKeyName) $(MAXIMUM_ALLOWED) KeySecurity
  321. Ifstr $(KeySecurity) == ""
  322. Set RegistryErrorIndes = UNABLE_ACCESS_SOFTWARE_REG
  323. Goto fatalregistry
  324. Endif
  325. GetRegValue $(KeySecurity), "DefaultProvider", ProviderNameValue
  326. Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  327. CloseRegKey $(KeyNameService)
  328. CloseRegKey $(KeySecurity)
  329. Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  330. Goto fatalregistry
  331. Endif
  332. ;
  333. ; See if the DCE security provider is installed.
  334. ;
  335. GetRegValue $(KeySecurity), "11", DCEProviderDllValue
  336. read-syms SecurityNames$(!STF_LANGUAGE)
  337. Ifstr $(DCEProviderDllValue) == ""
  338. Set SecurityChoiceList = {"SecurityWINNT"}
  339. Set SecurityDllList = {"security.dll"}
  340. Set SecurityListboxNames = {$(SecName1)}
  341. Set DCEProviderDll = ""
  342. Else
  343. Set DCEProviderDll = *($(DCEProviderDllValue),4)
  344. Set SecurityChoiceList = {"SecurityWINNT","SecurityDCE"}
  345. Set SecurityDllList = {"security.dll",$(DCEProviderDll)}
  346. Set SecurityListboxNames = {$(SecName1),$(SecName2)}
  347. Endif
  348. Debug-Output "OEMNSVRP.INF: Configure Name Services"
  349. configureretry = +
  350. read-syms LocatorNames$(!STF_LANGUAGE)
  351. Set LocatorListboxNames = {$(LocName1),$(LocName2)}
  352. Set ProtocolName = *($(ProtocolNameValue),4)
  353. Set LocatorIndex = ~($(LocatorProtocolList),$(ProtocolName))
  354. Set LocatorInUse = *($(LocatorChoiceList),$(LocatorIndex))
  355. Set LocatorChosen = $(LocatorInUse)
  356. Set LocatorChosenName = *($(LocatorListboxNames),$(LocatorIndex))
  357. GetRegValue $(KeyNameService),"NetworkAddress", NetAddrValue
  358. Set NetworkAddress = *($(NetAddrValue),4)
  359. Set NetworkAddressInUse = $(NetworkAddress)
  360. Ifstr(i) $(LocatorChosen) == "LocatorWINNT"
  361. Set NetworkAddressDCE = ""
  362. Else
  363. Set NetworkAddressDCE = $(NetworkAddress)
  364. Endif
  365. Set SecurityProviderName = *($(ProviderNameValue),4)
  366. Set SecurityProviderIndex = ~($(SecurityDllList),$(SecurityProviderName))
  367. Set SecurityProviderInUse = *($(SecurityChoiceList),$(SecurityProviderIndex))
  368. Set SecurityChosen = $(SecurityProviderInUse)
  369. Set SecurityChosenName = *($(SecurityListboxNames),$(SecurityProviderIndex))
  370. reinitdialog = +
  371. Set LocatorLastChosen = $(LocatorChosen)
  372. Ifstr(i) $(LocatorChosen) == "LocatorWINNT"
  373. Set NetworkAddress = ""
  374. Else
  375. Set NetworkAddress = $(NetworkAddressDCE)
  376. Endif
  377. read-syms RpcProviderDlg$(!STF_LANGUAGE)
  378. ui start "System"
  379. Ifstr(i) $(DLGEVENT) == "NOTIFY"
  380. Set LocatorIndex = ~($(LocatorListboxNames),$(Combo1Out))
  381. Set LocatorChosen = *($(LocatorChoiceList),$(LocatorIndex))
  382. Set LocatorChosenName = *($(LocatorListboxNames),$(LocatorIndex))
  383. Debug-Output "OEMNSVRP.INF: NOTIFY: "$(LocatorChosenName)" = "$(LocatorChosen)
  384. Set ReInit = YES
  385. Ifstr(i) $(LocatorChosen) == $(LocatorLastChosen)
  386. Goto reinitdialog
  387. Endif
  388. Ifstr(i) $(LocatorChosen) == "LocatorWINNT"
  389. Set NetworkAddress = ""
  390. Set NetworkAddressDCE = $(EditTextOut)
  391. Endif
  392. Goto reinitdialog
  393. Else-Ifstr(i) $(DLGEVENT) != "CONTINUE"
  394. ui pop 1
  395. Set CommonStatus = STATUS_USERCANCEL
  396. Goto configuredone
  397. Endif
  398. Set NetworkAddress = $(EditTextOut)
  399. Set LocatorIndex = ~($(LocatorListboxNames),$(Combo1Out))
  400. Set LocatorChosen = *($(LocatorChoiceList),$(LocatorIndex))
  401. Set LocatorChosenName = *($(LocatorListboxNames),$(LocatorIndex))
  402. Set SecurityProviderIndex = ~($(SecurityListboxNames),$(Combo2Out))
  403. Set SecurityChosen = *($(SecurityChoiceList),$(SecurityProviderIndex))
  404. Set SecurityChosenName = *($(SecurityListboxNames),$(SecurityProviderIndex))
  405. Debug-Output "OEMNSVRP.INF: OK: "$(LocatorChosenName)", "$(LocatorChosen)
  406. Debug-Output "OEMNSVRP.INF: OK: "$(SecurityChosenName)", "$(SecurityChosen)
  407. Ifstr(i) $(LocatorChosen) == "LocatorWINNT"
  408. Ifstr(i) $(NetworkAddress) != ""
  409. read-syms NonFatalError2$(!STF_LANGUAGE)
  410. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(NonFatal)
  411. Endif
  412. Set NetworkAddress = "\\."
  413. Else-ifstr(i) $(NetworkAddress) == ""
  414. read-syms NonFatalError1$(!STF_LANGUAGE)
  415. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(NonFatal)
  416. Goto configureretry
  417. Endif
  418. ; If nothing has changed, treat dialog as cancelled.
  419. Ifstr(i) $(SecurityChosen) == "SecurityDCE"
  420. Ifstr(i) $(DCEProviderDll) == ""
  421. read-syms NonFatalError3$(!STF_LANGUAGE)
  422. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(NonFatal)
  423. Goto configureretry
  424. Endif
  425. Endif
  426. Ifstr(i) $(LocatorChosen) == $(LocatorInUse)
  427. Ifstr(i) $(NetworkAddress) == $(NetworkAddressInUse)
  428. Ifstr(i) $(SecurityChosen) == $(SecurityProviderInUse)
  429. ui pop 1
  430. Set CommonStatus = STATUS_USERCANCEL
  431. Goto configuredone
  432. Endif
  433. Endif
  434. Endif
  435. ui pop 1
  436. Set ProtocolName = *($(LocatorProtocolList),$(LocatorIndex))
  437. Set EndPointName = *($(LocatorEndPointList),$(LocatorIndex))
  438. Set NewValueList = {{Protocol,$(NoTitle),$(!REG_VT_SZ),$(ProtocolName)},+
  439. {NetworkAddress,$(NoTitle),$(!REG_VT_SZ),$(NetworkAddress)},+
  440. {ServerNetworkAddress,$(NoTitle),$(!REG_VT_SZ),$(NetworkAddress)},+
  441. {Endpoint,$(NoTitle),$(!REG_VT_SZ),$(EndPointName)}}
  442. Shell $(UtilityInf), AddValueList, $(KeyNameService), $(NewValueList)
  443. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  444. Debug-Output "OEMNSVRP.INF: ShellCode error."
  445. Goto ShellCodeError
  446. Endif
  447. set RegistryErrorIndex = $($R0)
  448. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  449. Debug-Output "OEMNSVRP.INF: registry error: add value list."
  450. Goto fatalregistry
  451. Endif
  452. ;
  453. ; Set the Default security provider
  454. ;
  455. Set SecurityDllName = *($(SecurityDllList),$(SecurityProviderIndex))
  456. Set NewValueList = {{DefaultProvider,$(NoTitle),$(!REG_VT_SZ),$(SecurityDllName)}}
  457. Debug-Output "OEMNSVRP.INF: adding security provider list: "$(SecurityDllName)
  458. Shell $(UtilityInf), AddValueList, $(KeySecurity), $(NewValueList)
  459. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  460. Debug-Output "OEMNSVRP.INF: ShellCode error."
  461. Goto ShellCodeError
  462. Endif
  463. set RegistryErrorIndex = $($R0)
  464. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  465. Debug-Output "OEMNSVRP.INF: registry error: add value list."
  466. Goto fatalregistry
  467. Endif
  468. configuredone = +
  469. CloseRegKey $(KeyNameService)
  470. CloseRegKey $(KeySecurity)
  471. Goto successful
  472. ;-----------------------------------------------
  473. ; Installation Section
  474. ;-----------------------------------------------
  475. installadapter = +
  476. ifstr(i) $(Option) == "RPCBANYAN"
  477. OpenRegKey $(!REG_H_LOCAL) "" $(RpcBanyanSoftKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  478. ;
  479. ; have we installed before?
  480. ;
  481. Ifstr $(KeyProduct) != $(KeyNull)
  482. ;
  483. ; Product already exists.
  484. ; Popup the dialog and ask the user whether he wants to continue
  485. ;
  486. CloseRegKey $(KeyProduct)
  487. Shell $(UtilityInf), VerExistedDlg, $(ProductRPCBanyanTitle),+
  488. $(ProductVersion)
  489. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  490. Debug-Output "ShellCode error: cannot get an error string."
  491. goto ShellCodeError
  492. endif
  493. set CommonStatus = STATUS_USERCANCEL
  494. goto end
  495. endif
  496. ;
  497. ; confirm source location
  498. ;
  499. Ifstr(i) $(DoCopy) == "YES"
  500. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  501. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  502. Goto ShellCodeError
  503. Else-Ifstr(i) $($R0) == STATUS_FAILED
  504. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  505. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  506. goto ShellCodeError
  507. endif
  508. set Error = $($R0)
  509. Goto fatal
  510. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  511. Goto successful
  512. Endif
  513. Set SrcDir = $($R1)
  514. Endif
  515. ;
  516. ; copy files
  517. ;
  518. install "Install-Option"
  519. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  520. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  521. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  522. goto ShellCodeError
  523. endif
  524. set Error = $($R0)
  525. goto fatal
  526. endif
  527. ;
  528. ; Add software Item so we can manage this change
  529. ;
  530. Shell $(UtilityInf), InstallSoftwareProduct, $(Manufacturer), $(RpcSrvNameBanyan), "oemnsvrp.inf"
  531. Set SoftProductKey = $($R1)
  532. Set SoftNetRuleKey = $($R2)
  533. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),"service"},+
  534. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  535. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  536. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductRPCBanyanTitle)},+
  537. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductRPCBaynanSoftDescription)},+
  538. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupportRPCBANYAN)}, +
  539. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  540. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  541. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  542. Debug-Output "OEMNSVNW.INF: ShellCode error."
  543. goto ShellCodeError
  544. endif
  545. set RegistryErrorIndex = $($R0)
  546. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  547. EndWait
  548. Debug-Output "OEMNSVNW.INF: registry error: add value list."
  549. CloseRegKey $(SoftProductKey)
  550. CloseRegKey $(SoftNetRuleKey)
  551. goto fatalregistry
  552. endif
  553. set NewValueList = {{InfOption,$(NoTitle),$(!REG_VT_SZ),RPCBANYAN}}
  554. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  555. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  556. Debug-Output "OEMNSVNW.INF: ShellCode error."
  557. goto ShellCodeError
  558. endif
  559. set RegistryErrorIndex = $($R0)
  560. CloseRegKey $(SoftProductKey)
  561. CloseRegKey $(SoftNetRuleKey)
  562. ;
  563. ; modify value in RPC software protocols,
  564. ; this is what this is all about
  565. ;
  566. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSoftKeyName)$(ServerProto) $(MAXIMUM_ALLOWED) KeyProduct
  567. Ifstr $(KeyProduct) == $(KeyNull)
  568. Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  569. Goto fatalregistry
  570. endif
  571. SetRegValue $(KeyProduct) +
  572. {"ncacn_vns_spp",$(NoTitle),$(!REG_VT_SZ),"rpclt1.dll" }
  573. CloseRegKey $(KeyProduct)
  574. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSoftKeyName)$(ClientProto) $(MAXIMUM_ALLOWED) KeyProduct
  575. Ifstr $(KeyProduct) == $(KeyNull)
  576. Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  577. Goto fatalregistry
  578. endif
  579. SetRegValue $(KeyProduct) +
  580. {"ncacn_vns_spp",$(NoTitle),$(!REG_VT_SZ),"rpclt1.dll" }
  581. CloseRegKey $(KeyProduct)
  582. Goto successful
  583. endif
  584. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSrvKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  585. Ifstr $(KeyProduct) != $(KeyNull)
  586. ;
  587. ; Product already exists.
  588. ; Popup the dialog and ask the user whether he wants to continue
  589. ;
  590. CloseRegKey $(KeyProduct)
  591. Shell $(UtilityInf), VerExistedDlg, $(ProductRPCTitle),+
  592. $(ProductVersion)
  593. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  594. Debug-Output "ShellCode error: cannot get an error string."
  595. goto ShellCodeError
  596. endif
  597. set CommonStatus = STATUS_USERCANCEL
  598. goto end
  599. endif
  600. ;
  601. ; Copy the files if this is installation.
  602. ;
  603. StartWait
  604. ifstr(i) $(!NTN_InstallMode) == "install"
  605. Ifstr(i) $(DoCopy) == "YES"
  606. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  607. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  608. Goto ShellCodeError
  609. Else-Ifstr(i) $($R0) == STATUS_FAILED
  610. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  611. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  612. goto ShellCodeError
  613. endif
  614. set Error = $($R0)
  615. Goto fatal
  616. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  617. Goto successful
  618. Endif
  619. Set SrcDir = $($R1)
  620. Endif
  621. install "Install-Option"
  622. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  623. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  624. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  625. goto ShellCodeError
  626. endif
  627. set Error = $($R0)
  628. goto fatal
  629. endif
  630. endif
  631. set OEM_ABANDON_ON = TRUE
  632. ;
  633. ; Create the RPC entries in the SOFTWARE hive
  634. ;
  635. Set RpcSecurityServiceKey = $(KeyNull)
  636. Set RpcKey = $(KeyNull)
  637. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSoftKeyName) $(MAXIMUM_ALLOWED) RpcKey
  638. Ifstr(i) $(RpcKey) == $(KeyNull)
  639. ;
  640. ; RPC section is not in the registry.
  641. ;
  642. Debug-Output "OEMNSVRP.INF: Error opening RPC key"
  643. Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  644. Goto fatalregistry
  645. Endif
  646. CreateRegKey $(RpcKey) {"SecurityService",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" RpcSecurityServiceKey
  647. Ifstr(i) $(RpcSecurityServiceKey) == $(KeyNull)
  648. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSecurityKeyName) $(MAXIMUM_ALLOWED) RpcSecurityServiceKey
  649. Endif
  650. Ifstr(i) $(RpcSecurityServiceKey) == $(KeyNull)
  651. Debug-Output "OEMNSVRP.INF: Registry error creating subordinate RPC keys"
  652. CloseRegKey $(RpcKey)
  653. Goto fatalregistry
  654. Endif
  655. ;
  656. ; Set "SecurityService" key values
  657. ;
  658. Set NewValueList = {{DefaultProvider,$(NoTitle),$(!REG_VT_SZ),$(MSSecurityDLL)},+
  659. {10,$(NoTitle),$(!REG_VT_SZ),$(MSSecurityDLL)},+
  660. {1,$(NoTitle),$(!REG_VT_SZ),$(MSSecurityDLL)},+
  661. {DefaultAuthLevel,$(NoTitle),$(!REG_VT_DWORD),0}}
  662. Shell $(UtilityInf), AddValueList, $(RpcSecurityServiceKey), $(NewValueList)
  663. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  664. Debug-Output "OEMNSVRP.INF: ShellCode error."
  665. CloseRegKey $(RpcSecurityServiceKey)
  666. goto ShellCodeError
  667. Endif
  668. set RegistryErrorIndex = $($R0)
  669. CloseRegKey $(RpcSecurityServiceKey)
  670. CloseRegKey $(RpcKey)
  671. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  672. EndWait
  673. Debug-Output "OEMNSVRP.INF: registry error: add value list."
  674. goto fatalregistry
  675. Endif
  676. ;
  677. ; Check for error so far, then create services
  678. ;
  679. createrpcservices =+
  680. ;
  681. ; Install "RpcLocator" as a networking product.
  682. ;
  683. Ifstr(i) $(!STF_PRODUCT) == "LANMANNT"
  684. Set RpcLocatorStartType = "serviceauto"
  685. Else
  686. Set RpcLocatorStartType = "service"
  687. Endif
  688. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  689. $(RpcSrvNameLocator), +
  690. $(RpcSrvNameLocator), +
  691. $(RpcSrvDisplayNameLocator), $(STF_CONTEXTINFNAME), +
  692. $(RpcSrvExeLocator), $(RpcLocatorStartType), "", $(RpcSrvDepend), "", ""
  693. set RegistryErrorIndex = $($R0)
  694. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  695. Debug-Output "OEMNSVRP.INF: ShellCode error creating RPCLOCATOR service: "$($ShellCode)
  696. Goto ShellCodeError
  697. Endif
  698. Set SoftProductKey = $($R1)
  699. Set SoftNetRuleKey = $($R2)
  700. CloseRegKey $($R3)
  701. Set RpcLocatorParametersKey = $($R4)
  702. CloseRegKey $($R5)
  703. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  704. EndWait
  705. Debug-Output "OEMNSVRP.INF: Registry error: creating RPCLOCATE software product"
  706. CloseRegKey $(SoftProductKey)
  707. CloseRegKey $(SoftNetRuleKey)
  708. CloseRegKey $(RpcLocatorParametersKey)
  709. Goto fatalregistry
  710. Endif
  711. Set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  712. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  713. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  714. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductRPCTitle)},+
  715. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  716. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupportRPC)}, +
  717. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  718. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  719. Set RegistryErrorIndex = $($R0)
  720. CloseRegKey $(SoftProductKey)
  721. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  722. Debug-Output "ShellCode error."
  723. goto ShellCodeError
  724. endif
  725. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  726. EndWait
  727. Debug-Output "OEMNSVRP.INF: Registry error: add value list to RPCLOCATE product"
  728. CloseRegKey $(SoftNetRuleKey)
  729. CloseRegKey $(RpcLocatorParametersKey)
  730. goto fatalregistry
  731. endif
  732. Set NewValueList = {{InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  733. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  734. set RegistryErrorIndex = $($R0)
  735. CloseRegKey $(SoftNetRuleKey)
  736. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  737. CloseRegKey $(RpcLocatorParametersKey)
  738. Debug-Output "ShellCode error."
  739. goto ShellCodeError
  740. endif
  741. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  742. EndWait
  743. CloseRegKey $(RpcLocatorParametersKey)
  744. Debug-Output "OEMNSVSV.INF: Registry error: add value list."
  745. goto fatalregistry
  746. Endif
  747. Set NewValueList = {{ExpirationAge,$(NoTitle),$(!REG_VT_DWORD),3600}}
  748. Shell $(UtilityInf), AddValueList, $(RpcLocatorParametersKey), $(NewValueList)
  749. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  750. Debug-Output "OEMNSVRP.INF: ShellCode error."
  751. goto ShellCodeError
  752. Endif
  753. set RegistryErrorIndex = $($R0)
  754. CloseRegKey $(RpcLocatorParametersKey)
  755. ;
  756. ; Choose proper ACL based upon system type
  757. ;
  758. Ifstr(i) $(!STF_PRODUCT) == "LANMANNT"
  759. Set AclIndex = 4
  760. Else
  761. Set AclIndex = 3
  762. Endif
  763. ;
  764. ; Create the Security service.
  765. ;
  766. Shell $(UtilityInf), CreateService, $(RpcSrvNameSSP), +
  767. $(RpcSrvDisplayNameSSP), $(RpcSrvExeSSP), "serviceshare", "", {}, "", ""
  768. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  769. Debug-Output "OEMNSVRP.INF: ShellCode error creating RPCSS service: "$($ShellCode)
  770. goto ShellCodeError
  771. endif
  772. Set RegistryErrorIndex = $($R0)
  773. CloseRegKey $($R1)
  774. CloseRegKey $($R2)
  775. CloseRegKey $($R3)
  776. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  777. EndWait
  778. Debug-Output "OEMNSVRP.INF: Registry error: creating RPCSS service"
  779. Goto fatalregistry
  780. Endif
  781. ;
  782. ; Set proper security on the RPCLOCATE service so that normal users can
  783. ; start the service.
  784. ;
  785. LibraryProcedure NCPA_RESULT $(!NCPA_HANDLE), CPlSetup $(!STF_HWND),+
  786. SECURESVC, $(RpcSrvNameLocator), $(AclIndex)
  787. LibraryProcedure NCPA_RESULT $(!NCPA_HANDLE), CPlSetup $(!STF_HWND),+
  788. SECURESVC, $(RpcSrvNameRpcss), $(AclIndex)
  789. LibraryProcedure NCPA_RESULT $(!NCPA_HANDLE), CPlSetup $(!STF_HWND),+
  790. SECURESVC, $(RpcSrvNameSSP), $(AclIndex)
  791. EndWait
  792. goto successful
  793. ;-----------------------------------------------
  794. ; Binding section
  795. ;-----------------------------------------------
  796. bindingadapter =+
  797. set Error = "RPC INF file invoked during bindings review."
  798. goto fatal
  799. ;-----------------------------------------------
  800. ; Removeadapter section
  801. ;-----------------------------------------------
  802. removeadapter = +
  803. ifstr(i) $(Option) == "RPCBANYAN"
  804. Debug-Output "OEMNSVRP.INF: Remove component RpcBanyan"
  805. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), $(RpcSrvNameBanyan), FALSE
  806. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSoftKeyName)$(ServerProto) $(MAXIMUM_ALLOWED) KeyProduct
  807. Ifstr $(KeyProduct) == $(KeyNull)
  808. Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  809. Goto fatalregistry
  810. endif
  811. DeleteRegValue $(KeyProduct) "ncacn_vns_spp"
  812. CloseRegKey $(KeyProduct)
  813. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSoftKeyName)$(ClientProto) $(MAXIMUM_ALLOWED) KeyProduct
  814. Ifstr $(KeyProduct) == $(KeyNull)
  815. Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  816. Goto fatalregistry
  817. endif
  818. DeleteRegValue $(KeyProduct) "ncacn_vns_spp"
  819. CloseRegKey $(KeyProduct)
  820. Goto successful
  821. endif
  822. ;
  823. ; Remove the RPCLOCATOR component
  824. ;
  825. Debug-Output "OEMNSVRP.INF: Remove component "$(RpcSrvNameLocator)
  826. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), $(RpcSrvNameLocator), FALSE
  827. ;
  828. ; Do Not Remove RPCSS service, as OLE still requires it!
  829. ;
  830. ; Debug-Output "OEMNSVRP.INF: Remove service "$(RpcSrvNameRpcss)
  831. ; Shell $(UtilityInf), RemoveService, $(RpcSrvNameRpcss), "YES"
  832. ;
  833. ; Remove Security service
  834. ;
  835. Debug-Output "OEMNSVRP.INF: Remove service "$(RpcSrvNameSSP)
  836. Shell $(UtilityInf), RemoveService, $(RpcSrvNameSSP), "YES"
  837. goto end
  838. ;-----------------------------------------------
  839. ; Upgrade Software section
  840. ;-----------------------------------------------
  841. UpgradeSoftware = +
  842. ifstr(i) $(Option) == "RPCBANYAN"
  843. OpenRegKey $(!REG_H_LOCAL) "" $(RpcBanyanSoftKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  844. Ifstr $(KeyProduct) != $(KeyNull)
  845. ; Upgrade the version number
  846. ;
  847. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  848. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  849. ;
  850. ; Update description and op support
  851. ;
  852. SetRegValue $(KeyProduct) {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductRPCBanyanSoftDescription)}
  853. SetRegValue $(KeyProduct) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupportRPCBANYAN)}
  854. CloseRegKey $(KeyProduct)
  855. endif
  856. Goto successful
  857. endif
  858. #if defined( CAIRO_INF )
  859. ; upgrade the service dependancies
  860. ;
  861. set RpcLocatorService = "SYSTEM\CurrentControlSet\Services\"$(RpcSrvNameLocator)
  862. OpenRegKey $(!REG_H_LOCAL) "" $(RpcLocatorService) $(MAXIMUM_ALLOWED) KeyService
  863. ifstr $(KeyService) != $(KeyNull)
  864. SetRegValue $(KeyService) +
  865. {"DependOnService",$(NoTitle),$(!REG_VT_MULTI_SZ),$(RpcSrvDepend) }
  866. endif
  867. #endif
  868. ; Upgrade software component
  869. ;
  870. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  871. Ifstr $(KeyProduct) != $(KeyNull)
  872. install "Install-Update"
  873. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  874. goto fatal
  875. endif
  876. ; Upgrade the version number
  877. ;
  878. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  879. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  880. ;
  881. ; Update description and op support
  882. ;
  883. SetRegValue $(KeyProduct) {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)}
  884. SetRegValue $(KeyProduct) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupportRPC)}
  885. ;
  886. ; Now check to see if the Security key is there. If not, add it.
  887. ;
  888. OpenRegKey $(!REG_H_LOCAL) "" $(SecurityKeyName) $(MAXIMUM_ALLOWED) KeySecurity
  889. Ifstr $(KeySecurity) == ""
  890. ;
  891. ; First create the RPC Security service
  892. ;
  893. Shell $(UtilityInf), CreateService, $(RpcSrvNameSSP), +
  894. $(RpcSrvDisplayNameSSP), $(RpcSrvExeSSP), "serviceshare", +
  895. "", {}, "", ""
  896. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  897. Debug-Output "OEMNSVRP.INF: ShellCode error creating RPCSS service: "$($ShellCode)
  898. goto ShellCodeError
  899. endif
  900. Set RegistryErrorIndex = $($R0)
  901. CloseRegKey $($R1)
  902. CloseRegKey $($R2)
  903. CloseRegKey $($R3)
  904. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  905. EndWait
  906. Debug-Output "OEMNSVRP.INF: Registry error: creating RPCSS service"
  907. Goto fatalregistry
  908. Endif
  909. ;
  910. ; Now create the SecurityService key in the software section
  911. ;
  912. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSoftKeyName) $(MAXIMUM_ALLOWED) RpcKey
  913. Ifstr(i) $(RpcKey) == $(KeyNull)
  914. ;
  915. ; RPC section is not in the registry.
  916. ;
  917. Debug-Output "OEMNSVRP.INF: Error opening RPC key"
  918. Set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  919. Goto fatalregistry
  920. Endif
  921. CreateRegKey $(RpcKey) {"SecurityService",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeySecurity
  922. Ifstr(i) $(KeySecurity) == $(KeyNull)
  923. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSecurityKeyName) $(MAXIMUM_ALLOWED) KeySecurity
  924. Endif
  925. CloseRegKey $(RpcKey)
  926. Ifstr(i) $(KeySecurity) == $(KeyNull)
  927. Debug-Output "OEMNSVRP.INF: Registry error creating subordinate RPC keys"
  928. Goto fatalregistry
  929. Endif
  930. ;
  931. ; Now set the default values
  932. ;
  933. Set NewValueList = {{DefaultProvider,$(NoTitle),$(!REG_VT_SZ),$(MSSecurityDLL)},+
  934. {10,$(NoTitle),$(!REG_VT_SZ),$(MSSecurityDLL)},+
  935. {1,$(NoTitle),$(!REG_VT_SZ),$(MSSecurityDLL)},+
  936. {DefaultAuthLevel,$(NoTitle),$(!REG_VT_DWORD),0}}
  937. Shell $(UtilityInf), AddValueList, $(KeySecurity), $(NewValueList)
  938. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  939. Debug-Output "OEMNSVRP.INF: ShellCode error."
  940. CloseRegKey $(KeySecurity)
  941. goto ShellCodeError
  942. Endif
  943. set RegistryErrorIndex = $($R0)
  944. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  945. Debug-Output "OEMNSVRP.INF: registry error: add value list."
  946. goto fatalregistry
  947. Endif
  948. Endif
  949. ;
  950. ; now check client and server protocols and replace old dlls with new dlls
  951. ;
  952. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSoftKeyName)$(ClientProto) $(MAXIMUM_ALLOWED) KeyClient
  953. Ifstr $(KeyClient) != $(KeyNull)
  954. EnumRegValue $(KeyClient) ValueList
  955. ForListDo $(ValueList)
  956. set ValueItemList = $($)
  957. Ifcontains(i) *($(ValueItemList),4) in $(DLLClientList)
  958. set NewValueList = {*($(ValueItemList),1),0,$(!REG_VT_SZ),"rpclt1.dll" }
  959. SetRegValue $(KeyClient) $(NewValueList)
  960. Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  961. Debug-Output "OEMNSVRP.INF: registry error: setting new client protocol dll name:"*($(ValueItemList),1)":"$(RegLastError)
  962. goto fatalregistry
  963. endif
  964. Endif
  965. EndForListDo
  966. CloseRegKey $(KeyClient)
  967. else
  968. Debug-Output "OEMNSVRP.INF: registry error: opening client protocols for dll rename"
  969. goto fatalregistry
  970. endif
  971. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSoftKeyName)$(ServerProto) $(MAXIMUM_ALLOWED) KeyServer
  972. Ifstr $(KeyServer) != $(KeyNull)
  973. EnumRegValue $(KeyServer) ValueList
  974. ForListDo $(ValueList)
  975. set ValueItemList = $($)
  976. Ifcontains(i) *($(ValueItemList),4) in $(DLLServerList)
  977. set NewValueList = {*($(ValueItemList),1),0,$(!REG_VT_SZ),"rpclt1.dll" }
  978. SetRegValue $(KeyServer) $(NewValueList)
  979. Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  980. Debug-Output "OEMNSVRP.INF: registry error: setting new server protocol dll name:"*($(ValueItemList),1)":"$(RegLastError)
  981. goto fatalregistry
  982. endif
  983. Endif
  984. EndForListDo
  985. CloseRegKey $(KeyServer)
  986. else
  987. Debug-Output "OEMNSVRP.INF: registry error: opening server protocols for dll rename"
  988. goto fatalregistry
  989. endif
  990. CloseRegKey $(KeySecurity)
  991. CloseRegKey $(KeyProduct)
  992. else
  993. ;
  994. ; Cannot Open software key, goto ERROR
  995. ;
  996. goto fatalregistry
  997. endif
  998. ;
  999. ; Upgrade ImagePath for NTLMSSP
  1000. ;
  1001. OpenRegKey $(!REG_H_LOCAL) "" $(RpcSrvSSPKeyName) $(MAXIMUM_ALLOWED) KeyNTLMSSP
  1002. Ifstr $(KeyNTLMSSP) != $(KeyNull)
  1003. SetRegValue $(KeyNTLMSSP) {ImagePath,$(NoTitle),$(!REG_VT_EXPAND_SZ),$(RpcSrvExeSSP)}
  1004. Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1005. Debug-Output "OEMNSVRP.INF: registry error: Upgrading NTLMSSP ImagePath:"$(RegLastError)
  1006. CloseRegKey $(KeyNTLMSSP)
  1007. goto fatalregistry
  1008. endif
  1009. CloseRegKey $(KeyNTLMSSP)
  1010. else
  1011. Debug-Output "OEMNSVRP.INF: registry error: opening NTLMSSP for upgrade"
  1012. endif
  1013. goto end
  1014. ;
  1015. ; End of Upgrade Software
  1016. ;
  1017. ;
  1018. ; Escape hatches
  1019. ;
  1020. successful = +
  1021. goto end
  1022. ;
  1023. ; warning display
  1024. ;
  1025. warning = +
  1026. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1027. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1028. goto ShellCodeError
  1029. endif
  1030. ifstr(i) $($R1) == "OK"
  1031. goto $(to)
  1032. else-ifstr(i) $($R1) == "CANCEL"
  1033. goto $(from)
  1034. else
  1035. ; Debug-Msg "Error Error Bad DLGEVENT"
  1036. goto "end"
  1037. endif
  1038. ;
  1039. ; non fatal error display
  1040. ;
  1041. nonfatal = +
  1042. ifstr(i) $(Error) == ""
  1043. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1044. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1045. goto ShellCodeError
  1046. endif
  1047. set Error = $($R0)
  1048. endif
  1049. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(Error)
  1050. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1051. goto ShellCodeError
  1052. endif
  1053. ifstr(i) $($R1) == "OK"
  1054. goto $(from)
  1055. else
  1056. goto "end"
  1057. endif
  1058. ;
  1059. ; Registry is broken
  1060. ;
  1061. fatalregistry = +
  1062. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1063. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1064. goto ShellCodeError
  1065. endif
  1066. set Error = $($R0)
  1067. goto fatal
  1068. ;
  1069. ; fatal error display
  1070. ;
  1071. fatal = +
  1072. ifstr(i) $(Error) == ""
  1073. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1074. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1075. goto ShellCodeError
  1076. endif
  1077. set Error = $($R0)
  1078. endif
  1079. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1080. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1081. goto ShellCodeError
  1082. endif
  1083. goto setfailed
  1084. ;
  1085. ; Shelling error
  1086. ;
  1087. ShellCodeError = +
  1088. set DlgType = "MessageBox"
  1089. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1090. set STF_MB_TEXT = $(ShellCodeErrorText)
  1091. set STF_MB_TYPE = 1
  1092. set STF_MB_ICON = 3
  1093. set STF_MB_DEF = 1
  1094. ui start "Error Message"
  1095. goto setfailed
  1096. setfailed = +
  1097. set CommonStatus = STATUS_FAILED
  1098. ;
  1099. ; If OEM_ABANDON_ON, we need to clean up the registry
  1100. ;
  1101. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1102. set OEM_ABANDON_ON = FALSE
  1103. goto removeadapter
  1104. endif
  1105. goto end
  1106. end = +
  1107. goto term
  1108. term = +
  1109. Return $(CommonStatus)
  1110. ;***************************************************************
  1111. ; INSTALL SECTIONS
  1112. ;***************************************************************
  1113. [Install-Option]
  1114. set STF_VITAL = ""
  1115. ifstr(i) $(AddCopy) == "YES"
  1116. ;
  1117. ; Add the files to the copy list
  1118. ;
  1119. ; BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1120. ; the other INF files
  1121. ;
  1122. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1123. endif
  1124. ifstr(i) $(DoCopy) == "YES"
  1125. ;
  1126. ; Copy files in the copy list
  1127. ;
  1128. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1129. CopyFilesInCopyList
  1130. endif
  1131. ifstr(i) $(DoConfig) == "YES"
  1132. ;
  1133. ; Add product to registry
  1134. ;
  1135. ;
  1136. ; Finish up
  1137. endif
  1138. Exit
  1139. [Install-Update]
  1140. set STF_VITAL = ""
  1141. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  1142. ;set STF_VERSION = "YES"
  1143. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1144. exit