mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-12 18:11:35 -06:00
19.00
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "../FileManager/LangUtils.h"
|
||||
#include "../FileManager/resourceGui.h"
|
||||
#include "../FileManager/OverwriteDialogRes.h"
|
||||
#include "../FileManager/ViewSettings.h"
|
||||
|
||||
#include "../Common/ArchiveExtractCallback.h"
|
||||
#include "../Common/PropIDUtils.h"
|
||||
@@ -33,6 +34,7 @@
|
||||
using namespace NWindows;
|
||||
using namespace NFile;
|
||||
using namespace NDir;
|
||||
extern bool g_bProcessError;
|
||||
|
||||
static const wchar_t * const kIncorrectOutDir = L"Incorrect output directory path";
|
||||
|
||||
@@ -141,10 +143,10 @@ HRESULT CThreadExtracting::ProcessVirt()
|
||||
AddSizePair(s, IDS_PROP_ALT_STREAMS_SIZE, Stat.AltStreams_UnpackSize);
|
||||
}
|
||||
s.Add_LF();
|
||||
AddLangString(s, IDS_MESSAGE_NO_ERRORS);
|
||||
FinalMessage.OkMessage.Title = Title;
|
||||
FinalMessage.OkMessage.Message = s;
|
||||
}
|
||||
AddLangString(s, IDS_MESSAGE_NO_ERRORS);
|
||||
FinalMessage.OkMessage.Title = Title;
|
||||
FinalMessage.OkMessage.Message = s;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -169,7 +171,11 @@ HRESULT ExtractGUI(
|
||||
CExtractCallbackImp *extractCallback,
|
||||
HWND hwndParent)
|
||||
{
|
||||
bool openOutputFolder = false;
|
||||
bool deleteSourceFile = false;
|
||||
|
||||
messageWasDisplayed = false;
|
||||
g_bProcessError = false;
|
||||
|
||||
CThreadExtracting extracter;
|
||||
extracter.codecs = codecs;
|
||||
@@ -222,6 +228,9 @@ HRESULT ExtractGUI(
|
||||
options.PathMode = dialog.PathMode;
|
||||
options.ElimDup = dialog.ElimDup;
|
||||
|
||||
openOutputFolder = dialog.m_bOpenOutputFolder;
|
||||
deleteSourceFile = dialog.m_bDeleteSourceFile;
|
||||
|
||||
#ifndef _SFX
|
||||
// options.NtOptions.AltStreams = dialog.AltStreams;
|
||||
options.NtOptions.NtSecurity = dialog.NtSecurity;
|
||||
@@ -238,7 +247,7 @@ HRESULT ExtractGUI(
|
||||
NName::NormalizeDirPathPrefix(options.OutputDir);
|
||||
|
||||
/*
|
||||
if (!CreateComplexDirectory(options.OutputDir))
|
||||
if(!CreateComplexDirectory(options.OutputDir))
|
||||
{
|
||||
UString s = GetUnicodeString(NError::MyFormatMessage(GetLastError()));
|
||||
UString s2 = MyFormatNew(IDS_CANNOT_CREATE_FOLDER,
|
||||
@@ -276,5 +285,33 @@ HRESULT ExtractGUI(
|
||||
|
||||
RINOK(extracter.Create(title, hwndParent));
|
||||
messageWasDisplayed = extracter.ThreadFinishedOK && extracter.MessagesDisplayed;
|
||||
if (extracter.ThreadFinishedOK && !g_bProcessError)
|
||||
{
|
||||
if (openOutputFolder)
|
||||
{
|
||||
StartApplication(options.OutputDir, options.OutputDir);
|
||||
}
|
||||
if (deleteSourceFile)
|
||||
{
|
||||
DWORD dwAttr;
|
||||
UString strFilePath;
|
||||
for (unsigned i = 0; i < archivePathsFull.Size(); i++)
|
||||
{
|
||||
strFilePath = archivePathsFull[i];
|
||||
dwAttr = GetFileAttributesW(strFilePath);
|
||||
|
||||
if ((dwAttr != INVALID_FILE_ATTRIBUTES)
|
||||
&& (dwAttr & FILE_ATTRIBUTE_ARCHIVE))
|
||||
{
|
||||
if (dwAttr & FILE_ATTRIBUTE_READONLY)
|
||||
{
|
||||
dwAttr &= (~FILE_ATTRIBUTE_READONLY);
|
||||
SetFileAttributesW(strFilePath, dwAttr);
|
||||
}
|
||||
::DeleteFileW(strFilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return extracter.Result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user