diff --git a/GVFS/GVFS.Common/GVFSPlatform.cs b/GVFS/GVFS.Common/GVFSPlatform.cs index f0a8f5c5..3c3bda62 100644 --- a/GVFS/GVFS.Common/GVFSPlatform.cs +++ b/GVFS/GVFS.Common/GVFSPlatform.cs @@ -27,6 +27,8 @@ namespace GVFS.Common public UnderConstructionFlags UnderConstruction { get; } public abstract string Name { get; } + public abstract string GVFSConfigPath { get; } + public static void Register(GVFSPlatform platform) { if (GVFSPlatform.Instance != null) diff --git a/GVFS/GVFS.Common/LocalGVFSConfig.cs b/GVFS/GVFS.Common/LocalGVFSConfig.cs index e69f1192..158c77bb 100644 --- a/GVFS/GVFS.Common/LocalGVFSConfig.cs +++ b/GVFS/GVFS.Common/LocalGVFSConfig.cs @@ -15,10 +15,7 @@ namespace GVFS.Common public LocalGVFSConfig() { - string servicePath = GVFSPlatform.Instance.GetDataRootForGVFSComponent(GVFSConstants.Service.ServiceName); - string gvfsDirectory = Path.GetDirectoryName(servicePath); - - this.configFile = Path.Combine(gvfsDirectory, FileName); + this.configFile = GVFSPlatform.Instance.GVFSConfigPath; this.fileSystem = new PhysicalFileSystem(); } diff --git a/GVFS/GVFS.Platform.Mac/MacPlatform.cs b/GVFS/GVFS.Platform.Mac/MacPlatform.cs index a58f1219..e8503ddf 100644 --- a/GVFS/GVFS.Platform.Mac/MacPlatform.cs +++ b/GVFS/GVFS.Platform.Mac/MacPlatform.cs @@ -24,6 +24,14 @@ namespace GVFS.Platform.Mac public override GVFSPlatformConstants Constants { get; } = new MacPlatformConstants(); public override IPlatformFileSystem FileSystem { get; } = new MacFileSystem(); + public override string GVFSConfigPath + { + get + { + return Path.Combine(this.Constants.GVFSBinDirectoryPath, LocalGVFSConfig.FileName); + } + } + public override string GetOSVersionInformation() { ProcessResult result = ProcessHelper.Run("sw_vers", args: string.Empty, redirectOutput: true); diff --git a/GVFS/GVFS.Platform.Windows/WindowsPlatform.cs b/GVFS/GVFS.Platform.Windows/WindowsPlatform.cs index 6a330ed6..260a6dd0 100644 --- a/GVFS/GVFS.Platform.Windows/WindowsPlatform.cs +++ b/GVFS/GVFS.Platform.Windows/WindowsPlatform.cs @@ -36,6 +36,17 @@ namespace GVFS.Platform.Windows public override string Name { get => "Windows"; } public override GVFSPlatformConstants Constants { get; } = new WindowsPlatformConstants(); + public override string GVFSConfigPath + { + get + { + string servicePath = GVFSPlatform.Instance.GetDataRootForGVFSComponent(GVFSConstants.Service.ServiceName); + string gvfsDirectory = Path.GetDirectoryName(servicePath); + + return Path.Combine(gvfsDirectory, LocalGVFSConfig.FileName); + } + } + public static string GetStringFromRegistry(string key, string valueName) { object value = GetValueFromRegistry(RegistryHive.LocalMachine, key, valueName); diff --git a/GVFS/GVFS.UnitTests/Mock/Common/MockPlatform.cs b/GVFS/GVFS.UnitTests/Mock/Common/MockPlatform.cs index 67d93504..fe24fc1d 100644 --- a/GVFS/GVFS.UnitTests/Mock/Common/MockPlatform.cs +++ b/GVFS/GVFS.UnitTests/Mock/Common/MockPlatform.cs @@ -29,6 +29,8 @@ namespace GVFS.UnitTests.Mock.Common public override string Name { get => "Mock"; } + public override string GVFSConfigPath { get => Path.Combine("mock:", LocalGVFSConfig.FileName); } + public override GVFSPlatformConstants Constants { get; } = new MockPlatformConstants(); public HashSet ActiveProcesses { get; } = new HashSet();