Set the version in the Windows installer automatically

This commit is contained in:
Thomas Goyne 2014-05-06 08:05:06 -07:00
parent ca86b0da33
commit ca1cf8d9e7
2 changed files with 14 additions and 8 deletions

View File

@ -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_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) git_version_str=$(git describe --exact-match 2> /dev/null)
installer_version='0.0.0'
if test x$git_version_str != x; then if test x$git_version_str != x; then
git_version_str="${git_version_str##v}" git_version_str="${git_version_str##v}"
tagged_release=1 tagged_release=1
if [ $(echo $git_version_str | grep '\d\.\d\.\d') ]; then
installer_version=$git_version_str
fi
else else
git_branch="$(git symbolic-ref HEAD 2> /dev/null)" || git_branch="(unnamed branch)" git_branch="$(git symbolic-ref HEAD 2> /dev/null)" || git_branch="(unnamed branch)"
git_branch="${git_branch##refs/heads/}" git_branch="${git_branch##refs/heads/}"
@ -38,10 +42,12 @@ else
tagged_release=0 tagged_release=0
fi fi
new_version_h="\ new_version_h="\
#define BUILD_GIT_VERSION_NUMBER ${git_revision} #define BUILD_GIT_VERSION_NUMBER ${git_revision}
#define BUILD_GIT_VERSION_STRING \"${git_version_str}\" #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 # may not exist yet for out of tree builds
mkdir -p build mkdir -p build

View File

@ -32,17 +32,17 @@
; Contact: mailto:nielsm@indvikleren.dk ; Contact: mailto:nielsm@indvikleren.dk
; ;
#define VERSION "3.1.0" #include "../../build/git_version.h"
[Setup] [Setup]
AppName=Aegisub AppName=Aegisub
AppVerName=Aegisub {#VERSION} AppVerName=Aegisub {#BUILD_GIT_VERSION_STRING}
AppVersion={#VERSION} AppVersion={#INSTALLER_VERSION}
AppPublisher=Aegisub Team AppPublisher=Aegisub Team
AppPublisherURL=http://www.aegisub.org/ AppPublisherURL=http://www.aegisub.org/
AppSupportURL=http://forum.aegisub.org/ AppSupportURL=http://forum.aegisub.org/
AppCopyright=© 2005-2014 The Aegisub Team AppCopyright=© 2005-2014 The Aegisub Team
VersionInfoVersion={#VERSION} VersionInfoVersion={#INSTALLER_VERSION}
DefaultGroupName=Aegisub DefaultGroupName=Aegisub
AllowNoIcons=true AllowNoIcons=true
OutputDir=output OutputDir=output
@ -62,8 +62,8 @@ UninstallDisplayIcon={app}\aegisub{#ARCH}.exe
WizardImageFile=welcome-large.bmp WizardImageFile=welcome-large.bmp
WizardSmallImageFile=aegisub-large.bmp WizardSmallImageFile=aegisub-large.bmp
OutputBaseFilename=Aegisub-{#VERSION}-{#ARCH} OutputBaseFilename=Aegisub-{#BUILD_GIT_VERSION_STRING}-{#ARCH}
VersionInfoDescription=Aegisub {#VERSION} {#ARCH} VersionInfoDescription=Aegisub {#BUILD_GIT_VERSION_STRING} {#ARCH}-bit
[Languages] [Languages]
Name: "en"; MessagesFile: "compiler:Default.isl" Name: "en"; MessagesFile: "compiler:Default.isl"
@ -95,7 +95,7 @@ Name: "zh_TW"; MessagesFile: "compiler:Languages\ChineseTraditional.isl"
[Messages] [Messages]
; Replacement for License page, no need to bother the user with legal mumbo-jumbo ; 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] [Files]
; small bitmaps (used by beautify code) ; small bitmaps (used by beautify code)