diff projects/determineversion.vbs @ 16626:26f234f699a1 draft

(svn r21356) -Fix (r21351): sometimes versions wouldn't be correctly set for Windows builds
author rubidium <rubidium@openttd.org>
date Tue, 30 Nov 2010 12:02:19 +0000 (2010-11-30)
parents 0a728d98d51e
children dd473f691ea9
line wrap: on
line diff
--- a/projects/determineversion.vbs
+++ b/projects/determineversion.vbs
@@ -86,7 +86,7 @@
 End Function
 
 Function DetermineSVNVersion()
-	Dim WshShell, version, branch, modified, revision, url, oExec, line, hash
+	Dim WshShell, version, branch, modified, revision, clean_rev, url, oExec, line, hash
 	Set WshShell = CreateObject("WScript.Shell")
 	On Error Resume Next
 
@@ -261,10 +261,11 @@
 		End If ' version = "norev000"
 	End If ' version <> "norev000"
 
-	Dim rev_file
-	Set rev_file = FSO.OpenTextFile("../.ottdrev", 1, True, 0)
-	If Not rev_file.atEndOfStream Then
+	If version = "norev000" And FSO.FileExists("../.ottdrev") Then
+		Dim rev_file
+		Set rev_file = FSO.OpenTextFile("../.ottdrev", 1, True, 0)
 		DetermineSVNVersion = rev_file.ReadLine()
+		rev_file.Close()
 	Else
 		If modified = 2 Then
 			version = version & "M"
@@ -281,7 +282,6 @@
 			DetermineSVNVersion = version
 		End If
 	End If
-	rev_file.close
 End Function
 
 Function IsCachedVersion(ByVal version)