mirror of
https://github.com/sp-tarkov/launcher.git
synced 2025-02-13 03:30:43 -05:00
batFix (!35)
Co-authored-by: IsWaffle <waffle.lord@noreply.dev.sp-tarkov.com> Co-authored-by: Dev <dev@dev.sp-tarkov.com> Reviewed-on: SPT-AKI/Launcher#35
This commit is contained in:
parent
1112795fcd
commit
7eaff0da37
@ -49,10 +49,10 @@ namespace Aki.Launcher
|
|||||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var uninstallStringValue = Registry.LocalMachine.OpenSubKey(registryInstall, false)
|
var installLocation = Registry.LocalMachine.OpenSubKey(registryInstall, false)
|
||||||
?.GetValue("UninstallString");
|
?.GetValue("InstallLocation");
|
||||||
var info = (uninstallStringValue is string key) ? new FileInfo(key) : null;
|
var info = (installLocation is string key) ? new DirectoryInfo(key) : null;
|
||||||
return info?.DirectoryName;
|
return info?.FullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GameStarterResult> LaunchGame(ServerInfo server, AccountInfo account, string gamePath)
|
public async Task<GameStarterResult> LaunchGame(ServerInfo server, AccountInfo account, string gamePath)
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection.Metadata.Ecma335;
|
|
||||||
using Aki.ByteBanger;
|
using Aki.ByteBanger;
|
||||||
|
using Aki.Launcher.Controllers;
|
||||||
using Aki.Launcher.MiniCommon;
|
using Aki.Launcher.MiniCommon;
|
||||||
using Aki.Launcher.Models.Launcher;
|
using Aki.Launcher.Models.Launcher;
|
||||||
|
|
||||||
@ -115,15 +115,22 @@ namespace Aki.Launcher.Helpers
|
|||||||
var target = Path.ChangeExtension(file.FullName, null);
|
var target = Path.ChangeExtension(file.FullName, null);
|
||||||
|
|
||||||
// remove patched file
|
// remove patched file
|
||||||
|
try
|
||||||
|
{
|
||||||
var patched = new FileInfo(target);
|
var patched = new FileInfo(target);
|
||||||
patched.IsReadOnly = false;
|
patched.IsReadOnly = false;
|
||||||
patched.Delete();
|
patched.Delete();
|
||||||
|
|
||||||
// restore from backup
|
// Restore from backup
|
||||||
File.Copy(file.FullName, target);
|
File.Copy(file.FullName, target);
|
||||||
file.IsReadOnly = false;
|
file.IsReadOnly = false;
|
||||||
file.Delete();
|
file.Delete();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogManager.Instance.Exception(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user