summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--commonheaders.h1
-rw-r--r--main.cpp12
-rw-r--r--new_gpg.vcproj4
3 files changed, 13 insertions, 4 deletions
diff --git a/commonheaders.h b/commonheaders.h
index e80d81f..e7b6e7e 100644
--- a/commonheaders.h
+++ b/commonheaders.h
@@ -22,6 +22,7 @@
#include <errno.h>
#include <time.h>
#include <uxtheme.h>
+#include <shlwapi.h>
#include <iostream>
#include <map>
diff --git a/main.cpp b/main.cpp
index 0941c28..2eb1cd7 100644
--- a/main.cpp
+++ b/main.cpp
@@ -401,10 +401,18 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
- tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", _T(""));
+ TCHAR *path = new TCHAR [MAX_PATH];
+ DWORD len = MAX_PATH;
+ tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", (SHGetValue(HKEY_CURRENT_USER, _T("Software\\GNU\\GnuPG\\gpgProgram"), 0, 0, path, &len) == ERROR_SUCCESS)?path:_T(""));
+ delete [] path;
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
mir_free(tmp);
- tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
+ path = new TCHAR [MAX_PATH];
+ ExpandEnvironmentStrings(_T("%APPDATA%"), path, MAX_PATH);
+ wstring path_ = path;
+ delete [] path;
+ path_ += _T("\\GnuPG");
+ tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", (TCHAR*)path_.c_str());
SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp);
mir_free(tmp);
return TRUE;
diff --git a/new_gpg.vcproj b/new_gpg.vcproj
index 9cccfd6..bb907a5 100644
--- a/new_gpg.vcproj
+++ b/new_gpg.vcproj
@@ -179,7 +179,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies=""
+ AdditionalDependencies="shlwapi.lib"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""
@@ -281,7 +281,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies=""
+ AdditionalDependencies="shlwapi.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""