diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-10-18 12:29:55 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-10-18 12:29:55 +0000 |
commit | 6b13c95e804c549e732bf0583ee17bd0348c112c (patch) | |
tree | 54fe682e09036f1e234cafada519a7c6da9c5bd2 /plugins/PluginUpdater | |
parent | 4e322da2d81dbc38a8f39e0fd861fb37f0800ace (diff) |
revert 10823
git-svn-id: http://svn.miranda-ng.org/main/trunk@10824 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater')
-rw-r--r-- | plugins/PluginUpdater/src/DlgListNew.cpp | 9 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/DlgUpdate.cpp | 15 |
2 files changed, 14 insertions, 10 deletions
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index d5ecbb14e9..59b534d97e 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -50,11 +50,15 @@ static void ApplyDownloads(void *param) AutoHandle pipe(hPipe);
HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES);
OBJLIST<FILEINFO> &todo = *(OBJLIST<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
- TCHAR tszFileBack[MAX_PATH];
+ //create needed folders after escalating priviledges. Folders creates when we actually install updates
+ TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
mir_sntprintf(tszFileBack, SIZEOF(tszFileBack), _T("%s\\Backups"), tszRoot);
SafeCreateDirectory(tszFileBack);
+ mir_sntprintf(tszFileTemp, SIZEOF(tszFileTemp), _T("%s\\Temp"), tszRoot);
+ SafeCreateDirectory(tszFileTemp);
+
VARST tszMirandaPath(_T("%miranda_path%"));
HANDLE nlc = NULL;
@@ -348,9 +352,6 @@ static void GetList(void *) }
FILELIST *UpdateFiles = new FILELIST(20);
- TCHAR tszFileTemp[MAX_PATH];
- mir_sntprintf(tszFileTemp, SIZEOF(tszFileTemp), _T("%s\\Temp"), tszRoot);
- SafeCreateDirectory(tszFileTemp);
VARST dirname(_T("%miranda_path%"));
for (int i=0; i < hashes.getCount(); i++) {
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index a558caa03c..18b223de8e 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -57,9 +57,12 @@ static void ApplyUpdates(void *param) AutoHandle pipe(hPipe);
HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES);
- TCHAR tszFileBack[MAX_PATH];
+ //create needed folders after escalating priviledges. Folders creates when we actually install updates
+ TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
mir_sntprintf(tszFileBack, SIZEOF(tszFileBack), _T("%s\\Backups"), tszRoot);
SafeCreateDirectory(tszFileBack);
+ mir_sntprintf(tszFileTemp, SIZEOF(tszFileTemp), _T("%s\\Temp"), tszRoot);
+ SafeCreateDirectory(tszFileTemp);
// 2) Download all plugins
HANDLE nlc = NULL;
@@ -358,11 +361,15 @@ static void DlgUpdateSilent(void *lParam) }
AutoHandle pipe(hPipe);
- TCHAR tszFileBack[MAX_PATH];
+ //create needed folders after escalating priviledges. Folders creates when we actually install updates
+ TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
mir_sntprintf(tszFileBack, SIZEOF(tszFileBack), _T("%s\\Backups"), tszRoot);
SafeCreateDirectory(tszFileBack);
+ mir_sntprintf(tszFileTemp, SIZEOF(tszFileTemp), _T("%s\\Temp"), tszRoot);
+ SafeCreateDirectory(tszFileTemp);
+
// 2) Download all plugins
HANDLE nlc = NULL;
// Count all updates that have been enabled
@@ -585,10 +592,6 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const Netlib_LogfT(hNetlibUser,_T("Scanning folder %s"), tszFolder);
- TCHAR tszFileTemp[MAX_PATH];
- mir_sntprintf(tszFileTemp, SIZEOF(tszFileTemp), _T("%s\\Temp"), tszRoot);
- SafeCreateDirectory(tszFileTemp);
-
int count = 0;
do {
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|