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.

637 lines
17 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNSVIN.INF
  4. ;
  5. ; Internet Information Server
  6. ;
  7. ; History:
  8. ; terryk 4-1-1996 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. INETSRV
  39. ;***********************************************************************
  40. ; CONSTANTS FOR USING DIALOGS
  41. ;***********************************************************************
  42. [FileConstants]
  43. ;
  44. ; Product Info
  45. ;
  46. Manufacturer = "Microsoft"
  47. ProductMajorVersion = "4"
  48. ProductMinorVersion = "0"
  49. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  50. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  51. ;================================================================
  52. ProductINETSRVName = "Inetsrv"
  53. ;
  54. ; Registry Key Names
  55. ;
  56. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\Inetsrv\CurrentVersion"
  57. [GeneralConstants]
  58. ;
  59. ; File names, etc.
  60. ;
  61. UtilityInf = "UTILITY.INF"
  62. subroutineinf = "SUBROUTN.INF"
  63. Exit_Code = 0
  64. ;ShellCode = 0
  65. BillboardVisible = 0
  66. ;
  67. ; Program flow control variables.
  68. ;
  69. from = ""
  70. to = ""
  71. ;
  72. ; Return codes; Exit_Code is set to one of these
  73. ;
  74. ExitCodeOk = 0
  75. ExitCodeCancel = 1
  76. ExitCodeFatal = 2
  77. KeyNull = ""
  78. MAXIMUM_ALLOWED = 33554432
  79. SERVICE_NO_CHANGE = 4294967295
  80. RegistryErrorIndex = NO_ERROR
  81. KeyProduct = ""
  82. KeyParameters = ""
  83. TRUE = 1
  84. FALSE = 0
  85. NoTitle = 0
  86. ExitState = "Active"
  87. OldVersionExisted = $(FALSE)
  88. [date]
  89. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  90. ; Minute, Second }
  91. Now = {} ? $(!LIBHANDLE) GetSystemDate
  92. ;---------------------------------------------------------------------------
  93. ; 1. Identify
  94. ;
  95. ; DESCRIPTION: To verify that this INF deals with the same type of options
  96. ; as we are choosing currently.
  97. ;
  98. ; INPUT: None
  99. ;
  100. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  101. ; $($R1): Option Type (COMPUTER ...)
  102. ; $($R2): Diskette description
  103. ;---------------------------------------------------------------------------
  104. [Identify]
  105. ;
  106. ;
  107. read-syms Identification
  108. set Status = STATUS_SUCCESSFUL
  109. set Identifier = $(OptionType)
  110. set Media = #("Source Media Descriptions", 1, 1)
  111. Return $(Status) $(Identifier) $(Media)
  112. ;------------------------------------------------------------------------
  113. ; 2. ReturnOptions:
  114. ;
  115. ; DESCRIPTION: To return the option list supported by this INF and the
  116. ; localised text list representing the options.
  117. ;
  118. ;
  119. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  120. ;
  121. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  122. ; STATUS_NOLANGUAGE
  123. ; STATUS_FAILED
  124. ;
  125. ; $($R1): Option List
  126. ; $($R2): Option Text List
  127. ;------------------------------------------------------------------------
  128. [ReturnOptions]
  129. ;
  130. ;
  131. set Status = STATUS_FAILED
  132. set OptionList = {}
  133. set OptionTextList = {}
  134. ;
  135. ; Check if the language requested is supported
  136. ;
  137. set LanguageList = ^(LanguagesSupported, 1)
  138. Ifcontains(i) $($0) in $(LanguageList)
  139. goto returnoptions
  140. else
  141. set Status = STATUS_NOLANGUAGE
  142. goto finish_ReturnOptions
  143. endif
  144. ;
  145. ; form a list of all the options and another of the text representing
  146. ;
  147. returnoptions = +
  148. set OptionList = ^(Options, 1)
  149. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  150. set OptionTextList = ^(OptionsWINNTText$($0), 1)
  151. else
  152. set OptionTextList = ^(OptionsLANMANNTText$($0), 1)
  153. endif
  154. set Status = STATUS_SUCCESSFUL
  155. finish_ReturnOptions = +
  156. Return $(Status) $(OptionList) $(OptionTextList)
  157. ;----------InstallOption-------------------------------------------------
  158. ;
  159. ; InstallOption:
  160. ;
  161. ; This section is shelled to by main installation processing
  162. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  163. ;
  164. ;
  165. ; FUNCTION: To copy files representing Options
  166. ; To configure the installed option
  167. ; To update the registry for the installed option
  168. ;
  169. ; INPUT: $($0): Language to use
  170. ; $($1): OptionID to install
  171. ; $($2): SourceDirectory
  172. ; $($3): AddCopy (YES | NO)
  173. ; $($4): DoCopy (YES | NO)
  174. ; $($5): DoConfig (YES | NO)
  175. ;
  176. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  177. ; STATUS_NOLANGUAGE |
  178. ; STATUS_USERCANCEL |
  179. ; STATUS_FAILED
  180. ;
  181. ;------------------------------------------------------------------------
  182. [InstallOption]
  183. ;
  184. ; extract parameters
  185. ;
  186. set Option = $($1)
  187. set SrcDir = $($2)
  188. set AddCopy = $($3)
  189. set DoCopy = $($4)
  190. set DoConfig = $($5)
  191. ;
  192. ; Check if the language requested is supported
  193. ;
  194. set LanguageList = ^(LanguagesSupported, 1)
  195. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  196. Return STATUS_NOLANGUAGE
  197. endif
  198. ; define all the constants
  199. set-subst LF = "\n"
  200. read-syms GeneralConstants
  201. read-syms FileConstants
  202. read-syms DialogConstants$(!STF_LANGUAGE)
  203. ifstr(i) $(!NTN_Origination) == "NCPA"
  204. set Continue = $(OK)
  205. endif
  206. read-syms FileConstants$(!STF_LANGUAGE)
  207. detect date
  208. set-title $(FunctionTitle)
  209. set to = Begin
  210. set from = Begin
  211. ;
  212. ; Assume all is well.
  213. ;
  214. set CommonStatus = STATUS_NO_EFFECT
  215. EndWait
  216. ;
  217. ; Set up the operation-mode-based variables and gaily welcome
  218. ; the user. If the "install mode" variable is improperly set,
  219. ; assume this is a new installation.
  220. ;
  221. Begin = +
  222. Ifstr(i) $(!NTN_InstallMode) == deinstall
  223. set StartLabel = removeadapter
  224. else-Ifstr(i) $(!NTN_InstallMode) == Update
  225. set StartLabel = UpgradeSoftware
  226. else-Ifstr(i) $(!NTN_InstallMode) == configure
  227. ;
  228. ; You cannot config the software component
  229. ;
  230. Debug-Output "Cannot configure the software."
  231. set Error = $(Warning1)
  232. set from = end
  233. set to = end
  234. goto nonfatalinfo
  235. else-Ifstr(i) $(!NTN_InstallMode) == bind
  236. set StartLabel = bindingadapter
  237. else
  238. set StartLabel = installadapter
  239. set OEM_ABANDON_SOFTWARE = {}
  240. set OEM_ABANDON_OPTIONS = {}
  241. endif
  242. set from = $(fatal)
  243. set to = $(fatal)
  244. goto $(StartLabel)
  245. ;-----------------------------------------------
  246. ; Installation Section
  247. ;-----------------------------------------------
  248. installadapter = +
  249. ; detect date ; LIBHANDLE is undefined
  250. Shell "utility.inf" InstallSoftwareProduct "Microsoft" "Inetsrv" "oemnsvin.inf"
  251. set ISVersion = $($R1)
  252. set ISNetRule = $($R2)
  253. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  254. set ProductTitle = $(FunctionWINNTTitle)
  255. set ProductDescription = $(ProductSoftwareWINNTDescription)
  256. set ProductName = $(ProductTitle)
  257. else
  258. set ProductTitle = $(FunctionLANMANNTTitle)
  259. set ProductDescription = $(ProductSoftwareLANMANNTDescription)
  260. set ProductName = $(ProductTitle)
  261. endif
  262. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),"service"},+
  263. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  264. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  265. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductTitle)},+
  266. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductDescription)},+
  267. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductName)},+
  268. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}, +
  269. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  270. Shell $(UtilityInf), AddValueList, $(ISVersion), $(NewValueList)
  271. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  272. Debug-Output "OEMNSVNW.INF: ShellCode error."
  273. goto ShellCodeError
  274. endif
  275. set NewValueList = {{"InfOption",$(NoTitle),$(!REG_VT_SZ),"Inetsrv"}}
  276. Shell $(UtilityInf), AddValueList, $(ISNetRule), $(NewValueList)
  277. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  278. Debug-Output "OEMNSVNW.INF: ShellCode error."
  279. goto ShellCodeError
  280. endif
  281. ifstr(i) $(!NTN_InstallPhase) == primary
  282. goto end
  283. endif
  284. ;
  285. ; caller inetins.exe and it will run setup
  286. ;
  287. ;
  288. ; first make sure we don't have inetstp.exe around first
  289. ;
  290. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\INetStp" $(MAXIMUM_ALLOWED) BS_INetStp
  291. ifstr $(BS_INetStp) != $(KeyNull)
  292. ;
  293. ; display error message
  294. ;
  295. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  296. set Error = $(Warning3Winnt)
  297. else
  298. set Error = $(Warning3LanmanNt)
  299. endif
  300. set from = end
  301. set to = end
  302. goto warning
  303. else
  304. ;
  305. ; call inetstp.exe up
  306. ;
  307. ifstr(i) $(!NTN_Origination) == "install"
  308. ifstr(i) $(!NTN_InstallPhase) == "secondary"
  309. ;
  310. ; display error message
  311. ;
  312. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  313. set Error = $(Warning4Winnt)
  314. else
  315. set Error = $(Warning4LanmanNt)
  316. endif
  317. ;
  318. ; remove the software component
  319. ;
  320. Shell "utility.inf" RemoveSoftwareComponent "Microsoft" "Inetsrv" "FALSE"
  321. set from = end
  322. set to = end
  323. goto nonfatal
  324. endif
  325. endif
  326. set FWaitForProcess = 1
  327. RunProgram RC "" "" $(!STF_WINDOWSSYSPATH)"\inetins.exe"
  328. set FWaitForProcess = 0
  329. ifint $(RC) == 1
  330. ; user cancel
  331. Shell "utility.inf" RemoveSoftwareComponent "Microsoft" "Inetsrv" "FALSE"
  332. endif
  333. endif
  334. set CommonStatus = STATUS_NO_EFFECT
  335. goto successful
  336. ;-----------------------------------------------
  337. ; Configuration Section
  338. ;-----------------------------------------------
  339. configureadapter = +
  340. goto end
  341. ;-----------------------------------------------
  342. ; Binding section
  343. ;-----------------------------------------------
  344. bindingadapter =+
  345. ;
  346. goto end
  347. ;-----------------------------------------------
  348. ; Removeadapter section
  349. ;
  350. ;
  351. ; Removal errors are ignored, since we want to
  352. ; try to remove as much as possible.
  353. ;-----------------------------------------------
  354. removeadapter = +
  355. ;
  356. ; called inetins.exe and it will run setup
  357. ;
  358. ;
  359. ; first make sure we have inetstp.exe around first
  360. ;
  361. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\INetStp" $(MAXIMUM_ALLOWED) BS_INetStp
  362. ifstr $(BS_INetStp) == $(KeyNull)
  363. ;
  364. ; display error message
  365. ;
  366. ;ifstr(i) $(!STF_PRODUCT) == "WINNT"
  367. ; set Error = $(Warning2Winnt)
  368. ;else
  369. ; set Error = $(Warning2LanmanNt)
  370. ;endif
  371. ;
  372. ; just in case the registry tag is still around, remove it.
  373. ;
  374. Shell "utility.inf" RemoveSoftwareComponent "Microsoft" "Inetsrv" "FALSE"
  375. ;set from = end
  376. ;set to = end
  377. ;goto warning
  378. set CommonStatus = STATUS_NO_EFFECT
  379. else
  380. ;
  381. ; call inetstp.exe up
  382. ;
  383. ifstr(i) $(!NTN_InstallPhase) == primary
  384. goto end
  385. endif
  386. GetRegValue $(BS_INetStp),"InstallPath",InstallPath
  387. set FWaitForProcess = 1
  388. RunProgram RC "" "" *($(InstallPath),4)"\setup.exe" "/R"
  389. set FWaitForProcess = 0
  390. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\INetStp" $(MAXIMUM_ALLOWED) INetStpKey
  391. ifstr $(INetStpKey) == $(KeyNull)
  392. Shell "utility.inf" RemoveSoftwareComponent "Microsoft" "Inetsrv" "FALSE"
  393. endif
  394. endif
  395. goto end
  396. ;-----------------------------------------------
  397. ; Upgrade Software section
  398. ;-----------------------------------------------
  399. UpgradeSoftware = +
  400. ;
  401. ; Update description and op support
  402. ;
  403. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  404. set ProductDescription = $(ProductSoftwareWINNTDescription)
  405. else
  406. set ProductDescription = $(ProductSoftwareLANMANNTDescription)
  407. endif
  408. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyCurrentVersion
  409. Ifstr $(KeyCurrentVersion) != $(KeyNull)
  410. SetRegValue $(KeyCurrentVersion) {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductDescription)}
  411. SetRegValue $(KeyCurrentVersion) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  412. CloseRegKey $(KeyCurrentVersion)
  413. endif
  414. goto end
  415. ;
  416. ; End of Upgrade Software
  417. ;
  418. ;
  419. ; Escape hatches
  420. ;
  421. successful = +
  422. goto end
  423. ;
  424. ; warning display
  425. ;
  426. warning = +
  427. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  428. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  429. goto ShellCodeError
  430. endif
  431. ifstr(i) $($R1) == "OK"
  432. goto $(to)
  433. else-ifstr(i) $($R1) == "CANCEL"
  434. goto $(from)
  435. else
  436. ; Debug-Msg "Error Error Bad DLGEVENT"
  437. goto end
  438. endif
  439. ;
  440. ; non fatal error display
  441. ;
  442. nonfatalinfo = +
  443. Set CommonStatus = STATUS_USERCANCEL
  444. Set Severity = STATUS
  445. goto nonfatalmsg
  446. nonfatal = +
  447. Set Severity = NONFATAL
  448. goto nonfatalmsg
  449. nonfatalmsg = +
  450. ifstr(i) $(Error) == ""
  451. Set Severity = NONFATAL
  452. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  453. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  454. goto ShellCodeError
  455. endif
  456. set Error = $($R0)
  457. endif
  458. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  459. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  460. goto ShellCodeError
  461. endif
  462. ifstr(i) $($R1) == "OK"
  463. goto $(from)
  464. else
  465. goto "end"
  466. endif
  467. ;
  468. ; Registry is broken
  469. ;
  470. fatalregistry = +
  471. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  472. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  473. goto ShellCodeError
  474. endif
  475. set Error = $($R0)
  476. goto fatal
  477. ;
  478. ; fatal error display
  479. ;
  480. fatal = +
  481. ifstr(i) $(Error) == ""
  482. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  483. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  484. goto ShellCodeError
  485. endif
  486. set Error = $($R0)
  487. endif
  488. Ifint $(BillboardVisible) != 0
  489. Shell "subroutn.inf" PopBillboard
  490. Set BillboardVisible = 0
  491. Endif
  492. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  493. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  494. goto ShellCodeError
  495. endif
  496. goto setfailed
  497. ;
  498. ; Shelling error
  499. ;
  500. ShellCodeError = +
  501. set DlgType = "MessageBox"
  502. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  503. set STF_MB_TEXT = $(ShellCodeErrorText)
  504. set STF_MB_TYPE = 1
  505. set STF_MB_ICON = 3
  506. set STF_MB_DEF = 1
  507. ui start "Error Message"
  508. goto setfailed
  509. setfailed = +
  510. set CommonStatus = STATUS_FAILED
  511. ;
  512. ; If OEM_ABANDON_ON, we need to clean up the registry
  513. ;
  514. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  515. set OEM_ABANDON_ON = FALSE
  516. goto removeadapter
  517. endif
  518. goto end
  519. end = +
  520. goto term
  521. term = +
  522. Return $(CommonStatus)
  523. ;***************************************************************
  524. ; INSTALL SECTIONS
  525. ;***************************************************************
  526. [Install-Option]
  527. set STF_VITAL = ""
  528. ifstr(i) $(AddCopy) == "YES"
  529. ;
  530. ; Add the files to the copy list
  531. ;
  532. endif
  533. ifstr(i) $(DoCopy) == "YES"
  534. ;
  535. ; Copy files in the copy list
  536. ;
  537. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  538. endif
  539. ifstr(i) $(DoConfig) == "YES"
  540. ;
  541. ; Add product to registry
  542. ;
  543. endif
  544. Exit
  545. [Install-Update]
  546. set STF_VITAL = ""
  547. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  548. ;set STF_VERSION = "YES"
  549. Exit