mirror of
https://github.com/sp-tarkov/launcher.git
synced 2025-02-12 17:10:44 -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
616393d985
commit
8e6ff47a63
@ -49,10 +49,10 @@ namespace Aki.Launcher
|
||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
return null;
|
||||
|
||||
var uninstallStringValue = Registry.LocalMachine.OpenSubKey(registryInstall, false)
|
||||
?.GetValue("UninstallString");
|
||||
var info = (uninstallStringValue is string key) ? new FileInfo(key) : null;
|
||||
return info?.DirectoryName;
|
||||
var installLocation = Registry.LocalMachine.OpenSubKey(registryInstall, false)
|
||||
?.GetValue("InstallLocation");
|
||||
var info = (installLocation is string key) ? new DirectoryInfo(key) : null;
|
||||
return info?.FullName;
|
||||
}
|
||||
|
||||
public async Task<GameStarterResult> LaunchGame(ServerInfo server, AccountInfo account, string gamePath)
|
||||
|
@ -9,8 +9,8 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using Aki.ByteBanger;
|
||||
using Aki.Launcher.Controllers;
|
||||
using Aki.Launcher.MiniCommon;
|
||||
using Aki.Launcher.Models.Launcher;
|
||||
|
||||
@ -115,14 +115,21 @@ namespace Aki.Launcher.Helpers
|
||||
var target = Path.ChangeExtension(file.FullName, null);
|
||||
|
||||
// remove patched file
|
||||
var patched = new FileInfo(target);
|
||||
patched.IsReadOnly = false;
|
||||
patched.Delete();
|
||||
try
|
||||
{
|
||||
var patched = new FileInfo(target);
|
||||
patched.IsReadOnly = false;
|
||||
patched.Delete();
|
||||
|
||||
// restore from backup
|
||||
File.Copy(file.FullName, target);
|
||||
file.IsReadOnly = false;
|
||||
file.Delete();
|
||||
// Restore from backup
|
||||
File.Copy(file.FullName, target);
|
||||
file.IsReadOnly = false;
|
||||
file.Delete();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.Instance.Exception(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user