mirror of
https://github.com/HolographicHat/Yae.git
synced 2025-12-15 02:48:12 +08:00
fix #31
This commit is contained in:
@@ -58,13 +58,8 @@ public static class Export {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void ToSnapGenshin(AchievementAllDataNotify data) {
|
private static void ToSnapGenshin(AchievementAllDataNotify data) {
|
||||||
if (CheckSnapScheme()) {
|
Utils.CopyToClipboard(JsonConvert.SerializeObject(ExportToUIAFApp(data)));
|
||||||
Utils.CopyToClipboard(JsonConvert.SerializeObject(ExportToUIAFApp(data)));
|
Console.WriteLine(App.ExportToSnapGenshinSuccess);
|
||||||
Utils.ShellOpen("snapgenshin://achievement/import/uiaf");
|
|
||||||
Console.WriteLine(App.ExportToSnapGenshinSuccess);
|
|
||||||
} else {
|
|
||||||
Console.WriteLine(App.ExportToSnapGenshinNeedUpdate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ToPaimon(AchievementAllDataNotify data) {
|
private static void ToPaimon(AchievementAllDataNotify data) {
|
||||||
@@ -173,10 +168,6 @@ public static class Export {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning disable CA1416
|
#pragma warning disable CA1416
|
||||||
private static bool CheckSnapScheme() {
|
|
||||||
return (string?)Registry.ClassesRoot.OpenSubKey("snapgenshin")?.GetValue("") == "URL:snapgenshin";
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool CheckXunkongScheme() {
|
private static bool CheckXunkongScheme() {
|
||||||
return (string?)Registry.ClassesRoot.OpenSubKey("xunkong")?.GetValue("") == "URL:xunkong";
|
return (string?)Registry.ClassesRoot.OpenSubKey("xunkong")?.GetValue("") == "URL:xunkong";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,7 +193,8 @@ public static class Utils {
|
|||||||
|
|
||||||
// ReSharper disable once UnusedMethodReturnValue.Global
|
// ReSharper disable once UnusedMethodReturnValue.Global
|
||||||
public static Thread StartAndWaitResult(string exePath, Func<string, bool> onReceive) {
|
public static Thread StartAndWaitResult(string exePath, Func<string, bool> onReceive) {
|
||||||
const string lib = "C:/ProgramData/yae.dll";
|
var dataDir = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
|
||||||
|
var lib = Path.Combine(dataDir, "yae.dll");
|
||||||
File.Copy(Path.GetFullPath(GlobalVars.LibName), lib, true);
|
File.Copy(Path.GetFullPath(GlobalVars.LibName), lib, true);
|
||||||
AppDomain.CurrentDomain.ProcessExit += (_, _) => {
|
AppDomain.CurrentDomain.ProcessExit += (_, _) => {
|
||||||
File.Delete(lib);
|
File.Delete(lib);
|
||||||
|
|||||||
Reference in New Issue
Block a user