mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
chore: always ignore default if env vars are predefined
This commit is contained in:
parent
0c59f65aef
commit
9d538d3b2a
1 changed files with 12 additions and 8 deletions
|
|
@ -55,14 +55,9 @@ namespace Dalamud.Injector
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set boot defaults
|
// Set boot defaults
|
||||||
var prevFixList = Environment.GetEnvironmentVariable("DALAMUD_GAMEFIX_LIST");
|
SetEnvDefaultIfNotExist("DALAMUD_GAMEFIX_LIST", "prevent_devicechange_crashes,disable_game_openprocess_access_check,redirect_openprocess");
|
||||||
if (string.IsNullOrWhiteSpace(prevFixList))
|
SetEnvDefaultIfNotExist("DALAMUD_DOTNET_OPENPROCESS_HOOKMODE", "0");
|
||||||
{
|
SetEnvDefaultIfNotExist("DALAMUD_UNHOOK_DLLS", "kernel32.dll,ntdll.dll,user32.dll");
|
||||||
Environment.SetEnvironmentVariable("DALAMUD_GAMEFIX_LIST", "prevent_devicechange_crashes,disable_game_openprocess_access_check,redirect_openprocess");
|
|
||||||
}
|
|
||||||
|
|
||||||
Environment.SetEnvironmentVariable("DALAMUD_DOTNET_OPENPROCESS_HOOKMODE", "0");
|
|
||||||
Environment.SetEnvironmentVariable("DALAMUD_UNHOOK_DLLS", "kernel32.dll,ntdll.dll,user32.dll");
|
|
||||||
|
|
||||||
DalamudStartInfo startInfo = null;
|
DalamudStartInfo startInfo = null;
|
||||||
if (args.Count == 1)
|
if (args.Count == 1)
|
||||||
|
|
@ -111,6 +106,15 @@ namespace Dalamud.Injector
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void SetEnvDefaultIfNotExist(string name, string value)
|
||||||
|
{
|
||||||
|
var prevValue = Environment.GetEnvironmentVariable(name);
|
||||||
|
if (string.IsNullOrWhiteSpace(prevValue))
|
||||||
|
{
|
||||||
|
Environment.SetEnvironmentVariable(name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static string GetLogPath(string filename)
|
private static string GetLogPath(string filename)
|
||||||
{
|
{
|
||||||
var baseDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
var baseDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue