mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #3900 from Flow-Launcher/environment_install
Add error handler for DroplexPackage.Drop
This commit is contained in:
commit
2f9c101222
4 changed files with 49 additions and 6 deletions
|
|
@ -11,6 +11,8 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
|
|||
{
|
||||
internal class PythonEnvironment : AbstractPluginEnvironment
|
||||
{
|
||||
private static readonly string ClassName = nameof(PythonEnvironment);
|
||||
|
||||
internal override string Language => AllowedLanguage.Python;
|
||||
|
||||
internal override string EnvName => DataLocation.PythonEnvironmentName;
|
||||
|
|
@ -39,9 +41,20 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
|
|||
|
||||
// Python 3.11.4 is no longer Windows 7 compatible. If user is on Win 7 and
|
||||
// uses Python plugin they need to custom install and use v3.8.9
|
||||
JTF.Run(() => DroplexPackage.Drop(App.python_3_11_4_embeddable, InstallPath));
|
||||
JTF.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
await DroplexPackage.Drop(App.python_3_11_4_embeddable, InstallPath);
|
||||
|
||||
PluginsSettingsFilePath = ExecutablePath;
|
||||
PluginsSettingsFilePath = ExecutablePath;
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
API.ShowMsgError(API.GetTranslation("failToInstallPythonEnv"));
|
||||
API.LogException(ClassName, "Failed to install Python environment", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
internal override PluginPair CreatePluginPair(string filePath, PluginMetadata metadata)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
|
|||
{
|
||||
internal class TypeScriptEnvironment : AbstractPluginEnvironment
|
||||
{
|
||||
private static readonly string ClassName = nameof(TypeScriptEnvironment);
|
||||
|
||||
internal override string Language => AllowedLanguage.TypeScript;
|
||||
|
||||
internal override string EnvName => DataLocation.NodeEnvironmentName;
|
||||
|
|
@ -34,9 +36,20 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
|
|||
{
|
||||
FilesFolders.RemoveFolderIfExists(InstallPath, (s) => API.ShowMsgBox(s));
|
||||
|
||||
JTF.Run(() => DroplexPackage.Drop(App.nodejs_16_18_0, InstallPath));
|
||||
JTF.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
await DroplexPackage.Drop(App.nodejs_16_18_0, InstallPath);
|
||||
|
||||
PluginsSettingsFilePath = ExecutablePath;
|
||||
PluginsSettingsFilePath = ExecutablePath;
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
API.ShowMsgError(API.GetTranslation("failToInstallTypeScriptEnv"));
|
||||
API.LogException(ClassName, "Failed to install TypeScript environment", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
internal override PluginPair CreatePluginPair(string filePath, PluginMetadata metadata)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
|
|||
{
|
||||
internal class TypeScriptV2Environment : AbstractPluginEnvironment
|
||||
{
|
||||
private static readonly string ClassName = nameof(TypeScriptV2Environment);
|
||||
|
||||
internal override string Language => AllowedLanguage.TypeScriptV2;
|
||||
|
||||
internal override string EnvName => DataLocation.NodeEnvironmentName;
|
||||
|
|
@ -34,9 +36,20 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
|
|||
{
|
||||
FilesFolders.RemoveFolderIfExists(InstallPath, (s) => API.ShowMsgBox(s));
|
||||
|
||||
JTF.Run(() => DroplexPackage.Drop(App.nodejs_16_18_0, InstallPath));
|
||||
JTF.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
await DroplexPackage.Drop(App.nodejs_16_18_0, InstallPath);
|
||||
|
||||
PluginsSettingsFilePath = ExecutablePath;
|
||||
PluginsSettingsFilePath = ExecutablePath;
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
API.ShowMsgError(API.GetTranslation("failToInstallTypeScriptEnv"));
|
||||
API.LogException(ClassName, "Failed to install TypeScript environment", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
internal override PluginPair CreatePluginPair(string filePath, PluginMetadata metadata)
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@
|
|||
<system:String x:Key="pleaseTryAgain">Please try again</system:String>
|
||||
<system:String x:Key="parseProxyFailed">Unable to parse Http Proxy</system:String>
|
||||
|
||||
<!-- AbstractPluginEnvironment -->
|
||||
<system:String x:Key="failToInstallTypeScriptEnv">Failed to install TypeScript environment. Please try again later</system:String>
|
||||
<system:String x:Key="failToInstallPythonEnv">Failed to install Python environment. Please try again later.</system:String>
|
||||
|
||||
<!-- MainWindow -->
|
||||
<system:String x:Key="registerHotkeyFailed">Failed to register hotkey "{0}". The hotkey may be in use by another program. Change to a different hotkey, or exit another program.</system:String>
|
||||
<system:String x:Key="unregisterHotkeyFailed">Failed to unregister hotkey "{0}". Please try again or see log for details</system:String>
|
||||
|
|
|
|||
Loading…
Reference in a new issue