Fix relocated desktop tool paths and package release 0.2.2
This commit is contained in:
1 parent
efaf16de18
commit
e366eb5bec
14 files changed
+250
-33
No files matched your search
@@ -97,6 +97,18 @@ public partial class MainViewModel : ObservableObject, IDisposable
|
||||
preferredDevice = settings.PreferredDevice;
|
||||
}
|
||||
catch (Exception error) { Log("读取配置失败,使用默认值:" + error.Message); }
|
||||
if (File.Exists(settingsFile)) {
|
||||
var changed=false;
|
||||
string Repair(string value,string name) {
|
||||
try {
|
||||
var resolved=DesktopPaths.ResolveTool(value,name);
|
||||
if(resolved!=value){changed=true;Log($"已更新 {name} 工具位置:{resolved}");}
|
||||
return resolved;
|
||||
} catch(InvalidOperationException) { return value; }
|
||||
}
|
||||
ClientPath=Repair(ClientPath,"ads-client");AdbPath=Repair(AdbPath,"adb");ScrcpyPath=Repair(ScrcpyPath,"scrcpy");
|
||||
if(changed)PersistSelectedPaths();
|
||||
}
|
||||
var environmentToken = loadLocalCredentials ? Environment.GetEnvironmentVariable("ADS_CLIENT_TOKEN") : null;
|
||||
if (!string.IsNullOrWhiteSpace(environmentToken))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user