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.

779 lines
23 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNSVDH.INF
  4. ;
  5. ; DHCP Service
  6. ;
  7. ; History:
  8. ; terryk 10-10-1993 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. DHCP
  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 = 132 ; 0x0084 ; Display,Removable,NOT Properties,Not Updatable
  51. ;================================================================
  52. ; TCP/IP: Service and Driver
  53. ;
  54. ;================================================================
  55. ; TCP Software data: this is the WIN32 Service. It
  56. ; automatically loads the TCPIP.SYS driver.
  57. ;
  58. ProductDHCPName = "DHCPServer"
  59. ProductDHCPImagePath = "%SystemRoot%\System32\tcpsvcs.exe"
  60. ProductDHCPSvcType = "autoserviceshare"
  61. NetRuleDHCPType = "dhcpserver tcpipService dhcp"
  62. NetRuleDHCPUse = "service yes yes"
  63. NetRuleDHCPBindForm = """Dhcpserver"" yes yes container"
  64. NetRuleDHCPClass = {"dhcp tcpipService yes"}
  65. ;
  66. ; Registry Key Names
  67. ;
  68. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(Product$(Option)Name)"\CurrentVersion"
  69. [GeneralConstants]
  70. ;
  71. ; File names, etc.
  72. ;
  73. UtilityInf = "UTILITY.INF"
  74. subroutineinf = "SUBROUTN.INF"
  75. Exit_Code = 0
  76. ;ShellCode = 0
  77. BillboardVisible = 0
  78. ;
  79. ; Program flow control variables.
  80. ;
  81. from = ""
  82. to = ""
  83. ;
  84. ; Return codes; Exit_Code is set to one of these
  85. ;
  86. ExitCodeOk = 0
  87. ExitCodeCancel = 1
  88. ExitCodeFatal = 2
  89. KeyNull = ""
  90. MAXIMUM_ALLOWED = 33554432
  91. SERVICE_NO_CHANGE = 4294967295
  92. RegistryErrorIndex = NO_ERROR
  93. KeyProduct = ""
  94. KeyParameters = ""
  95. TRUE = 1
  96. FALSE = 0
  97. NoTitle = 0
  98. ExitState = "Active"
  99. OldVersionExisted = $(FALSE)
  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 "OEMNSVCU.INF: STF_CWDIR is: "$(!STF_CWDIR)
  207. Debug-Output "OEMNSVCU.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. read-syms FileDependentDlg$(!STF_LANGUAGE)
  218. detect date
  219. set-title $(FunctionTitle)
  220. set to = Begin
  221. set from = Begin
  222. ;
  223. ; Assume all is well.
  224. ;
  225. set CommonStatus = STATUS_SUCCESSFUL
  226. EndWait
  227. ;
  228. ; Set up the operation-mode-based variables and gaily welcome
  229. ; the user. If the "install mode" variable is improperly set,
  230. ; assume this is a new installation.
  231. ;
  232. Begin = +
  233. Ifstr(i) $(!NTN_InstallMode) == deinstall
  234. set StartLabel = removeadapter
  235. else-Ifstr(i) $(!NTN_InstallMode) == Update
  236. set StartLabel = UpgradeSoftware
  237. else-Ifstr(i) $(!NTN_InstallMode) == configure
  238. set StartLabel = configureadapter
  239. ;
  240. ; You cannot config the software component
  241. ;
  242. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  243. Debug-Output "Cannot configure the software."
  244. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  245. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  246. Debug-Output "ShellCode error: cannot get an error string."
  247. goto ShellCodeError
  248. endif
  249. set Error = $($R0)
  250. set from = end
  251. set to = end
  252. goto nonfatalinfo
  253. endif
  254. else-Ifstr(i) $(!NTN_InstallMode) == bind
  255. set StartLabel = bindingadapter
  256. else
  257. set StartLabel = installadapter
  258. set OEM_ABANDON_SOFTWARE = {}
  259. set OEM_ABANDON_OPTIONS = {}
  260. endif
  261. set from = $(fatal)
  262. set to = $(fatal)
  263. goto $(StartLabel)
  264. ;-----------------------------------------------
  265. ; Installation Section
  266. ;-----------------------------------------------
  267. installadapter = +
  268. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  269. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  270. Goto ShellCodeError
  271. Else-Ifstr(i) $($R0) == STATUS_FAILED
  272. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  273. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  274. goto ShellCodeError
  275. endif
  276. set Error = $($R0)
  277. Goto fatal
  278. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  279. Goto successful
  280. Endif
  281. Set SrcDir = $($R1)
  282. ifstr(i) $(!NTN_InstallMode) == "install"
  283. Debug-Output "OEMNSVCU.INF: installadapter: installing [Install-Option]"
  284. install "Install-Option"
  285. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  286. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  287. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  288. goto ShellCodeError
  289. endif
  290. set Error = $($R0)
  291. goto fatal
  292. endif
  293. endif
  294. set OEM_ABANDON_ON = TRUE
  295. StartWait
  296. set ThisOption = DHCP
  297. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer),+
  298. $(Product$(ThisOption)Name),+
  299. $(Product$(ThisOption)Name),+
  300. $(Product$(ThisOption)DisplayName), $(STF_CONTEXTINFNAME),+
  301. $(Product$(ThisOption)ImagePath),+
  302. $(Product$(ThisOption)SvcType),+
  303. "", {"Tcpip"}, "", "%SystemRoot%\System32\dhcpssvc.dll", 7, "", "", "",+
  304. "%SystemRoot%\System32\kernel32.dll"
  305. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  306. Debug-Output "OEMNXPTC.INF: ShellCode error, add software component"
  307. goto ShellCodeError
  308. endif
  309. set RegistryErrorIndex = $($R0)
  310. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  311. EndWait
  312. Debug-Output "OEMNSVDH.INF: Registry error: add software components"
  313. CloseRegKey $($R1)
  314. CloseRegKey $($R2)
  315. CloseRegKey $($R3)
  316. CloseRegKey $($R4)
  317. CloseRegKey $($R5)
  318. goto fatalregistry
  319. endif
  320. ;
  321. ; At this point:
  322. ; $R1 contains the product version key handle;
  323. ; $R2 contains the NetRules subkey handle;
  324. ; $R3 contains the new Services key handle; and
  325. ; $R4 contains the Parameters key
  326. ; $R5 contains the Linkage Key
  327. ;
  328. Set DHCPVersKeyHandle = $($R1)
  329. set DHCPNetRulesKeyHandle = $($R2)
  330. CloseRegKey $($R3)
  331. Set DHCPParmKeyHandle = $($R4)
  332. Set DHCPLinkageHandle = $($R5)
  333. set NewValueList = {{OtherDependencies,$(NoTitle),$(!REG_VT_MULTI_SZ),{"Rpcss","NTLMSSP"}}}
  334. Shell $(UtilityInf), AddValueList, $(DHCPLinkageHandle), $(NewValueList)
  335. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  336. Debug-Output "OEMNXPTC.INF: ShellCode error."
  337. goto ShellCodeError
  338. endif
  339. CloseRegKey $(DHCPLinkageHandle)
  340. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),"service"},+
  341. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  342. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  343. {Title,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Title)},+
  344. {Description,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Description)},+
  345. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Name)},+
  346. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  347. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  348. Shell $(UtilityInf), AddValueList, $(DHCPVersKeyHandle), $(NewValueList)
  349. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  350. Debug-Output "OEMNXPTC.INF: ShellCode error, add value list"
  351. goto ShellCodeError
  352. endif
  353. set RegistryErrorIndex = $($R0)
  354. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  355. EndWait
  356. Debug-Output "OEMNXPTC.INF: Registry error: add value list."
  357. CloseRegKey $(DHCPVersKeyHandle)
  358. CloseRegKey $(DHCPNetRulesKeyHandle)
  359. CloseRegKey $(DHCPParmKeyHandle)
  360. goto fatalregistry
  361. Endif
  362. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleDHCPType)},+
  363. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleDHCPClass)}, +
  364. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleDHCPUse)}, +
  365. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleDHCPBindForm)}, +
  366. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  367. Shell $(UtilityInf), AddValueList, $(DHCPNetRulesKeyHandle), $(NewValueList)
  368. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  369. Debug-Output "ShellCode error."
  370. goto ShellCodeError
  371. endif
  372. CloseRegKey $(DHCPNetRulesKeyHandle)
  373. set RegistryErrorIndex = $($R0)
  374. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  375. EndWait
  376. Debug-Output "OEMNXPTC.INF: Registry error: add value list."
  377. CloseRegKey $(DHCPVersKeyHandle)
  378. CloseRegKey $(DHCPParmKeyHandle)
  379. goto fatalregistry
  380. Endif
  381. set NewValueList = {{APIProtocolSupport,$(NoTitle),$(!REG_VT_DWORD),5},+
  382. {DebugFlag,$(NoTitle),$(!REG_VT_DWORD),0},+
  383. {DatabaseName,$(NoTitle),$(!REG_VT_SZ),"dhcp.mdb"},+
  384. {BackupDatabasePath,$(NoTitle),$(!REG_VT_EXPAND_SZ),"%SystemRoot%\System32\dhcp\backup"},+
  385. {BackupInterval,$(NoTitle),$(!REG_VT_DWORD),60},+
  386. {DatabaseLoggingFlag,$(NoTitle),$(!REG_VT_DWORD),1},+
  387. {DatabaseCleanupInterval,$(NoTitle),$(!REG_VT_DWORD),1440},+
  388. {RestoreFlag,$(NoTitle),$(!REG_VT_DWORD),0},+
  389. {DatabasePath,$(NoTitle),$(!REG_VT_EXPAND_SZ),"%SystemRoot%\System32\dhcp"}}
  390. Shell $(UtilityInf), AddValueList, $(DHCPParmKeyHandle), $(NewValueList)
  391. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  392. Debug-Output "OEMNXPTC.INF: ShellCode error, add value list"
  393. goto ShellCodeError
  394. endif
  395. set RegistryErrorIndex = $($R0)
  396. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  397. EndWait
  398. Debug-Output "OEMNXPTC.INF: Registry error: add value list."
  399. CloseRegKey $(DHCPVersKeyHandle)
  400. CloseRegKey $(DHCPParmKeyHandle)
  401. goto fatalregistry
  402. Endif
  403. CreateRegKey $(DHCPParmsKeyHandle) {"MultiHomeInfo",$(NoTitle),GenericClass} "" +
  404. $(MAXIMUM_ALLOWED) "" KeyMultiHomeInfo
  405. CloseRegKey $(KeyMultiHomeInfo)
  406. CreateRegKey $(DHCPParmsKeyHandle) {"Configuration",$(NoTitle),GenericClass} "" +
  407. $(MAXIMUM_ALLOWED) "" KeyConfiguration
  408. CloseRegKey $(KeyConfiguration)
  409. CloseRegKey $(DHCPVersKeyHandle)
  410. CloseRegKey $(DHCPParmsKeyHandle)
  411. ifstr(i) $(!STF_INSTALL_TYPE) != "SETUPBOOTED"
  412. Shell "" AddDHCP
  413. endif
  414. Shell "oemnsvsn.inf" InstallMicrosoftAgent "DHCPServer" "DhcpMibAgent" "%SystemRoot%\System32\dhcpmib.dll"
  415. EndWait
  416. ;
  417. ; Set our master component for auto-self-removal
  418. ;
  419. Shell $(UtilityInf) SetMasterComponent Microsoft Tcpip $(STF_CONTEXTINFNAME) DHCP
  420. ; Force binding. This will force TCP/IP to check its address and bring up the UI
  421. ifstr(i) $(!NTN_InstallPhase) != primary
  422. read-syms DHCPServerDialog
  423. ui start "Warning"
  424. endif
  425. return STATUS_SUCCESSFUL
  426. ;-----------------------------------------------
  427. ; Configuration Section
  428. ;-----------------------------------------------
  429. configureadapter = +
  430. goto end
  431. ;-----------------------------------------------
  432. ; Binding section
  433. ;-----------------------------------------------
  434. bindingadapter =+
  435. goto end
  436. ;-----------------------------------------------
  437. ; Removeadapter section
  438. ;
  439. ;
  440. ; Removal errors are ignored, since we want to
  441. ; try to remove as much as possible.
  442. ;-----------------------------------------------
  443. removeadapter = +
  444. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), $(ProductDHCPName)
  445. ifstr(i) $(!STF_INSTALL_TYPE) != "SETUPBOOTED"
  446. install "Remove-DHCP-Icon"
  447. endif
  448. Shell "oemnsvsn.inf" RemoveMicrosoftAgent "DhcpMibAgent"
  449. goto end
  450. ;-----------------------------------------------
  451. ; Upgrade Software section
  452. ;-----------------------------------------------
  453. UpgradeSoftware = +
  454. ; Upgrade software component
  455. ;
  456. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  457. Ifstr $(KeyProduct) != $(KeyNull)
  458. install "Install-Update"
  459. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  460. goto fatal
  461. endif
  462. ; Upgrade the version number
  463. ;
  464. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  465. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  466. ;
  467. ; Update description and op support
  468. ;
  469. SetRegValue $(KeyProduct) {Description,$(NoTitle),$(!REG_VT_SZ),$(Product$(Option)Description)}
  470. SetRegValue $(KeyProduct) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  471. install "Remove-DHCP-Icon"
  472. install "Install-DHCP-Icon"
  473. ;
  474. ; do nothing for update
  475. ;
  476. CloseRegKey $(KeyProduct)
  477. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\DHCPServer\Parameters" $(MAXIMUM_ALLOWED) DHCPSrvKey
  478. ifstr(i) $(DHCPSrvKey) != ""
  479. SetRegValue $(DHCPSrvKey) {BackupInterval,$(NoTitle),$(!REG_VT_DWORD),60}
  480. GetRegValue $(DHCPSrvKey),"DatabaseCleanupInterval", IntervalInfo
  481. ifint *($(IntervalInfo),4) == 86400
  482. SetRegValue $(DHCPSrvKey) {DatabaseCleanupInterval,$(NoTitle),$(!REG_VT_DWORD),1440}
  483. endif
  484. CloseRegKey $(DHCPSrvKey)
  485. endif
  486. endif
  487. goto end
  488. ;
  489. ; End of Upgrade Software
  490. ;
  491. ;
  492. ; Escape hatches
  493. ;
  494. successful = +
  495. goto end
  496. ;
  497. ; info display
  498. ;
  499. infomsg =+
  500. read-syms InfoDlg
  501. ui start "Warning"
  502. set CommonStatus = STATUS_USERCANCEL
  503. goto end
  504. ;
  505. ; warning display
  506. ;
  507. warning = +
  508. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  509. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  510. goto ShellCodeError
  511. endif
  512. ifstr(i) $($R1) == "OK"
  513. goto $(to)
  514. else-ifstr(i) $($R1) == "CANCEL"
  515. goto $(from)
  516. else
  517. ; Debug-Msg "Error Error Bad DLGEVENT"
  518. goto "end"
  519. endif
  520. ;
  521. ; non fatal error display
  522. ;
  523. nonfatalinfo = +
  524. Set CommonStatus = STATUS_USERCANCEL
  525. Set Severity = STATUS
  526. goto nonfatalmsg
  527. nonfatal = +
  528. Set Severity = NONFATAL
  529. goto nonfatalmsg
  530. nonfatalmsg = +
  531. ifstr(i) $(Error) == ""
  532. Set Severity = NONFATAL
  533. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  534. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  535. goto ShellCodeError
  536. endif
  537. set Error = $($R0)
  538. endif
  539. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  540. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  541. goto ShellCodeError
  542. endif
  543. ifstr(i) $($R1) == "OK"
  544. goto $(from)
  545. else
  546. goto "end"
  547. endif
  548. ;
  549. ; Registry is broken
  550. ;
  551. fatalregistry = +
  552. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  553. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  554. goto ShellCodeError
  555. endif
  556. set Error = $($R0)
  557. goto fatal
  558. ;
  559. ; fatal error display
  560. ;
  561. fatal = +
  562. ifstr(i) $(Error) == ""
  563. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  564. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  565. goto ShellCodeError
  566. endif
  567. set Error = $($R0)
  568. endif
  569. Ifint $(BillboardVisible) != 0
  570. Shell "subroutn.inf" PopBillboard
  571. Set BillboardVisible = 0
  572. Endif
  573. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  574. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  575. goto ShellCodeError
  576. endif
  577. goto setfailed
  578. ;
  579. ; Shelling error
  580. ;
  581. ShellCodeError = +
  582. set DlgType = "MessageBox"
  583. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  584. set STF_MB_TEXT = $(ShellCodeErrorText)
  585. set STF_MB_TYPE = 1
  586. set STF_MB_ICON = 3
  587. set STF_MB_DEF = 1
  588. ui start "Error Message"
  589. goto setfailed
  590. setfailed = +
  591. set CommonStatus = STATUS_FAILED
  592. ;
  593. ; If OEM_ABANDON_ON, we need to clean up the registry
  594. ;
  595. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  596. set OEM_ABANDON_ON = FALSE
  597. goto removeadapter
  598. endif
  599. goto end
  600. end = +
  601. goto term
  602. term = +
  603. Return $(CommonStatus)
  604. ;***************************************************************
  605. ; Get File Size SECTIONS
  606. ;***************************************************************
  607. [GetFilesSize]
  608. set FileSizeList = ^(Files-DHCP,3)
  609. set TotalSize = 0
  610. ForListDo $(FileSizeList)
  611. Split-String $($) "=" SplitString
  612. set Size = *($(SplitString),3)
  613. set-add TotalSize = $(TotalSize) $(Size)
  614. EndForListDo
  615. set-div SizeInK = $(TotalSize) 1024
  616. return $(SizeInK)
  617. ;***************************************************************
  618. ; INSTALL SECTIONS
  619. ;***************************************************************
  620. [Install-Option]
  621. set STF_VITAL = ""
  622. ifstr(i) $(AddCopy) == "YES"
  623. ;
  624. ; Add the files to the copy list
  625. ;
  626. AddSectionFilesToCopyList Files-DHCP $(SrcDir) $(!STF_WINDOWSSYSPATH)
  627. endif
  628. ifstr(i) $(DoCopy) == "YES"
  629. ;
  630. ; Copy files in the copy list
  631. ;
  632. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  633. CopyFilesInCopyList
  634. else
  635. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\DHCPADMN.EXE $(!STF_WINDOWSSYSPATH)\DHCPADMN.EXE
  636. endif
  637. ifstr(i) $(DoConfig) == "YES"
  638. ;
  639. ; Add product to registry
  640. ;
  641. ;
  642. ; Finish up
  643. endif
  644. Exit
  645. [Install-Update]
  646. set STF_VITAL = ""
  647. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  648. ;set STF_VERSION = "YES"
  649. AddSectionFilesToCopyList Files-DHCP $(SrcDir) $(!STF_WINDOWSSYSPATH)
  650. Exit
  651. [Install-DHCP-Icon]
  652. CreateCommonProgManGroup $(GroupName), ""
  653. RemoveCommonProgManItem $(GroupName), $(IconName)
  654. CreateCommonProgManItem $(GroupName), $(IconName), dhcpadmn.exe, dhcpadmn.exe, ""
  655. ShowCommonProgManGroup $(GroupName), 6
  656. exit
  657. [Remove-DHCP-Icon]
  658. RemoveCommonProgManItem $(OldGroupName), $(IconName)
  659. RemoveCommonProgManItem $(GroupName), $(IconName)
  660. exit
  661. [AddDHCP]
  662. read-syms FileConstants$(!STF_LANGUAGE)
  663. read-syms GeneralConstants
  664. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\DHCPServer" $(MAXIMUM_ALLOWED) ProductKey
  665. ifstr(i) $(ProductKey) != ""
  666. install "Install-DHCP-Icon"
  667. CloseRegKey $(ProductKey)
  668. endif
  669. return