Changeset - 8c3f6ec929d6
[Not reviewed]
default
0 1 0
Jason Maltzen (jmaltzen) - 9 years ago 2015-12-31 05:50:21
jason.maltzen@unsanctioned.net
Fix an error with searching for application data directories
1 file changed with 4 insertions and 5 deletions:
0 comments (0 inline, 0 general)
FileUtils.cs
Show inline comments
...
 
@@ -18,16 +18,15 @@ namespace DesertPaintLab
 
                return dirPath;
 
            }
 
            dirPath = System.IO.Path.Combine(
 
                System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
 
                "data", 
 
                dirname);
 
            if (!System.IO.Directory.Exists(dirPath))
 
            if (System.IO.Directory.Exists(dirPath))
 
            {
 
                // not found
 
                dirPath = null;
 
                return dirPath;
 
            }
 
            // try "Resources" in case this is a Mac app bundle
 
            dirPath = System.IO.Path.Combine(
 
                Environment.GetFolderPath(Environment.SpecialFolder.Resources), "data", dirname);
 
            if (System.IO.Directory.Exists(dirPath))
 
            {
...
 
@@ -41,16 +40,16 @@ namespace DesertPaintLab
 
                return dirPath;
 
            }
 
            dirPath = System.IO.Path.Combine(
 
                System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
 
                "Resources", "data",
 
                dirname);
 
            if (!System.IO.Directory.Exists(dirPath))
 
            if (System.IO.Directory.Exists(dirPath))
 
            {
 
                // not found
 
                dirPath = null;
 
                return dirPath;
 
            }
 
            dirPath = System.IO.Path.Combine(
 
                System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
 
                "Resources", 
 
                dirname);
 
            if (!System.IO.Directory.Exists(dirPath))
0 comments (0 inline, 0 general)