This commit is contained in:
Igor Pavlov
2015-06-15 00:00:00 +00:00
committed by Kornel Lesiński
parent 0713a3ab80
commit 54490d51d5
591 changed files with 34932 additions and 16390 deletions

View File

@@ -126,14 +126,8 @@ static int Main2()
#endif
#endif
CCodecs *codecs = new CCodecs;
#ifdef EXTERNAL_CODECS
CExternalCodecs __externalCodecs;
__externalCodecs.GetCodecs = codecs;
__externalCodecs.GetHashers = codecs;
#else
CMyComPtr<IUnknown> compressCodecsInfo = codecs;
#endif
CREATE_CODECS_OBJECT
codecs->CaseSensitiveChange = options.CaseSensitiveChange;
codecs->CaseSensitive = options.CaseSensitive;
ThrowException_if_Error(codecs->Load());
@@ -144,8 +138,18 @@ static int Main2()
(isExtractGroupCommand
|| options.Command.IsFromUpdateGroup()))
{
#ifdef EXTERNAL_CODECS
if (!codecs->MainDll_ErrorPath.IsEmpty())
{
UString s = L"7-Zip cannot load module ";
s += fs2us(codecs->MainDll_ErrorPath);
throw s;
}
#endif
throw kNoFormats;
}
CObjectVector<COpenType> formatIndices;
if (!ParseOpenTypes(*codecs, options.ArcType, formatIndices))
{
@@ -171,12 +175,12 @@ static int Main2()
if (isExtractGroupCommand
|| options.Command.CommandType == NCommandType::kHash
|| options.Command.CommandType == NCommandType::kBenchmark)
ThrowException_if_Error(__externalCodecs.LoadCodecs());
ThrowException_if_Error(__externalCodecs.Load());
#endif
if (options.Command.CommandType == NCommandType::kBenchmark)
{
HRESULT res = Benchmark(EXTERNAL_CODECS_VARS options.Properties);
HRESULT res = Benchmark(EXTERNAL_CODECS_VARS_L options.Properties);
/*
if (res == S_FALSE)
{
@@ -188,6 +192,9 @@ static int Main2()
}
else if (isExtractGroupCommand)
{
UStringVector ArchivePathsSorted;
UStringVector ArchivePathsFullSorted;
CExtractCallbackImp *ecs = new CExtractCallbackImp;
CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs;
@@ -218,14 +225,35 @@ static int Main2()
if (!options.HashMethods.IsEmpty())
{
hb_ptr = &hb;
ThrowException_if_Error(hb.SetMethods(EXTERNAL_CODECS_VARS options.HashMethods));
ThrowException_if_Error(hb.SetMethods(EXTERNAL_CODECS_VARS_L options.HashMethods));
}
#endif
{
CDirItemsStat st;
HRESULT hresultMain = EnumerateDirItemsAndSort(
options.arcCensor,
NWildcard::k_RelatPath,
UString(), // addPathPrefix
ArchivePathsSorted,
ArchivePathsFullSorted,
st,
NULL // &scan: change it!!!!
);
if (hresultMain != S_OK)
{
/*
if (hresultMain != E_ABORT && messageWasDisplayed)
return NExitCode::kFatalError;
*/
throw CSystemException(hresultMain);
}
}
HRESULT result = ExtractGUI(codecs,
formatIndices, excludedFormatIndices,
options.ArchivePathsSorted,
options.ArchivePathsFullSorted,
ArchivePathsSorted,
ArchivePathsFullSorted,
options.Censor.Pairs.Front().Head,
eo,
#ifndef _SFX
@@ -291,7 +319,7 @@ static int Main2()
else if (options.Command.CommandType == NCommandType::kHash)
{
bool messageWasDisplayed = false;
HRESULT result = HashCalcGUI(EXTERNAL_CODECS_VARS
HRESULT result = HashCalcGUI(EXTERNAL_CODECS_VARS_L
options.Censor, options.HashOptions, messageWasDisplayed);
if (result != S_OK)