Elaborate on admin warning, now with manual override (resolves #3835)
This commit is contained in:
parent
a48ca42125
commit
0e084eaefd
|
@ -135,6 +135,8 @@ namespace BizHawk.Client.Common
|
|||
public string UpdateIgnoreVersion { get; set; } = "";
|
||||
public bool SkipOutdatedOsCheck { get; set; }
|
||||
|
||||
public bool SkipSuperuserPrivsCheck { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Makes a .bak file before any saveram-writing operation (could be extended to make timestamped backups)
|
||||
/// </summary>
|
||||
|
|
|
@ -294,15 +294,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
_ = SetDllDirectoryW(dllDir);
|
||||
}
|
||||
|
||||
if (OSTailoredCode.HostWindowsVersion is null ||
|
||||
OSTailoredCode.HostWindowsVersion.Value.Version >= OSTailoredCode.WindowsVersion._10) // "windows isn't capable of being useful for non-administrators until windows 10" --zeromus
|
||||
if (!initialConfig.SkipSuperuserPrivsCheck
|
||||
&& OSTailoredCode.HostWindowsVersion is null or { Version: >= OSTailoredCode.WindowsVersion._10 }) // "windows isn't capable of being useful for non-administrators until windows 10" --zeromus
|
||||
{
|
||||
if (EmuHawkUtil.CLRHostHasElevatedPrivileges)
|
||||
{
|
||||
using MsgBox dialog = new(
|
||||
title: "This EmuHawk is privileged",
|
||||
message: $"EmuHawk detected it {(OSTailoredCode.IsUnixHost ? "is running as root (Superuser)" : "has Administrator privileges")}.\n"
|
||||
+ "This is a bad idea.",
|
||||
+ "Regularly using {(OSTailoredCode.IsUnixHost ? "Superuser" : "Administrator")} for things other than system administration makes it easier to hack you.\n"
|
||||
+ "If you're certain, you may continue anyway (and without support). You'll find a flag \"{nameof(Config.SkipSuperuserPrivsCheck)}\" in the config file, which disables this warning.",
|
||||
boxIcon: MessageBoxIcon.Warning);
|
||||
dialog.ShowDialog();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue