From ca1cf8d9e77308dcf4eb70d2a60830e9d6a3a994 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 6 May 2014 08:05:06 -0700 Subject: [PATCH] Set the version in the Windows installer automatically --- build/version.sh | 8 +++++++- packages/win_installer/fragment_setupbase.iss | 14 +++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/build/version.sh b/build/version.sh index 82c087917..287fe5895 100755 --- a/build/version.sh +++ b/build/version.sh @@ -26,9 +26,13 @@ last_svn_hash="16cd907fe7482cb54a7374cd28b8501f138116be" git_revision=$(expr $last_svn_revision + $(git log --pretty=oneline $last_svn_hash..HEAD 2>/dev/null | wc -l)) git_version_str=$(git describe --exact-match 2> /dev/null) +installer_version='0.0.0' if test x$git_version_str != x; then git_version_str="${git_version_str##v}" tagged_release=1 + if [ $(echo $git_version_str | grep '\d\.\d\.\d') ]; then + installer_version=$git_version_str + fi else git_branch="$(git symbolic-ref HEAD 2> /dev/null)" || git_branch="(unnamed branch)" git_branch="${git_branch##refs/heads/}" @@ -38,10 +42,12 @@ else tagged_release=0 fi + new_version_h="\ #define BUILD_GIT_VERSION_NUMBER ${git_revision} #define BUILD_GIT_VERSION_STRING \"${git_version_str}\" -#define TAGGED_RELEASE ${tagged_release}" +#define TAGGED_RELEASE ${tagged_release} +#define INSTALLER_VERSION \"${installer_version}\"" # may not exist yet for out of tree builds mkdir -p build diff --git a/packages/win_installer/fragment_setupbase.iss b/packages/win_installer/fragment_setupbase.iss index b971685bd..4c3d48037 100644 --- a/packages/win_installer/fragment_setupbase.iss +++ b/packages/win_installer/fragment_setupbase.iss @@ -32,17 +32,17 @@ ; Contact: mailto:nielsm@indvikleren.dk ; -#define VERSION "3.1.0" +#include "../../build/git_version.h" [Setup] AppName=Aegisub -AppVerName=Aegisub {#VERSION} -AppVersion={#VERSION} +AppVerName=Aegisub {#BUILD_GIT_VERSION_STRING} +AppVersion={#INSTALLER_VERSION} AppPublisher=Aegisub Team AppPublisherURL=http://www.aegisub.org/ AppSupportURL=http://forum.aegisub.org/ AppCopyright=© 2005-2014 The Aegisub Team -VersionInfoVersion={#VERSION} +VersionInfoVersion={#INSTALLER_VERSION} DefaultGroupName=Aegisub AllowNoIcons=true OutputDir=output @@ -62,8 +62,8 @@ UninstallDisplayIcon={app}\aegisub{#ARCH}.exe WizardImageFile=welcome-large.bmp WizardSmallImageFile=aegisub-large.bmp -OutputBaseFilename=Aegisub-{#VERSION}-{#ARCH} -VersionInfoDescription=Aegisub {#VERSION} {#ARCH} +OutputBaseFilename=Aegisub-{#BUILD_GIT_VERSION_STRING}-{#ARCH} +VersionInfoDescription=Aegisub {#BUILD_GIT_VERSION_STRING} {#ARCH}-bit [Languages] Name: "en"; MessagesFile: "compiler:Default.isl" @@ -95,7 +95,7 @@ Name: "zh_TW"; MessagesFile: "compiler:Languages\ChineseTraditional.isl" [Messages] ; Replacement for License page, no need to bother the user with legal mumbo-jumbo -WelcomeLabel2=This will install Aegisub {#VERSION} on your computer.%n%nAegisub is covered by the GNU General Public License version 2. This means you may use the application for any purpose without charge, but that no warranties of any kind are given either.%n%nSee the Aegisub website for information on obtaining the source code. +WelcomeLabel2=This will install Aegisub {#BUILD_GIT_VERSION_STRING} on your computer.%n%nAegisub is covered by the GNU General Public License version 2. This means you may use the application for any purpose without charge, but that no warranties of any kind are given either.%n%nSee the Aegisub website for information on obtaining the source code. [Files] ; small bitmaps (used by beautify code)