diff options
author | Rob Mensching <rob@firegiant.com> | 2021-03-02 03:01:31 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-03-02 03:05:04 -0800 |
commit | 263c62069df0f154001915cca00d6d4926f2fbb5 (patch) | |
tree | 22553745e5aaf8121311afe1d132b75e6f10d9af | |
parent | 166186a5831bd515939544a8f662938d5ae755e3 (diff) | |
download | wix-263c62069df0f154001915cca00d6d4926f2fbb5.tar.gz wix-263c62069df0f154001915cca00d6d4926f2fbb5.tar.bz2 wix-263c62069df0f154001915cca00d6d4926f2fbb5.zip |
Version the extension cache folders
Resolves wixtoolset/issues#6184
-rw-r--r-- | src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs b/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs index c23c8383..31184c33 100644 --- a/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs +++ b/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs | |||
@@ -13,8 +13,12 @@ namespace WixToolset.Core.ExtensibilityServices | |||
13 | 13 | ||
14 | internal class ExtensionManager : IExtensionManager | 14 | internal class ExtensionManager : IExtensionManager |
15 | { | 15 | { |
16 | private List<IExtensionFactory> extensionFactories = new List<IExtensionFactory>(); | 16 | private const string UserWixFolderName = ".wix4"; |
17 | private Dictionary<Type, List<object>> loadedExtensionsByType = new Dictionary<Type, List<object>>(); | 17 | private const string MachineWixFolderName = "WixToolset4"; |
18 | private const string ExtensionsFolderName = "extensions"; | ||
19 | |||
20 | private readonly List<IExtensionFactory> extensionFactories = new List<IExtensionFactory>(); | ||
21 | private readonly Dictionary<Type, List<object>> loadedExtensionsByType = new Dictionary<Type, List<object>>(); | ||
18 | 22 | ||
19 | public ExtensionManager(IWixToolsetCoreServiceProvider serviceProvider) | 23 | public ExtensionManager(IWixToolsetCoreServiceProvider serviceProvider) |
20 | { | 24 | { |
@@ -123,14 +127,14 @@ namespace WixToolset.Core.ExtensibilityServices | |||
123 | 127 | ||
124 | private IEnumerable<string> CacheLocations() | 128 | private IEnumerable<string> CacheLocations() |
125 | { | 129 | { |
126 | var path = Path.Combine(Environment.CurrentDirectory, ".wix", "extensions"); | 130 | var path = Path.Combine(Environment.CurrentDirectory, UserWixFolderName, ExtensionsFolderName); |
127 | if (Directory.Exists(path)) | 131 | if (Directory.Exists(path)) |
128 | { | 132 | { |
129 | yield return path; | 133 | yield return path; |
130 | } | 134 | } |
131 | 135 | ||
132 | path = Environment.GetEnvironmentVariable("WIX_EXTENSIONS") ?? Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); | 136 | path = Environment.GetEnvironmentVariable("WIX_EXTENSIONS") ?? Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); |
133 | path = Path.Combine(path, ".wix", "extensions"); | 137 | path = Path.Combine(path, UserWixFolderName, ExtensionsFolderName); |
134 | if (Directory.Exists(path)) | 138 | if (Directory.Exists(path)) |
135 | { | 139 | { |
136 | yield return path; | 140 | yield return path; |
@@ -138,20 +142,20 @@ namespace WixToolset.Core.ExtensibilityServices | |||
138 | 142 | ||
139 | if (Environment.Is64BitOperatingSystem) | 143 | if (Environment.Is64BitOperatingSystem) |
140 | { | 144 | { |
141 | path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles), @"WixToolset\extensions\"); | 145 | path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles), MachineWixFolderName, ExtensionsFolderName); |
142 | if (Directory.Exists(path)) | 146 | if (Directory.Exists(path)) |
143 | { | 147 | { |
144 | yield return path; | 148 | yield return path; |
145 | } | 149 | } |
146 | } | 150 | } |
147 | 151 | ||
148 | path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFilesX86), @"WixToolset\extensions\"); | 152 | path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFilesX86), MachineWixFolderName, ExtensionsFolderName); |
149 | if (Directory.Exists(path)) | 153 | if (Directory.Exists(path)) |
150 | { | 154 | { |
151 | yield return path; | 155 | yield return path; |
152 | } | 156 | } |
153 | 157 | ||
154 | path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetCallingAssembly().CodeBase).LocalPath), @"extensions\"); | 158 | path = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetCallingAssembly().CodeBase).LocalPath), ExtensionsFolderName); |
155 | if (Directory.Exists(path)) | 159 | if (Directory.Exists(path)) |
156 | { | 160 | { |
157 | yield return path; | 161 | yield return path; |