Try to detect Wine.

Make the Windoes binary try to detect if it's running under Wine. Display a
warning if so, as Rockbox Utility is likely to fail in all kind of strange ways
when running on Wine. We do provide Linux binaries, so it's not even a good
idea to try running under Wine at all.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25471 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2010-04-04 21:08:17 +00:00
parent c9532a2e30
commit fa84c2fdbf

View file

@ -83,6 +83,21 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
this->setWindowIcon(windowIcon);
#endif
#if defined(Q_OS_WIN32)
long ret;
HKEY hk;
ret = RegOpenKeyEx(HKEY_CURRENT_USER, _TEXT("Software\\Wine"),
0, KEY_QUERY_VALUE, &hk);
if(ret == ERROR_SUCCESS) {
QMessageBox::warning(this, tr("Wine detected!"),
tr("It seems you are trying to run this program under Wine. "
"Please don't do this, running under Wine will fail. "
"Use the native Linux binary instead."),
QMessageBox::Ok, QMessageBox::Ok);
qDebug() << "[RbUtil] WINE DETECTED!";
RegCloseKey(hk);
}
#endif
downloadInfo();
m_gotInfo = false;