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.

786 lines
22 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNSVWI.INF
  4. ;
  5. ; WINS - Windows Internet Name Service setup file
  6. ;
  7. ; History:
  8. ; terryk 05-Oct-1993 Created
  9. ;
  10. ;***********************************************************************
  11. ;-----------------------------------------------------------------------
  12. ; OPTION TYPE
  13. ; -----------
  14. ; This identifies the Option type we are dealing with. The different
  15. ; possible types are:
  16. ;
  17. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  18. ;
  19. ; Types specific to networking:
  20. ;
  21. ; NetAdapter, a netcard / adapter combination or just a netcard
  22. ; NetDriver, just a netcard driver
  23. ; NetTransport, a complete NDIS-compliant TDI transport stack
  24. ; NetService, an NT networking service
  25. ; NetWork, a complete network ensemble.
  26. ; NetProvider a complete network which supports NT MPR protocol
  27. ;-----------------------------------------------------------------------
  28. [Identification]
  29. OptionType = NetService
  30. ;-----------------------------------------------------------------------
  31. ; OPTION LIST
  32. ; -----------
  33. ; This section lists the OEM Option key names. These keys are locale
  34. ; independent and used to represent the option in a locale independent
  35. ; manner.
  36. ;
  37. ;-----------------------------------------------------------------------
  38. [Options]
  39. WINS
  40. ;***********************************************************************
  41. ; CONSTANTS FOR USING DIALOGS
  42. ;***********************************************************************
  43. [FileConstants]
  44. ;
  45. ; File names, etc.
  46. ;
  47. UtilityInf = "UTILITY.INF"
  48. subroutineinf = "SUBROUTN.INF"
  49. SoftwareType = "service"
  50. Exit_Code = 0
  51. ;ShellCode = 0
  52. ;
  53. ; EventLog Message File
  54. ;
  55. WINSMsgDLL = "%SystemRoot%\System32\winsevnt.dll"
  56. ;
  57. ; Product Info
  58. ;
  59. Manufacturer = "Microsoft"
  60. ProductMajorVersion = "4"
  61. ProductMinorVersion = "0"
  62. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  63. ProductOpSupport = 132 ; 0x0084 ; Display,Removable,NOT Properties,Not Updatable
  64. ;
  65. ; Software
  66. ;
  67. ProductSoftwareName = "Wins"
  68. ProductSoftwareImagePath = "%SystemRoot%\System32\wins.exe"
  69. ;
  70. ; Registry Key
  71. ;
  72. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  73. SystemService = $(!NTN_ServiceBase)
  74. ServiceKeyName = $(!NTN_ServiceBase)
  75. PerformanceKey = $(!NTN_ServiceBase)"\Wins\Performance"
  76. [GeneralConstants]
  77. ;
  78. ; Program flow control variables.
  79. ;
  80. from = ""
  81. to = ""
  82. ;
  83. ; Return codes; Exit_Code is set to one of these
  84. ;
  85. ExitCodeOk = 0
  86. ExitCodeCancel = 1
  87. ExitCodeFatal = 2
  88. KeyNull = ""
  89. MAXIMUM_ALLOWED = 33554432
  90. RegistryErrorIndex = NO_ERROR
  91. KeyProduct = ""
  92. KeyParameters = ""
  93. TRUE = 1
  94. FALSE = 0
  95. NoTitle = 0
  96. ExitState = "Active"
  97. OldVersionExisted = $(FALSE)
  98. DefaultStatusReturn = STATUS_NO_EFFECT
  99. DriverPath = $(!STF_NTPATH)\drivers
  100. [date]
  101. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  102. ; Minute, Second }
  103. Now = {} ? $(!LIBHANDLE) GetSystemDate
  104. ;---------------------------------------------------------------------------
  105. ; 1. Identify
  106. ;
  107. ; DESCRIPTION: To verify that this INF deals with the same type of options
  108. ; as we are choosing currently.
  109. ;
  110. ; INPUT: None
  111. ;
  112. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  113. ; $($R1): Option Type (COMPUTER ...)
  114. ; $($R2): Diskette description
  115. ;---------------------------------------------------------------------------
  116. [Identify]
  117. ;
  118. ;
  119. read-syms Identification
  120. set Status = STATUS_SUCCESSFUL
  121. set Identifier = $(OptionType)
  122. set Media = #("Source Media Descriptions", 1, 1)
  123. Return $(Status) $(Identifier) $(Media)
  124. ;------------------------------------------------------------------------
  125. ; 2. ReturnOptions:
  126. ;
  127. ; DESCRIPTION: To return the option list supported by this INF and the
  128. ; localised text list representing the options.
  129. ;
  130. ;
  131. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  132. ;
  133. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  134. ; STATUS_NOLANGUAGE
  135. ; STATUS_FAILED
  136. ;
  137. ; $($R1): Option List
  138. ; $($R2): Option Text List
  139. ;------------------------------------------------------------------------
  140. [ReturnOptions]
  141. ;
  142. ;
  143. set Status = STATUS_FAILED
  144. set OptionList = {}
  145. set OptionTextList = {}
  146. ;
  147. ; Check if the language requested is supported
  148. ;
  149. set LanguageList = ^(LanguagesSupported, 1)
  150. Ifcontains(i) $($0) in $(LanguageList)
  151. goto returnoptions
  152. else
  153. set Status = STATUS_NOLANGUAGE
  154. goto finish_ReturnOptions
  155. endif
  156. ;
  157. ; form a list of all the options and another of the text representing
  158. ;
  159. returnoptions = +
  160. set OptionList = ^(Options, 1)
  161. set OptionTextList = ^(OptionsText$($0), 1)
  162. set Status = STATUS_SUCCESSFUL
  163. finish_ReturnOptions = +
  164. Return $(Status) $(OptionList) $(OptionTextList)
  165. ;----------InstallOption-------------------------------------------------
  166. ;
  167. ; InstallOption:
  168. ;
  169. ; This section is shelled to by main installation processing
  170. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  171. ;
  172. ;
  173. ; FUNCTION: To copy files representing Options
  174. ; To configure the installed option
  175. ; To update the registry for the installed option
  176. ;
  177. ; INPUT: $($0): Language to use
  178. ; $($1): OptionID to install
  179. ; $($2): SourceDirectory
  180. ; $($3): AddCopy (YES | NO)
  181. ; $($4): DoCopy (YES | NO)
  182. ; $($5): DoConfig (YES | NO)
  183. ;
  184. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  185. ; STATUS_NOLANGUAGE |
  186. ; STATUS_USERCANCEL |
  187. ; STATUS_FAILED
  188. ;
  189. ;------------------------------------------------------------------------
  190. [InstallOption]
  191. ;
  192. ; extract parameters
  193. ;
  194. set Option = $($1)
  195. set SrcDir = $($2)
  196. set AddCopy = $($3)
  197. set DoCopy = $($4)
  198. set DoConfig = $($5)
  199. ;
  200. ; Check if the language requested is supported
  201. ;
  202. set LanguageList = ^(LanguagesSupported, 1)
  203. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  204. Return STATUS_NOLANGUAGE
  205. endif
  206. Debug-Output "OEMNSVWI.INF: STF_CWDIR is: "$(!STF_CWDIR)
  207. Debug-Output "OEMNSVWI.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  208. ; define all the constants
  209. set-subst LF = "\n"
  210. read-syms GeneralConstants
  211. read-syms FileConstants
  212. read-syms DialogConstants$(!STF_LANGUAGE)
  213. ifstr(i) $(!NTN_Origination) == "NCPA"
  214. set Continue = $(OK)
  215. endif
  216. read-syms FileConstants$(!STF_LANGUAGE)
  217. detect date
  218. set-title $(FunctionTitle)
  219. set to = Begin
  220. set from = Begin
  221. ;
  222. ; Assume all is well.
  223. ;
  224. set CommonStatus = STATUS_SUCCESSFUL
  225. EndWait
  226. ;
  227. ; Set up the operation-mode-based variables and gaily welcome
  228. ; the user. If the "install mode" variable is improperly set,
  229. ; assume this is a new installation.
  230. ;
  231. Begin = +
  232. Ifstr(i) $(!NTN_InstallMode) == deinstall
  233. set StartLabel = removeadapter
  234. else-Ifstr(i) $(!NTN_InstallMode) == Update
  235. set StartLabel = UpgradeSoftware
  236. else-Ifstr(i) $(!NTN_InstallMode) == bind
  237. set StartLabel = bindingadapter
  238. else-Ifstr(i) $(!NTN_InstallMode) == configure
  239. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  240. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  241. Debug-Output "OEMNXPNB.INF: ShellCode error: cannot get an error string."
  242. goto ShellCodeError
  243. endif
  244. set Error = $($R0)
  245. set from = end
  246. set to = end
  247. goto nonfatal
  248. else
  249. set StartLabel = installadapter
  250. endif
  251. set from = $(fatal)
  252. set to = $(fatal)
  253. goto $(StartLabel)
  254. ;-----------------------------------------------
  255. ; Installation Section
  256. ;-----------------------------------------------
  257. installadapter = +
  258. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  259. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  260. Goto ShellCodeError
  261. Else-Ifstr(i) $($R0) == STATUS_FAILED
  262. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  263. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  264. goto ShellCodeError
  265. endif
  266. set Error = $($R0)
  267. Goto fatal
  268. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  269. Goto successful
  270. Endif
  271. Set SrcDir = $($R1)
  272. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  273. Ifstr $(KeyProduct) != $(KeyNull)
  274. ;
  275. ; Same version already existed in the local machine
  276. ; Popup the dialog and ask the user whether he wants to continue
  277. ;
  278. CloseRegKey $(KeyProduct)
  279. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  280. $(ProductVersion)
  281. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  282. Debug-Output "ShellCode error: cannot get an error string."
  283. goto ShellCodeError
  284. endif
  285. goto end
  286. endif
  287. StartWait
  288. ifstr(i) $(OldVersionExisted) == $(FALSE)
  289. install "Install-Option"
  290. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  291. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  292. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  293. goto ShellCodeError
  294. endif
  295. set Error = $($R0)
  296. goto fatal
  297. endif
  298. set OEM_ABANDON_ON = TRUE
  299. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  300. $(ProductSoftwareName), $(ProductSoftwareName),+
  301. $(ProductSoftwareDisplayName), +
  302. $(STF_CONTEXTINFNAME), $(ProductSoftwareImagePath), "serviceauto", "",+
  303. {"RPCSS","NTLMSSP"}, "", $(WINSMsgDLL)
  304. Set SoftwareProductKey = $($R1)
  305. Set SoftwareNetRuleKey = $($R2)
  306. Set SoftwareServiceKey = $($R3)
  307. Set KeyParameters = $($R4)
  308. Set SoftLinkageKey = $($R5)
  309. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  310. Debug-Output "ShellCode error"
  311. goto ShellCodeError
  312. endif
  313. set RegistryErrorIndex = $($R0)
  314. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  315. EndWait
  316. Debug-Output "Registry error: add software components"
  317. CloseRegKey $(SoftwareProductKey)
  318. CloseRegKey $(SoftwareNetRuleKey)
  319. CloseRegKey $(SoftwareServiceKey)
  320. CloseRegKey $(KeyParameters)
  321. CloseRegKey $(SoftLinkageKey)
  322. goto fatalregistry
  323. endif
  324. ;
  325. ; Setup other registry key
  326. ;
  327. CreateRegKey $(KeyParameters) {"Datafiles",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" DataFilesKey
  328. CloseRegKey $(DataFilesKey)
  329. CreateRegKey $(SoftwareServiceKey) {"Partners",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" PartnersKey
  330. CreateRegKey $(PartnersKey) {"Pull",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" PullKey
  331. CreateRegKey $(PartnersKey) {"Push",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" PushKey
  332. CloseRegKey $(PullKey)
  333. CloseRegKey $(PushKey)
  334. CloseRegKey $(PartnersKey)
  335. CreateRegKey $(SoftwareServiceKey) {"Performance",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" PerformanceKey
  336. set NewValueList = {{Library,$(NoTitle),$(!REG_VT_SZ),"winsctrs.dll"},+
  337. {Open,$(NoTitle),$(!REG_VT_SZ),"OpenWinsPerformanceData"},+
  338. {Collect,$(NoTitle),$(!REG_VT_SZ),"CollectWinsPerformanceData"},+
  339. {Close,$(NoTitle),$(!REG_VT_SZ),"CloseWinsPerformanceData"}}
  340. Shell $(UtilityInf), AddValueList, $(PerformanceKey), $(NewValueList)
  341. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  342. Debug-Output "ShellCode error."
  343. goto ShellCodeError
  344. endif
  345. set RegistryErrorIndex = $($R0)
  346. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  347. EndWait
  348. Debug-Output "Resgitry error: add value list."
  349. CloseRegKey $(PerformanceKey)
  350. CloseRegKey $(SoftwareProductKey)
  351. CloseRegKey $(SoftwareNetRuleKey)
  352. CloseRegKey $(SoftwareServiceKey)
  353. CloseRegKey $(SoftLinkageKey)
  354. CloseRegKey $(KeyParameters)
  355. goto fatalregistry
  356. endif
  357. CloseRegKey $(PerformanceKey)
  358. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  359. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  360. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  361. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  362. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  363. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  364. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}, +
  365. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  366. Shell $(UtilityInf), AddValueList, $(SoftwareProductKey), $(NewValueList)
  367. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  368. Debug-Output "ShellCode error."
  369. goto ShellCodeError
  370. endif
  371. set RegistryErrorIndex = $($R0)
  372. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  373. EndWait
  374. Debug-Output "Resgitry error: add value list."
  375. CloseRegKey $(SoftwareProductKey)
  376. CloseRegKey $(SoftwareNetRuleKey)
  377. CloseRegKey $(SoftwareServiceKey)
  378. CloseRegKey $(SoftLinkageKey)
  379. CloseRegKey $(KeyParameters)
  380. goto fatalregistry
  381. endif
  382. set NewValueList = {{InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  383. Shell $(UtilityInf), AddValueList, $(SoftwareNetRuleKey), $(NewValueList)
  384. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  385. Debug-Output "ShellCode error."
  386. goto ShellCodeError
  387. endif
  388. set RegistryErrorIndex = $($R0)
  389. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  390. EndWait
  391. Debug-Output "Resgitry error: add value list."
  392. CloseRegKey $(SoftwareProductKey)
  393. CloseRegKey $(SoftwareNetRuleKey)
  394. CloseRegKey $(SoftwareServiceKey)
  395. CloseRegKey $(KeyParameters)
  396. CloseRegKey $(SoftLinkageKey)
  397. goto fatalregistry
  398. endif
  399. CloseRegKey $(SoftwareProductKey)
  400. CloseRegKey $(SoftwareNetRuleKey)
  401. CloseRegKey $(SoftwareServiceKey)
  402. CloseRegKey $(KeyParameters)
  403. CloseRegKey $(SoftLinkageKey)
  404. ;
  405. ; Hack, disable TCP/IP proxy
  406. ;
  407. OpenRegKey $(!REG_H_LOCAL) "" "system\currentcontrolset\services\netbt\parameters" $(MAXIMUM_ALLOWED) KeyNetBT
  408. ifstr(i) $(KeyNetBT) != ""
  409. SetRegValue $(KeyNetBT) {EnableProxy,$(NoTitle),$(!REG_VT_DWORD),0}
  410. SetRegValue $(KeyNetBT) {NodeType,$(NoTitle),$(!REG_VT_DWORD),8}
  411. CloseRegKey $(KeyNetBT)
  412. endif
  413. Shell "oemnsvsn.inf" InstallMicrosoftAgent "WINS" "WinsMibAgent" "%SystemRoot%\System32\winsmib.dll"
  414. endif
  415. ifstr(i) $(!STF_INSTALL_TYPE) != "SETUPBOOTED"
  416. Shell "" AddWINS
  417. endif
  418. EndWait
  419. ;
  420. ; Set our master component for auto-self-removal
  421. ;
  422. Shell $(UtilityInf) SetMasterComponent Microsoft Tcpip $(STF_CONTEXTINFNAME) WINS
  423. goto successful
  424. ;-----------------------------------------------
  425. ; Configuration Section
  426. ;-----------------------------------------------
  427. configureadapter = +
  428. goto successful
  429. ;-----------------------------------------------
  430. ; Binding section
  431. ;-----------------------------------------------
  432. bindingadapter =+
  433. set Error = "Binding: Sorry, not yet implemented."
  434. goto fatal
  435. ;-----------------------------------------------
  436. ; Removeadapter section
  437. ;-----------------------------------------------
  438. removeadapter = +
  439. ;
  440. ; Remove WINS service
  441. ;
  442. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  443. $(ProductSoftwareName)
  444. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  445. Debug-Output "ShellCode error"
  446. goto ShellCodeError
  447. endif
  448. set RegistryErrorIndex = $($R0)
  449. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  450. goto fatalregistry
  451. endif
  452. Shell "oemnsvsn.inf" RemoveMicrosoftAgent "WinsMibAgent"
  453. ifstr(i) $(!STF_INSTALL_TYPE) != "SETUPBOOTED"
  454. install "Remove-WINS-Icon"
  455. endif
  456. goto end
  457. ;-----------------------------------------------
  458. ; Upgrade Software section
  459. ;-----------------------------------------------
  460. UpgradeSoftware = +
  461. ; Upgrade software component
  462. ;
  463. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  464. Ifstr $(KeyProduct) != $(KeyNull)
  465. install "Install-Update"
  466. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  467. goto fatal
  468. endif
  469. ;
  470. ; update the software type (it was once transport)
  471. ;
  472. SetRegValue $(KeyProduct) {SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)}
  473. ; Upgrade the version number
  474. ;
  475. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  476. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  477. ;
  478. ; Update description and op support
  479. ;
  480. SetRegValue $(KeyProduct) {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)}
  481. SetRegValue $(KeyProduct) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  482. install "Remove-WINS-Icon"
  483. install "Install-WINS-Icon"
  484. ;
  485. ; Make sure the performance key collect value is correct.
  486. ;
  487. OpenRegKey $(!REG_H_LOCAL) "" $(PerformanceKey) $(MAXIMUM_ALLOWED) KeyPerformance
  488. Ifstr $(KeyPerformance) != $(KeyNull)
  489. SetRegValue $(KeyPerformance) {Collect,$(NoTitle),$(!REG_VT_SZ),"CollectWinsPerformanceData"}
  490. CloseRegKey $(KeyPerformance)
  491. endif
  492. CloseRegKey $(KeyProduct)
  493. endif
  494. goto end
  495. ;
  496. ; End of Upgrade Software
  497. ;
  498. ;
  499. ; Escape hatches
  500. ;
  501. successful = +
  502. goto end
  503. ;
  504. ; warning display
  505. ;
  506. warning = +
  507. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  508. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  509. goto ShellCodeError
  510. endif
  511. ifstr(i) $($R1) == "OK"
  512. goto $(to)
  513. else-ifstr(i) $($R1) == "CANCEL"
  514. goto $(from)
  515. else
  516. ; Debug-Msg "Error Error Bad DLGEVENT"
  517. goto "end"
  518. endif
  519. ;
  520. ; non fatal error display
  521. ;
  522. nonfatal = +
  523. ifstr(i) $(Error) == ""
  524. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  525. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  526. goto ShellCodeError
  527. endif
  528. set Error = $($R0)
  529. endif
  530. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(Error)
  531. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  532. goto ShellCodeError
  533. endif
  534. ifstr(i) $($R1) == "OK"
  535. goto $(from)
  536. else
  537. goto "end"
  538. endif
  539. ;
  540. ; Registry is broken
  541. ;
  542. fatalregistry = +
  543. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  544. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  545. goto ShellCodeError
  546. endif
  547. set Error = $($R0)
  548. goto fatal
  549. ;
  550. ; fatal error display
  551. ;
  552. fatal = +
  553. ifstr(i) $(Error) == ""
  554. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  555. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  556. goto ShellCodeError
  557. endif
  558. set Error = $($R0)
  559. endif
  560. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  561. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  562. goto ShellCodeError
  563. endif
  564. goto setfailed
  565. ;
  566. ; Shelling error
  567. ;
  568. ShellCodeError = +
  569. set DlgType = "MessageBox"
  570. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  571. set STF_MB_TEXT = $(ShellCodeErrorText)
  572. set STF_MB_TYPE = 1
  573. set STF_MB_ICON = 3
  574. set STF_MB_DEF = 1
  575. ui start "Error Message"
  576. goto setfailed
  577. setfailed = +
  578. set CommonStatus = STATUS_FAILED
  579. ;
  580. ; If OEM_ABANDON_ON, we need to clean up the registry
  581. ;
  582. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  583. set OEM_ABANDON_ON = FALSE
  584. goto removeadapter
  585. endif
  586. goto end
  587. end = +
  588. goto term
  589. term = +
  590. Return $(CommonStatus)
  591. ;***************************************************************
  592. ; Get File Size SECTIONS
  593. ;***************************************************************
  594. [GetFilesSize]
  595. set FileSizeList = ^(Files-WINS,3)
  596. set TotalSize = 0
  597. ForListDo $(FileSizeList)
  598. Split-String $($) "=" SplitString
  599. set Size = *($(SplitString),3)
  600. set-add TotalSize = $(TotalSize) $(Size)
  601. EndForListDo
  602. set-div SizeInK = $(TotalSize) 1024
  603. return $(SizeInK)
  604. ;***************************************************************
  605. ; INSTALL SECTIONS
  606. ;***************************************************************
  607. [Install-Option]
  608. set STF_VITAL = ""
  609. ifstr(i) $(AddCopy) == "YES"
  610. ;
  611. ; Add the files to the copy list
  612. ;
  613. AddSectionFilesToCopyList Files-WINS $(SrcDir) $(!STF_WINDOWSSYSPATH)
  614. endif
  615. ifstr(i) $(DoCopy) == "YES"
  616. ;
  617. ; Copy files in the copy list
  618. ;
  619. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  620. CopyFilesInCopyList
  621. else
  622. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\WINSADMN.EXE $(!STF_WINDOWSSYSPATH)\WINSADMN.EXE
  623. endif
  624. ifstr(i) $(DoConfig) == "YES"
  625. ;
  626. ; Add product to registry
  627. ;
  628. ;
  629. ; Finish up
  630. endif
  631. Exit
  632. [Install-Update]
  633. set STF_VITAL = ""
  634. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  635. ;set STF_VERSION = "YES"
  636. AddSectionFilesToCopyList Files-WINS $(SrcDir) $(!STF_WINDOWSSYSPATH)
  637. exit
  638. [Install-WINS-Icon]
  639. CreateCommonProgManGroup $(GroupName), ""
  640. RemoveCommonProgManItem $(GroupName), $(IconName)
  641. CreateCommonProgManItem $(GroupName), $(IconName), winsadmn.exe, winsadmn.exe, ""
  642. ShowCommonProgManGroup $(GroupName), 6
  643. exit
  644. [Remove-WINS-Icon]
  645. RemoveCommonProgManItem $(OldGroupName), $(IconName)
  646. RemoveCommonProgManItem $(GroupName), $(IconName)
  647. exit
  648. [AddWINS]
  649. read-syms FileConstants$(!STF_LANGUAGE)
  650. read-syms GeneralConstants
  651. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\WINS" $(MAXIMUM_ALLOWED) ProductKey
  652. ifstr(i) $(ProductKey) != ""
  653. install "Install-WINS-Icon"
  654. CloseRegKey $(ProductKey)
  655. endif
  656. return