|
6 | 6 | using System.Threading; |
7 | 7 | using System.Threading.Tasks; |
8 | 8 | using System.Windows.Controls; |
9 | | -using Flow.Launcher.Infrastructure.UserSettings; |
10 | 9 | using Flow.Launcher.Plugin.Program.Programs; |
11 | 10 | using Flow.Launcher.Plugin.Program.Views; |
12 | 11 | using Flow.Launcher.Plugin.Program.Views.Models; |
@@ -234,11 +233,17 @@ static void MoveFile(string sourcePath, string destinationPath) |
234 | 233 | } |
235 | 234 | } |
236 | 235 |
|
| 236 | + // If plugin cache directory is this: D:\\Data\\Cache\\Plugins\\Flow.Launcher.Plugin.Program |
| 237 | + // then the parent directory is: D:\\Data\\Cache |
| 238 | + // So we can use the parent of the parent directory to get the cache directory path |
| 239 | + var directoryInfo = new DirectoryInfo(pluginCacheDirectory); |
| 240 | + var cacheDirectory = directoryInfo.Parent.Parent.FullName; |
| 241 | + |
237 | 242 | // Move old cache files to the new cache directory |
238 | | - var oldWin32CacheFile = Path.Combine(DataLocation.CacheDirectory, $"{Win32CacheName}.cache"); |
| 243 | + var oldWin32CacheFile = Path.Combine(cacheDirectory, $"{Win32CacheName}.cache"); |
239 | 244 | var newWin32CacheFile = Path.Combine(pluginCacheDirectory, $"{Win32CacheName}.cache"); |
240 | 245 | MoveFile(oldWin32CacheFile, newWin32CacheFile); |
241 | | - var oldUWPCacheFile = Path.Combine(DataLocation.CacheDirectory, $"{UwpCacheName}.cache"); |
| 246 | + var oldUWPCacheFile = Path.Combine(cacheDirectory, $"{UwpCacheName}.cache"); |
242 | 247 | var newUWPCacheFile = Path.Combine(pluginCacheDirectory, $"{UwpCacheName}.cache"); |
243 | 248 | MoveFile(oldUWPCacheFile, newUWPCacheFile); |
244 | 249 |
|
|
0 commit comments