File tree Expand file tree Collapse file tree 4 files changed +49
-6
lines changed
Flow.Launcher.Core/ExternalPlugins/Environments Expand file tree Collapse file tree 4 files changed +49
-6
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
11
11
{
12
12
internal class PythonEnvironment : AbstractPluginEnvironment
13
13
{
14
+ private static readonly string ClassName = nameof ( PythonEnvironment ) ;
15
+
14
16
internal override string Language => AllowedLanguage . Python ;
15
17
16
18
internal override string EnvName => DataLocation . PythonEnvironmentName ;
@@ -39,9 +41,20 @@ internal override void InstallEnvironment()
39
41
40
42
// Python 3.11.4 is no longer Windows 7 compatible. If user is on Win 7 and
41
43
// uses Python plugin they need to custom install and use v3.8.9
42
- JTF . Run ( ( ) => DroplexPackage . Drop ( App . python_3_11_4_embeddable , InstallPath ) ) ;
44
+ JTF . Run ( async ( ) =>
45
+ {
46
+ try
47
+ {
48
+ await DroplexPackage . Drop ( App . python_3_11_4_embeddable , InstallPath ) ;
43
49
44
- PluginsSettingsFilePath = ExecutablePath ;
50
+ PluginsSettingsFilePath = ExecutablePath ;
51
+ }
52
+ catch ( System . Exception e )
53
+ {
54
+ API . ShowMsgError ( API . GetTranslation ( "failToInstallPythonEnv" ) ) ;
55
+ API . LogException ( ClassName , "Failed to install Python environment" , e ) ;
56
+ }
57
+ } ) ;
45
58
}
46
59
47
60
internal override PluginPair CreatePluginPair ( string filePath , PluginMetadata metadata )
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
11
11
{
12
12
internal class TypeScriptEnvironment : AbstractPluginEnvironment
13
13
{
14
+ private static readonly string ClassName = nameof ( TypeScriptEnvironment ) ;
15
+
14
16
internal override string Language => AllowedLanguage . TypeScript ;
15
17
16
18
internal override string EnvName => DataLocation . NodeEnvironmentName ;
@@ -34,9 +36,20 @@ internal override void InstallEnvironment()
34
36
{
35
37
FilesFolders . RemoveFolderIfExists ( InstallPath , ( s ) => API . ShowMsgBox ( s ) ) ;
36
38
37
- JTF . Run ( ( ) => DroplexPackage . Drop ( App . nodejs_16_18_0 , InstallPath ) ) ;
39
+ JTF . Run ( async ( ) =>
40
+ {
41
+ try
42
+ {
43
+ await DroplexPackage . Drop ( App . nodejs_16_18_0 , InstallPath ) ;
38
44
39
- PluginsSettingsFilePath = ExecutablePath ;
45
+ PluginsSettingsFilePath = ExecutablePath ;
46
+ }
47
+ catch ( System . Exception e )
48
+ {
49
+ API . ShowMsgError ( API . GetTranslation ( "failToInstallTypeScriptEnv" ) ) ;
50
+ API . LogException ( ClassName , "Failed to install TypeScript environment" , e ) ;
51
+ }
52
+ } ) ;
40
53
}
41
54
42
55
internal override PluginPair CreatePluginPair ( string filePath , PluginMetadata metadata )
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
11
11
{
12
12
internal class TypeScriptV2Environment : AbstractPluginEnvironment
13
13
{
14
+ private static readonly string ClassName = nameof ( TypeScriptV2Environment ) ;
15
+
14
16
internal override string Language => AllowedLanguage . TypeScriptV2 ;
15
17
16
18
internal override string EnvName => DataLocation . NodeEnvironmentName ;
@@ -34,9 +36,20 @@ internal override void InstallEnvironment()
34
36
{
35
37
FilesFolders . RemoveFolderIfExists ( InstallPath , ( s ) => API . ShowMsgBox ( s ) ) ;
36
38
37
- JTF . Run ( ( ) => DroplexPackage . Drop ( App . nodejs_16_18_0 , InstallPath ) ) ;
39
+ JTF . Run ( async ( ) =>
40
+ {
41
+ try
42
+ {
43
+ await DroplexPackage . Drop ( App . nodejs_16_18_0 , InstallPath ) ;
38
44
39
- PluginsSettingsFilePath = ExecutablePath ;
45
+ PluginsSettingsFilePath = ExecutablePath ;
46
+ }
47
+ catch ( System . Exception e )
48
+ {
49
+ API . ShowMsgError ( API . GetTranslation ( "failToInstallTypeScriptEnv" ) ) ;
50
+ API . LogException ( ClassName , "Failed to install TypeScript environment" , e ) ;
51
+ }
52
+ } ) ;
40
53
}
41
54
42
55
internal override PluginPair CreatePluginPair ( string filePath , PluginMetadata metadata )
Original file line number Diff line number Diff line change 34
34
<system : String x : Key =" pleaseTryAgain" >Please try again</system : String >
35
35
<system : String x : Key =" parseProxyFailed" >Unable to parse Http Proxy</system : String >
36
36
37
+ <!-- AbstractPluginEnvironment -->
38
+ <system : String x : Key =" failToInstallTypeScriptEnv" >Failed to install TypeScript environment. Please try again later</system : String >
39
+ <system : String x : Key =" failToInstallPythonEnv" >Failed to install Python environment. Please try again later.</system : String >
40
+
37
41
<!-- MainWindow -->
38
42
<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 >
39
43
<system : String x : Key =" unregisterHotkeyFailed" >Failed to unregister hotkey "{0}". Please try again or see log for details</system : String >
You can’t perform that action at this time.
0 commit comments