meson, app, build: Fix Inno wrongly allowing to unninstall with GIMP running

Inno needs an AppMutex to be aware of GIMP execution so
prevent unninstalling or installing GIMP if still running.

(Unninstalling with GIMP running was making GIMP to not be
fully unninstaled since gimp*.exe process file was opened.
It also could cause problems with settings unninstall.)

(Installing with GIMP running was already not possible
since Inno code in that part is more refined but
that check isn't done before deleting .debug files)
This commit is contained in:
Bruno Lopes 2025-03-30 08:26:34 -03:00 committed by Bruno
parent b2b0ad7536
commit e975c1625a
3 changed files with 19 additions and 1 deletions

View file

@ -595,6 +595,15 @@ main (int argc,
gimp_init_signal_handlers (&backtrace_file); gimp_init_signal_handlers (&backtrace_file);
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
/* Make Inno aware of gimp process avoiding broken install/unninstall */
char *utf8_name = g_strdup_printf ("GIMP-%s", GIMP_MUTEX_VERSION);
wchar_t *name = g_utf8_to_utf16 (utf8_name, -1, NULL, NULL, NULL);
CreateMutexW (NULL, FALSE, name);
g_free (utf8_name);
g_free (name);
/* Enable Anti-Aliasing*/ /* Enable Anti-Aliasing*/
g_setenv ("PANGOCAIRO_BACKEND", "fc", TRUE); g_setenv ("PANGOCAIRO_BACKEND", "fc", TRUE);

View file

@ -129,7 +129,9 @@ NotRecognizedMessagesWarning=no
;3.2.1 INNO INTERNAL VERSIONING (used to rule how different versions are installed) ;3.2.1 INNO INTERNAL VERSIONING (used to rule how different versions are installed)
;Inno installer identifier: https://github.com/jrsoftware/issrc/pull/461 ;GIMP process identifier for Inno
AppMutex=GIMP-{#GIMP_MUTEX_VERSION}
;Inno installer identifier
SetupMutex=GIMP-{#GIMP_MUTEX_VERSION} SetupMutex=GIMP-{#GIMP_MUTEX_VERSION}
;Inno installer (default) install location ;Inno installer (default) install location
DefaultDirName={autopf}\GIMP {#GIMP_MUTEX_VERSION} DefaultDirName={autopf}\GIMP {#GIMP_MUTEX_VERSION}

View file

@ -103,6 +103,13 @@ endif
# GIMP_IS_GIT can only be set during development of a RC. # GIMP_IS_GIT can only be set during development of a RC.
conf.set('GIMP_IS_RC_GIT', gimp_rc_git ? 1 : false) conf.set('GIMP_IS_RC_GIT', gimp_rc_git ? 1 : false)
# Mutex version
if gimp_unstable != false
conf.set_quoted('GIMP_MUTEX_VERSION', gimp_app_version)
else
conf.set_quoted('GIMP_MUTEX_VERSION', gimp_app_version_major.to_string())
endif
versionconfig = configuration_data() versionconfig = configuration_data()
versionconfig.set('GIMP_FULL_NAME', full_name) versionconfig.set('GIMP_FULL_NAME', full_name)
versionconfig.set('GIMP_MAJOR_VERSION', gimp_app_version_major) versionconfig.set('GIMP_MAJOR_VERSION', gimp_app_version_major)