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;