Browse Source

Fixed not correctly setting file version on Win32. Fixes #86.

woollybah 6 years ago
parent
commit
61c3fbce06
3 changed files with 43 additions and 2 deletions
  1. 4 0
      CHANGELOG
  2. 18 1
      bmk_config.bmx
  3. 21 1
      make.bmk

+ 4 - 0
CHANGELOG

@@ -1,3 +1,7 @@
+## [3.39] - 2019-07-18
+### Fixed
+ - Correctly set file version on Win32.
+
 ## [3.38] - 2019-05-29
 ### Added
  - New '-ud' option to add user defined compiler options. (bcc 0.108+)

+ 18 - 1
bmk_config.bmx

@@ -10,7 +10,7 @@ Import brl.map
 
 Import "stringbuffer_core.bmx"
 
-Const BMK_VERSION:String = "3.38"
+Const BMK_VERSION:String = "3.39"
 
 Const ALL_SRC_EXTS$="bmx;i;c;m;h;cpp;cxx;mm;hpp;hxx;s;cc;asm;S"
 
@@ -708,6 +708,23 @@ Function ParseApplicationIniFile:TMap()
 		id :+ ".debug"
 	End If
 	settings.Insert("app.id", id)
+	
+	If Not settings.Contains("app.version.major") Then
+		Local version:String = String(settings.ValueForKey("app.version.name"))
+		If version Then
+			Local parts:String[] = version.Split(".")
+			For Local i:Int = 0 Until parts.length
+				Select i
+					Case 0
+						settings.Insert("app.version.major", String.FromInt(parts[i].ToInt()))
+					Case 1
+						settings.Insert("app.version.minor", String.FromInt(parts[i].ToInt()))
+					Case 2
+						settings.Insert("app.version.patch", String.FromInt(parts[i].ToInt()))
+				End Select
+			Next
+		End If
+	End If
 
 	Return settings
 End Function

+ 21 - 1
make.bmk

@@ -635,7 +635,27 @@
 	end
 	
 	resource = resource .. "1 VERSIONINFO\n" ..
-			"FILEVERSION 1,0,0,0\n" ..
+			"FILEVERSION "
+			
+	if bmk.AppSetting("app.version.major") ~= "" then
+		resource = resource .. bmk.AppSetting("app.version.major")
+	else
+		resource = resource .. "1"
+	end
+			
+	if bmk.AppSetting("app.version.minor") ~= "" then
+		resource = resource .. "," .. bmk.AppSetting("app.version.minor")
+	else
+		resource = resource .. ",0"
+	end
+
+	if bmk.AppSetting("app.version.patch") ~= "" then
+		resource = resource .. "," .. bmk.AppSetting("app.version.patch")
+	else
+		resource = resource .. ",0"
+	end
+	
+	resource = resource .. ",0\n" ..
 			"PRODUCTVERSION 1,0,0,0\n" ..
 			"FILEOS 0x40004\n" ..
 			"FILETYPE 0x1\n" ..