Leaked source code of windows server 2003
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.

60 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} . "\\PostBuildScripts";
  17. use lib $ENV{RAZZLETOOLPATH};
  18. use PbuildEnv;
  19. use ParseArgs;
  20. use IO::File;
  21. use SymDelegate;
  22. use Logmsg;
  23. my ($FileName, $DDFDir, $Type, $DestDir);
  24. parseargs(
  25. '?' => \&Usage,
  26. 'f:' => \$FileName,
  27. 's:' => \$DDFDir,
  28. 't:' => \$Type,
  29. 'd:' => \$DestDir
  30. );
  31. logmsg("Calling SymCab()");
  32. &SymCab;
  33. sub SymCab {
  34. logmsg("Attempting to chdir ($DDFDir)");
  35. chdir($DDFDir);
  36. if ( -e $DDFDir && -d $DDFDir ) {
  37. logmsg("chdir was successful ($DDFDir)");
  38. } else {
  39. logmsg("chdir was failed ($DDFDir)");
  40. }
  41. if (uc$Type eq 'CAT') {
  42. logmsg("Starting $FileName\.CAT");
  43. system("makecat -n -v $DDFDir\\$FileName\.CDF > $DDFDir\\$FileName\.CAT\.LOG");
  44. system("copy $DDFDir\\$FileName\.CAT $DestDir\\$FileName\.CAT");
  45. } else {
  46. logmsg("Starting $FileName\.CAB");
  47. system("makecab.exe /f $DDFDir\\$FileName\.DDF > $DDFDir\\$FileName\.CAB\.LOG");
  48. }
  49. }
  50. sub mymsg {
  51. my ($fh, $msg);
  52. logmsg $msg . "\n";
  53. print $fh $msg . "\n";
  54. }