Leaked source code of windows server 2003
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.

580 lines
16 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNSVRC.INF
  4. ;
  5. ; Remote Command Service
  6. ;
  7. ; History:
  8. ; DaveTh 4-28-1994 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. RCMD
  39. ;***********************************************************************
  40. ; CONSTANTS FOR USING DIALOGS
  41. ;***********************************************************************
  42. [FileConstants]
  43. ;
  44. ; Product Info
  45. ;
  46. Manufacturer = "Microsoft"
  47. ProductMajorVersion = "3"
  48. ProductMinorVersion = "5"
  49. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  50. ProductRCMDName = "RemoteCmd"
  51. ProductRCMDImagePath = "%SystemRoot%\System32\rcmdsvc.exe"
  52. ProductRCMDSvcType = "service"
  53. ;
  54. ; Registry Key Names
  55. ;
  56. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductRCMDName)"\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. set OptionTextList = ^(OptionsText$($0), 1)
  150. set Status = STATUS_SUCCESSFUL
  151. finish_ReturnOptions = +
  152. Return $(Status) $(OptionList) $(OptionTextList)
  153. ;----------InstallOption-------------------------------------------------
  154. ;
  155. ; InstallOption:
  156. ;
  157. ; This section is shelled to by main installation processing
  158. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  159. ;
  160. ;
  161. ; FUNCTION: To copy files representing Options
  162. ; To configure the installed option
  163. ; To update the registry for the installed option
  164. ;
  165. ; INPUT: $($0): Language to use
  166. ; $($1): OptionID to install
  167. ; $($2): SourceDirectory
  168. ; $($3): AddCopy (YES | NO)
  169. ; $($4): DoCopy (YES | NO)
  170. ; $($5): DoConfig (YES | NO)
  171. ;
  172. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  173. ; STATUS_NOLANGUAGE |
  174. ; STATUS_USERCANCEL |
  175. ; STATUS_FAILED
  176. ;
  177. ;------------------------------------------------------------------------
  178. [InstallOption]
  179. ;
  180. ; extract parameters
  181. ;
  182. set Option = $($1)
  183. set SrcDir = $($2)
  184. set AddCopy = $($3)
  185. set DoCopy = $($4)
  186. set DoConfig = $($5)
  187. ;
  188. ; Check if the language requested is supported
  189. ;
  190. set LanguageList = ^(LanguagesSupported, 1)
  191. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  192. Return STATUS_NOLANGUAGE
  193. endif
  194. Debug-Output "OEMNSVCU.INF: STF_CWDIR is: "$(!STF_CWDIR)
  195. Debug-Output "OEMNSVCU.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  196. ; define all the constants
  197. set-subst LF = "\n"
  198. read-syms GeneralConstants
  199. read-syms FileConstants
  200. read-syms DialogConstants$(!STF_LANGUAGE)
  201. ifstr(i) $(!NTN_Origination) == "NCPA"
  202. set Continue = $(OK)
  203. endif
  204. read-syms FileConstants$(!STF_LANGUAGE)
  205. read-syms FileDependentDlg$(!STF_LANGUAGE)
  206. detect date
  207. set-title $(FunctionTitle)
  208. set to = Begin
  209. set from = Begin
  210. ;
  211. ; Assume all is well.
  212. ;
  213. set CommonStatus = STATUS_SUCCESSFUL
  214. EndWait
  215. ;
  216. ; Set up the operation-mode-based variables and gaily welcome
  217. ; the user. If the "install mode" variable is improperly set,
  218. ; assume this is a new installation.
  219. ;
  220. Begin = +
  221. Ifstr(i) $(!NTN_InstallMode) == deinstall
  222. set StartLabel = removeadapter
  223. else-Ifstr(i) $(!NTN_InstallMode) == Update
  224. set StartLabel = UpgradeSoftware
  225. else-Ifstr(i) $(!NTN_InstallMode) == configure
  226. set StartLabel = configureadapter
  227. ;
  228. ; You cannot config the software component
  229. ;
  230. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  231. Debug-Output "Cannot configure the software."
  232. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  233. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  234. Debug-Output "ShellCode error: cannot get an error string."
  235. goto ShellCodeError
  236. endif
  237. set Error = $($R0)
  238. set from = end
  239. set to = end
  240. goto nonfatalinfo
  241. endif
  242. else-Ifstr(i) $(!NTN_InstallMode) == bind
  243. set StartLabel = bindingadapter
  244. else
  245. set StartLabel = installadapter
  246. set OEM_ABANDON_SOFTWARE = {}
  247. set OEM_ABANDON_OPTIONS = {}
  248. endif
  249. set from = $(fatal)
  250. set to = $(fatal)
  251. goto $(StartLabel)
  252. ;-----------------------------------------------
  253. ; Installation Section
  254. ;-----------------------------------------------
  255. installadapter = +
  256. set OEM_ABANDON_ON = TRUE
  257. StartWait
  258. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer),+
  259. $(ProductRCMDName),+
  260. $(ProductRCMDName),+
  261. $(ProductRCMDDisplayName), $(STF_CONTEXTINFNAME),+
  262. $(ProductRCMDImagePath),+
  263. $(ProductRCMDSvcType),+
  264. "", {"LanmanServer"}, ""
  265. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  266. Debug-Output "OEMNXPTC.INF: ShellCode error, add software component"
  267. goto ShellCodeError
  268. endif
  269. set RegistryErrorIndex = $($R0)
  270. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  271. EndWait
  272. Debug-Output "OEMNSVDH.INF: Registry error: add software components"
  273. CloseRegKey $($R1)
  274. CloseRegKey $($R2)
  275. CloseRegKey $($R3)
  276. CloseRegKey $($R4)
  277. CloseRegKey $($R5)
  278. goto fatalregistry
  279. endif
  280. ;
  281. ; At this point:
  282. ; $R1 contains the product version key handle;
  283. ; $R2 contains the NetRules subkey handle;
  284. ; $R3 contains the new Services key handle; and
  285. ; $R4 contains the Parameters key
  286. ; $R5 contains the Linkage Key
  287. ;
  288. Set RCMDVersKeyHandle = $($R1)
  289. set RCMDNetRulesKeyHandle = $($R2)
  290. CloseRegKey $($R3)
  291. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),"service"},+
  292. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  293. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  294. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductRCMDTitle)},+
  295. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductRCMDDescription)},+
  296. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductRCMDName)},+
  297. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  298. Shell $(UtilityInf), AddValueList, $(RCMDVersKeyHandle), $(NewValueList)
  299. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  300. Debug-Output "OEMNXPTC.INF: ShellCode error, add value list"
  301. goto ShellCodeError
  302. endif
  303. set RegistryErrorIndex = $($R0)
  304. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  305. EndWait
  306. Debug-Output "OEMNXPTC.INF: Registry error: add value list."
  307. CloseRegKey $(RCMDVersKeyHandle)
  308. CloseRegKey $(RCMDNetRulesKeyHandle)
  309. goto fatalregistry
  310. Endif
  311. set NewValueList = {{InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  312. Shell $(UtilityInf), AddValueList, $(RCMDNetRulesKeyHandle), $(NewValueList)
  313. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  314. Debug-Output "ShellCode error."
  315. goto ShellCodeError
  316. endif
  317. CloseRegKey $(RCMDNetRulesKeyHandle)
  318. set RegistryErrorIndex = $($R0)
  319. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  320. EndWait
  321. Debug-Output "OEMNXPTC.INF: Registry error: add value list."
  322. CloseRegKey $(RCMDVersKeyHandle)
  323. goto fatalregistry
  324. Endif
  325. goto successful
  326. ;-----------------------------------------------
  327. ; Configuration Section
  328. ;-----------------------------------------------
  329. configureadapter = +
  330. goto end
  331. ;-----------------------------------------------
  332. ; Binding section
  333. ;-----------------------------------------------
  334. bindingadapter =+
  335. goto end
  336. ;-----------------------------------------------
  337. ; Removeadapter section
  338. ;
  339. ;
  340. ; Removal errors are ignored, since we want to
  341. ; try to remove as much as possible.
  342. ;-----------------------------------------------
  343. removeadapter = +
  344. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), $(ProductRCMDName)
  345. goto end
  346. ;-----------------------------------------------
  347. ; Upgrade Software section
  348. ;-----------------------------------------------
  349. UpgradeSoftware = +
  350. ; Upgrade software component
  351. ;
  352. goto end
  353. ;
  354. ; End of Upgrade Software
  355. ;
  356. ;
  357. ; Escape hatches
  358. ;
  359. successful = +
  360. goto end
  361. ;
  362. ; info display
  363. ;
  364. infomsg =+
  365. read-syms InfoDlg
  366. ui start "Warning"
  367. set CommonStatus = STATUS_USERCANCEL
  368. goto end
  369. ;
  370. ; warning display
  371. ;
  372. warning = +
  373. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  374. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  375. goto ShellCodeError
  376. endif
  377. ifstr(i) $($R1) == "OK"
  378. goto $(to)
  379. else-ifstr(i) $($R1) == "CANCEL"
  380. goto $(from)
  381. else
  382. ; Debug-Msg "Error Error Bad DLGEVENT"
  383. goto "end"
  384. endif
  385. ;
  386. ; non fatal error display
  387. ;
  388. nonfatalinfo = +
  389. Set CommonStatus = STATUS_USERCANCEL
  390. Set Severity = STATUS
  391. goto nonfatalmsg
  392. nonfatal = +
  393. Set Severity = NONFATAL
  394. goto nonfatalmsg
  395. nonfatalmsg = +
  396. ifstr(i) $(Error) == ""
  397. Set Severity = NONFATAL
  398. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  399. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  400. goto ShellCodeError
  401. endif
  402. set Error = $($R0)
  403. endif
  404. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  405. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  406. goto ShellCodeError
  407. endif
  408. ifstr(i) $($R1) == "OK"
  409. goto $(from)
  410. else
  411. goto "end"
  412. endif
  413. ;
  414. ; Registry is broken
  415. ;
  416. fatalregistry = +
  417. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  418. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  419. goto ShellCodeError
  420. endif
  421. set Error = $($R0)
  422. goto fatal
  423. ;
  424. ; fatal error display
  425. ;
  426. fatal = +
  427. ifstr(i) $(Error) == ""
  428. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  429. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  430. goto ShellCodeError
  431. endif
  432. set Error = $($R0)
  433. endif
  434. Ifint $(BillboardVisible) != 0
  435. Shell "subroutn.inf" PopBillboard
  436. Set BillboardVisible = 0
  437. Endif
  438. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  439. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  440. goto ShellCodeError
  441. endif
  442. goto setfailed
  443. ;
  444. ; Shelling error
  445. ;
  446. ShellCodeError = +
  447. set DlgType = "MessageBox"
  448. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  449. set STF_MB_TEXT = $(ShellCodeErrorText)
  450. set STF_MB_TYPE = 1
  451. set STF_MB_ICON = 3
  452. set STF_MB_DEF = 1
  453. ui start "Error Message"
  454. goto setfailed
  455. setfailed = +
  456. set CommonStatus = STATUS_FAILED
  457. ;
  458. ; If OEM_ABANDON_ON, we need to clean up the registry
  459. ;
  460. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  461. set OEM_ABANDON_ON = FALSE
  462. goto removeadapter
  463. endif
  464. goto end
  465. end = +
  466. goto term
  467. term = +
  468. Return $(CommonStatus)
  469. [Source Media Descriptions]
  470. 1 = "Windows NT Workstation Setup Disk #1" , TAGFILE = disk1
  471. 2 = "Windows NT Workstation Setup CD-ROM" , TAGFILE = disk2
  472. [LanguagesSupported]
  473. ENG
  474. [OptionsTextENG]
  475. RCMD = "Remote Command Server"
  476. [DialogConstantsENG]
  477. Help = "&Help"
  478. Exit = "Cancel"
  479. OK = "OK"
  480. HelpContext = ""
  481. Continue = "Continue"
  482. Cancel = "Cancel"
  483. [FileDependentDlgENG]
  484. ;
  485. ; Variables to support thermometer gauge and error dialogs
  486. ;
  487. ProCaption = "Windows NT Setup"
  488. ProCancel = "Cancel"
  489. ProCancelMsg = "Windows NT Networking is not correctly installed. "+
  490. "Are you sure you want to cancel copying files?"
  491. ProCancelCap = "Network Setup Message"
  492. ProText1 = "Copying:"
  493. ProText2 = "To:"
  494. [FileConstantsENG]
  495. ProductRCMDDisplayName = "Remote Command Server"
  496. ProductRCMDTitle = "Remote Command Server"
  497. ProductRCMDDescription = "Microsoft Remote Command Server"