diff --git a/src/core/kernel/init/CxbxKrnl.cpp b/src/core/kernel/init/CxbxKrnl.cpp index 284519bb4..b859d744b 100644 --- a/src/core/kernel/init/CxbxKrnl.cpp +++ b/src/core/kernel/init/CxbxKrnl.cpp @@ -664,8 +664,10 @@ bool HandleFirstLaunch() return false; } + // Wine will always run programs as administrator by default, it can be safely disregard. + // Since Wine doesn't use root permission. Unless user is running Wine as root. bool bElevated = CxbxIsElevated(); - if (bElevated && !g_Settings->m_core.allowAdminPrivilege) { + if (bElevated && !isWineEnv() && !g_Settings->m_core.allowAdminPrivilege) { PopupReturn ret = PopupWarningEx(nullptr, PopupButtons::YesNo, PopupReturn::No, "Cxbx-Reloaded has detected that it has been launched with Administrator rights.\n" "\nThis is dangerous, as a maliciously modified Xbox titles could take control of your system.\n" diff --git a/src/gui/WndMain.cpp b/src/gui/WndMain.cpp index bb1044fcc..c38e7b056 100644 --- a/src/gui/WndMain.cpp +++ b/src/gui/WndMain.cpp @@ -44,6 +44,7 @@ #include "core\hle\D3D8\XbConvert.h" // For EmuPC2XB_D3DFormat #include "common\Settings.hpp" #include "common/util/cliConfig.hpp" +#include "common/win32/WineEnv.h" #include "core\kernel\init\CxbxKrnl.h" // For CxbxExec #include "resource/ResCxbx.h" @@ -273,6 +274,12 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP ReleaseDC(hwnd, hDC); } + // Check if running in Wine environment. If it is, then we don't need admin warning message popup on startup. + if (isWineEnv()) { + BOOL bAdminCheckRemoveRet = RemoveMenu(GetMenu(hwnd), ID_SETTINGS_ALLOWADMINPRIVILEGE, MF_GRAYED); + assert(bAdminCheckRemoveRet != -1); + } + SetClassLong(hwnd, GCL_HICON, (LONG)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_CXBX))); DragAcceptFiles(hwnd, TRUE);