Skip to content

Commit

Permalink
Fixed not correctly setting file version on Win32. Fixes #86.
Browse files Browse the repository at this point in the history
  • Loading branch information
woollybah committed Jun 18, 2019
1 parent d892998 commit 61c3fbc
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
4 changes: 4 additions & 0 deletions 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+)
Expand Down
19 changes: 18 additions & 1 deletion bmk_config.bmx
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down
22 changes: 21 additions & 1 deletion make.bmk
Expand Up @@ -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" ..
Expand Down

0 comments on commit 61c3fbc

Please sign in to comment.