[hyena] Fix Paths.InstalledApplicationPrefix to work uninstalled on Windows



commit 6c5a803be087dcfe9ae021140053d1f8423dcfc2
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Fri Feb 4 10:15:30 2011 -0600

    Fix Paths.InstalledApplicationPrefix to work uninstalled on Windows

 Hyena/Hyena/Paths.cs |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/Hyena/Hyena/Paths.cs b/Hyena/Hyena/Paths.cs
index 1294d3a..aa847ce 100644
--- a/Hyena/Hyena/Paths.cs
+++ b/Hyena/Hyena/Paths.cs
@@ -222,10 +222,16 @@ namespace Hyena
                     installed_application_prefix = Path.GetDirectoryName (
                         System.Reflection.Assembly.GetExecutingAssembly ().Location);
 
+                    // For Banshee on Linux running uninstalled, share/ is located within the assembly's dir
                     if (Directory.Exists (Paths.Combine (installed_application_prefix, "share", ApplicationName))) {
                         return installed_application_prefix;
                     }
 
+                    // For Banshee on Windows, share/ is one up from bin/ where the assembly is located
+                    if (Directory.Exists (Paths.Combine (installed_application_prefix, "..", "share", ApplicationName))) {
+                        return installed_application_prefix = new DirectoryInfo (installed_application_prefix).Parent.FullName;
+                    }
+
                     DirectoryInfo entry_directory = new DirectoryInfo (installed_application_prefix);
 
                     if (entry_directory != null && entry_directory.Parent != null && entry_directory.Parent.Parent != null) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]