diff --git a/lib/common/helper/system_helper.dart b/lib/common/helper/system_helper.dart index c23cad8..d2040ee 100644 --- a/lib/common/helper/system_helper.dart +++ b/lib/common/helper/system_helper.dart @@ -255,7 +255,7 @@ foreach ($adapter in $adapterMemory) { static Future openDir(path) async { dPrint("SystemHelper.openDir path === $path"); await Process.run( - SystemHelper.powershellPath, ["explorer.exe", "/select,\"$path\""]); + SystemHelper.powershellPath, ["explorer.exe", "/select,\"\"$path\"\""]); } static String getHostsFilePath() { diff --git a/lib/ui/home/localization/localization_ui_model.dart b/lib/ui/home/localization/localization_ui_model.dart index c12d493..939ed90 100644 --- a/lib/ui/home/localization/localization_ui_model.dart +++ b/lib/ui/home/localization/localization_ui_model.dart @@ -265,8 +265,7 @@ class LocalizationUIModel extends _$LocalizationUIModel { openDir(BuildContext context) async { showToast(context, S.current.localization_info_custom_file_instructions); - await Process.run(SystemHelper.powershellPath, - ["explorer.exe", "/select,\"${_customizeDir.absolute.path}\"\\"]); + SystemHelper.openDir("\"${_customizeDir.absolute.path}\"\\"); } VoidCallback? doRemoteInstall( diff --git a/lib/ui/settings/upgrade_dialog.dart b/lib/ui/settings/upgrade_dialog.dart index b2e512c..41eac83 100644 --- a/lib/ui/settings/upgrade_dialog.dart +++ b/lib/ui/settings/upgrade_dialog.dart @@ -259,8 +259,7 @@ class UpgradeDialogUI extends HookConsumerWidget { progress.value = 0; if (!context.mounted) return; showToast(context, S.current.app_upgrade_info_run_failed); - Process.run(SystemHelper.powershellPath, - ["explorer.exe", "/select,\"$fileName\""]); + SystemHelper.openDir("\"$fileName\""); } } } diff --git a/lib/ui/tools/tools_ui_model.dart b/lib/ui/tools/tools_ui_model.dart index d5e4bd3..c3604ce 100644 --- a/lib/ui/tools/tools_ui_model.dart +++ b/lib/ui/tools/tools_ui_model.dart @@ -361,8 +361,7 @@ class ToolsUIModel extends _$ToolsUIModel { } openDir(path) async { - await Process.run( - SystemHelper.powershellPath, ["explorer.exe", "/select,\"$path\""]); + SystemHelper.openDir("\"$path\""); } Future _showSystemInfo(BuildContext context) async {