From 2695f2da46f585e8a65811b0eb22c9c3a1715257 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 18 Aug 2019 19:16:15 -0400 Subject: [PATCH] Update installer with appveyor commands. --- appveyor.yml | 10 ++++++---- janet-installer.nsi | 14 +++++++++++++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0cd08d3d..2da5aa20 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,7 +26,9 @@ install: - refreshenv # We need to reload vcvars after refreshing - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" - - build_win test-install + - build_win test-install\ + - set janet_outname="%appveyor_repo_tag_name%" + - if "%janet_outname%"=="" (set janet_outname=v1.2.0) build: off only_commits: @@ -44,11 +46,11 @@ artifacts: - name: janetconf.h path: dist\janetconf.h type: File - - name: "janet-$(appveyor_repo_tag_name)-windows" + - name: "janet-$(janet_outname)-windows" path: dist type: Zip - - path: "janet-$(appveyor_repo_tag_name)-windows-installer.exe" - name: "janet-$(appveyor_repo_tag_name)-windows-installer.exe" + - path: "janet-$(janet_outname)-windows-installer.exe" + name: "janet-$(janet_outname)-windows-installer.exe" type: File deploy: diff --git a/janet-installer.nsi b/janet-installer.nsi index b9f9f0f8..8719d42a 100644 --- a/janet-installer.nsi +++ b/janet-installer.nsi @@ -25,7 +25,19 @@ VIFileVersion "${PRODUCT_VERSION}" # Basics Name "Janet" -OutFile "janet-v${VERSION}-windows-installer.exe" + +# Do some NSIS-fu to figure out at compile time if we are in appveyor +!define OUTNAME $%APPVEYOR_REPO_TAG_NAME% +!define "CHECK_${OUTNAME}" +!define DOLLAR "$" +!ifdef CHECK_${DOLLAR}%APPVEYOR_REPO_TAG_NAME% + # We are not in the appveyor environment, use version name + !define OUTNAME_PART v${VERSION}-nonrelease- +!else + # We are in appveyor, use git tag name for installer + !define OUTNAME_PART ${OUTNAME} +!endif +OutFile "janet-${OUTNAME_PART}-windows-installer.exe" # Some Configuration !define APPNAME "Janet"