Skip to content

Commit

Permalink
another fix to the patch script
Browse files Browse the repository at this point in the history
  • Loading branch information
vividos committed Jun 30, 2020
1 parent 4c9edf4 commit dbef4da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/Patch-BuildVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ $buildYear = Get-Date -format yyyy
# modify version.h
$versionHeader = Get-Content "$scriptPath\version.h"

$versionHeader = $versionHeader -replace "MAIN_VERSION [0-9]+","MAIN_VERSION $majorVersion"
$versionHeader = $versionHeader -replace "MAIN_VERSION [0-9]+","MAIN_VERSION $majorVersion"
$versionHeader = $versionHeader -replace "MINOR_VERSION [0-9]+","MINOR_VERSION $minorVersion"
$versionHeader = $versionHeader -replace "SUB_VERSION [0-9]+","SUB_VERSION $releaseNumber"
$versionHeader = $versionHeader -replace "BUILD_NUMBER [0-9]+","BUILD_NUMBER $buildNumber"
$versionHeader = $versionHeader -replace "BUILD_YEAR [0-9]+","BUILD_YEAR $buildYear"
$versionHeader = $versionHeader -replace "SUB_VERSION [0-9]+","SUB_VERSION $releaseNumber"
$versionHeader = $versionHeader -replace "BUILD_NUMBER [0-9]+","BUILD_NUMBER $buildNumber"
$versionHeader = $versionHeader -replace "BUILD_YEAR [0-9]+","BUILD_YEAR $buildYear"

Out-File -FilePath "$scriptPath\version.h" -InputObject $versionHeader -Encoding ASCII

# modify BuildNumber.wxi
$setupBuildNumberFile = Get-Content "$scriptPath\Setup\BuildNumber.wxi"

$setupBuildNumberFile = $setupBuildNumberFile -replace "BuildNumber = ""[0-9]+"","BuildNumber = ""$buildNumber"""
$setupBuildNumberFile = $setupBuildNumberFile -replace "BuildNumber = ""[0-9]+""","BuildNumber = ""$buildNumber"""

Out-File -FilePath "$scriptPath\Setup\BuildNumber.wxi" -InputObject $setupBuildNumberFile -Encoding UTF8

Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define MINOR_VERSION 6
#define SUB_VERSION 0
#define BUILD_NUMBER 125
#define BUILD_YEAR 2020
#define BUILD_YEAR 2020

#define VERSIONINFO_FILEVERSION_NUMERIC MAIN_VERSION##, ##MINOR_VERSION##, ##SUB_VERSION##, ##BUILD_NUMBER
#define VERSIONINFO_PRODUCTVERSION_NUMERIC MAIN_VERSION##, ##MINOR_VERSION##, ##SUB_VERSION
Expand Down

0 comments on commit dbef4da

Please sign in to comment.