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.

64 lines
2.1 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) - 1998) * 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 = 4111
  24. end if
  25. BuildType = "00"
  26. ' This section creates the include file.
  27. set oFS = CreateObject("Scripting.FileSystemObject")
  28. set file = oFS.CreateTextFile("setup\installer\currver.inc", True)
  29. file.WriteLine "// This file is generated, DO NOT EDIT"
  30. lineout = "#define VERSION ""5.1." & BuildNum & "." & BuildType & """"
  31. file.WriteLine(lineout)
  32. lineout = "#define VER_FILEVERSION_STR ""5.1." & BuildNum & "." & BuildType & " """
  33. file.WriteLine(lineout)
  34. lineout = "#define VER_FILEVERSION 5,1," & BuildNum & "," & BuildType
  35. file.WriteLine(lineout)
  36. lineout = "#define VER_PRODUCTVERSION_STR ""5.1." & BuildNum & "." & BuildType & " """
  37. file.WriteLine(lineout)
  38. lineout = "#define VER_PRODUCTVERSION 5,1," & BuildNum & "," & BuildType
  39. file.WriteLine(lineout)
  40. file.Close
  41. if err.number = 0 then
  42. wscript.echo "Updated version with build number " & BuildNum & "."
  43. if BuildType = "01" then
  44. wscript.echo "NOTE: This is a private build and will not be copied to the buildshare."
  45. end if
  46. else
  47. wscript.echo "makebldnum.vbs completed with ERRORS!"
  48. end if
  49. if err.number = 0 then
  50. wscript.quit BuildNum
  51. else
  52. wscript.quit -1
  53. end if