Bloom.BloomFileLocator.IsInstalledFileOrDirectory C# (CSharp) Method

IsInstalledFileOrDirectory() public static method

Check whether this file was installed with Bloom (and likely to be read-only on Linux or for allUsers install).
public static IsInstalledFileOrDirectory ( string filepath ) : bool
filepath string
return bool
        public static bool IsInstalledFileOrDirectory(string filepath)
        {
            var file = Assembly.GetExecutingAssembly().CodeBase.Replace("file://", string.Empty);
            if (SIL.PlatformUtilities.Platform.IsWindows)
                file = file.TrimStart('/');
            var folder = Path.GetDirectoryName(file);
            if (folder.EndsWith("/output/Debug"))
                folder = folder.Replace("/Debug", string.Empty);	// files now copied to output/browser for access
            return filepath.Contains(folder);
        }