]> repos.lx-s.de Git - winmute.git/commitdiff
Fixed winmute-is-currently-running detection on setup and uninstall #40
authorlx-s <lx-s@users.noreply.github.com>
Wed, 2 Oct 2024 07:00:32 +0000 (09:00 +0200)
committerlx-s <lx-s@users.noreply.github.com>
Wed, 2 Oct 2024 07:00:32 +0000 (09:00 +0200)
Dist/InnoSetup/winmute-setup.iss
WinMute/WinMain.cpp

index 595e44f294cb38b16293db31d44164c10baec496..1afdc897ddcd514cdf2843581a91931524f84f69 100644 (file)
@@ -6,7 +6,7 @@
 #define MyAppPublisher "LX-Systems"\r
 #define MyAppURL       "https://www.lx-s.de/winmute"\r
 #define MyAppExeName   "WinMute.exe"\r
-#define MyAppMutex     "LxSystemsWinMute"\r
+#define MyAppMutex     "LxSystemsWinMuteRunning"\r
 #define CurrentYear    GetDateTimeString('yyyy','','')\r
 \r
 [Setup]\r
@@ -26,7 +26,7 @@ VersionInfoProductName={#MyAppName}
 VersionInfoVersion={#MyAppVersion}\r
 \r
 UninstallDisplayName={#MyAppName}\r
-UninstallDisplayIcon={app}\{#MyAppExeName}.exe,1\r
+UninstallDisplayIcon={app}\{#MyAppExeName}.exe\r
 \r
 WizardStyle=modern\r
 ShowLanguageDialog=yes\r
@@ -44,7 +44,7 @@ OutputDir=..\bin\
 OutputBaseFilename=WinMuteSetup\r
 \r
 SetupIconFile=..\..\WinMute\icons\app.ico\r
-ArchitecturesInstallIn64BitMode=x64\r
+ArchitecturesInstallIn64BitMode=x64os\r
 Compression=lzma\r
 SolidCompression=yes\r
 \r
@@ -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\r
 \r
 [Run]\r
-Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent\r
+Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent runasoriginaluser\r
+\r
+[UninstallRun]\r
+\r
index 816b663aa208fdb3545126b5899aa4d996a4b6ed..8d909f810ef0df4c2a78039118ae9de6b20cd9a8 100644 (file)
@@ -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) {