There is no conflict on Windows.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-01-11 13:47:56 +02:00
parent 225db2efc6
commit 334983bc6e

View File

@ -11,7 +11,6 @@
; Appstatus: "" = release, "b" = beta, "a" = alpha ; Appstatus: "" = release, "b" = beta, "a" = alpha
; this only modifies the resulting exe name of the installer package ;-) ; this only modifies the resulting exe name of the installer package ;-)
#define MyAppStatus "a" #define MyAppStatus "a"
#define ConflictingAppId "{7081AEC7-38FC-479F-B712-DB073BB76513}"
[Setup] [Setup]
; NOTE: The value of AppId uniquely identifies this application. ; NOTE: The value of AppId uniquely identifies this application.
@ -417,37 +416,29 @@ var
InstallationCanceledMessage : String; InstallationCanceledMessage : String;
begin begin
if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#ConflictingAppId}_is1') or // Create a mutex for the installer and if it's already running then show a message and stop installation
RegKeyExists(HKEY_CURRENT_USER, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#ConflictingAppId}_is1') then if CheckForMutexes(installer_mutex_name) then begin
begin SuppressibleMsgBox(ExpandConstant('{cm:SetupIsRunningWarning}'), mbError, MB_OK, MB_OK);
MsgBox('Detected conflicting application. Please, uninstall Seamly2D before proceeding installation.', mbError, MB_OK);
Result := False; Result := False;
end end
else begin else begin
// Create a mutex for the installer and if it's already running then show a message and stop installation Result := True;
if CheckForMutexes(installer_mutex_name) then begin CreateMutex(installer_mutex_name);
SuppressibleMsgBox(ExpandConstant('{cm:SetupIsRunningWarning}'), mbError, MB_OK, MB_OK);
Result := False;
end
else begin
Result := True;
CreateMutex(installer_mutex_name);
ProgramRunningOnInstallMessage := ExpandConstant('{cm:WarnRunningOnUnInstall1}') + #13 + #13 + ExpandConstant('{cm:WarnRunningOnUnInstall2}'); ProgramRunningOnInstallMessage := ExpandConstant('{cm:WarnRunningOnUnInstall1}') + #13 + #13 + ExpandConstant('{cm:WarnRunningOnUnInstall2}');
InstallationCanceledMessage := ExpandConstant('{cm:WarnCancelInstall}'); InstallationCanceledMessage := ExpandConstant('{cm:WarnCancelInstall}');
Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName1, ProgramName1 + ProgramRunningOnInstallMessage) Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName1, ProgramName1 + ProgramRunningOnInstallMessage)
If Result Then If Result Then
begin begin
Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName2, ProgramName2 + ProgramRunningOnInstallMessage) Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName2, ProgramName2 + ProgramRunningOnInstallMessage)
end; end;
if Not Result then if Not Result then
begin begin
MsgBox( InstallationCanceledMessage, mbInformation, MB_OK ); MsgBox( InstallationCanceledMessage, mbInformation, MB_OK );
end else begin end else begin
Result := VersionCompareAndUninstall Result := VersionCompareAndUninstall
end;
end; end;
end; end;
end; end;