diff --git a/app/main.c b/app/main.c index 7a408d4733..deb63e833f 100644 --- a/app/main.c +++ b/app/main.c @@ -595,6 +595,15 @@ main (int argc, gimp_init_signal_handlers (&backtrace_file); #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*/ g_setenv ("PANGOCAIRO_BACKEND", "fc", TRUE); diff --git a/build/windows/installer/base_gimp3264.iss b/build/windows/installer/base_gimp3264.iss index c4554b164a..f2a496709c 100644 --- a/build/windows/installer/base_gimp3264.iss +++ b/build/windows/installer/base_gimp3264.iss @@ -129,7 +129,9 @@ NotRecognizedMessagesWarning=no ;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} ;Inno installer (default) install location DefaultDirName={autopf}\GIMP {#GIMP_MUTEX_VERSION} diff --git a/meson.build b/meson.build index c91e8fc97d..5a4cf56149 100644 --- a/meson.build +++ b/meson.build @@ -103,6 +103,13 @@ endif # GIMP_IS_GIT can only be set during development of a RC. 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.set('GIMP_FULL_NAME', full_name) versionconfig.set('GIMP_MAJOR_VERSION', gimp_app_version_major)