diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index bb0f5750..4a3744a5 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -3310,22 +3310,22 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. - + Executable '%1' requires Qt v%2, but found Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. - + Executable '%1' requires Windows XP or later. @@ -3394,104 +3394,124 @@ - - + + Build - + Unknown - + + Sorry, but only users in the "Administrators" group can install updates. + + + + + Please start application from an administrator account and try again! + + + + Testing your internet connection, please wait... - + It appears that the computer currently is offline! - - + + Please make sure your computer is connected to the internet and try again. - + Network connectivity test has failed! - + Checking for new updates online, please wait... - + Failed to fetch update information from server! - + Sorry, the update server might be busy at this time. Plase try again later. - + More information available at: - + A new version of LameXP is available! - + + Discard + + + + + Ignore + + + + Initializing, please wait... - + We highly recommend all users to install this update as soon as possible. - + No new updates available at this time. - + Your version of LameXP is still up-to-date. Please check for updates regularly! - + Your version appears to be newer than the latest release. - + This usually indicates your are currently using a pre-release version of LameXP. - + Update is being downloaded, please be patient... - + Update ready to install. Applicaion will quit... - + Update failed. Please try again or download manually! diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index e68be8ae..84b59461 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -2024,7 +2024,7 @@ APE - + @@ -2743,5 +2743,21 @@ Initializing, please wait... Initialisiere, bitte warten... + + Discard + Schließen + + + Ignore + Ignorieren + + + Sorry, but only users in the "Administrators" group can install updates. + Ausschließlich Benutzer der "Administratoren" Gruppe können Updates installieren. + + + Please start application from an administrator account and try again! + Bitte starten Sie den Update-Prozess aus einem Administrator-Konto erneut! + diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts index c78634c4..6022b2d4 100644 --- a/etc/Translation/LameXP_ES.ts +++ b/etc/Translation/LameXP_ES.ts @@ -2742,5 +2742,21 @@ Initializing, please wait... Iniciando, espere por favor... + + Discard + + + + Ignore + Ignorar + + + Sorry, but only users in the "Administrators" group can install updates. + + + + Please start application from an administrator account and try again! + + diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts index 6d3ddc06..aef6ca18 100644 --- a/etc/Translation/LameXP_FR.ts +++ b/etc/Translation/LameXP_FR.ts @@ -2753,5 +2753,21 @@ Ouvrir le dossier récursivement... Initializing, please wait... Initialisation, patientez... + + Discard + Abandonner + + + Ignore + Ignorer + + + Sorry, but only users in the "Administrators" group can install updates. + + + + Please start application from an administrator account and try again! + + diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts index 144b42e4..35be5b37 100644 --- a/etc/Translation/LameXP_IT.ts +++ b/etc/Translation/LameXP_IT.ts @@ -2743,5 +2743,21 @@ Initializing, please wait... Inizializzazione, attendere prego... + + Discard + Annulla + + + Ignore + Ignora + + + Sorry, but only users in the "Administrators" group can install updates. + + + + Please start application from an administrator account and try again! + + diff --git a/etc/Translation/LameXP_KR.ts b/etc/Translation/LameXP_KR.ts index 4b37f179..355bb9ee 100644 --- a/etc/Translation/LameXP_KR.ts +++ b/etc/Translation/LameXP_KR.ts @@ -2725,5 +2725,21 @@ Initializing, please wait... 초기화중, 잠시만 기다려 주십시오... + + Discard + 닫기 + + + Ignore + 무시 + + + Sorry, but only users in the "Administrators" group can install updates. + + + + Please start application from an administrator account and try again! + + diff --git a/etc/Translation/LameXP_PL.ts b/etc/Translation/LameXP_PL.ts index da1db550..8aab31d4 100644 --- a/etc/Translation/LameXP_PL.ts +++ b/etc/Translation/LameXP_PL.ts @@ -3347,22 +3347,22 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. Plik wykonywalny '%1' nie działa w trybie kompatybilności z Windows. - + Executable '%1' requires Qt v%2, but found Qt v%3. Plik wykonywalny '%1' wymaga Qt v%2, znaleziono jednak Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. Plik wykonywalny "%1" został skompilowany dla Qt "%2", znaleziono "%3". - + Executable '%1' requires Windows XP or later. Plik wykonywalny "%1" wymaga Windows XP lub nowszego. @@ -3431,104 +3431,124 @@ Zamknij - - + + Build Build - + Unknown Nieznana - + + Sorry, but only users in the "Administrators" group can install updates. + + + + + Please start application from an administrator account and try again! + + + + Testing your internet connection, please wait... Testowanie połączenia internetowego, prosze czekać... - + It appears that the computer currently is offline! LameXP wykrył brak dostępu do internetu! - - + + Please make sure your computer is connected to the internet and try again. Upewnij się że komputer jest podłączony do internetu i spróbuj ponownie. - + Network connectivity test has failed! Test połączenia internetowego zakończony niepowodzeniem! - + Checking for new updates online, please wait... Sprawdzanie aktualizacji online, prosze czekać... - + Failed to fetch update information from server! Pobieranie informacji z serwera zakończone niepowodzeniem! - + Sorry, the update server might be busy at this time. Plase try again later. Serwer aktualizacji wydaje się nie odpowiadać w tej chwili. Prosze spróbować później. - + More information available at: Więcej informacji tutaj: - + A new version of LameXP is available! Dostępna nowa wersja LameXP! - + + Discard + + + + + Ignore + Ignoruj + + + Initializing, please wait... Inicjowanie, prosze czekać... - + We highly recommend all users to install this update as soon as possible. Jest wysoce zalecane aby zainstalować tę aktualizację jak najszybciej. - + No new updates available at this time. Nie ma nowych aktualizacji w tej chwili. - + Your version of LameXP is still up-to-date. Please check for updates regularly! Posiadasz najnowszą wersję LameXP. Sprawdzaj aktualizacje regularnie! - + Your version appears to be newer than the latest release. Posiadasz nowszą wersję LameXP niż ostatnie wydanie. - + This usually indicates your are currently using a pre-release version of LameXP. To wskazuje na to, że posiadasz wersję alfa LameXP. - + Update is being downloaded, please be patient... Pobieranie aktualizacji w toku, prosze czekać... - + Update ready to install. Applicaion will quit... Aktualizacja gotowa do instalacji. Teraz program zostanie zamknięty... - + Update failed. Please try again or download manually! Aktualizacja zakończona niepowodzeniem. Prosze spróbować ponownie lub zainstalować ręcznie! diff --git a/etc/Translation/LameXP_RU.ts b/etc/Translation/LameXP_RU.ts index 015575ba..ec6f32ae 100644 --- a/etc/Translation/LameXP_RU.ts +++ b/etc/Translation/LameXP_RU.ts @@ -2768,5 +2768,21 @@ Initializing, please wait... Инициализация, пожалуйста, подождите... + + Discard + Отменить + + + Ignore + Игнорировать + + + Sorry, but only users in the "Administrators" group can install updates. + + + + Please start application from an administrator account and try again! + + diff --git a/etc/Translation/LameXP_SV.ts b/etc/Translation/LameXP_SV.ts index d791f655..1615e78e 100644 --- a/etc/Translation/LameXP_SV.ts +++ b/etc/Translation/LameXP_SV.ts @@ -3330,22 +3330,22 @@ QApplication - + Executable '%1' doesn't support Windows compatibility mode. EXE-filen '%1' stöder inte Windows kompatibilitetsläge. - + Executable '%1' requires Qt v%2, but found Qt v%3. EXE-filen '%1' kräver Qt v%2, du har Qt v%3. - + Executable '%1' was built for Qt '%2', but found Qt '%3'. EXE-filen '%1' är byggd för Qt '%2', du har Qt '%3'. - + Executable '%1' requires Windows XP or later. @@ -3414,104 +3414,124 @@ Stäng - - + + Build Build - + Unknown Okänd - + + Sorry, but only users in the "Administrators" group can install updates. + + + + + Please start application from an administrator account and try again! + + + + Testing your internet connection, please wait... Kontrollerar iInternetanslutningen, vänta... - + It appears that the computer currently is offline! Datorn verkar inte vara ansluten till Internet! - - + + Please make sure your computer is connected to the internet and try again. Tillse att datorn är ansluten till Internet och försök igen. - + Network connectivity test has failed! Anslutningskontrollen misslyckades! - + Checking for new updates online, please wait... Söker nya uppdateringar, vänta... - + Failed to fetch update information from server! Kunde inte hämta uppdateringsinformation från servern! - + Sorry, the update server might be busy at this time. Plase try again later. Uppdateringsservern kan vara upptagen. Försök senare. - + More information available at: Mer information hittas på: - + A new version of LameXP is available! En ny version av LameXP finns tillgänglig! - + + Discard + Stäng + + + + Ignore + Ignorera + + + Initializing, please wait... Initierar, vänta... - + We highly recommend all users to install this update as soon as possible. Vi rekommenderar alla användare att installera denna uppdatering så snart som möjligt. - + No new updates available at this time. Det finns inga nya uppdateringar. - + Your version of LameXP is still up-to-date. Please check for updates regularly! Din version av LameXP är uppdaterad. Kontrollera regelbundet! - + Your version appears to be newer than the latest release. Din version verkar vara nyare än senaste 'Release'. - + This usually indicates your are currently using a pre-release version of LameXP. Det innebär normalt att du använder en beta-version av LameXP. - + Update is being downloaded, please be patient... Uppdatering laddas ner, vänta... - + Update ready to install. Applicaion will quit... Uppdatering klar att installeras. Programmet kommer att avslutas... - + Update failed. Please try again or download manually! Uppdateringen misslyckades. Försök igen, eller ladda ner manuellt! diff --git a/etc/Translation/LameXP_TW.ts b/etc/Translation/LameXP_TW.ts index 2a15d75b..c0a7ee63 100644 --- a/etc/Translation/LameXP_TW.ts +++ b/etc/Translation/LameXP_TW.ts @@ -2724,5 +2724,21 @@ Initializing, please wait... 正在初始化,請稍候... + + Discard + 放棄 + + + Ignore + 忽略 + + + Sorry, but only users in the "Administrators" group can install updates. + + + + Please start application from an administrator account and try again! + + diff --git a/etc/Translation/LameXP_UK.ts b/etc/Translation/LameXP_UK.ts index 3d676e75..9da6e9c8 100644 --- a/etc/Translation/LameXP_UK.ts +++ b/etc/Translation/LameXP_UK.ts @@ -2761,5 +2761,21 @@ Initializing, please wait... Ініціалізація, будь ласка, зачекайте... + + Discard + + + + Ignore + Ігнорувати + + + Sorry, but only users in the "Administrators" group can install updates. + + + + Please start application from an administrator account and try again! + + diff --git a/etc/Translation/LameXP_ZH.ts b/etc/Translation/LameXP_ZH.ts index d7b895df..96ba70bb 100644 --- a/etc/Translation/LameXP_ZH.ts +++ b/etc/Translation/LameXP_ZH.ts @@ -2724,5 +2724,21 @@ Initializing, please wait... 正在初始化,请稍候... + + Discard + 放弃 + + + Ignore + 忽略 + + + Sorry, but only users in the "Administrators" group can install updates. + + + + Please start application from an administrator account and try again! + + diff --git a/res/Icons.qrc b/res/Icons.qrc index ac59be7c..7a6f69ad 100644 --- a/res/Icons.qrc +++ b/res/Icons.qrc @@ -99,6 +99,7 @@ icons/script_go.png icons/server_error.png icons/shield_admin.png + icons/shield_blue.png icons/shield_error.png icons/shield_exclamation.png icons/shield_green.png diff --git a/res/icons/shield_blue.png b/res/icons/shield_blue.png new file mode 100644 index 00000000..2ded609b Binary files /dev/null and b/res/icons/shield_blue.png differ diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm index 475c5ede..aceb813b 100644 Binary files a/res/localization/LameXP_DE.qm and b/res/localization/LameXP_DE.qm differ diff --git a/res/localization/LameXP_ES.qm b/res/localization/LameXP_ES.qm index 908286f2..02a2d3fb 100644 Binary files a/res/localization/LameXP_ES.qm and b/res/localization/LameXP_ES.qm differ diff --git a/res/localization/LameXP_FR.qm b/res/localization/LameXP_FR.qm index 3495c24f..bc70c4dc 100644 Binary files a/res/localization/LameXP_FR.qm and b/res/localization/LameXP_FR.qm differ diff --git a/res/localization/LameXP_IT.qm b/res/localization/LameXP_IT.qm index 3006badf..ded50810 100644 Binary files a/res/localization/LameXP_IT.qm and b/res/localization/LameXP_IT.qm differ diff --git a/res/localization/LameXP_KR.qm b/res/localization/LameXP_KR.qm index dee84393..e7e415de 100644 Binary files a/res/localization/LameXP_KR.qm and b/res/localization/LameXP_KR.qm differ diff --git a/res/localization/LameXP_PL.qm b/res/localization/LameXP_PL.qm index c1b7b296..e3a01810 100644 Binary files a/res/localization/LameXP_PL.qm and b/res/localization/LameXP_PL.qm differ diff --git a/res/localization/LameXP_RU.qm b/res/localization/LameXP_RU.qm index d2943268..deb144e6 100644 Binary files a/res/localization/LameXP_RU.qm and b/res/localization/LameXP_RU.qm differ diff --git a/res/localization/LameXP_SV.qm b/res/localization/LameXP_SV.qm index 102e5d9d..1dca69d5 100644 Binary files a/res/localization/LameXP_SV.qm and b/res/localization/LameXP_SV.qm differ diff --git a/res/localization/LameXP_TW.qm b/res/localization/LameXP_TW.qm index 4ec877a8..933d418f 100644 Binary files a/res/localization/LameXP_TW.qm and b/res/localization/LameXP_TW.qm differ diff --git a/res/localization/LameXP_UK.qm b/res/localization/LameXP_UK.qm index dc97bc6f..2df84ed8 100644 Binary files a/res/localization/LameXP_UK.qm and b/res/localization/LameXP_UK.qm differ diff --git a/res/localization/LameXP_ZH.qm b/res/localization/LameXP_ZH.qm index d9b7f649..84e27ae9 100644 Binary files a/res/localization/LameXP_ZH.qm and b/res/localization/LameXP_ZH.qm differ diff --git a/src/Config.h b/src/Config.h index 8835ed10..f816c33c 100644 --- a/src/Config.h +++ b/src/Config.h @@ -35,7 +35,7 @@ #define VER_LAMEXP_MINOR_LO 9 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 10 -#define VER_LAMEXP_BUILD 1507 +#define VER_LAMEXP_BUILD 1511 #define VER_LAMEXP_CONFG 1348 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Dialog_Update.cpp b/src/Dialog_Update.cpp index fd35a1e7..a9516aa8 100644 --- a/src/Dialog_Update.cpp +++ b/src/Dialog_Update.cpp @@ -41,6 +41,7 @@ #include #include #include +#include /////////////////////////////////////////////////////////////////////////////// @@ -238,8 +239,7 @@ void UpdateDialog::updateInit(void) { setMinimumSize(size()); setMaximumHeight(height()); - QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); - checkForUpdates(); + QTimer::singleShot(0, this, SLOT(checkForUpdates())); } void UpdateDialog::checkForUpdates(void) @@ -249,6 +249,19 @@ void UpdateDialog::checkForUpdates(void) qWarning("Update in progress, cannot check for updates now!"); } + if(!lamexp_user_is_admin()) + { + qWarning("User is not in the \"admin\" group, cannot update!"); + QString message; + message += QString("%1
").arg(tr("Sorry, but only users in the \"Administrators\" group can install updates.")); + message += QString("%1").arg(tr("Please start application from an administrator account and try again!")); + if(QMessageBox::critical(this, this->windowTitle(), message, tr("Discard"), tr("Ignore")) != 1) + { + ui->closeButton->setEnabled(true); + close(); return; + } + } + WinSevenTaskbar::setTaskbarState(this->parentWidget(), WinSevenTaskbar::WinSevenTaskbarNormalState); WinSevenTaskbar::setOverlayIcon(this->parentWidget(), &QIcon(":/icons/transmit_blue.png")); @@ -294,7 +307,7 @@ void UpdateDialog::threadStatusChanged(const int status) break; case UpdateCheckThread::UpdateStatus_CompletedNewVersionOlder: ui->statusLabel->setText(tr("Your version appears to be newer than the latest release.")); - SHOW_HINT(tr("This usually indicates your are currently using a pre-release version of LameXP."), ":/icons/shield_error.png"); + SHOW_HINT(tr("This usually indicates your are currently using a pre-release version of LameXP."), ":/icons/shield_blue.png"); UPDATE_TASKBAR(WinSevenTaskbar::WinSevenTaskbarNormalState, ":/icons/shield_error.png"); break; case UpdateCheckThread::UpdateStatus_ErrorNoConnection: diff --git a/src/Global.h b/src/Global.h index c60a6b3c..66473224 100644 --- a/src/Global.h +++ b/src/Global.h @@ -229,6 +229,7 @@ QString lamexp_translation_name(const QString &language); bool lamexp_translation_register(const QString &langId, const QString &qmFile, const QString &langName, unsigned int &systemId, unsigned int &country); unsigned int lamexp_translation_sysid(const QString &langId); bool lamexp_update_sysmenu(const QWidget *win, const unsigned int identifier, const QString &text); +bool lamexp_user_is_admin(void); const QString lamexp_version2string(const QString &pattern, unsigned int version, const QString &defaultText, const QString *tag = NULL); const char *lamexp_version_arch(void); unsigned int lamexp_version_build(void); diff --git a/src/Global_Win32.cpp b/src/Global_Win32.cpp index 4dd52061..d5f771ab 100644 --- a/src/Global_Win32.cpp +++ b/src/Global_Win32.cpp @@ -892,13 +892,14 @@ static bool lamexp_event_filter(void *message, long *result) /* * Check for process elevation */ -static bool lamexp_check_elevation(void) +static bool lamexp_process_is_elevated(bool *bIsUacEnabled = NULL) { typedef enum { lamexp_token_elevationType_class = 18, lamexp_token_elevation_class = 20 } LAMEXP_TOKEN_INFORMATION_CLASS; typedef enum { lamexp_elevationType_default = 1, lamexp_elevationType_full, lamexp_elevationType_limited } LAMEXP_TOKEN_ELEVATION_TYPE; - HANDLE hToken = NULL; bool bIsProcessElevated = false; + if(bIsUacEnabled) *bIsUacEnabled = false; + HANDLE hToken = NULL; if(OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) { @@ -916,9 +917,14 @@ static bool lamexp_check_elevation(void) case lamexp_elevationType_full: qWarning("Process token elevation type: Full -> potential security risk!\n"); bIsProcessElevated = true; + if(bIsUacEnabled) *bIsUacEnabled = true; break; case lamexp_elevationType_limited: qDebug("Process token elevation type: Limited -> not elevated.\n"); + if(bIsUacEnabled) *bIsUacEnabled = true; + break; + default: + qWarning("Unknown tokenElevationType value: %d", tokenElevationType); break; } } @@ -930,7 +936,7 @@ static bool lamexp_check_elevation(void) qWarning("Failed to open process token!"); } - return !bIsProcessElevated; + return bIsProcessElevated; } /* @@ -1098,7 +1104,7 @@ bool lamexp_init_qt(int argc, char* argv[]) lamexp_translation_init(); //Check for process elevation - if((!lamexp_check_elevation()) && (!lamexp_detect_wine())) + if(lamexp_process_is_elevated() && (!lamexp_detect_wine())) { QMessageBox messageBox(QMessageBox::Warning, "LameXP", "LameXP was started with 'elevated' rights, altough LameXP does not need these rights.
Running an applications with unnecessary rights is a potential security risk!
", QMessageBox::NoButton, NULL, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowStaysOnTopHint); messageBox.addButton("Quit Program (Recommended)", QMessageBox::NoRole); @@ -1852,15 +1858,15 @@ bool lamexp_bring_process_to_front(const unsigned long pid) } /* - * Check the network connection status + * Check the network connectivity status */ int lamexp_network_status(void) { DWORD dwFlags; - const BOOL ret = (IsNetworkAlive(&dwFlags) == TRUE); + const BOOL ret = IsNetworkAlive(&dwFlags); if(GetLastError() == 0) { - return (ret == TRUE) ? lamexp_network_yes : lamexp_network_non; + return (ret != FALSE) ? lamexp_network_yes : lamexp_network_non; } return lamexp_network_err; } @@ -2163,6 +2169,42 @@ QColor lamexp_system_color(const int color_id) return color; } +/* + * Check if the current user is in the "admin" group (up to and including Windows XP only) + */ +bool lamexp_user_is_admin(void) +{ + bool isAdmin = false; + + //Check for process elevation and UAC first! + if(lamexp_process_is_elevated(&isAdmin)) + { + qWarning("Process is elevated -> user is admin!"); + return true; + } + + //If not elevated and UAC is not available -> user must be in admin group! + if(!isAdmin) + { + qDebug("UAC is disabled/unavailable -> checking for Administrators group"); + + SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY; + PSID AdministratorsGroup; + + if(AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorsGroup)) + { + BOOL b = FALSE; + if(CheckTokenMembership(NULL, AdministratorsGroup, &b)) + { + if(b) isAdmin = true; + } + FreeSid(AdministratorsGroup); + } + } + + return isAdmin; +} + /* * Fatal application exit */