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.

126 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/TargetWIN9XVers=F/g)
  33. {
  34. print OUTPUT sprintf( "TargetWIN9XVers=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\\nt50redist.dat";
  50. open(REDISTFILES,$Path) || die "$BuildErrorMsg Unable to open nt50redist.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")?(($SubPath=~m/Win9X/i)?$SubPath."\\".$LocalizedDirectory:$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 ($Filters=~m/SWITCHFILED/i)
  85. {
  86. if (($BuildType ne "" && $BuildType ne "ntsdnodbg") || ($CabType=~/core/i && $Language eq "eng")) {
  87. print OUTPUT sprintf( "%s\\%s=\n",$SubPath,$FileName);
  88. }
  89. } else {
  90. print OUTPUT sprintf( "%s\\%s=\n",$SubPath,$FileName);
  91. }
  92. }
  93. }
  94. }
  95. if($PackOption=~m/W\/BDA/i) {
  96. $BDACAB=$NTTree."\\cabpack\\bdant.cab";
  97. if (!(-e $BDACAB)) {
  98. die "nmake : error : can not find the file to pack: $BDACAB";
  99. }
  100. print OUTPUT ("[SourceFiles1]\n");
  101. print OUTPUT sprintf( "cabpack\\bdant.cab=\n");
  102. }
  103. #print OUTPUT sprintf( "[SourceFiles1]\n");
  104. #print OUTPUT sprintf( "$CatName=\n");
  105. close (OUTPUT);
  106. close (REDISTFILES);
  107. exit;