diff --git a/Vocaluxe/Base/Server/CVocaluxeServer.cs b/Vocaluxe/Base/Server/CVocaluxeServer.cs index 62b1d14e..138df11f 100644 --- a/Vocaluxe/Base/Server/CVocaluxeServer.cs +++ b/Vocaluxe/Base/Server/CVocaluxeServer.cs @@ -598,12 +598,7 @@ namespace Vocaluxe.Base.Server public static string GetServerVersion() { - var informationalVersion = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false).FirstOrDefault(); - if (informationalVersion != null) - { - informationalVersion = ""; - } - return Assembly.GetExecutingAssembly().GetName().Version.ToString() + " (" + informationalVersion + ")"; + return Application.ProductVersion; } public static CBase64Image GetDelayedImage(string hashedFilename) diff --git a/Vocaluxe/Linux/Build/PostBuildEvent.sh b/Vocaluxe/Linux/Build/PostBuildEvent.sh new file mode 100755 index 00000000..c9c2d125 --- /dev/null +++ b/Vocaluxe/Linux/Build/PostBuildEvent.sh @@ -0,0 +1,5 @@ +#!/bin/sh +PROJECT=$1 +cd $PROJECT +sed -i -r -e 's/AssemblyInformationalVersion\(".*?"\)/AssemblyInformationalVersion("GITVERSION")/' $PROJECT/Properties/AssemblyInfo.cs +sed -i -e 's/var matchingServerVersion = "";/var matchingServerVersion = "'$(git describe --long)'";/' $PROJECT/../Output/Website/js/main.js diff --git a/Vocaluxe/Linux/Build/PreBuildEvent.sh b/Vocaluxe/Linux/Build/PreBuildEvent.sh new file mode 100755 index 00000000..4d7c6ef7 --- /dev/null +++ b/Vocaluxe/Linux/Build/PreBuildEvent.sh @@ -0,0 +1,4 @@ +#!/bin/sh +PROJECT=$1 +cd $PROJECT +sed -i -e s/GITVERSION/$(git describe --long)/ $PROJECT/Properties/AssemblyInfo.cs diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index 85b12678..bc340b00 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -539,10 +539,12 @@ xcopy /E /D /Y "$(ProjectDir)\Website" "$(SolutionDir)\PhoneGap" powershell -command "$version = git describe --long; (Get-Content -Encoding UTF8 '$(ProjectDir)..\Output\Website\js\main.js') | Foreach-Object {$_ -replace '(?<=var *matchingServerVersion * = *\")\w*(?=\" *;)', "$version"} | Set-Content -Encoding UTF8 '$(ProjectDir)..\Output\Website\js\main.js'" powershell -command "(Get-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs') | Foreach-Object {$_ -replace '(?<=AssemblyInformationalVersion\()(.*)(?=\))', '\"GITVERSION\"'} | Set-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs'" - cp -ruT "$(ProjectDir)Website" "$(SolutionDir)/PhoneGap" + cp -ruT "$(ProjectDir)Website" "$(SolutionDir)/PhoneGap" + $(ProjectDir)Linux/Build/PostBuildEvent.sh $(ProjectDir) powershell -command "$version = git describe --long; (Get-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs') | Foreach-Object {$_ -replace 'GITVERSION', $version} | Set-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs'" + $(ProjectDir)Linux/Build/PreBuildEvent.sh $(ProjectDir)