From: lx-s Date: Wed, 2 Oct 2024 07:00:32 +0000 (+0200) Subject: Fixed winmute-is-currently-running detection on setup and uninstall #40 X-Git-Tag: 2.5.2.0~22 X-Git-Url: https://repos.lx-s.de/gitweb/?a=commitdiff_plain;h=3569e212a62ba72efee96d66e269e1d5ca41b4d9;p=winmute.git Fixed winmute-is-currently-running detection on setup and uninstall #40 --- diff --git a/Dist/InnoSetup/winmute-setup.iss b/Dist/InnoSetup/winmute-setup.iss index 595e44f..1afdc89 100644 --- a/Dist/InnoSetup/winmute-setup.iss +++ b/Dist/InnoSetup/winmute-setup.iss @@ -6,7 +6,7 @@ #define MyAppPublisher "LX-Systems" #define MyAppURL "https://www.lx-s.de/winmute" #define MyAppExeName "WinMute.exe" -#define MyAppMutex "LxSystemsWinMute" +#define MyAppMutex "LxSystemsWinMuteRunning" #define CurrentYear GetDateTimeString('yyyy','','') [Setup] @@ -26,7 +26,7 @@ VersionInfoProductName={#MyAppName} VersionInfoVersion={#MyAppVersion} UninstallDisplayName={#MyAppName} -UninstallDisplayIcon={app}\{#MyAppExeName}.exe,1 +UninstallDisplayIcon={app}\{#MyAppExeName}.exe WizardStyle=modern ShowLanguageDialog=yes @@ -44,7 +44,7 @@ OutputDir=..\bin\ OutputBaseFilename=WinMuteSetup SetupIconFile=..\..\WinMute\icons\app.ico -ArchitecturesInstallIn64BitMode=x64 +ArchitecturesInstallIn64BitMode=x64os Compression=lzma SolidCompression=yes @@ -78,4 +78,7 @@ Root: HKCU; Subkey: "Software\lx-systems\WinMute\ManagedAudioEndpoints"; Flags: Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "LX-Systems WinMute"; ValueData: "{app}\{#MyAppExeName}"; Tasks: autostart; Flags: uninsdeletevalue [Run] -Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent runasoriginaluser + +[UninstallRun] + diff --git a/WinMute/WinMain.cpp b/WinMute/WinMain.cpp index 816b663..8d909f8 100644 --- a/WinMute/WinMain.cpp +++ b/WinMute/WinMain.cpp @@ -114,7 +114,7 @@ int WINAPI wWinMain( LoadLanguage(settings, i18n); - HANDLE hMutex = CreateMutexW(nullptr, TRUE, L"LxSystemsWinMuteRunOnce"); + HANDLE hMutex = CreateMutexW(nullptr, TRUE, L"LxSystemsWinMuteRunning"); if (hMutex == nullptr) { return FALSE; } else if (GetLastError() == ERROR_ALREADY_EXISTS) {