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.

899 lines
27 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNSVIR.INF (tough to make a sensible unique name)
  4. ;
  5. ; Microsoft RIP for IP
  6. ;
  7. ; History:
  8. ; ramc 3-10-95 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. IPRIP
  39. ;***********************************************************************
  40. ; CONSTANTS FOR USING DIALOGS
  41. ;***********************************************************************
  42. [FileConstants]
  43. ;
  44. ; Product Info
  45. ;
  46. Manufacturer = "Microsoft"
  47. ProductMajorVersion = "4"
  48. ProductMinorVersion = "0"
  49. SoftwareType = "service"
  50. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  51. ProductOpSupport = 132 ; 0x0084 ; Display,Removable,NOT Properties,Not Updatable
  52. ;================================================================
  53. ; TCP/IP: Service and Driver
  54. ;
  55. ;================================================================
  56. ; TCP Software data: this is the WIN32 Service. It
  57. ; automatically loads the TCPIP.SYS driver.
  58. ;
  59. ProductIPRIPName = "IpRip"
  60. ProductIPRIPImagePath = "%SystemRoot%\System32\router.exe"
  61. ProductIPRIPEventFile = "%SystemRoot%\System32\iprip.dll"
  62. ProductSoftwareConfigDLL = tcpcfg.dll
  63. ;
  64. ; Registry Key Names
  65. ;
  66. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\IpRip\CurrentVersion"
  67. [GeneralConstants]
  68. ;
  69. ; File names, etc.
  70. ;
  71. UtilityInf = "UTILITY.INF"
  72. subroutineinf = "SUBROUTN.INF"
  73. Exit_Code = 0
  74. ;ShellCode = 0
  75. BillboardVisible = 0
  76. ;
  77. ; Program flow control variables.
  78. ;
  79. from = ""
  80. to = ""
  81. ;
  82. ; Return codes; Exit_Code is set to one of these
  83. ;
  84. ExitCodeOk = 0
  85. ExitCodeCancel = 1
  86. ExitCodeFatal = 2
  87. KeyNull = ""
  88. MAXIMUM_ALLOWED = 33554432
  89. SERVICE_NO_CHANGE = 4294967295
  90. RegistryErrorIndex = NO_ERROR
  91. KeyProduct = ""
  92. KeyParameters = ""
  93. TRUE = 1
  94. FALSE = 0
  95. NoTitle = 0
  96. ExitState = "Active"
  97. OldVersionExisted = $(FALSE)
  98. [date]
  99. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  100. ; Minute, Second }
  101. Now = {} ? $(!LIBHANDLE) GetSystemDate
  102. ;---------------------------------------------------------------------------
  103. ; 1. Identify
  104. ;
  105. ; DESCRIPTION: To verify that this INF deals with the same type of options
  106. ; as we are choosing currently.
  107. ;
  108. ; INPUT: None
  109. ;
  110. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  111. ; $($R1): Option Type (COMPUTER ...)
  112. ; $($R2): Diskette description
  113. ;---------------------------------------------------------------------------
  114. [Identify]
  115. ;
  116. ;
  117. read-syms Identification
  118. set Status = STATUS_SUCCESSFUL
  119. set Identifier = $(OptionType)
  120. set Media = #("Source Media Descriptions", 1, 1)
  121. Return $(Status) $(Identifier) $(Media)
  122. ;------------------------------------------------------------------------
  123. ; 2. ReturnOptions:
  124. ;
  125. ; DESCRIPTION: To return the option list supported by this INF and the
  126. ; localised text list representing the options.
  127. ;
  128. ;
  129. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  130. ;
  131. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  132. ; STATUS_NOLANGUAGE
  133. ; STATUS_FAILED
  134. ;
  135. ; $($R1): Option List
  136. ; $($R2): Option Text List
  137. ;------------------------------------------------------------------------
  138. [ReturnOptions]
  139. ;
  140. ;
  141. set Status = STATUS_FAILED
  142. set OptionList = {}
  143. set OptionTextList = {}
  144. ;
  145. ; Check if the language requested is supported
  146. ;
  147. set LanguageList = ^(LanguagesSupported, 1)
  148. Ifcontains(i) $($0) in $(LanguageList)
  149. goto returnoptions
  150. else
  151. set Status = STATUS_NOLANGUAGE
  152. goto finish_ReturnOptions
  153. endif
  154. ;
  155. ; form a list of all the options and another of the text representing
  156. ;
  157. returnoptions = +
  158. set OptionList = ^(Options, 1)
  159. set OptionTextList = ^(OptionsText$($0), 1)
  160. set Status = STATUS_SUCCESSFUL
  161. finish_ReturnOptions = +
  162. Return $(Status) $(OptionList) $(OptionTextList)
  163. ;----------InstallOption-------------------------------------------------
  164. ;
  165. ; InstallOption:
  166. ;
  167. ; This section is shelled to by main installation processing
  168. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  169. ;
  170. ;
  171. ; FUNCTION: To copy files representing Options
  172. ; To configure the installed option
  173. ; To update the registry for the installed option
  174. ;
  175. ; INPUT: $($0): Language to use
  176. ; $($1): OptionID to install
  177. ; $($2): SourceDirectory
  178. ; $($3): AddCopy (YES | NO)
  179. ; $($4): DoCopy (YES | NO)
  180. ; $($5): DoConfig (YES | NO)
  181. ;
  182. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  183. ; STATUS_NOLANGUAGE |
  184. ; STATUS_USERCANCEL |
  185. ; STATUS_FAILED
  186. ;
  187. ;------------------------------------------------------------------------
  188. [InstallOption]
  189. ;
  190. ; extract parameters
  191. ;
  192. set Option = $($1)
  193. set SrcDir = $($2)
  194. set AddCopy = $($3)
  195. set DoCopy = $($4)
  196. set DoConfig = $($5)
  197. set InstallFrom = $($6)
  198. ifstr(i) $(InstallFrom) == ""
  199. set InstallFrom = "IPRIP"
  200. endif
  201. ;
  202. ; Check if the language requested is supported
  203. ;
  204. set LanguageList = ^(LanguagesSupported, 1)
  205. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  206. Return STATUS_NOLANGUAGE
  207. endif
  208. Debug-Output "OEMNSVIR.INF: STF_CWDIR is: "$(!STF_CWDIR)
  209. Debug-Output "OEMNSVIR.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  210. ; define all the constants
  211. set-subst LF = "\n"
  212. read-syms GeneralConstants
  213. read-syms FileConstants
  214. read-syms DialogConstants$(!STF_LANGUAGE)
  215. ifstr(i) $(!NTN_Origination) == "NCPA"
  216. set Continue = $(OK)
  217. endif
  218. read-syms FileConstants$(!STF_LANGUAGE)
  219. detect date
  220. set-title $(FunctionTitle)
  221. set to = Begin
  222. set from = Begin
  223. ;
  224. ; Assume all is well.
  225. ;
  226. set CommonStatus = STATUS_SUCCESSFUL
  227. EndWait
  228. ;
  229. ; Set up the operation-mode-based variables and gaily welcome
  230. ; the user. If the "install mode" variable is improperly set,
  231. ; assume this is a new installation.
  232. ;
  233. Begin = +
  234. Ifstr(i) $(!NTN_InstallMode) == deinstall
  235. set StartLabel = removeadapter
  236. else-Ifstr(i) $(!NTN_InstallMode) == Update
  237. set StartLabel = UpgradeSoftware
  238. else-Ifstr(i) $(!NTN_InstallMode) == configure
  239. ;
  240. ; You cannot config the software component
  241. ;
  242. Debug-Output "Cannot configure the software."
  243. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  244. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  245. Debug-Output "ShellCode error: cannot get an error string."
  246. goto ShellCodeError
  247. endif
  248. set Error = $($R0)
  249. set from = end
  250. set to = end
  251. goto nonfatalinfo
  252. else-Ifstr(i) $(!NTN_InstallMode) == bind
  253. set StartLabel = bindingadapter
  254. else
  255. set StartLabel = installadapter
  256. set OEM_ABANDON_SOFTWARE = {}
  257. set OEM_ABANDON_OPTIONS = {}
  258. endif
  259. set from = $(fatal)
  260. set to = $(fatal)
  261. goto $(StartLabel)
  262. ;-----------------------------------------------
  263. ; Installation Section
  264. ;-----------------------------------------------
  265. installadapter = +
  266. set OEM_ABANDON_ON = TRUE
  267. StartWait
  268. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeySoftware
  269. Ifstr(i) $(KeySoftware) == $(KeyNull)
  270. ifstr(i) $(!NTN_InstallMode) == "install"
  271. Ifstr(i) $(DoCopy) == "YES"
  272. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  273. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  274. Goto ShellCodeError
  275. Else-Ifstr(i) $($R0) == STATUS_FAILED
  276. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  277. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  278. goto ShellCodeError
  279. endif
  280. set Error = $($R0)
  281. Goto fatal
  282. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  283. Goto successful
  284. Endif
  285. Set SrcDir = $($R1)
  286. Endif
  287. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\TCPIP" $(MAXIMUM_ALLOWED) BS_KeyServices
  288. Ifstr $(BS_KeyServices) == $(KeyNull)
  289. ; Set up tcpip for the user
  290. ;
  291. Shell "oemnxpip.inf" ReturnOptions $(!STF_LANGUAGE)
  292. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  293. set OldStfSrcDir = $(!STF_SRCDIR_OVERRIDE)
  294. set !STF_SRCDIR_OVERRIDE = ""
  295. Shell "oemnxpip.inf" InstallOption $(!STF_LANGUAGE), *($($R1),1),+
  296. $(SrcDir), $(AddCopy), "NO", $(DoConfig)
  297. set !STF_SRCDIR_OVERRIDE = $(OldStfSrcDir)
  298. else
  299. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(InstallNWLINKFirst)
  300. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  301. goto ShellCodeError
  302. endif
  303. goto end
  304. endif
  305. else
  306. CloseRegKey $(BS_KeyServices)
  307. endif
  308. Debug-Output "OEMNSVIR.INF: installadapter: installing [Install-Option]"
  309. install "Install-Option"
  310. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  311. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  312. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  313. goto ShellCodeError
  314. endif
  315. set Error = $($R0)
  316. goto fatal
  317. endif
  318. endif
  319. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\IPRIP" $(MAXIMUM_ALLOWED) KeyService
  320. Ifstr(i) $(KeyService) == $(KeyNull)
  321. Shell $(UtilityInf), AddSoftwareComponent, "Microsoft", +
  322. $(ProductIPRIPName), +
  323. $(ProductIPRIPName), +
  324. $(ProductIPRIPDisplayName), +
  325. $(STF_CONTEXTINFNAME),+
  326. $(ProductIPRIPImagePath), +
  327. "autoserviceshare" , "", {"TCPIP"}, "", $(ProductIPRIPEventFile)
  328. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  329. Debug-Output "OEMNSVIR.INF: ShellCode error"
  330. return STATUS_FAILED
  331. endif
  332. set RegistryErrorIndex = $($R0)
  333. set ProductKey = $($R1)
  334. set RuleKey = $($R2)
  335. CloseRegKey $($R3)
  336. set ParamKey = $($R4)
  337. CloseRegKey $($R5)
  338. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  339. EndWait
  340. Debug-Output "OEMNSVIR.INF: Registry Error "$(RegistryErrorIndex)
  341. CloseRegKey $($R1)
  342. CloseRegKey $($R2)
  343. CloseRegKey $($R4)
  344. goto fatalregistry
  345. endif
  346. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  347. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  348. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductIPRIPTitle)},+
  349. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductIPRIPDescription)},+
  350. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  351. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}, +
  352. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)} +
  353. {Review,$(NoTitle),$(!REG_VT_DWORD),1)}}
  354. Shell $(UtilityInf), AddValueList, $(ProductKey), $(NewValueList)
  355. CloseRegKey $(ProductKey)
  356. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  357. Debug-Output "utility.INF: ShellCode error. Cannot add IPRIP router service"
  358. goto ShellCodeError
  359. endif
  360. set RegistryErrorIndex = $($R0)
  361. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  362. EndWait
  363. Debug-Output "OEMNSVIR.INF: error: create service"
  364. set Status = STATUS_FAILED
  365. endif
  366. ; set netrules information in the registry
  367. set NewValueList = +
  368. {{class, $(NoTitle), $(!REG_VT_SZ), "ipripRouter basic"},+
  369. {type,$(NoTitle),$(!REG_VT_SZ),"iprip ipripRouter"},+
  370. {InfOption,$(NoTitle),$(!REG_VT_SZ),"IPRIP"}, +
  371. {bindform,$(NoTitle),$(!REG_VT_SZ),"""iprip"" yes yes simple"}, +
  372. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),+
  373. {"ipripRouter ndisDriver non non 100"}}}
  374. Shell $(UtilityInf), AddValueList, $(RuleKey), $(NewValueList)
  375. CloseRegKey $(RuleKey)
  376. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  377. Debug-Output "utility.INF: ShellCode error. Cannot add IPRIP service"
  378. goto ShellCodeError
  379. endif
  380. set RegistryErrorIndex = $($R0)
  381. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  382. EndWait
  383. Debug-Output "OEMNSVIR.INF: Registry error: create service"
  384. set Status = STATUS_FAILED
  385. endif
  386. ; Default to not to SilentRip
  387. set Result = 0;
  388. ifstr(i) $(!STF_GUI_UNATTENDED) != "YES"
  389. LoadLibrary "x" $(!STF_CWDDIR)$(ProductSoftwareConfigDLL) !hDialogDLL
  390. ifstr(i) $(!hDialogDLL) != NULL
  391. set FLibraryErrCtl = 1
  392. LibraryProcedure ResultList, $(!hDialogDLL), TcpEnableRipSilentMode
  393. set FLibraryErrCtl = 0
  394. set Result = *($(ResultList), 1)
  395. endif
  396. endif
  397. SetRegValue $(ParamKey) {SilentRip, $(NoTitle), $(!REG_VT_DWORD), $(Result)}
  398. CloseRegKey $(ParamKey)
  399. endif
  400. Else
  401. Debug-Output "OEMNSVIR.INF: already installed InstallFrom = "$(InstallFrom)
  402. GetRegValue $(KeySoftware) "MajorVersion" VersionInfo
  403. set VersionMajor = *($(VersionInfo), 4)
  404. GetRegValue $(KeySoftware) "MinorVersion" VersionInfo
  405. set VersionMinor = *($(VersionInfo), 4)
  406. set InstalledVersion = $(VersionMajor)"."$(VersionMinor)
  407. ; display the VerExists dialog only if the RIP router is installed
  408. ; from NCPA directly - not if some other component is installing us
  409. ifstr(i) $(InstallFrom) == "IPRIP"
  410. read-syms VerExists$(!STF_LANGUAGE)
  411. set Text = $(Product$(Option)Title)$(Ver)$(ProductVersion)+
  412. $(Text1)
  413. Shell $(subroutineinf), SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(Text)
  414. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  415. Goto fatal
  416. Else-Ifstr(i) $($R0) == STATUS_FAILED
  417. Goto fatal
  418. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  419. Goto end
  420. Endif
  421. else
  422. Shell "" AddIPRIPUsed $(InstallFrom)
  423. endif
  424. goto end
  425. EndIf
  426. Ifstr(i) $(KeySoftware) != $(KeyNull)
  427. CloseRegKey $(KeySoftware)
  428. endif
  429. Shell "" AddIPRIPUsed $(InstallFrom)
  430. ;
  431. ; make sure that IPEnableRouter is turn on
  432. ;
  433. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\Tcpip\Parameters" $(MAXIMUM_ALLOWED) KeyTcpParameter
  434. ifstr(i) $(KeyTcpParameter) != ""
  435. GetRegValue $(KeyTcpParameter) "IPEnableRouter" RouterInfo
  436. ifint *($(RouterInfo),4) == 0
  437. SetRegValue $(KeyTcpParameter) {"IPEnableRouter", $(NoTitle), $(!REG_VT_DWORD), 1}
  438. endif
  439. endif
  440. goto successful
  441. ;-----------------------------------------------
  442. ; Configuration Section
  443. ;-----------------------------------------------
  444. configureadapter = +
  445. goto end
  446. ;-----------------------------------------------
  447. ; Binding section
  448. ; Determine the number of net card and if there is 1 silent mode == 1 else 0
  449. ;-----------------------------------------------
  450. bindingadapter =+
  451. goto end
  452. ;-----------------------------------------------
  453. ; Removeadapter section
  454. ;
  455. ;
  456. ; Removal errors are ignored, since we want to
  457. ; try to remove as much as possible.
  458. ;-----------------------------------------------
  459. removeadapter = +
  460. set IpRipKeyName = "System\CurrentControlSet\Services\IpRip"
  461. set ProductIPRIPName = "IpRip"
  462. Shell "" RemoveIPRIPUsed $(InstallFrom)
  463. OpenRegKey $(!REG_H_LOCAL) "" $(IpRipKeyName) $(MAXIMUM_ALLOWED) BS_KeyServices
  464. Ifstr $(BS_KeyServices) != $(KeyNull)
  465. CloseRegKey $(BS_KeyServices)
  466. Shell "" NumOfUsed
  467. set NumOfUsed = $($R0)
  468. ; if the only consumer is IPRIP, that means all other
  469. ; consumers have since been removed. So IPRIP should
  470. ; be removed as well.
  471. ifint $(NumOfUsed) == 1
  472. Shell "" FindUsed "IPRIP"
  473. ifstr(i) $($R0) == TRUE
  474. set NumOfUsed = 0
  475. endif
  476. endif
  477. ifint $(NumOfUsed) == 0
  478. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), $(ProductIPRIPName)
  479. else
  480. ifstr(i) $(InstallFrom) == "IPRIP"
  481. read-syms InUse$(!STF_LANGUAGE)
  482. set from = end
  483. set to = end
  484. goto warning
  485. endif
  486. endif
  487. endif
  488. goto end
  489. ;-----------------------------------------------
  490. ; Upgrade Software section
  491. ;-----------------------------------------------
  492. UpgradeSoftware = +
  493. ; Upgrade software component
  494. ;
  495. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  496. Ifstr(i) $(KeyProduct) != $(KeyNull)
  497. install "Install-Update"
  498. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  499. goto fatal
  500. endif
  501. ;
  502. ; makesure a software type is defined
  503. ;
  504. SetRegValue $(KeyProduct) {SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)}
  505. ; Upgrade the version number
  506. ;
  507. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  508. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  509. ;
  510. ; Update description and op support
  511. ;
  512. SetRegValue $(KeyProduct) {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductIPRIPDescription)}
  513. SetRegValue $(KeyProduct) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  514. ;
  515. ; Change image path
  516. ;
  517. LibraryProcedure Result, $(!LIBHANDLE), SetupChangeServiceConfig, "IpRip", $(SERVICE_NO_CHANGE), $(SERVICE_NO_CHANGE), $(SERVICE_NO_CHANGE), "%SystemRoot%\System32\router.exe", "", "", "", "", ""
  518. ;
  519. ; do nothing for update
  520. ;
  521. CloseRegKey $(KeyProduct)
  522. endif
  523. goto end
  524. ;
  525. ; End of Upgrade Software
  526. ;
  527. ;
  528. ; Escape hatches
  529. ;
  530. successful = +
  531. goto end
  532. ;
  533. ; info display
  534. ;
  535. infomsg =+
  536. read-syms InfoDlg
  537. ui start "Warning"
  538. set CommonStatus = STATUS_USERCANCEL
  539. goto end
  540. ;
  541. ; warning display
  542. ;
  543. warning = +
  544. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  545. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  546. goto ShellCodeError
  547. endif
  548. ifstr(i) $($R1) == "OK"
  549. goto $(to)
  550. else-ifstr(i) $($R1) == "CANCEL"
  551. goto $(from)
  552. else
  553. ; Debug-Msg "Error Error Bad DLGEVENT"
  554. goto "end"
  555. endif
  556. ;
  557. ; non fatal error display
  558. ;
  559. nonfatalinfo = +
  560. Set CommonStatus = STATUS_USERCANCEL
  561. Set Severity = STATUS
  562. goto nonfatalmsg
  563. nonfatal = +
  564. Set Severity = NONFATAL
  565. goto nonfatalmsg
  566. nonfatalmsg = +
  567. ifstr(i) $(Error) == ""
  568. Set Severity = NONFATAL
  569. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  570. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  571. goto ShellCodeError
  572. endif
  573. set Error = $($R0)
  574. endif
  575. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  576. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  577. goto ShellCodeError
  578. endif
  579. ifstr(i) $($R1) == "OK"
  580. goto $(from)
  581. else
  582. goto "end"
  583. endif
  584. ;
  585. ; Registry is broken
  586. ;
  587. fatalregistry = +
  588. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  589. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  590. goto ShellCodeError
  591. endif
  592. set Error = $($R0)
  593. goto fatal
  594. ;
  595. ; fatal error display
  596. ;
  597. fatal = +
  598. ifstr(i) $(Error) == ""
  599. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  600. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  601. goto ShellCodeError
  602. endif
  603. set Error = $($R0)
  604. endif
  605. Ifint $(BillboardVisible) != 0
  606. Shell "subroutn.inf" PopBillboard
  607. Set BillboardVisible = 0
  608. Endif
  609. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  610. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  611. goto ShellCodeError
  612. endif
  613. goto setfailed
  614. ;
  615. ; Shelling error
  616. ;
  617. ShellCodeError = +
  618. set DlgType = "MessageBox"
  619. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  620. set STF_MB_TEXT = $(ShellCodeErrorText)
  621. set STF_MB_TYPE = 1
  622. set STF_MB_ICON = 3
  623. set STF_MB_DEF = 1
  624. ui start "Error Message"
  625. goto setfailed
  626. setfailed = +
  627. set CommonStatus = STATUS_FAILED
  628. ;
  629. ; If OEM_ABANDON_ON, we need to clean up the registry
  630. ;
  631. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  632. set OEM_ABANDON_ON = FALSE
  633. goto removeadapter
  634. endif
  635. goto end
  636. end = +
  637. goto term
  638. term = +
  639. Return $(CommonStatus)
  640. ;***************************************************************
  641. ; Get File Size SECTIONS
  642. ;***************************************************************
  643. [GetFilesSize]
  644. set FileSizeList = ^(Files-TCPPRINT,3)
  645. set TotalSize = 0
  646. ForListDo $(FileSizeList)
  647. Split-String $($) "=" SplitString
  648. set Size = *($(SplitString),3)
  649. set-add TotalSize = $(TotalSize) $(Size)
  650. EndForListDo
  651. set-div SizeInK = $(TotalSize) 1024
  652. return $(SizeInK)
  653. ;***************************************************************
  654. ; INSTALL SECTIONS
  655. ;***************************************************************
  656. [Install-Option]
  657. set STF_VITAL = NO
  658. ifstr(i) $(AddCopy) == "YES"
  659. ;
  660. ; Add the files to the copy list
  661. ;
  662. AddSectionFilesToCopyList Files-IPRIP $(SrcDir) $(!STF_WINDOWSSYSPATH)
  663. endif
  664. ifstr(i) $(DoCopy) == "YES"
  665. ;
  666. ; Copy files in the copy list
  667. ;
  668. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  669. CopyFilesInCopyList
  670. endif
  671. ifstr(i) $(DoConfig) == "YES"
  672. ;
  673. ; Add product to registry
  674. ;
  675. ;
  676. ; Finish up
  677. endif
  678. Exit
  679. [Install-Update]
  680. set STF_VITAL = NO
  681. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  682. ;set STF_VERSION = "YES"
  683. AddSectionFilesToCopyList Files-IPRIP $(SrcDir) $(!STF_WINDOWSSYSPATH)
  684. Exit
  685. [AddIPRIPUsed]
  686. read-syms GeneralConstants
  687. read-syms FileConstants
  688. read-syms FileConstants$(!STF_LANGUAGE)
  689. set KeyName = $($0)
  690. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyService
  691. ifstr(i) $(KeyService) != ""
  692. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName)"\UseRef" $(MAXIMUM_ALLOWED) KeyUseRef
  693. ifstr(i) $(KeyUseRef) == ""
  694. CreateRegKey $(KeyService) {"UseRef",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyUseRef
  695. endif
  696. ifstr(i) $(KeyUseRef) != ""
  697. ;
  698. ; Set up the usage reference
  699. ;
  700. SetRegValue $(KeyUseRef) {$(KeyName),$(NoTitle),$(!REG_VT_SZ),"1"}
  701. CloseRegKey $(KeyUseRef)
  702. endif
  703. CloseRegKey $(KeyService)
  704. else
  705. ; debug-output "error: cannot open product key"
  706. endif
  707. return
  708. [RemoveIPRIPUsed]
  709. read-syms GeneralConstants
  710. read-syms FileConstants
  711. read-syms FileConstants$(!STF_LANGUAGE)
  712. set KeyName = $($0)
  713. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyService
  714. ifstr(i) $(KeyService) != ""
  715. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName)"\UseRef" $(MAXIMUM_ALLOWED) KeyUseRef
  716. ifstr(i) $(KeyUseRef) == ""
  717. CreateRegKey $(KeyService) {"UseRef",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyUseRef
  718. endif
  719. ifstr(i) $(KeyUseRef) != ""
  720. ;
  721. ; Delete the usage reference
  722. ;
  723. DeleteRegValue $(KeyUseRef) $(KeyName)
  724. CloseRegKey $(KeyUseRef)
  725. endif
  726. CloseRegKey $(KeyService)
  727. else
  728. ; debug-output "error: cannot open product key"
  729. endif
  730. return
  731. [NumOfUsed]
  732. read-syms GeneralConstants
  733. read-syms FileConstants
  734. read-syms FileConstants$(!STF_LANGUAGE)
  735. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyService
  736. ifstr(i) $(KeyService) != ""
  737. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName)"\UseRef" $(MAXIMUM_ALLOWED) KeyUseRef
  738. ifstr(i) $(KeyUseRef) == ""
  739. CreateRegKey $(KeyService) {"UseRef",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyUseRef
  740. endif
  741. ifstr(i) $(KeyUseRef) != ""
  742. ;
  743. ; enumerate the usage reference
  744. ;
  745. EnumRegValue $(KeyUseRef) UsageList
  746. set Num = 0
  747. ForListDo $(UsageList)
  748. set-add Num = $(Num), 1
  749. EndForListDo
  750. CloseRegKey $(KeyUseRef)
  751. endif
  752. CloseRegKey $(KeyService)
  753. else
  754. ; debug-output "error: cannot open product key"
  755. endif
  756. return $(Num)
  757. [FindUsed]
  758. read-syms GeneralConstants
  759. read-syms FileConstants
  760. read-syms FileConstants$(!STF_LANGUAGE)
  761. set KeyName = $($0)
  762. set Find = FALSE
  763. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyService
  764. ifstr(i) $(KeyService) != ""
  765. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName)"\UseRef" $(MAXIMUM_ALLOWED) KeyUseRef
  766. ifstr(i) $(KeyUseRef) == ""
  767. CreateRegKey $(KeyService) {"UseRef",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyUseRef
  768. endif
  769. ifstr(i) $(KeyUseRef) != ""
  770. ;
  771. ; Find the vairable
  772. ;
  773. GetRegValue $(KeyUseRef),$(KeyName), KeyInfo
  774. ifstr(i) $(RegLastError) == $(!REG_ERROR_SUCCESS)
  775. set Find = TRUE
  776. endif
  777. CloseRegKey $(KeyUseRef)
  778. endif
  779. CloseRegKey $(KeyService)
  780. else
  781. ; debug-output "error: cannot open product key"
  782. endif
  783. return $(Find)