This commit is contained in:
HolographicHat
2022-09-01 11:16:08 +08:00
parent 92e8cd8997
commit ffd75da2bf
2 changed files with 4 additions and 12 deletions

View File

@@ -58,13 +58,8 @@ public static class Export {
}
private static void ToSnapGenshin(AchievementAllDataNotify data) {
if (CheckSnapScheme()) {
Utils.CopyToClipboard(JsonConvert.SerializeObject(ExportToUIAFApp(data)));
Utils.ShellOpen("snapgenshin://achievement/import/uiaf");
Console.WriteLine(App.ExportToSnapGenshinSuccess);
} else {
Console.WriteLine(App.ExportToSnapGenshinNeedUpdate);
}
Utils.CopyToClipboard(JsonConvert.SerializeObject(ExportToUIAFApp(data)));
Console.WriteLine(App.ExportToSnapGenshinSuccess);
}
private static void ToPaimon(AchievementAllDataNotify data) {
@@ -173,10 +168,6 @@ public static class Export {
}
#pragma warning disable CA1416
private static bool CheckSnapScheme() {
return (string?)Registry.ClassesRoot.OpenSubKey("snapgenshin")?.GetValue("") == "URL:snapgenshin";
}
private static bool CheckXunkongScheme() {
return (string?)Registry.ClassesRoot.OpenSubKey("xunkong")?.GetValue("") == "URL:xunkong";
}

View File

@@ -193,7 +193,8 @@ public static class Utils {
// ReSharper disable once UnusedMethodReturnValue.Global
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);
AppDomain.CurrentDomain.ProcessExit += (_, _) => {
File.Delete(lib);