Skip to content

Commit a27e98b

Browse files
committed
add handling of default plugin installation
1 parent 8c2f0bd commit a27e98b

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,30 @@ private void Install(UserPlugin plugin, string downloadedFilePath)
419419
plugin.Name));
420420
}
421421

422-
var directory = string.IsNullOrEmpty(plugin.Version) ? $"{plugin.Name}-{Guid.NewGuid()}" : $"{plugin.Name}-{plugin.Version}";
423-
var newPluginPath = Path.Combine(DataLocation.PluginsDirectory, directory);
422+
var folderName = string.IsNullOrEmpty(plugin.Version) ? $"{plugin.Name}-{Guid.NewGuid()}" : $"{plugin.Name}-{plugin.Version}";
423+
424+
var defaultPluginIDs = new List<string>
425+
{
426+
"0ECADE17459B49F587BF81DC3A125110", // BrowserBookmark
427+
"CEA0FDFC6D3B4085823D60DC76F28855", // Calculator
428+
"572be03c74c642baae319fc283e561a8", // Explorer
429+
"6A122269676E40EB86EB543B945932B9", // PluginIndicator
430+
"9f8f9b14-2518-4907-b211-35ab6290dee7", // PluginsManager
431+
"b64d0a79-329a-48b0-b53f-d658318a1bf6", // ProcessKiller
432+
"791FC278BA414111B8D1886DFE447410", // Program
433+
"D409510CD0D2481F853690A07E6DC426", // Shell
434+
"CEA08895D2544B019B2E9C5009600DF4", // Sys
435+
"0308FD86DE0A4DEE8D62B9B535370992", // URL
436+
"565B73353DBF4806919830B9202EE3BF", // WebSearch
437+
"5043CETYU6A748679OPA02D27D99677A" // WindowsSettings
438+
};
439+
440+
// Treat default plugin differently, it needs to be removable along with each flow release
441+
var installDirectory = !defaultPluginIDs.Any(x => x == plugin.ID)
442+
? DataLocation.PluginsDirectory
443+
: Constant.PreinstalledDirectory;
444+
445+
var newPluginPath = Path.Combine(installDirectory, folderName);
424446

425447
FilesFolders.CopyAll(pluginFolderPath, newPluginPath);
426448

0 commit comments

Comments
 (0)