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.

61 lines
1.4 KiB

  1. @rem ='
  2. @echo off
  3. REM ------------------------------------------------------------------
  4. REM
  5. REM <<template_script.cmd>>
  6. REM <<purpose of this script>>
  7. REM
  8. REM Copyright (c) Microsoft Corporation. All rights reserved.
  9. REM
  10. REM ------------------------------------------------------------------
  11. perl -x "%~f0" %*
  12. goto :EOF
  13. rem ';
  14. #!perl
  15. use strict;
  16. use lib $ENV{RAZZLETOOLPATH} . "\\sp";
  17. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  18. use lib $ENV{RAZZLETOOLPATH};
  19. use PbuildEnv;
  20. use ParseArgs;
  21. use IO::File;
  22. use Delegate;
  23. use Logmsg;
  24. my ($FileName, $DDFDir, $Type, $DestDir);
  25. parseargs(
  26. '?' => \&Usage,
  27. 'f:' => \$FileName,
  28. 's:' => \$DDFDir,
  29. 't:' => \$Type,
  30. 'd:' => \$DestDir
  31. );
  32. logmsg("Calling SymCab()");
  33. &SymCab;
  34. sub SymCab {
  35. logmsg("Attempting to chdir ($DDFDir)");
  36. chdir($DDFDir);
  37. if ( -e $DDFDir && -d $DDFDir ) {
  38. logmsg("chdir was successful ($DDFDir)");
  39. } else {
  40. logmsg("chdir was failed ($DDFDir)");
  41. }
  42. if (uc$Type eq 'CAT') {
  43. logmsg("Starting $FileName\.CAT");
  44. system("makecat -n -v $DDFDir\\$FileName\.CDF > $DDFDir\\$FileName\.CAT\.LOG");
  45. system("copy $DDFDir\\$FileName\.CAT $DestDir\\$FileName\.CAT");
  46. } else {
  47. logmsg("Starting $FileName\.CAB");
  48. system("makecab.exe /f $DDFDir\\$FileName\.DDF > $DDFDir\\$FileName\.CAB\.LOG");
  49. }
  50. }
  51. sub mymsg {
  52. my ($fh, $msg);
  53. logmsg $msg . "\n";
  54. print $fh $msg . "\n";
  55. }