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.

72 lines
2.3 KiB

  1. ' MAKEBLDNUM.VBS
  2. ' This script generates a file to be included with in setver.h, setting the build number
  3. ' based on the current date. If the build is running in 2000, 12 will be added to the
  4. ' month (the January builds will be 13xx); if in 2001, 24 is added, and so forth.
  5. ' This section does the date calculations to come up with the number.
  6. On Error Resume Next
  7. BuildMonth = Month(Date) + ((Year(Date) - 2000) * 12)
  8. BuildDay = Day(Date)
  9. BuildNum = ""
  10. if BuildMonth <= 9 then
  11. BuildNum = BuildNum & "0"
  12. end if
  13. BuildNum = BuildNum & BuildMonth
  14. if BuildDay <= 9 then
  15. BuildNum = BuildNum & "0"
  16. end if
  17. BuildNum = BuildNum & BuildDay
  18. ' This section sets the third node of the build number to '00' if this script is run by
  19. ' the official builder, or '01' if this is a private build.
  20. set WshShell = CreateObject("WScript.Shell")
  21. domain = WshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
  22. if domain <> "REDMOND" then
  23. BuildNum = 1518
  24. end if
  25. ' Would like the Tablet test builds also to have the same build number
  26. ' as the NT bld labs building with NTDEV will have.
  27. IsTabletBldEnv = WshShell.ExpandEnvironmentStrings("%SDTABROOT%")
  28. if IsTabletBldEnv <> "%SDTABROOT%" then
  29. BuildNum = 1518
  30. end if
  31. BuildType = "00"
  32. ' This section creates the include file.
  33. set oFS = CreateObject("Scripting.FileSystemObject")
  34. set file = oFS.CreateTextFile("setup\installer\currver.inc", True)
  35. file.WriteLine "// This file is generated, DO NOT EDIT"
  36. lineout = "#define VERSION ""6.0." & BuildNum & "." & BuildType & """"
  37. file.WriteLine(lineout)
  38. lineout = "#define VER_FILEVERSION_STR ""6.0." & BuildNum & "." & BuildType & " """
  39. file.WriteLine(lineout)
  40. lineout = "#define VER_FILEVERSION 6,0," & BuildNum & "," & BuildType
  41. file.WriteLine(lineout)
  42. lineout = "#define VER_PRODUCTVERSION_STR ""6.0." & BuildNum & "." & BuildType & " """
  43. file.WriteLine(lineout)
  44. lineout = "#define VER_PRODUCTVERSION 6,0," & BuildNum & "," & BuildType
  45. file.WriteLine(lineout)
  46. file.Close
  47. if err.number = 0 then
  48. wscript.echo "Updated version with build number " & BuildNum & "."
  49. if BuildType = "01" then
  50. wscript.echo "NOTE: This is a private build and will not be copied to the buildshare."
  51. end if
  52. else
  53. wscript.echo "makebldnum.vbs completed with ERRORS!"
  54. end if
  55. if err.number = 0 then
  56. wscript.quit BuildNum
  57. else
  58. wscript.quit -1
  59. end if