Merge commit '8d3eb2c395c9e41d2feae3ca0a7b85defc396211' into develop

This commit is contained in:
Florian Küpper committed 2015-04-01 14:08:20 +02:00
commit 4f35c9c583
12 files changed
+68 -14

No files matched your search

+2
View File
@@ -75,6 +75,8 @@ namespace Vocaluxe.Base
#if INSTALLER
public static readonly string DataFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Vocaluxe");
#elif LINUX
public static readonly string DataFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vocaluxe");
#else
public static readonly string DataFolder = ProgramFolder;
#endif
+1 -6
View File
@@ -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)
+20
View File
@@ -96,6 +96,23 @@ namespace Vocaluxe
return _IsProgramInstalled("Microsoft Visual C++ 2010");
}
private static void _EnsureDataFolderExists()
{
if (!Directory.Exists(CSettings.DataFolder)) {
Directory.CreateDirectory(CSettings.DataFolder);
// copy default profiles to DataFolder instead of adding ProgramFolder to CConfig.ProfileFolders
// because we want to be able to edit them, but might not have permission to write to ProgramFolder
string profilePath = Path.Combine(CSettings.DataFolder, CSettings.FolderNameProfiles);
Directory.CreateDirectory(profilePath);
DirectoryInfo defaultProfileDir = new DirectoryInfo(Path.Combine(CSettings.ProgramFolder, CSettings.FolderNameProfiles));
FileInfo[] files = defaultProfileDir.GetFiles();
foreach (FileInfo file in files) {
string newPath = Path.Combine(profilePath, file.Name);
file.CopyTo(newPath, false);
}
}
}
public static bool CheckRequirements()
{
#if WIN
@@ -135,6 +152,9 @@ namespace Vocaluxe
#endif
path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar + path;
COSFunctions.AddEnvironmentPath(path);
#if LINUX
_EnsureDataFolderExists();
#endif
}
}
}
-2
View File
@@ -16,8 +16,6 @@
#endregion
using System;
using System.Diagnostics.PerformanceData;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
using OpenTK.Input;
+1 -1
View File
@@ -47,7 +47,7 @@ namespace Vocaluxe.Lib.Input
#endif
#if LINUX
private const string _HIDApiDll = "libhidapi.so";
private const string _HIDApiDll = "libhidapi-libusb.so";
#endif
#endif
+1 -1
View File
@@ -176,7 +176,7 @@ namespace Vocaluxe.Lib.Video.Acinerella
#endif
#if LINUX
private const string _AcDll = "x86/libacinerella.so";
private const string _AcDll = "libacinerella.so";
#endif
#endif
+5
View File
@@ -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
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
PROJECT=$1
cd $PROJECT
sed -i -e s/GITVERSION/$(git describe --long)/ $PROJECT/Properties/AssemblyInfo.cs
+12
View File
@@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=Vocaluxe
Keywords=game;party;singing;
GenericName=Karaoke
Icon=INSTALLPATH/Vocaluxe.ico
Path=INSTALLPATH
Exec=mono INSTALLPATH/Vocaluxe.exe %U
Terminal=false
StartupNotify=false
Categories=Game;
+2 -1
View File
@@ -85,11 +85,12 @@ namespace Vocaluxe
{
// Init Log
CLog.Init();
CLog.StartBenchmark("Init Program");
if (!CProgrammHelper.CheckRequirements())
return;
CProgrammHelper.Init();
CLog.StartBenchmark("Init Program");
CMain.Init();
Application.DoEvents();
+4 -2
View File
@@ -536,13 +536,15 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">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 '(?&lt;=var *matchingServerVersion * = *\\\")\w*(?=\\\" *;)', %2524('@(VersionNumber)'+' ('+$version+')')} | Set-Content -Encoding UTF8 '$(ProjectDir)..\Output\Website\js\main.js'"
<PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">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 '(?&lt;=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 '(?&lt;=AssemblyInformationalVersion\()(.*)(?=\))', '\"GITVERSION\"'} | Set-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs'"</PostBuildEvent>
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">cp -ruT "$(ProjectDir)Website" "$(SolutionDir)/PhoneGap"</PostBuildEvent>
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">$(ProjectDir)Linux/Build/PostBuildEvent.sh $(ProjectDir)</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">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'"</PreBuildEvent>
<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">$(ProjectDir)Linux/Build/PreBuildEvent.sh $(ProjectDir)</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
+16 -1
View File
@@ -1,12 +1,27 @@
ARCH?=$(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x64/)
windowsLibs = Output/gstreamer-sharp.dll Output/glib-sharp.dll
all:
$(MAKE) -C PitchTracker
$(MAKE) -C Vocaluxe/Lib/Video/Acinerella
rm -f $(windowsLibs)
xbuild /property:Platform=x64 /property:Configuration=ReleaseLinux
xbuild /property:Platform=$(ARCH) /property:Configuration=ReleaseLinux
clean:
xbuild /target:Clean
$(MAKE) -C PitchTracker clean
$(MAKE) -C Vocaluxe/Lib/Video/Acinerella clean
git checkout $(windowsLibs)
INSTALLPATH?=/usr/share/vocaluxe
WRONG_ARCH=$(shell echo $(ARCH) | sed -e s/x86/x64/ -e s/x64/x86/)
install:
mkdir -p $(DESTDIR)$(INSTALLPATH)
cp -ru Output/. $(DESTDIR)$(INSTALLPATH)
rm -rf $(DESTDIR)$(INSTALLPATH)/$(WRONG_ARCH)
ICONPATH?=/usr/share/applications
install_icon:
mkdir -p $(DESTDIR)$(ICONPATH)
cp Vocaluxe/Linux/Package/Vocaluxe.desktop $(DESTDIR)$(ICONPATH)/
sed -i -e 's=INSTALLPATH=$(INSTALLPATH)=' $(DESTDIR)$(ICONPATH)/Vocaluxe.desktop