diff --git a/src/BizHawk.Client.EmuHawk/EmuHawkUtil.cs b/src/BizHawk.Client.EmuHawk/EmuHawkUtil.cs
index 04585374a5..2e9c6088ec 100644
--- a/src/BizHawk.Client.EmuHawk/EmuHawkUtil.cs
+++ b/src/BizHawk.Client.EmuHawk/EmuHawkUtil.cs
@@ -1,5 +1,6 @@
using System;
using System.IO;
+using System.Security.Principal;
using System.Text;
using BizHawk.Common;
@@ -7,6 +8,10 @@ namespace BizHawk.Client.EmuHawk
{
public static class EmuHawkUtil
{
+ /// iff running as Administrator (on Windows) or Superuser (on Unix under Mono)
+ /// TODO check .NET Core
+ public static readonly bool CLRHostHasElevatedPrivileges = new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
+
/// http://stackoverflow.com/questions/139010/how-to-resolve-a-lnk-in-c-sharp
public static string ResolveShortcut(string filename)
{
diff --git a/src/BizHawk.Client.EmuHawk/Program.cs b/src/BizHawk.Client.EmuHawk/Program.cs
index 3def9e92c9..b828c1acae 100644
--- a/src/BizHawk.Client.EmuHawk/Program.cs
+++ b/src/BizHawk.Client.EmuHawk/Program.cs
@@ -219,6 +219,8 @@ namespace BizHawk.Client.EmuHawk
SetDllDirectory(dllDir);
}
+ Util.DebugWriteLine(EmuHawkUtil.CLRHostHasElevatedPrivileges ? "running as Superuser/Administrator" : "running as unprivileged user");
+
var exitCode = 0;
try
{