From e8ee591e874907938f9d67f13f1a81914af646e6 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 11 Jan 2018 12:40:06 +0200 Subject: [PATCH] Warn user about conflicting package. --HG-- branch : develop --- dist/OBS_debian/debian.control | 1 + dist/debian/control | 1 + dist/rpm/valentina.spec | 2 ++ dist/win/inno/valentina.iss | 51 ++++++++++++++++++++-------------- 4 files changed, 34 insertions(+), 21 deletions(-) diff --git a/dist/OBS_debian/debian.control b/dist/OBS_debian/debian.control index 73c101e4a..5e7ea1302 100644 --- a/dist/OBS_debian/debian.control +++ b/dist/OBS_debian/debian.control @@ -16,6 +16,7 @@ Vcs-Browser: https://bitbucket.org/dismine/valentina Package: valentina Architecture: i386 amd64 Depends: libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libqt5core5a (>= 5.2.0) | libqt5core5 (>= 5.2.0), libqt5gui5 (>= 5.2.0) | libqt5gui5-gles (>= 5.2.0), libqt5printsupport5 (>= 5.2.0), libqt5svg5 (>= 5.2.0), libqt5widgets5 (>= 5.2.0), libqt5xml5 (>= 5.2.0), libqt5xmlpatterns5 (>= 5.2.0), libstdc++6 (>= 4.6), xpdf +Conflicts: seamly2d Description: Pattern making program. Valentina is a cross-platform patternmaking program which allows designers to create and model patterns of clothing. This software allows pattern diff --git a/dist/debian/control b/dist/debian/control index 73c101e4a..5e7ea1302 100644 --- a/dist/debian/control +++ b/dist/debian/control @@ -16,6 +16,7 @@ Vcs-Browser: https://bitbucket.org/dismine/valentina Package: valentina Architecture: i386 amd64 Depends: libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libqt5core5a (>= 5.2.0) | libqt5core5 (>= 5.2.0), libqt5gui5 (>= 5.2.0) | libqt5gui5-gles (>= 5.2.0), libqt5printsupport5 (>= 5.2.0), libqt5svg5 (>= 5.2.0), libqt5widgets5 (>= 5.2.0), libqt5xml5 (>= 5.2.0), libqt5xmlpatterns5 (>= 5.2.0), libstdc++6 (>= 4.6), xpdf +Conflicts: seamly2d Description: Pattern making program. Valentina is a cross-platform patternmaking program which allows designers to create and model patterns of clothing. This software allows pattern diff --git a/dist/rpm/valentina.spec b/dist/rpm/valentina.spec index 7725a4196..7e6d781e0 100644 --- a/dist/rpm/valentina.spec +++ b/dist/rpm/valentina.spec @@ -6,6 +6,8 @@ Requires(postun): /sbin/ldconfig Requires(post): desktop-file-utils Requires(postun): desktop-file-utils +Conflicts: seamly2d + %if 0%{?fedora_version} > 0 || 0%{?rhel_version} >= 700 || 0%{?centos_version} >= 700 BuildRequires: qt5-qtbase-devel >= 5.2.0 BuildRequires: pkgconfig(Qt5Svg) diff --git a/dist/win/inno/valentina.iss b/dist/win/inno/valentina.iss index d2424c6f0..bba79aff4 100644 --- a/dist/win/inno/valentina.iss +++ b/dist/win/inno/valentina.iss @@ -6,11 +6,12 @@ #define MyAppPublisher "Roman Telezhynskyi" #define MyAppURL "http://www.valentina-project.org/" #define MyAppExeName "valentina.exe" -#define MyAppCopyright "(C) 2013-2017 Valentina project" +#define MyAppCopyright "(C) 2013-2018 Valentina project" #define MyDateTimeString GetDateTimeString('yyyymmddhhnnss', '', ''); ; Appstatus: "" = release, "b" = beta, "a" = alpha ; this only modifies the resulting exe name of the installer package ;-) #define MyAppStatus "a" +#define ConflictingAppId "{7081AEC7-38FC-479F-B712-DB073BB76513}" [Setup] ; NOTE: The value of AppId uniquely identifies this application. @@ -416,29 +417,37 @@ var InstallationCanceledMessage : String; begin - // Create a mutex for the installer and if it's already running then show a message and stop installation - if CheckForMutexes(installer_mutex_name) then begin - SuppressibleMsgBox(ExpandConstant('{cm:SetupIsRunningWarning}'), mbError, MB_OK, MB_OK); + if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#ConflictingAppId}_is1') or + RegKeyExists(HKEY_CURRENT_USER, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#ConflictingAppId}_is1') then + begin + MsgBox('Detected conflicting application. Please, uninstall Seamly2D before proceeding installation.', mbError, MB_OK); Result := False; end else begin - Result := True; - CreateMutex(installer_mutex_name); - - ProgramRunningOnInstallMessage := ExpandConstant('{cm:WarnRunningOnUnInstall1}') + #13 + #13 + ExpandConstant('{cm:WarnRunningOnUnInstall2}'); - InstallationCanceledMessage := ExpandConstant('{cm:WarnCancelInstall}'); - - Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName1, ProgramName1 + ProgramRunningOnInstallMessage) - If Result Then - begin - Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName2, ProgramName2 + ProgramRunningOnInstallMessage) - end; - - if Not Result then - begin - MsgBox( InstallationCanceledMessage, mbInformation, MB_OK ); - end else begin - Result := VersionCompareAndUninstall + // Create a mutex for the installer and if it's already running then show a message and stop installation + if CheckForMutexes(installer_mutex_name) then begin + 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}'); + InstallationCanceledMessage := ExpandConstant('{cm:WarnCancelInstall}'); + + Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName1, ProgramName1 + ProgramRunningOnInstallMessage) + If Result Then + begin + Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName2, ProgramName2 + ProgramRunningOnInstallMessage) + end; + + if Not Result then + begin + MsgBox( InstallationCanceledMessage, mbInformation, MB_OK ); + end else begin + Result := VersionCompareAndUninstall + end; end; end; end;