Skip to content

Commit

Permalink
Fill version in wxs file from tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mechairoi committed Feb 6, 2015
1 parent 500c98d commit d452ee0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
/build
/id
/pid
/wix/mackerel-agent.wxs
/wix/mackerel-agent.wixobj
8 changes: 8 additions & 0 deletions wix/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ go get github.com/mackerelio/mackerel-agent/wix/replace
go build -o ..\build\wrapper.exe wrapper\wrapper_windows.go
go build -o ..\build\replace.exe replace\replace_windows.go



FOR /F "usebackq" %%w IN (`git describe --tags --abbrev^=0`) DO SET VERSION=%%w
set VERSION=%VERSION:v=%
FOR /F "tokens=1 delims=-+" %%w IN ('ECHO %%VERSION%%') DO SET VERSION=%%w

..\build\replace.exe mackerel-agent.wxs.template mackerel-agent.wxs "___VERSION___" "%VERSION%"

"%WIX%bin\candle.exe" mackerel-agent.wxs
"%WIX%bin\light.exe" -out "..\build\mackerel-agent.msi" mackerel-agent.wixobj

Expand Down
2 changes: 1 addition & 1 deletion wix/mackerel-agent.wxs → wix/mackerel-agent.wxs.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>

<Product Name='mackerel-agent' Id='*' UpgradeCode='1EF11651-A09E-47A3-BFE3-5877E22F7D26'
Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Hatena'>
Language='1033' Codepage='1252' Version='___VERSION___' Manufacturer='Hatena'>

<Package Id='*' Keywords='Installer' Description="Mackerel Agent Installer"
Comments='Mackerel Agent sends metrics to https://mackerel.io' Manufacturer='Hatena'
Expand Down

0 comments on commit d452ee0

Please sign in to comment.