Browse Source

use Downloads folder

COM-121
Volker Birk 10 months ago
parent
commit
dcd000afc4
3 changed files with 10 additions and 5 deletions
  1. +0
    -1
      CMainWindow.h
  2. +9
    -4
      GateKeeper.cpp
  3. +1
    -0
      stdafx.h

+ 0
- 1
CMainWindow.h View File

@ -27,7 +27,6 @@ public:
LRESULT OnNotification(UINT /*nMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnMenuCommand(UINT /*nMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
protected:
typedef std::basic_string<TCHAR> tstring;
void ShowNotificationInfo(tstring title, tstring text);
};

+ 9
- 4
GateKeeper.cpp View File

@ -567,17 +567,22 @@ namespace pEp {
BCryptDestroyKey(dk);
TCHAR temp_path[MAX_PATH + 1];
GetTempPath(MAX_PATH, temp_path);
TCHAR download_path[MAX_PATH + 1];
PWSTR _downloads;
SHGetKnownFolderPath(FOLDERID_Downloads, 0, NULL, &_downloads);
StringCchCopy(download_path, MAX_PATH, _downloads);
CoTaskMemFree(_downloads);
GetTempPath(MAX_PATH, download_path);
if (filename == _T("")) {
filename = temp_path;
filename = download_path;
filename += _T("\\pEp_");
filename += delivery.substr(0, 32);
filename += _T(".msi");
}
else {
filename = tstring(temp_path) + _T("\\") + filename;
filename = tstring(download_path) + _T("\\") + filename;
}
hFile = CreateFile(filename.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);


+ 1
- 0
stdafx.h View File

@ -29,6 +29,7 @@
#include <comutil.h>
#include <comdef.h>
#include <Shlobj.h>
#include <Wininet.h>
#include <intsafe.h>


Loading…
Cancel
Save