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.

35 lines
841 B

  1. use strict;
  2. # failed attempt at a auto-newver script, keeping for future reference
  3. my( $SdxRoot, $NtVerpFile, @NtVerpLines, $NtVerpLine, $Return );
  4. $SdxRoot = $ENV{ "SDXROOT" };
  5. #$NtVerpFile = "$SdxRoot\\Published\\sdk\\inc\\ntverp.h";
  6. $NtVerpFile = "D\:\\tests\\ntverp\.h";
  7. unless ( open( INFILE, "$NtVerpFile" ) ) {
  8. print( "Failed to open ntverp.h, exiting.\n" );
  9. exit( 1 );
  10. }
  11. @NtVerpLines = <INFILE>;
  12. close( INFILE );
  13. $Return = system( "echo sd edit $NtVerpFile" );
  14. unless ( open( OUTFILE, ">$NtVerpFile" ) ) {
  15. print( "Failed to open ntverp.h for writing, exiting.\n" );
  16. exit( 1 );
  17. }
  18. foreach $NtVerpLine ( @NtVerpLines ) {
  19. if ( $NtVerpLine =~ /^\#define VER_PRODUCTBUILD \/\* NT \*\/ (....)$/ ) {
  20. $NtVerpLine =~ s/$1/$ARGV[0]/;
  21. }
  22. print( OUTFILE $NtVerpLine );
  23. }
  24. close( OUTFILE );
  25. exit;