From f375e4f961eb52fa504c17e7825e832829310e8a Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 30 Oct 2010 23:33:34 +0300 Subject: modified: main.cpp --- main.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 34bb175..ab3739d 100644 --- a/main.cpp +++ b/main.cpp @@ -732,7 +732,17 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP MessageBox(0, _T("please set keyring's home directory"), _T("Warning"), MB_OK); break; } - DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", tmp); + DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", tmp); + { + TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); + DWORD dwFileAttr = GetFileAttributes(path); + if (dwFileAttr != INVALID_FILE_ATTRIBUTES) + { + dwFileAttr &=~ FILE_ATTRIBUTE_READONLY; + SetFileAttributes(path, dwFileAttr); + } + mir_free(path); + } DestroyWindow(hwndDlg); ShowFirstRunDialog(); break; @@ -1530,6 +1540,16 @@ void InitCheck() if(MessageBoxA(0, question.c_str(), "Own secret key warning", MB_YESNO) == IDYES) ShowFirstRunDialog(); } + { + TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); + DWORD dwFileAttr = GetFileAttributes(path); + if (dwFileAttr != INVALID_FILE_ATTRIBUTES) + { + dwFileAttr &=~ FILE_ATTRIBUTE_READONLY; + SetFileAttributes(path, dwFileAttr); + } + mir_free(path); + } extern bool bAutoExchange; if(bAutoExchange && (ServiceExists("ICQ"PS_ICQ_ADDCAPABILITY))) //work only for one icq instance { -- cgit v1.2.3