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.

125 lines
3.5 KiB

  1. $Language=$ARGV[0];
  2. $SedName=$ARGV[1];
  3. $CatName=$ARGV[2];
  4. $OutputPath=$ARGV[3];
  5. $DefaultLanguage=$ARGV[4];
  6. $MakeSedNamed=$ARGV[5];
  7. $LocalizedRoot=$ARGV[6];
  8. $CabType=$ARGV[7];
  9. $PackOption=$ARGV[8];
  10. $RootDir=lc($ENV{DXROOT});
  11. $BuildType=$ENV{NTDEBUG};
  12. $NTTree=$ENV{_NTTREE};
  13. $TouchedCommonDirRoot=$ENV{DXROOT}."\\DeliveryImages\\CabPacks\\temp";
  14. $BuildErrorMsg="nmake : error GENSED : ";
  15. $RootDir=$ENV{DXROOT};
  16. $LocalizedDirectory = "$LocalizedRoot\\$Language";
  17. $MultiLocalizedDirectory=$LocalizedRoot."\\multi";
  18. $ExtraPath = (-e ".\\$Language.txt")?".\\$Language.txt":"..\\$DefaultLanguage\\$DefaultLanguage.txt";
  19. $SedPath = (-e ".\\sed$Language.txt")?".\\sed$Language.txt":"..\\$DefaultLanguage\\sed$DefaultLanguage.txt";
  20. $Path="$OutputPath\\$MakeSedNamed.sed";
  21. open(OUTPUT,">$Path") || die "$BuildErrorMsg Unable to open ".$Path." for output\n";
  22. $Path = ".\\".$SedName;
  23. open(MASTERSED,$Path) || die "$BuildErrorMsg Unable to open master sed file ".$Path." for input\n";
  24. @MasterSed = <MASTERSED>;
  25. close (MASTERSED);
  26. open(SEDTEXT,$SedPath) || die "$BuildErrorMsg Unable to open sed file at".$SedPath." for input\n";
  27. @SedText = <SEDTEXT>;
  28. close (SEDTEXT);
  29. foreach (@MasterSed)
  30. {
  31. $SedLine= $_;
  32. if (m/TargetNTVers=F/g)
  33. {
  34. print OUTPUT sprintf( "TargetNTVers=0: %s\n", $SedText[0]);
  35. }
  36. elsif (m/MultiInstanceChk=E/g)
  37. {
  38. print OUTPUT sprintf( "MultiInstanceChk=B, %s", $SedText[1]);
  39. }
  40. else
  41. {
  42. print OUTPUT $_;
  43. }
  44. }
  45. $Path="$RootDir\\public\\sdk\\lib\\placefil.txt";
  46. open(PLACEFIL, $Path) || die "$BuildErrorMsg Unable to open placefil.txt at ".$Path." for input\n";
  47. @LocalizedFiles =grep(m/;localize/, <PLACEFIL>);
  48. close (PLACEFIL);
  49. $Path=$RootDir."\\DeliveryImages\\inc\\redistfiles.dat";
  50. open(REDISTFILES,$Path) || die "$BuildErrorMsg Unable to open redistfiles.dat at ".$Path." for input\n";
  51. foreach (<REDISTFILES>)
  52. {
  53. if (!(m/;/i))
  54. {
  55. ($FileName, $SubPath, $TimeDateStamp, $Filters) = split /,/,$_,4;
  56. $FileName=~s/^\s*(.*?)\s*$/$1/;
  57. $SubPath=~s/^\s*(.*?)\s*$/$1/;
  58. $Filters=~s/^\s*(.*?)\s*$/$1/;
  59. if (grep(m/$FileName/i, @LocalizedFiles))
  60. {
  61. # if ($Filters=~m/SINGLELANGUAGE/ig)
  62. if (!($Language eq "eng" && $FileName eq "dxdiag.exe"))
  63. {
  64. $SubPath=($Language ne "eng")?$LocalizedDirectory:$SubPath;
  65. } else {
  66. $SubPath=$MultiLocalizedDirectory;
  67. }
  68. }
  69. if ($FileName=~m/\.cat/i) {
  70. $SubPath=$SubPath."\\".$Language;
  71. }
  72. if ($Language ne "multi" && ($FileName=~m/\.chm/i || $FileName=~m/\.hlp/i)) {
  73. if ($FileName=~m/\.chm/i) {
  74. $HelpFile = "dxdia".$Language.".chm";
  75. } else {
  76. $HelpFile = "dijoy".$Language.".hlp";
  77. }
  78. if ($FileName eq "dxdiag.chm" || $FileName eq "dijoy.hlp" || $FileName eq $HelpFile) {
  79. print OUTPUT sprintf( "%s\\%s=\n",$SubPath,$FileName);
  80. }
  81. }
  82. elsif ($Filters!~m/nocab/i || $CabType!~m/core/i)
  83. {
  84. if($PackOption!~/NoDLS/i || ($FileName!~m/gm16\.dls/i && $FileName!~m/gmreadme\.txt/i)) {
  85. if ($Filters=~m/SWITCHFILED/i)
  86. {
  87. if (($BuildType ne "" && $BuildType ne "ntsdnodbg") || ($CabType=~/core/i && $Language eq "eng")) {
  88. print OUTPUT sprintf( "%s\\%s=\n",$SubPath,$FileName);
  89. }
  90. } else {
  91. print OUTPUT sprintf( "%s\\%s=\n",$SubPath,$FileName);
  92. }
  93. }
  94. }
  95. }
  96. }
  97. if($PackOption=~m/W\/BDA/i) {
  98. $BDACAB=$NTTree."\\cabpack\\bda.cab";
  99. if (!(-e $BDACAB)) {
  100. die "nmake : error : can not find the file to pack: $BDACAB";
  101. }
  102. print OUTPUT ("[SourceFiles1]\n");
  103. print OUTPUT sprintf( "cabpack\\bda.cab=\n");
  104. }
  105. close (OUTPUT);
  106. close (REDISTFILES);
  107. exit;