From 50b2a0dc0aab262a8a94bba3ad86d6a1b7174c75 Mon Sep 17 00:00:00 2001 From: LAGonauta Date: Thu, 21 May 2020 08:57:46 -0300 Subject: [PATCH] Do not hardcode GPG path on Windows --- plugins/gpgme-vala/src/gpgme_helper.vala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/gpgme-vala/src/gpgme_helper.vala b/plugins/gpgme-vala/src/gpgme_helper.vala index 3f42bb51..ee4d0095 100644 --- a/plugins/gpgme-vala/src/gpgme_helper.vala +++ b/plugins/gpgme-vala/src/gpgme_helper.vala @@ -177,7 +177,11 @@ private static uint8[] get_uint8_from_data(Data data) { private static void initialize() { if (!initialized) { #if _WIN32 - set_global_flag("w32-inst-dir", "C://Program Files (x86)//GnuPG//bin"); + string gpg = GLib.Environment.find_program_in_path("gpg.exe"); + if (gpg != null && gpg.length > 0) + { + set_global_flag("w32-inst-dir", GLib.Path.get_dirname(gpg)); + } #endif check_version(); initialized = true;