Commit 829ca658 authored by Simon Mueller's avatar Simon Mueller Committed by Jehan

Issue #2179: Make file_rawtherapee use the registry value that is...

... provided by RawTherapee's installer (version 5.5+).

See https://github.com/Beep6581/RawTherapee/issues/4783.
This patch required a small change to file_raw_get_executable_path
because the RawTherapee installer is supposed to work without admin
privileges and therefore can't write to HKLM.

Reviewer's note (Jehan): RawTherapee's installer does not add the
registry entry yet. We assume the upstream bug report will end up doing
so (someone has to make the first step!). :-)
parent 35c71348
......@@ -98,6 +98,7 @@ init (void)
"DARKTABLE_EXECUTABLE",
"org.darktable",
REGISTRY_KEY_BASE,
FALSE,
&search_path);
gchar *argv[] = { exec_path, "--version", NULL };
gchar *darktable_stdout = NULL;
......@@ -379,6 +380,7 @@ load_image (const gchar *filename,
"DARKTABLE_EXECUTABLE",
"org.darktable",
REGISTRY_KEY_BASE,
FALSE,
&search_path);
gchar *argv[] =
{
......@@ -472,6 +474,7 @@ load_thumbnail_image (const gchar *filename,
"DARKTABLE_EXECUTABLE",
"org.darktable",
REGISTRY_KEY_BASE,
FALSE,
&search_path);
gchar *argv[] =
{
......
......@@ -41,6 +41,7 @@ file_raw_get_executable_path (const gchar *main_executable,
const gchar *env_variable,
const gchar *mac_bundle_id,
const gchar *win32_registry_key_base,
gboolean win32_use_hkcu,
gboolean *search_path)
{
/*
......@@ -128,6 +129,10 @@ file_raw_get_executable_path (const gchar *main_executable,
else
registry_key = g_strconcat (win32_registry_key_base, ".exe", NULL);
if (win32_use_hkcu)
status = RegGetValue (HKEY_CURRENT_USER, registry_key, "", RRF_RT_ANY,
NULL, (PVOID)&path, &buffer_size);
else
status = RegGetValue (HKEY_LOCAL_MACHINE, registry_key, "", RRF_RT_ANY,
NULL, (PVOID)&path, &buffer_size);
......
......@@ -27,6 +27,7 @@ gchar * file_raw_get_executable_path (const gchar *main_executable,
const gchar *env_variable,
const gchar *mac_bundle_id,
const gchar *win32_registry_key_base,
gboolean win32_use_hkcu,
gboolean *search_path);
......
......@@ -33,6 +33,7 @@
#define LOAD_THUMB_PROC "file-rawtherapee-load-thumb"
#define REGISTRY_KEY_BASE "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\rawtherapee"
static void init (void);
......@@ -94,7 +95,8 @@ init (void)
gchar *exec_path = file_raw_get_executable_path ("rawtherapee", NULL,
"RAWTHERAPEE_EXECUTABLE",
"com.rawtherapee.rawtherapee",
NULL,
REGISTRY_KEY_BASE,
TRUE,
&search_path);
gchar *argv[] = { exec_path, "-v", NULL };
gchar *rawtherapee_stdout = NULL;
......@@ -297,7 +299,8 @@ load_image (const gchar *filename,
gchar *exec_path = file_raw_get_executable_path ("rawtherapee", NULL,
"RAWTHERAPEE_EXECUTABLE",
"com.rawtherapee.rawtherapee",
NULL,
REGISTRY_KEY_BASE,
TRUE,
&search_path);
/* linear sRGB for now as GIMP uses that internally in many places anyway */
......@@ -403,7 +406,8 @@ load_thumbnail_image (const gchar *filename,
gchar *exec_path = file_raw_get_executable_path ("rawtherapee", "-cli",
"RAWTHERAPEE_EXECUTABLE",
"com.rawtherapee.rawtherapee",
NULL,
REGISTRY_KEY_BASE,
TRUE,
&search_path);
gchar *argv[] =
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment