diff options
Diffstat (limited to 'src/WixToolset.Core.ExtensionCache/ExtensionCacheManager.cs')
-rw-r--r-- | src/WixToolset.Core.ExtensionCache/ExtensionCacheManager.cs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManager.cs b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManager.cs index 3ec6451e..256eeb0b 100644 --- a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManager.cs +++ b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManager.cs | |||
@@ -19,16 +19,16 @@ namespace WixToolset.Core.ExtensionCache | |||
19 | /// <summary> | 19 | /// <summary> |
20 | /// Extension cache manager. | 20 | /// Extension cache manager. |
21 | /// </summary> | 21 | /// </summary> |
22 | public class ExtensionCacheManager | 22 | internal class ExtensionCacheManager |
23 | { | 23 | { |
24 | public string CacheFolder(bool global) => global ? this.GlobalCacheFolder() : this.LocalCacheFolder(); | 24 | public string CacheFolder(bool global) => global ? this.GlobalCacheFolder() : this.LocalCacheFolder(); |
25 | 25 | ||
26 | public string LocalCacheFolder() => Path.Combine(Environment.CurrentDirectory, @".wix\extensions\"); | 26 | public string LocalCacheFolder() => Path.Combine(Environment.CurrentDirectory, ".wix", "extensions"); |
27 | 27 | ||
28 | public string GlobalCacheFolder() | 28 | public string GlobalCacheFolder() |
29 | { | 29 | { |
30 | var baseFolder = Environment.GetEnvironmentVariable("WIX_EXTENSIONS") ?? Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); | 30 | var baseFolder = Environment.GetEnvironmentVariable("WIX_EXTENSIONS") ?? Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); |
31 | return Path.Combine(baseFolder, @".wix\extensions\"); | 31 | return Path.Combine(baseFolder, ".wix", "extensions"); |
32 | } | 32 | } |
33 | 33 | ||
34 | public async Task<bool> AddAsync(bool global, string extension, CancellationToken cancellationToken) | 34 | public async Task<bool> AddAsync(bool global, string extension, CancellationToken cancellationToken) |
@@ -84,12 +84,8 @@ namespace WixToolset.Core.ExtensionCache | |||
84 | } | 84 | } |
85 | else if (!String.IsNullOrEmpty(extensionVersion)) // looking for an explicit version of an extension. | 85 | else if (!String.IsNullOrEmpty(extensionVersion)) // looking for an explicit version of an extension. |
86 | { | 86 | { |
87 | var extensionFolder = Path.Combine(cacheFolder, extensionId, extensionVersion); | 87 | var present = ExtensionFileExists(cacheFolder, extensionId, extensionVersion); |
88 | if (Directory.Exists(extensionFolder)) | 88 | found.Add(new CachedExtension(extensionId, extensionVersion, !present)); |
89 | { | ||
90 | var present = ExtensionFileExists(cacheFolder, extensionId, extensionVersion); | ||
91 | found.Add(new CachedExtension(extensionId, extensionVersion, !present)); | ||
92 | } | ||
93 | } | 89 | } |
94 | else // looking for all versions of an extension or all versions of all extensions. | 90 | else // looking for all versions of an extension or all versions of all extensions. |
95 | { | 91 | { |