diff --git a/.gitignore b/.gitignore index 27a116028..a3e72e4ec 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ /build /id /pid +/wix/mackerel-agent.wxs +/wix/mackerel-agent.wixobj diff --git a/wix/build.bat b/wix/build.bat index ccc284f57..43aa82aff 100755 --- a/wix/build.bat +++ b/wix/build.bat @@ -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 diff --git a/wix/mackerel-agent.wxs b/wix/mackerel-agent.wxs.template similarity index 96% rename from wix/mackerel-agent.wxs rename to wix/mackerel-agent.wxs.template index b0e230050..260e539b7 100644 --- a/wix/mackerel-agent.wxs +++ b/wix/mackerel-agent.wxs.template @@ -2,7 +2,7 @@ + Language='1033' Codepage='1252' Version='___VERSION___' Manufacturer='Hatena'>