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.

883 lines
25 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNSVBH.INF
  4. ;
  5. ; Network Monitoring network SETUP INF file.
  6. ;
  7. ; History:
  8. ; thomaspa 07-Jan-1994 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. NETMON
  40. NETMONTOOLS
  41. ;***********************************************************************
  42. ; CONSTANTS FOR USING DIALOGS
  43. ;***********************************************************************
  44. [FileConstants]
  45. ;
  46. ; File names, etc.
  47. ;
  48. UtilityInf = "UTILITY.INF"
  49. subroutineinf = "SUBROUTN.INF"
  50. SoftwareType = "service"
  51. Exit_Code = 0
  52. ;ShellCode = 0
  53. ;
  54. ; EventLog Message File
  55. ;
  56. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  57. ;
  58. ; Product Info
  59. ;
  60. Manufacturer = "Microsoft"
  61. ProductMajorVersion = "4"
  62. ProductMinorVersion = "0"
  63. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  64. ProductOpSupport = 132 ; 0x0084 ; Display,Removable,NOT Properties,Not Updatable
  65. ;
  66. ; Software
  67. ;
  68. ProductSoftwareName = "bh"
  69. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\bhnt.sys"
  70. NetRuleSoftwareType = "bloodhound ndisTransport bhService"
  71. NetRuleSoftwareClass = {"bhService ndisTransport"}
  72. NetRuleSoftwareUse = "transport yes yes"
  73. NetRuleSoftwareBindForm = """bh"" yes yes simple"
  74. ProductNMAgentName = "nmagent"
  75. ProductNMAgentImagePath = "%SystemRoot%\System32\nmagent.exe"
  76. ProductNMAgentSvcType = "service"
  77. ;
  78. ; Registry Key
  79. ;
  80. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  81. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductSoftwareName)"\Parameters"
  82. ServiceKeyName = $(!NTN_ServiceBase)"\"$(ProductSoftwareName)
  83. NMAgentKeyName = $(!NTN_ServiceBase)"\"$(ProductNMAgentName)
  84. [GeneralConstants]
  85. ;
  86. ; Program flow control variables.
  87. ;
  88. from = ""
  89. to = ""
  90. ;
  91. ; Return codes; Exit_Code is set to one of these
  92. ;
  93. ExitCodeOk = 0
  94. ExitCodeCancel = 1
  95. ExitCodeFatal = 2
  96. KeyNull = ""
  97. MAXIMUM_ALLOWED = 33554432
  98. RegistryErrorIndex = NO_ERROR
  99. KeyProduct = ""
  100. KeyParameters = ""
  101. TRUE = 1
  102. FALSE = 0
  103. NoTitle = 0
  104. ExitState = "Active"
  105. OldVersionExisted = $(FALSE)
  106. DriverPath = $(!STF_NTPATH)\drivers
  107. [date]
  108. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  109. ; Minute, Second }
  110. Now = {} ? $(!LIBHANDLE) GetSystemDate
  111. ;---------------------------------------------------------------------------
  112. ; 1. Identify
  113. ;
  114. ; DESCRIPTION: To verify that this INF deals with the same type of options
  115. ; as we are choosing currently.
  116. ;
  117. ; INPUT: None
  118. ;
  119. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  120. ; $($R1): Option Type (COMPUTER ...)
  121. ; $($R2): Diskette description
  122. ;---------------------------------------------------------------------------
  123. [Identify]
  124. ;
  125. ;
  126. read-syms Identification
  127. set Status = STATUS_SUCCESSFUL
  128. set Identifier = $(OptionType)
  129. set Media = #("Source Media Descriptions", 1, 1)
  130. Return $(Status) $(Identifier) $(Media)
  131. ;------------------------------------------------------------------------
  132. ; 2. ReturnOptions:
  133. ;
  134. ; DESCRIPTION: To return the option list supported by this INF and the
  135. ; localised text list representing the options.
  136. ;
  137. ;
  138. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  139. ;
  140. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  141. ; STATUS_NOLANGUAGE
  142. ; STATUS_FAILED
  143. ;
  144. ; $($R1): Option List
  145. ; $($R2): Option Text List
  146. ;------------------------------------------------------------------------
  147. [ReturnOptions]
  148. ;
  149. ;
  150. set Status = STATUS_FAILED
  151. set OptionList = {}
  152. set OptionTextList = {}
  153. ;
  154. ; Check if the language requested is supported
  155. ;
  156. set LanguageList = ^(LanguagesSupported, 1)
  157. Ifcontains(i) $($0) in $(LanguageList)
  158. goto returnoptions
  159. else
  160. set Status = STATUS_NOLANGUAGE
  161. goto finish_ReturnOptions
  162. endif
  163. ;
  164. ; form a list of all the options and another of the text representing
  165. ;
  166. returnoptions = +
  167. set AllOptionsList = ^(Options, 1)
  168. set AllOptionsTextList = ^(OptionsText$($0), 1)
  169. ;
  170. ; we only support the agent on workstation product
  171. ;
  172. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  173. set OptionList = >({}, *($(AllOptionsList),1))
  174. set OptionTextList = >({}, *($(AllOptionsTextList), 1))
  175. else
  176. set OptionList = $(AllOptionsList)
  177. set OptionTextList = $(AllOptionsTextList)
  178. endif
  179. set Status = STATUS_SUCCESSFUL
  180. finish_ReturnOptions = +
  181. Return $(Status) $(OptionList) $(OptionTextList)
  182. ;----------InstallOption-------------------------------------------------
  183. ;
  184. ; InstallOption:
  185. ;
  186. ; This section is shelled to by main installation processing
  187. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  188. ;
  189. ;
  190. ; FUNCTION: To copy files representing Options
  191. ; To configure the installed option
  192. ; To update the registry for the installed option
  193. ;
  194. ; INPUT: $($0): Language to use
  195. ; $($1): OptionID to install
  196. ; $($2): SourceDirectory
  197. ; $($3): AddCopy (YES | NO)
  198. ; $($4): DoCopy (YES | NO)
  199. ; $($5): DoConfig (YES | NO)
  200. ;
  201. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  202. ; STATUS_NOLANGUAGE |
  203. ; STATUS_USERCANCEL |
  204. ; STATUS_FAILED
  205. ;
  206. ;------------------------------------------------------------------------
  207. [InstallOption]
  208. ;
  209. ; extract parameters
  210. ;
  211. set Option = $($1)
  212. set AddCopy = $($3)
  213. set DoCopy = $($4)
  214. set DoConfig = $($5)
  215. ;
  216. ; Make sure the passed in SrcDir ends with a "\"
  217. ;
  218. Split-String $($2), "\", lSrcDirParts
  219. QueryListSize cSrcDirParts $(lSrcDirParts)
  220. ifstr(i) *($(lSrcDirParts),$(cSrcDirParts)) != "\"
  221. Set SrcDir = $($2)"\"
  222. else
  223. Set SrcDir = $($2)
  224. Endif
  225. ;
  226. ; Check if the language requested is supported
  227. ;
  228. set LanguageList = ^(LanguagesSupported, 1)
  229. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  230. Return STATUS_NOLANGUAGE
  231. endif
  232. Debug-Output "OEMNSVBH.INF: STF_CWDDIR is: "$(!STF_CWDDIR)
  233. Debug-Output "OEMNSVBH.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  234. ; define all the constants
  235. set-subst LF = "\n"
  236. read-syms GeneralConstants
  237. read-syms FileConstants
  238. read-syms DialogConstants$(!STF_LANGUAGE)
  239. ifstr(i) $(!NTN_Origination) == "NCPA"
  240. set Continue = $(OK)
  241. endif
  242. read-syms FileConstants$(!STF_LANGUAGE)
  243. read-syms $(Option)Constants$(!STF_LANGUAGE)
  244. detect date
  245. set-title $(FunctionTitle)
  246. set to = Begin
  247. set from = Begin
  248. ;
  249. ; Assume all is well.
  250. ;
  251. set CommonStatus = STATUS_SUCCESSFUL
  252. EndWait
  253. ;
  254. ; Set up the operation-mode-based variables and gaily welcome
  255. ; the user. If the "install mode" variable is improperly set,
  256. ; assume this is a new installation.
  257. ;
  258. Begin = +
  259. Ifstr(i) $(!NTN_InstallMode) == deinstall
  260. set StartLabel = removeadapter
  261. else-Ifstr(i) $(!NTN_InstallMode) == Update
  262. set StartLabel = UpgradeSoftware
  263. else-Ifstr(i) $(!NTN_InstallMode) == bind
  264. set StartLabel = bindingadapter
  265. else-Ifstr(i) $(!NTN_InstallMode) == configure
  266. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  267. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  268. Debug-Output "OEMNSVBH.INF: ShellCode error: cannot get an error string."
  269. goto ShellCodeError
  270. endif
  271. set Error = $($R0)
  272. set from = end
  273. set to = end
  274. goto nonfatalinfo
  275. else
  276. set StartLabel = installadapter
  277. endif
  278. ;
  279. ; set up default parameter
  280. ;
  281. set RadioDefault = 2
  282. set RadioIn = {$(RadioDefault)}
  283. set from = $(fatal)
  284. set to = $(fatal)
  285. goto $(StartLabel)
  286. ;-----------------------------------------------
  287. ; Installation Section
  288. ;-----------------------------------------------
  289. installadapter = +
  290. ;
  291. ; First, check whether the same version of the software exists
  292. ;
  293. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  294. Ifstr $(KeyProduct) != $(KeyNull)
  295. ;
  296. ; Same version already existed in the local machine
  297. ; Popup the dialog and ask the user whether he wants to continue
  298. ;
  299. CloseRegKey $(KeyProduct)
  300. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  301. $(ProductVersion)
  302. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  303. Debug-Output "ShellCode error: cannot get an error string."
  304. goto ShellCodeError
  305. endif
  306. goto end
  307. endif
  308. CloseRegKey $(KeyProduct)
  309. goto installproduct
  310. ;
  311. ; If installing, go create the necessary keys;
  312. ; if configuring, they're already open.
  313. ;
  314. installproduct = +
  315. StartWait
  316. ;
  317. ; Now bloodhound is to be installed
  318. ;
  319. ifint $(OldVersionExisted) == $(FALSE)
  320. Ifstr(i) $(DoCopy) == "YES"
  321. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  322. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  323. Goto ShellCodeError
  324. Else-Ifstr(i) $($R0) == STATUS_FAILED
  325. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  326. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  327. goto ShellCodeError
  328. endif
  329. set Error = $($R0)
  330. Goto fatal
  331. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  332. Goto successful
  333. Endif
  334. ; Make sure the SrcDir ends with a "\"
  335. Split-String $($R1), "\", lSrcDirParts
  336. QueryListSize cSrcDirParts $(lSrcDirParts)
  337. ifstr(i) *($(lSrcDirParts),$(cSrcDirParts)) != "\"
  338. Set SrcDir = $($R1)"\"
  339. else
  340. Set SrcDir = $($R1)
  341. Endif
  342. Endif
  343. install "Install-Option"
  344. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  345. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  346. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  347. goto ShellCodeError
  348. endif
  349. set Error = $($R0)
  350. goto fatal
  351. endif
  352. set OEM_ABANDON_ON = TRUE
  353. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  354. $(ProductSoftwareName), +
  355. $(ProductSoftwareName), +
  356. $(ProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
  357. $(ProductSoftwareImagePath), "kernel", "", {}, "",+
  358. $(NetEventDLL)
  359. set RegistryErrorIndex = $($R0)
  360. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  361. EndWait
  362. CloseRegKey $($R1)
  363. CloseRegKey $($R2)
  364. CloseRegKey $($R3)
  365. CloseRegKey $($R4)
  366. CloseRegKey $($R5)
  367. goto fatalRegistry
  368. endif
  369. ;
  370. ; At this point:
  371. ; $R1 contains the product version key handle;
  372. ; $R2 contains the NetRules subkey handle;
  373. ; $R3 contains the new Services key handle; and
  374. ; $R4 contains the Parameters key
  375. ; $R5 contains the Linkage Key
  376. ;
  377. Set SoftProductKey = $($R1)
  378. Set SoftNetRuleKey = $($R2)
  379. Set BhServiceKey = $($R3)
  380. set KeyParameters = $($R4)
  381. Set SoftLinkageKey = $($R5)
  382. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  383. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  384. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  385. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  386. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  387. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  388. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}, +
  389. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  390. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  391. set RegistryErrorIndex = $($R0)
  392. Ifstr $(RegistryErrorIndex) != NO_ERROR
  393. CloseRegKey $(SoftProductKey)
  394. CloseRegKey $(SoftNetRuleKey)
  395. CloseRegKey $(BhServiceKey)
  396. CloseRegKey $(SoftLinkageKey)
  397. CloseRegKey $(KeyParameters)
  398. goto fatalRegistry
  399. endif
  400. set NewValueList = {{type ,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)}, +
  401. {use ,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  402. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  403. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  404. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  405. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  406. set RegistryErrorIndex = $($R0)
  407. Ifstr $(RegistryErrorIndex) != NO_ERROR
  408. CloseRegKey $(SoftProductKey)
  409. CloseRegKey $(SoftNetRuleKey)
  410. CloseRegKey $(BhServiceKey)
  411. CloseRegKey $(SoftLinkageKey)
  412. CloseRegKey $(KeyParameters)
  413. goto fatalRegistry
  414. endif
  415. CloseRegKey $(SoftProductKey)
  416. CloseRegKey $(SoftNetRuleKey)
  417. CloseRegKey $(SoftLinkageKey)
  418. ;
  419. ; Add the NAL value
  420. ;
  421. set NewValueList = {{Nal,$(NoTitle),$(!REG_VT_MULTI_SZ),{"NDIS30","RNAL"}}}
  422. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  423. set RegistryErrorIndex = $($R0)
  424. Ifstr $(RegistryErrorIndex) != NO_ERROR
  425. CloseRegKey $(BhServiceKey)
  426. goto fatalRegistry
  427. endif
  428. CloseRegKey $(KeyParameters)
  429. ;
  430. ; Add the Performance key
  431. ;
  432. CreateRegKey $(BhServiceKey) {"Performance",$(NoTitle),GenericClass} "" +
  433. $(MAXIMUM_ALLOWED) "" KeyPerformance
  434. set NewValueList = {{Library,$(NoTitle),$(!REG_VT_SZ),bhmon.dll}, +
  435. {Open,$(NoTitle),$(!REG_VT_SZ),"BhOpenPerformanceData"}, +
  436. {Close,$(NoTitle),$(!REG_VT_SZ),"BhClosePerformanceData"}, +
  437. {Collect,$(NoTitle),$(!REG_VT_SZ),"BhCollectPerformanceData"}}
  438. Shell $(UtilityInf), AddValueList, $(KeyPerformance), $(NewValueList)
  439. set RegistryErrorIndex = $($R0)
  440. Ifstr $(RegistryErrorIndex) != NO_ERROR
  441. CloseRegKey $(KeyPerformance)
  442. CloseRegKey $(BhServiceKey)
  443. goto fatalRegistry
  444. endif
  445. CloseRegKey $(KeyPerformance)
  446. ;
  447. ; Add the NMAgent
  448. ;
  449. Shell $(UtilityInf), CreateService, $(ProductNMAgentName),+
  450. $(ProductNMAgentDisplayName),+
  451. $(ProductNMAgentImagePath),+
  452. $(ProductNMAgentSvcType), "",+
  453. {"bh"}, ""
  454. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  455. Debug-Output "OEMNSVBH.INF: ShellCode error"
  456. goto ShellCodeError
  457. endif
  458. set RegistryErrorIndex = $($R0)
  459. CloseRegKey $($R1)
  460. CloseRegKey $($R2)
  461. CloseRegKey $($R3)
  462. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  463. EndWait
  464. Debug-Output "OEMNSVBH.INF: Registry error creating Network Monitor Agent service"
  465. goto fatalregistry
  466. endif
  467. endif
  468. ;
  469. ; Add icons/shortcuts to programs / administrative tools
  470. ;
  471. ifstr(i) $(Option) == "NETMONTOOLS"
  472. read-syms IconInfo$(!STF_LANGUAGE)
  473. Install Install-Shortcuts
  474. endif
  475. goto successful
  476. ;-----------------------------------------------
  477. ; Binding section
  478. ;-----------------------------------------------
  479. bindingadapter =+
  480. set Error = "Binding: Sorry, not yet implemented."
  481. goto fatal
  482. ;-----------------------------------------------
  483. ; Removeadapter section
  484. ;-----------------------------------------------
  485. removeadapter = +
  486. ;
  487. ; Remove Bloodhound service
  488. ;
  489. ;
  490. ; Remove icons/shortcuts to programs / administrative tools
  491. ; and remove netmon directory; only if tools
  492. ;
  493. ifstr(i) $(Option) == "NETMONTOOLS"
  494. read-syms IconInfo$(!STF_LANGUAGE)
  495. Install Remove-Shortcuts
  496. LibraryProcedure ResultList, $(!LIBHANDLE), Delnode, $(!STF_WINDOWSSYSPATH)"\netmon"
  497. endif
  498. ;
  499. ; remove the new control panel applet
  500. ;
  501. AddfileToDeleteList $(!STF_WINDOWSSYSPATH)"\BHCTRL.CPL"
  502. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  503. $(ProductSoftwareName)
  504. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  505. Debug-Output "ShellCode error"
  506. goto ShellCodeError
  507. endif
  508. set RegistryErrorIndex = $($R0)
  509. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  510. goto fatalregistry
  511. endif
  512. Shell $(UtilityInf), RemoveService, $(ProductNMAgentName), "YES"
  513. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  514. Debug-Output "ShellCode error"
  515. goto ShellCodeError
  516. endif
  517. set RegistryErrorIndex = $($R0)
  518. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  519. goto fatalregistry
  520. endif
  521. goto end
  522. ;-----------------------------------------------
  523. ; Upgrade Software section
  524. ;-----------------------------------------------
  525. UpgradeSoftware = +
  526. ; Upgrade software component
  527. ;
  528. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  529. Ifstr $(KeyProduct) != $(KeyNull)
  530. install "Install-Update"
  531. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  532. goto fatal
  533. endif
  534. ; Upgrade the version number
  535. ;
  536. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  537. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  538. ;
  539. ; upgrade icons
  540. ;
  541. ifstr(i) $(Option) == "NETMONTOOLS"
  542. read-syms IconInfo$(!STF_LANGUAGE)
  543. Install Remove-Shortcuts
  544. Install Install-Shortcuts
  545. endif
  546. ;
  547. ; Upgrade the Name and software type
  548. ;
  549. SetRegValue $(KeyProduct) {"Description",$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)}
  550. SetRegValue $(KeyProduct) {"Title",$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)}
  551. SetRegValue $(KeyProduct) {"SoftwareType",$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)}
  552. ;
  553. ; Update op support
  554. ;
  555. SetRegValue $(KeyProduct) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  556. CloseRegKey $(KeyProduct)
  557. OpenRegKey $(!REG_H_LOCAL) "" $(ServiceKeyName) $(MAXIMUM_ALLOWED) ServiceKey
  558. ifstr(i) $(ServiceKey) != ""
  559. SetRegValue $(ServiceKey) {"DisplayName",$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDisplayName)}
  560. CloseRegKey $(ServiceKey)
  561. endif
  562. OpenRegKey $(!REG_H_LOCAL) "" $(NMAgentKeyName) $(MAXIMUM_ALLOWED) NMAgentKey
  563. ifstr(i) $(NMAgentKey) != ""
  564. SetRegValue $(NMAgentKey) {"DisplayName",$(NoTitle),$(!REG_VT_SZ),$(ProductNMAgentDisplayName)}
  565. CloseRegKey $(NMAgentKey)
  566. endif
  567. else
  568. ;
  569. ; Cannot Open software key, goto ERROR
  570. ;
  571. goto fatalregistry
  572. endif
  573. goto end
  574. ;
  575. ; End of Upgrade Software
  576. ;
  577. ;
  578. ; Escape hatches
  579. ;
  580. successful = +
  581. goto end
  582. ;
  583. ; warning display
  584. ;
  585. warning = +
  586. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  587. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  588. goto ShellCodeError
  589. endif
  590. ifstr(i) $($R1) == "OK"
  591. goto $(to)
  592. else-ifstr(i) $($R1) == "CANCEL"
  593. goto $(from)
  594. else
  595. ; Debug-Msg "Error Error Bad DLGEVENT"
  596. goto "end"
  597. endif
  598. ;
  599. ; non fatal error display
  600. ;
  601. nonfatalinfo = +
  602. Set CommonStatus = STATUS_USERCANCEL
  603. Set Severity = STATUS
  604. goto nonfatalmsg
  605. nonfatal = +
  606. Set Severity = NONFATAL
  607. goto nonfatalmsg
  608. nonfatalmsg = +
  609. ifstr(i) $(Error) == ""
  610. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  611. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  612. goto ShellCodeError
  613. endif
  614. set Error = $($R0)
  615. endif
  616. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  617. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  618. goto ShellCodeError
  619. endif
  620. ifstr(i) $($R1) == "OK"
  621. goto $(from)
  622. else
  623. goto "end"
  624. endif
  625. ;
  626. ; Registry is broken
  627. ;
  628. fatalregistry = +
  629. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  630. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  631. goto ShellCodeError
  632. endif
  633. set Error = $($R0)
  634. goto fatal
  635. ;
  636. ; fatal error display
  637. ;
  638. fatal = +
  639. ifstr(i) $(Error) == ""
  640. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  641. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  642. goto ShellCodeError
  643. endif
  644. set Error = $($R0)
  645. endif
  646. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  647. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  648. goto ShellCodeError
  649. endif
  650. goto setfailed
  651. ;
  652. ; Shelling error
  653. ;
  654. ShellCodeError = +
  655. set DlgType = "MessageBox"
  656. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  657. set STF_MB_TEXT = $(ShellCodeErrorText)
  658. set STF_MB_TYPE = 1
  659. set STF_MB_ICON = 3
  660. set STF_MB_DEF = 1
  661. ui start "Error Message"
  662. goto setfailed
  663. setfailed = +
  664. set CommonStatus = STATUS_FAILED
  665. ;
  666. ; If OEM_ABANDON_ON, we need to clean up the registry
  667. ;
  668. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  669. set OEM_ABANDON_ON = FALSE
  670. goto removeadapter
  671. endif
  672. goto end
  673. end = +
  674. goto term
  675. term = +
  676. Return $(CommonStatus)
  677. ;***************************************************************
  678. ; INSTALL SECTIONS
  679. ;***************************************************************
  680. [Install-Shortcuts]
  681. ShowCommonProgManGroup $(NetAdminGroupName), 1
  682. RemoveCommonProgManItem $(NetAdminGroupName), $(NetMonitor)
  683. CreateCommonProgManItem $(NetAdminGroupName), $(NetMonitor), "netmon\netmon.exe" "" 0
  684. ShowCommonProgManGroup $(NetAdminGroupName), 6
  685. exit
  686. [Remove-Shortcuts]
  687. ShowCommonProgManGroup $(NetAdminGroupName), 1
  688. RemoveCommonProgManItem $(OldNetAdminGroupName), $(NetMonitor)
  689. RemoveCommonProgManItem $(NetAdminGroupName), $(NetMonitor)
  690. ShowCommonProgManGroup $(NetAdminGroupName), 6
  691. exit
  692. [Install-Option]
  693. set STF_VITAL = ""
  694. ifstr(i) $(AddCopy) == "YES"
  695. ;
  696. ; Add the files to the copy list
  697. ;
  698. ;
  699. ifstr(i) $(Option) == "NETMONTOOLS"
  700. ;
  701. ; also add the tools files
  702. ;
  703. CreateDir $(!STF_WINDOWSSYSPATH)\Netmon
  704. CreateDir $(!STF_WINDOWSSYSPATH)\Netmon\Parsers
  705. CreateDir $(!STF_WINDOWSSYSPATH)\Netmon\Captures
  706. AddSectionFilesToCopyList Files-TOOLS $(SrcDir)"netmon" $(!STF_WINDOWSSYSPATH)\Netmon
  707. AddSectionFilesToCopyList Files-PARSERS $(SrcDir)"netmon" $(!STF_WINDOWSSYSPATH)\Netmon\Parsers
  708. AddSectionFilesToCopyList Files-CAPTURES $(SrcDir)"netmon" $(!STF_WINDOWSSYSPATH)\Netmon\Captures
  709. endif
  710. AddSectionFilesToCopyList Files-NETMON $(SrcDir) $(!STF_WINDOWSSYSPATH)
  711. AddSectionFilesToCopyList Files-DRIVERS $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  712. endif
  713. ifstr(i) $(DoCopy) == "YES"
  714. ;
  715. ; Copy files in the copy list
  716. ;
  717. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  718. CopyFilesInCopyList
  719. else
  720. ifstr(i) $(Option) == "NETMONTOOLS"
  721. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\netmon\netmon.exe $(!STF_WINDOWSSYSPATH)\Netmon\netmon.exe
  722. endif
  723. endif
  724. ifstr(i) $(DoConfig) == "YES"
  725. ;
  726. ; Add product to registry
  727. ;
  728. ;
  729. ; Finish up
  730. endif
  731. Exit
  732. [Install-Update]
  733. set STF_VITAL = ""
  734. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  735. ;set STF_VERSION = "YES"
  736. ifstr(i) $(Option) == "NETMONTOOLS"
  737. ;
  738. ; also add the tools files
  739. ;
  740. AddSectionFilesToCopyList Files-TOOLS $(SrcDir)"netmon" $(!STF_WINDOWSSYSPATH)\Netmon
  741. AddSectionFilesToCopyList Files-PARSERS $(SrcDir)"netmon" $(!STF_WINDOWSSYSPATH)\Netmon\Parsers
  742. AddSectionFilesToCopyList Files-CAPTURES $(SrcDir)"netmon" $(!STF_WINDOWSSYSPATH)\Netmon\Captures
  743. endif
  744. AddSectionFilesToCopyList Files-NETMON $(SrcDir) $(!STF_WINDOWSSYSPATH)
  745. AddSectionFilesToCopyList Files-DRIVERS $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  746. exit