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.

218 lines
5.4 KiB

  1. ;-----------------------------------------------------------------------
  2. ; OPTION TYPE
  3. ; -----------
  4. ; This identifies the Option type we are dealing with. The different
  5. ; possible types are:
  6. ;
  7. ; COMPUTER, VIDEO, POINTER, KEYBOARD, LAYOUT, LANGUAGE, SCSI, PRINTER, ...
  8. ;-----------------------------------------------------------------------
  9. [Identification]
  10. OptionType = COMPUTER
  11. ;-----------------------------------------------------------------------
  12. ; LANGUAGES SUPPORTED
  13. ; -------------------
  14. ;
  15. ; The languages supported by the OEM INF, For every language supported
  16. ; we need to have a separate text section for every displayable text
  17. ; section.
  18. ;
  19. ;-----------------------------------------------------------------------
  20. [LanguagesSupported]
  21. ENG
  22. ;-----------------------------------------------------------------------
  23. ; OPTION LIST
  24. ; -----------
  25. ; This section lists the OEM Option key names. These keys are locale
  26. ; independent and used to represent the option in a locale independent
  27. ; manner.
  28. ;
  29. ;-----------------------------------------------------------------------
  30. [Options]
  31. Option1
  32. Option2
  33. ;-----------------------------------------------------------------------
  34. ; OPTION TEXT SECTION
  35. ; -------------------
  36. ; These are text strings used to identify the option to the user. There
  37. ; are separate sections for each language supported. The format of the
  38. ; section name is "OptionsText" concatenated with the Language represented
  39. ; by the section.
  40. ;
  41. ;-----------------------------------------------------------------------
  42. [OptionsTextENG]
  43. Option1 = "Computer Option 1"
  44. Option2 = "Computer Option 2"
  45. ;---------------------------------------------------------------------------
  46. ; 1. Identify
  47. ;
  48. ; DESCRIPTION: To verify that this INF deals with the same type of options
  49. ; as we are choosing currently.
  50. ;
  51. ; INPUT: None
  52. ;
  53. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  54. ; $($R1): Option Type (COMPUTER ...)
  55. ; $($R2): Diskette description
  56. ;---------------------------------------------------------------------------
  57. [Identify]
  58. ;
  59. ;
  60. read-syms Identification
  61. set Status = STATUS_SUCCESSFUL
  62. set Identifier = $(OptionType)
  63. set Media = #("Source Media Descriptions", 1, 1)
  64. Return $(Status) $(Identifier) $(Media)
  65. ;------------------------------------------------------------------------
  66. ; 2. ReturnOptions:
  67. ;
  68. ; DESCRIPTION: To return the option list supported by this INF and the
  69. ; localised text list representing the options.
  70. ;
  71. ;
  72. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  73. ;
  74. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  75. ; STATUS_NOLANGUAGE
  76. ; STATUS_FAILED
  77. ;
  78. ; $($R1): Option List
  79. ; $($R2): Option Text List
  80. ;------------------------------------------------------------------------
  81. [ReturnOptions]
  82. ;
  83. ;
  84. set Status = STATUS_FAILED
  85. set OptionList = {}
  86. set OptionTextList = {}
  87. ;
  88. ; Check if the language requested is supported
  89. ;
  90. set LanguageList = ^(LanguagesSupported, 1)
  91. Ifcontains(i) $($0) in $(LanguageList)
  92. goto returnoptions
  93. else
  94. set Status = STATUS_NOLANGUAGE
  95. goto finish_ReturnOptions
  96. endif
  97. ;
  98. ; form a list of all the options and another of the text representing
  99. ;
  100. returnoptions = +
  101. set OptionList = ^(Options, 1)
  102. set OptionTextList = ^(OptionsText$($0), 1)
  103. set Status = STATUS_SUCCESSFUL
  104. finish_ReturnOptions = +
  105. Return $(Status) $(OptionList) $(OptionTextList)
  106. ;
  107. ; InstallOption:
  108. ;
  109. ; FUNCTION: To copy files representing OEM Options
  110. ; To configure the installed option
  111. ; To update the registry for the installed option
  112. ;
  113. ; INPUT: $($0): Language to use
  114. ; $($1): OptionID to install
  115. ; $($2): SourceDirectory
  116. ; $($3): AddCopy (YES | NO)
  117. ; $($4): DoCopy (YES | NO)
  118. ; $($5): DoConfig (YES | NO)
  119. ;
  120. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  121. ; STATUS_NOLANGUAGE |
  122. ; STATUS_USERCANCEL |
  123. ; STATUS_FAILED
  124. ;
  125. [InstallOption]
  126. ;
  127. ; Set default values for
  128. ;
  129. set Status = STATUS_FAILED
  130. ;
  131. ; extract parameters
  132. ;
  133. set Option = $($1)
  134. set SrcDir = $($2)
  135. set AddCopy = $($3)
  136. set DoCopy = $($4)
  137. set DoConfig = $($5)
  138. ;
  139. ; Check if the language requested is supported
  140. ;
  141. set LanguageList = ^(LanguagesSupported, 1)
  142. Ifcontains(i) $($0) in $(LanguageList)
  143. goto installoption
  144. else
  145. set Status = STATUS_NOLANGUAGE
  146. goto finish_InstallOption
  147. endif
  148. installoption = +
  149. ;
  150. ; Code to add files to copy list
  151. ;
  152. install Install-Option
  153. ifstr(i) $(STATUS) == STATUS_FAILED
  154. goto finish_InstallOption
  155. else
  156. set Status = STATUS_SUCCESSFUL
  157. endif
  158. finish_InstallOption = +
  159. Return $(Status)
  160. [Install-Option]
  161. ifstr(i) $(AddCopy) == "YES"
  162. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)
  163. endif
  164. ifstr(i) $(DoCopy) == "YES"
  165. ;
  166. ; Copy files in the copy list
  167. ;
  168. CopyFilesInCopyList
  169. endif
  170. ifstr(i) $(DoConfig) == "YES"
  171. ;
  172. ; Add product to registry
  173. ;
  174. ;
  175. ; Finish up
  176. endif
  177. exit