From deb68d20033eba2757f5c1e49b07101e98146514 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 14 Mar 2019 22:57:12 -0400 Subject: [PATCH] use cmd for resource hacker --- appveyor.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index c2aae64ed6..153686ea8c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,7 +17,13 @@ init: } install: -- ps: $env:PACKAGE_VERSION = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version +- ps: | + $env:PACKAGE_VERSION = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version + $env:PATH = "C:\Program Files (x86)\Resource Hacker\ResourceHacker.exe;${env:PATH}" + $env:SET_VERSION_INFO = "false" + if(Test-Path -Path $env:WIN_PKG_PATH) { + $env:SET_VERSION_INFO = "true" + } - ps: choco install reshack --no-progress - ps: choco install cloc --no-progress - ps: choco install checksum --no-progress @@ -29,23 +35,13 @@ before_build: - cmd: npm --version build_script: -- ps: | - if(Test-Path -Path $env:WIN_PKG_PATH) { - echo "Updating pkg resources" - $rh = "C:\Program Files (x86)\Resource Hacker\ResourceHacker.exe" - $rh1 = Start-Process -FilePath $rh -ArgumentList ` - "-open ${env:WIN_PKG_PATH} -save ${env:WIN_PKG_PATH} -action delete -mask ICONGROUP,1," - echo "1" - echo $rh1 - $rh2 = Start-Process -FilePath $rh -ArgumentList ` - "-open version-info.rc -save version-info.res -action compile" - echo "2" - echo $rh2 - $rh3 = Start-Process -FilePath $rh -ArgumentList ` - "-open ${env:WIN_PKG_PATH} -save ${env:WIN_PKG_PATH} -action addoverwrite -resource version-info.res," - echo "3" - echo $rh3 - } +- cmd: | + if %SET_VERSION_INFO% == "true" ( + echo "Updating pkg resources with version info" + call ResourceHacker -open %WIN_PKG_PATH% -save %WIN_PKG_PATH% -action delete -mask ICONGROUP,1, + call ResourceHacker -open .\version-info.rc -save .\version-info.res -action compile + call ResourceHacker -open %WIN_PKG_PATH% -save %WIN_PKG_PATH% -action addoverwrite -resource .\version-info.res + ) - cmd: npm install - cmd: npm run dist - cmd: 7z a ./dist/bw-windows-%PACKAGE_VERSION%.zip ./dist/windows/bw.exe