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.

249 lines
6.5 KiB

  1. # ---------------------------------------------------------------------------
  2. # Script: muiwhistler.pl
  3. #
  4. # (c) 2000 Microsoft Corporation. All rights reserved.
  5. #
  6. # Purpose: This is the top level mui build script.
  7. #
  8. # Version: 1.00 (8/1/2000) : (dmiura) Inital port from pseudoloc process to Whistler
  9. #---------------------------------------------------------------------
  10. # Set Package
  11. package muiwhistler;
  12. # Set the script name
  13. $ENV{script_name} = 'muiwhistler.pl';
  14. # Set version
  15. $VERSION = '1.00';
  16. # Set required perl version
  17. require 5.003;
  18. # Use section
  19. use lib $ENV{ "RazzleToolPath" };
  20. use lib $ENV{ "RazzleToolPath" } . "\\PostBuildScripts";
  21. use GetParams;
  22. use LocalEnvEx;
  23. use Logmsg;
  24. use strict;
  25. no strict 'vars';
  26. use muimake;
  27. # Require section
  28. require Exporter;
  29. # Global variable section
  30. sub Main {
  31. # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  32. # Begin Main code section
  33. # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  34. # Return when you want to exit on error
  35. # <Implement your code here>
  36. if (!&VerifyEnvironment()) {
  37. logmsg("MUI Step A: The environment is invalid.");
  38. return 0;
  39. }
  40. if (!&PostBuild()) {
  41. errmsg("MUI Step 3: Postbuild failed.");
  42. return 0;
  43. }
  44. return 1;
  45. # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  46. # End Main code section
  47. # /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  48. }
  49. # <Implement your subs here>
  50. sub VerifyEnvironment {
  51. if ($lang=~/usa/i) {
  52. logmsg("MUI is not created for the $lang language.");
  53. return 0;
  54. }
  55. if ($ENV{_BuildType} =~ /^chk$/i) {
  56. wrnmsg ("This does not run on chk machines");
  57. return 0;
  58. }
  59. # if ($lang=~/psu/i || $LANG=~/gb/i || $LANG=~/ca/i)
  60. # {
  61. # $_NTPOSTBLD="$ENV{_NTPostBld_Bak}";
  62. # }
  63. # logmsg ("Reset _NTPostBld for PSU to $_NTPOSTBLD");
  64. logmsg ("Step A: MUI Environment verification succeeded.");
  65. return 1;
  66. }
  67. sub PostBuild {
  68. logmsg ("**********************************************************");
  69. logmsg ("Step 3: Perform MUI Post Build");
  70. logmsg ("**********************************************************");
  71. if ($force) {
  72. $forceflag = "-f";
  73. } else {
  74. $forceflag = "";
  75. }
  76. # if ($lang=~/psu/i) {
  77. # logmsg ("Building mui for psu...using CA as the mui language for postbuild.");
  78. # logmsg ("perl $ENV{RazzleToolPath}\\PostBuildScripts\\muimake.pm $forceflag -l ca");
  79. # system ("perl $ENV{RazzleToolPath}\\PostBuildScripts\\muimake.pm $forceflag -l ca");
  80. # }
  81. # if ($lang!~/psu/i) {
  82. logmsg ("perl $ENV{RazzleToolPath}\\PostBuildScripts\\muimake.pm $forceflag -l $lang");
  83. system ("perl $ENV{RazzleToolPath}\\PostBuildScripts\\muimake.pm $forceflag -l $lang");
  84. if(-e "$ENV{RazzleToolPath}\\PostBuildScripts\\muimsi.pm") {
  85. logmsg ("perl $ENV{RazzleToolPath}\\PostBuildScripts\\muimsi.pm -l $lang");
  86. system ("perl $ENV{RazzleToolPath}\\PostBuildScripts\\muimsi.pm -l $lang");
  87. }
  88. # }
  89. logmsg ("Step 3: MUI Post build succeeded.");
  90. return 1;
  91. }
  92. sub ValidateParams {
  93. #<Add your code for validating the parameters here>
  94. }
  95. # <Add your usage here>
  96. sub Usage {
  97. print <<USAGE;
  98. Purpose of program
  99. Usage: $0 [-f][-l lang]
  100. -f Force
  101. -l Language
  102. -? Displays usage
  103. Example:
  104. $0 -l jpn
  105. USAGE
  106. }
  107. sub GetParams {
  108. # Step 1: Call pm getparams with specified arguments
  109. &GetParams::getparams(@_);
  110. # Step 2: Set the language into the enviroment
  111. $ENV{lang}=$lang;
  112. # Step 3: Call the usage if specified by /?
  113. if ($HELP) {
  114. &Usage();
  115. exit 1;
  116. }
  117. }
  118. # Cmd entry point for script.
  119. if (eval("\$0 =~ /" . __PACKAGE__ . "\\.pl\$/i")) {
  120. # Step 1: Parse the command line
  121. # <run perl.exe GetParams.pm /? to get the complete usage for GetParams.pm>
  122. &GetParams ('-o', 'fl:', '-p', 'force lang', @ARGV);
  123. # Include local environment extensions
  124. &LocalEnvEx::localenvex('initialize');
  125. # Set lang from the environment
  126. $lang=$ENV{lang};
  127. # Validate the option given as parameter.
  128. &ValidateParams;
  129. # Step 4: Call the main function
  130. &muiwhistler::Main();
  131. # End local environment extensions.
  132. &LocalEnvEx::localenvex('end');
  133. }
  134. # -------------------------------------------------------------------------------------------
  135. # Script: template_script.pl
  136. # Purpose: Template perl perl script for the NT postbuild environment
  137. # SD Location: %sdxroot%\tools\postbuildscripts
  138. #
  139. # (1) Code section description:
  140. # CmdMain - Developer code section. This is where your work gets done.
  141. # <Implement your subs here> - Developer subs code section. This is where you write subs.
  142. #
  143. # (2) Reserved Variables -
  144. # $ENV{HELP} - Flag that specifies usage.
  145. # $ENV{lang} - The specified language. Defaults to USA.
  146. # $ENV{logfile} - The path and filename of the logs file.
  147. # $ENV{logfile_bak} - The path and filename of the logfile.
  148. # $ENV{errfile} - The path and filename of the error file.
  149. # $ENV{tmpfile} - The path and filename of the temp file.
  150. # $ENV{errors} - The scripts errorlevel.
  151. # $ENV{script_name} - The script name.
  152. # $ENV{_NTPostBld} - Abstracts the language from the files path that
  153. # postbuild operates on.
  154. # $ENV{_NTPostBld_Bak} - Reserved support var.
  155. # $ENV{_temp_bak} - Reserved support var.
  156. #
  157. # (3) Reserved Subs -
  158. # Usage - Use this sub to discribe the scripts usage.
  159. # ValidateParams - Use this sub to verify the parameters passed to the script.
  160. #
  161. # (4) Call other executables or command scripts by using:
  162. # system "foo.exe";
  163. # Note that the executable/script you're calling with system must return a
  164. # non-zero value on errors to make the error checking mechanism work.
  165. #
  166. # Example
  167. # if (system("perl.exe foo.pl -l $lang")){
  168. # errmsg("perl.exe foo.pl -l $lang failed.");
  169. # # If you need to terminate function's execution on this error
  170. # goto End;
  171. # }
  172. #
  173. # (5) Log non-error information by using:
  174. # logmsg "<log message>";
  175. # and log error information by using:
  176. # errmsg "<error message>";
  177. #
  178. # (6) Have your changes reviewed by a member of the US build team (ntbusa) and
  179. # by a member of the international build team (ntbintl).
  180. #
  181. # -------------------------------------------------------------------------------------------
  182. =head1 NAME
  183. B<mypackage> - What this package for
  184. =head1 SYNOPSIS
  185. <An code example how to use>
  186. =head1 DESCRIPTION
  187. <Use above example to describe this package>
  188. =head1 INSTANCES
  189. =head2 <myinstances>
  190. <Description of myinstances>
  191. =head1 METHODS
  192. =head2 <mymathods>
  193. <Description of mymathods>
  194. =head1 SEE ALSO
  195. <Some related package or None>
  196. =head1 AUTHOR
  197. <Your Name <your e-mail address>>
  198. =cut
  199. 1;