From f69628d557b7970cc673392c792095678bc94f7a Mon Sep 17 00:00:00 2001 From: lx-s Date: Tue, 19 Dec 2023 20:50:41 +0100 Subject: [PATCH] Removed old readmes. Added updater disable file for package manager installations --- Dist/bin/liesmich.html | 85 --------------------------------- Dist/bin/readme.html | 81 ------------------------------- Dist/bin/update-check-disabled | 3 ++ WinMute/Settings_GeneralDlg.cpp | 9 ++++ WinMute/UpdateChecker.cpp | 24 +++++++--- WinMute/UpdateChecker.h | 1 + 6 files changed, 30 insertions(+), 173 deletions(-) delete mode 100644 Dist/bin/liesmich.html delete mode 100644 Dist/bin/readme.html create mode 100644 Dist/bin/update-check-disabled diff --git a/Dist/bin/liesmich.html b/Dist/bin/liesmich.html deleted file mode 100644 index f0c8448..0000000 --- a/Dist/bin/liesmich.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - WinMute 2.4.1 - Lies mich - - - - -

WinMute 2.4.1

- - -

Über

-

WinMute kann alle oder bestimmte Audio-Geräte automatisch stumm schalten, sobald

-
    -
  1. Sie den PC sperren.
  2. -
  3. sich der Bildschirm ausschaltet.
  4. -
  5. der PC heruntergefahren wird.
  6. -
  7. Sie sich Abmelden.
  8. -
  9. der PC in den Ruhezustand geht.
  10. -
  11. die Uhrzeit innerhalb eines konfigurierten Zeitraumes liegt
  12. -
  13. ihr Bluetooth Headset nichtmehr verbunden ist
  14. -
  15. - Der PC zu einem bestimmten WLAN-Netzwerk verbunden ist -
      -
    • Alternativ: Wenn er nicht zu einem bestimmten WLAN-Netzwerk verbunden ist
    • -
    -
  16. -
- -

- Das ist vor allem in einer Büroumgebung nützlich, wenn Sie Ihren - Schreibtisch verlassen, aber die Kollegen nicht mit Musik oder - sonstigen Geräuschen aus Ihrem Computer stören möchten - oder aber Sie bei der nächsten Präsentation sicher gehen möchten, dass - der Ton Stumm ist, sobald der PC hochgefahren wird. -

- - -

Systemvoraussetzungen

- - -

Installation

-

Einfach WinMute in ein Verzeichnis Ihrer Wahl kopieren und das war's!

- -

Deinstallation

-

- Einfach die Dateien WinMute.exe löschen. - Zusätzlich legt WinMute in der Registry (regedit.exe) im Schlüssel HKEY_CURRENT_USER\Software\lx-systems\WinMute - ab. Sollten sie die von WinMute Einstellungen nichtmehr benötigen, können sie diese einfach entfernen. -

- -

Benutzung

-

Einfach starten - und fertig!

-

- Sobald das Programm läuft, wird die - Lautstärke automatisch auf 0 gedreht, sobald Sie den PC sperren - oder sich der Bildschirmschoner ausschaltet. - Wenn Sie wieder an den PC zurückkehren, wird die Lautstärke auf den - ursprünglichen Wert zurückgestellt. -

- Wenn dieses Verhalten ändern oder die weiteren Optionen erforschen wollen, - können Sie dies über einen Rechtsklick auf das Taskbar-Icon bei der Uhr - erreichen. -

- - diff --git a/Dist/bin/readme.html b/Dist/bin/readme.html deleted file mode 100644 index 84a96c9..0000000 --- a/Dist/bin/readme.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - WinMute 2.4.1 - Readme - - - - -

WinMute 2.4.1

- - -

About

-

WinMute can automatically mute certain or all of your connected audio devices, when

-
    -
  1. You lock your PC.
  2. -
  3. Your screen turns off.
  4. -
  5. Your PC shuts down
  6. -
  7. You log off
  8. -
  9. Your PC goes to sleep
  10. -
  11. The wall clock is within a configured time-frame
  12. -
  13. your Bluetooth headset disconnects
  14. -
  15. - Your PC is connected to a particular wireless network -
      -
    • Alternatively: When it is not connected to particular wireless network
    • -
    -
  16. -
- -

- This is very helpful e.g. if you leave your desk and don't want - to annoy your co-workers with random sounds or music from - your computer or don't want music blasting out of your speakers, - the next time you power on your pc during a presentation. -

- - -

Requirements

- - -

Installation

-

Unzip it to your favourite directory and you are all set up ;)

- -

Uninstalling WinMute

-

- Just delete the file WinMute.exe from your hard drive. - If you want to also remove your personal WinMute settings, then open - the registry (regedit.exe) and delete the key - HKEY_CURRENT_USER\Software\lx-systems\WinMute. -

- -

Usage

-

Start it and that's it!

-

- Whenever you lock your screen from now on or your screen goes into standby, - WinMute will automatically mute your windows volume, and unmute it - right away when you come back to your pc.
- If you want to change the behaviour or explore all the other options, - right-click on the taskbar notification icon and explore! -

- - diff --git a/Dist/bin/update-check-disabled b/Dist/bin/update-check-disabled new file mode 100644 index 0000000..7312dad --- /dev/null +++ b/Dist/bin/update-check-disabled @@ -0,0 +1,3 @@ +This file should be used, when WinMute is installed via a package manager. + +If this file is present, WinMute does not display update-check options. \ No newline at end of file diff --git a/WinMute/Settings_GeneralDlg.cpp b/WinMute/Settings_GeneralDlg.cpp index d6e55c2..14657f5 100644 --- a/WinMute/Settings_GeneralDlg.cpp +++ b/WinMute/Settings_GeneralDlg.cpp @@ -105,6 +105,15 @@ INT_PTR CALLBACK Settings_GeneralDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA enabled = !!dlgData->settings->QueryValue(SettingsKey::CHECK_FOR_BETA_UPDATE); Button_SetCheck(hBetaUpdateCheck, enabled ? BST_CHECKED : BST_UNCHECKED); + // If the disable-update file is present, then also hide all options + UpdateChecker updateChecker; + if (updateChecker.IsUpdateCheckDisabledViaFile()) { + EnableWindow(hUpdateCheck, FALSE); + EnableWindow(hBetaUpdateCheck, FALSE); + Button_SetCheck(hUpdateCheck, BST_UNCHECKED); + Button_SetCheck(hBetaUpdateCheck, BST_UNCHECKED); + } + enabled = !!dlgData->settings->QueryValue(SettingsKey::LOGGING_ENABLED); Button_SetCheck(hLogging, enabled ? BST_CHECKED : BST_UNCHECKED); Button_Enable(hOpenLog, enabled); diff --git a/WinMute/UpdateChecker.cpp b/WinMute/UpdateChecker.cpp index e738df9..49b49d5 100644 --- a/WinMute/UpdateChecker.cpp +++ b/WinMute/UpdateChecker.cpp @@ -306,13 +306,8 @@ bool UpdateChecker::GetVersionFile(std::string &fileContents) const return true; } -bool UpdateChecker::IsUpdateCheckEnabled(const WMSettings &settings) const +bool UpdateChecker::IsUpdateCheckDisabledViaFile() const { - const auto updateCheckSetting = settings.QueryValue(SettingsKey::CHECK_FOR_UPDATE); - if (updateCheckSetting == static_cast(UpdateCheckInterval::DISABLED)) { - return false; - } - wchar_t thisExePath[MAX_PATH * 2]; const DWORD thisExePathSize = ARRAY_SIZE(thisExePath); const DWORD thisPathLen = GetModuleFileNameW(nullptr, thisExePath, thisExePathSize); @@ -320,9 +315,24 @@ bool UpdateChecker::IsUpdateCheckEnabled(const WMSettings &settings) const WMLog::GetInstance().LogWinError(L"GetModuleFileNameW", ERROR_INSUFFICIENT_BUFFER); return false; } + fs::path updateDisableFile{ thisExePath }; updateDisableFile.replace_filename(L"update-check-disabled"); - if (fs::exists(updateDisableFile)) { + if (!fs::exists(updateDisableFile)) { + return false; + } + + return true; +} + +bool UpdateChecker::IsUpdateCheckEnabled(const WMSettings &settings) const +{ + const auto updateCheckSetting = settings.QueryValue(SettingsKey::CHECK_FOR_UPDATE); + if (updateCheckSetting == static_cast(UpdateCheckInterval::DISABLED)) { + return false; + } + + if (IsUpdateCheckDisabledViaFile()) { return false; } diff --git a/WinMute/UpdateChecker.h b/WinMute/UpdateChecker.h index 33568d3..fda5945 100644 --- a/WinMute/UpdateChecker.h +++ b/WinMute/UpdateChecker.h @@ -57,6 +57,7 @@ public: UpdateChecker(); ~UpdateChecker(); + bool IsUpdateCheckDisabledViaFile() const; bool IsUpdateCheckEnabled(const WMSettings &settings) const; bool GetUpdateInfo(UpdateInfo& updateInfo) const; private: -- 2.43.0