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.

842 lines
24 KiB

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