新增自定义安装位置

新增根据现有安装位置推测其他版本位置
This commit is contained in:
2023-11-21 23:36:26 +08:00
parent d8dbbc5fbd
commit 74dc327bd6
5 changed files with 154 additions and 30 deletions

View File

@@ -1,5 +1,6 @@
import 'dart:io';
import 'package:hive/hive.dart';
import 'package:starcitizen_doctor/common/utils/base_utils.dart';
class SystemHelper {
@@ -79,6 +80,14 @@ class SystemHelper {
/// 获取 RSI 启动器 目录
static Future<String> getRSILauncherPath() async {
final confBox = await Hive.openBox("app_conf");
final path = confBox.get("custom_launcher_path");
if (path != null && path != "") {
if (await File(path).exists()) {
return path;
}
}
Map<String, String> envVars = Platform.environment;
final programDataPath = envVars["programdata"];
final rsiFilePath =