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.

40 lines
1.4 KiB

  1. require Build;
  2. $copyright = "� 1995-2000, Mission Critical Software, Inc.";
  3. while ($_ = $ARGV[0], /^-/) {
  4. shift;
  5. last if /^--$/;
  6. /^-version:(.*)/i && ($version = $1);
  7. /^-company:(.*)/i && ($company = $1);
  8. /^-copyright:(.*)/i && ($copyright = $1);
  9. /^-productname:(.*)/i && ($productname = $1);
  10. /^-projectfile:(.*)/i && ($projectfile = $1);
  11. /^-targetdir:(.*)/i && ($targetroot = $1);
  12. }
  13. ($version && $projectfile && $targetroot) ||
  14. die "Usage: UpdateVersion.pl -Version:<1,0,0,1> -ProjectFile:<Project INI File> -TargetDir:<Target Root Directory> [-Company:<Company Name>] [-Copyright:<Copyright>] [-ProductName:<Product Name>]\n";
  15. open (FILE, $projectfile) || die "Error opening $projectfile: $!.\n";
  16. while (<FILE>) {
  17. /^\[(.*)\]/ && ($projectname = $1);
  18. if ( $projectname ) {
  19. /^Directory=(.*)/i && ($directory{$projectname} = $1);
  20. if ( /^VersionResource=(.*)/i ) {
  21. @versionfiles = split( ",", $1 );
  22. for ( $index = 0; $versionfiles[$index]; $index++ ) {
  23. $version{"$directory{$projectname}\\$versionfiles[$index]"} = $version;
  24. }
  25. }
  26. }
  27. }
  28. close FILE;
  29. print "\n";
  30. foreach $versionfile (sort keys %version) {
  31. $targetfile = "$targetroot\\$versionfile";
  32. print "Updating $targetfile to version number $version{$versionfile}...\n";
  33. &Build::SetVersionResource( $version{$versionfile}, $productname, $company, $copyright, $targetfile );
  34. }
  35. exit 0;