Warn user about conflicting package.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-01-11 12:40:06 +02:00
parent 352912d12f
commit e8ee591e87
4 changed files with 34 additions and 21 deletions

View File

@ -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

1
dist/debian/control vendored
View File

@ -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

View File

@ -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)

View File

@ -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);
// 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}');
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;
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
if Not Result then
begin
MsgBox( InstallationCanceledMessage, mbInformation, MB_OK );
end else begin
Result := VersionCompareAndUninstall
end;
end;
end;
end;