Update package cleanup added
This commit is contained in:
parent
ada90646ac
commit
a5f71f6965
@ -365,7 +365,8 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In
|
||||
param += wxT("\"");
|
||||
|
||||
// Logging
|
||||
wxString fileNameLog(initializer.m_path + wxT("Updater-") wxT(UPDATER_CFG_APPLICATION) wxT("-msiexec.log"));
|
||||
wxString fileNameLog(initializer.m_path);
|
||||
fileNameLog += wxT("Updater-") wxT(UPDATER_CFG_APPLICATION) wxT("-msiexec.log");
|
||||
|
||||
param += wxT(" /l* \"");
|
||||
param += fileNameLog;
|
||||
@ -380,9 +381,18 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In
|
||||
}
|
||||
} else
|
||||
wxLogWarning(wxT("Update package file download failed."));
|
||||
} else
|
||||
} else {
|
||||
wxLogStatus(wxT("Update check complete. Your package is up to date."));
|
||||
|
||||
// Clean-up the downloaded package files to free space.
|
||||
wxDir dir(initializer.m_path);
|
||||
if (dir.IsOpened()) {
|
||||
wxString filename;
|
||||
for (bool cont = dir.GetFirst(&filename, wxT("Updater-") wxT(UPDATER_CFG_APPLICATION) wxT("-*.msi"), wxDIR_FILES | wxDIR_HIDDEN); cont; cont = dir.GetNext(&filename))
|
||||
wxRemoveFile(initializer.m_path + filename);
|
||||
}
|
||||
}
|
||||
|
||||
// Save the last check date.
|
||||
initializer.m_config.Write(wxT("LastChecked"), (long)wxDateTime::GetTimeNow());
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <wx/base64.h>
|
||||
#include <wx/config.h>
|
||||
#include <wx/datetime.h>
|
||||
#include <wx/dir.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/protocol/http.h>
|
||||
#include <wx/url.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user