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.

88 lines
1.7 KiB

  1. $PLATFORMS=$ARGV[1];
  2. $INTLDIR=$ARGV[2]."\\";
  3. $TRANSFORMDIR=$ARGV[3]."\\";
  4. $IGNORELANGID=$ENV{'IGNORELANGID'};
  5. $COMMAND="dir /x /b ".$INTLDIR."\\inst*.msi |";
  6. #print $COMMAND,"\n";
  7. open(FIND, $COMMAND);
  8. #building from the english database.
  9. $LANGIDLIST="1033,";
  10. FILE:
  11. while ($_ = <FIND>)
  12. {
  13. tr/A-Z/a-z/; # canonicalize to lower case
  14. # only take inst####.msi files
  15. if (/inst[0-9][0-9][0-9][0-9]/) {
  16. print $_;
  17. $filename = $_;
  18. s/\n$//;
  19. s/inst//;
  20. s/\.msi//;
  21. $LANGID=$_;
  22. # generate the transform
  23. $COMMAND = "msitran.exe -g ".$INTLDIR."inst1033.msi ".$INTLDIR.$filename." ".$TRANSFORMDIR.$LANGID." d";
  24. print $COMMAND."\n";
  25. system($COMMAND);
  26. $RETURN =$? / 256;
  27. if ($RETURN==0)
  28. {
  29. print "\n";
  30. $LANGIDLIST .= $LANGID.",";
  31. # read the transform into the database.
  32. $COMMAND = "msidb -d ".$ARGV[0]." -r ".$TRANSFORMDIR.$LANGID;
  33. print $COMMAND."\n";
  34. system($COMMAND);
  35. }
  36. else
  37. {
  38. if ($RETURN==232)
  39. {
  40. print "Skipping identical transforms.\n";
  41. }
  42. else
  43. {
  44. if ($RETURN==110)
  45. {
  46. print "Error: LANGID ".$LANGID." unsupported on this machine.\n";
  47. }
  48. else
  49. {
  50. print "Unknown error -- transform not included in database.\n";
  51. }
  52. $UNSUPPORTEDLANGIDLIST .= $LANGID.",";
  53. }
  54. }
  55. }
  56. next FILE;
  57. }
  58. $LANGIDLIST =~ s/,$//; # remove the trailing comma
  59. $UNSUPPORTEDLANGIDLIST =~ s/,$//; # remove the trailing comma
  60. #!! set the property stream.
  61. $COMMAND = "msiinfo ".$ARGV[0]." /p ".$PLATFORMS.";".$LANGIDLIST;
  62. print $COMMAND,"\n";
  63. system($COMMAND);
  64. if ($UNSUPPORTEDLANGIDLIST != "")
  65. {
  66. $ERROR = "The following LangIDs could not be built: ".$UNSUPPORTEDLANGIDLIST."\n";
  67. if ($IGNORELANGID != "")
  68. {
  69. print "Warning: ".$ERROR;
  70. }
  71. else
  72. {
  73. die ("Error: ".$ERROR, -1);
  74. }
  75. }