This commit is contained in:
Igor Pavlov
2023-12-22 17:17:05 +00:00
committed by Kornel
parent ec44a8a070
commit a36c48cece
954 changed files with 42199 additions and 25482 deletions

View File

@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /Gz /MD /W4 /WX /GX /O1 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "EXTRACT_ONLY" /D "_SFX" /D "NO_READ_FROM_CODER" /Yu"StdAfx.h" /FD /c
# ADD CPP /nologo /Gr /MD /W4 /WX /GX /O1 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "Z7_EXTRACT_ONLY" /D "Z7_SFX" /D "Z7_NO_READ_FROM_CODER" /FAcs /Yu"StdAfx.h" /FD /c
# ADD BASE RSC /l 0x419 /d "NDEBUG"
# ADD RSC /l 0x419 /d "NDEBUG"
BSC32=bscmake.exe
@@ -67,7 +67,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /Gz /MTd /W4 /WX /Gm /GX /ZI /Od /I "..\..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "EXTRACT_ONLY" /D "_SFX" /D "NO_READ_FROM_CODER" /Yu"StdAfx.h" /FD /GZ /c
# ADD CPP /nologo /Gz /MTd /W4 /WX /Gm /GX /ZI /Od /I "..\..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "Z7_EXTRACT_ONLY" /D "Z7_SFX" /D "Z7_NO_READ_FROM_CODER" /Yu"StdAfx.h" /FD /GZ /c
# ADD BASE RSC /l 0x419 /d "_DEBUG"
# ADD RSC /l 0x419 /d "_DEBUG"
BSC32=bscmake.exe
@@ -257,6 +257,10 @@ SOURCE=..\..\Compress\Bcj2Coder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Bcj2Coder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\Bcj2Register.cpp
# End Source File
# Begin Source File
@@ -265,6 +269,10 @@ SOURCE=..\..\Compress\BcjCoder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BcjCoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\BcjRegister.cpp
# End Source File
# Begin Source File
@@ -285,6 +293,10 @@ SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\CopyCoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\CopyRegister.cpp
# End Source File
# Begin Source File
@@ -309,6 +321,10 @@ SOURCE=..\..\Compress\LzmaDecoder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LzmaDecoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\LzmaRegister.cpp
# End Source File
# Begin Source File
@@ -317,6 +333,10 @@ SOURCE=..\..\Compress\PpmdDecoder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Compress\PpmdDecoder.h
# End Source File
# Begin Source File
SOURCE=..\..\Compress\PpmdRegister.cpp
# End Source File
# End Group
@@ -441,6 +461,10 @@ SOURCE=..\..\..\Common\CommandLineParser.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\Common.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\CRC.cpp
# End Source File
# Begin Source File
@@ -457,6 +481,18 @@ SOURCE=..\..\..\Common\IntToString.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\MyBuffer.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\MyBuffer2.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\MyCom.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\MyString.cpp
# End Source File
# Begin Source File
@@ -759,6 +795,19 @@ SOURCE=..\..\..\..\C\7zCrcOpt.c
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\7zStream.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\7zTypes.h
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\7zWindows.h
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\Aes.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
@@ -810,11 +859,19 @@ SOURCE=..\..\..\..\C\BraIA64.c
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\Compiler.h
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\CpuArch.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\CpuArch.h
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\Delta.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
@@ -825,7 +882,18 @@ SOURCE=..\..\..\..\C\Delta.h
# Begin Source File
SOURCE=..\..\..\..\C\DllSecur.c
!IF "$(CFG)" == "SFXCon - Win32 Release"
# ADD CPP /O2
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "SFXCon - Win32 Debug"
# SUBTRACT CPP /YX /Yc /Yu
!ENDIF
# End Source File
# Begin Source File
@@ -905,16 +973,36 @@ SOURCE=..\..\..\..\C\Threads.c
SOURCE=..\..\..\..\C\Threads.h
# End Source File
# End Group
# Begin Source File
# Begin Group "7zip"
SOURCE=.\7z.ico
# End Source File
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Archive\IArchive.h
# End Source File
# Begin Source File
SOURCE=..\..\ICoder.h
# End Source File
# Begin Source File
SOURCE=..\..\IDecl.h
# End Source File
# Begin Source File
SOURCE=..\..\IPassword.h
# End Source File
# Begin Source File
SOURCE=..\..\IProgress.h
# End Source File
# End Group
# Begin Source File
SOURCE=.\7z.ico
# End Source File
# Begin Source File
SOURCE=.\SfxCon.cpp
# End Source File
# End Target

View File

@@ -3,9 +3,9 @@
#include "StdAfx.h"
#include "../../../../C/CpuArch.h"
#include "../../../../C/DllSecur.h"
#include "../../../Common/MyWindows.h"
#include "../../../Common/MyInitGuid.h"
#include "../../../Common/CommandLineParser.h"
@@ -28,7 +28,6 @@
#include "../../MyVersion.h"
#include "../../../../C/DllSecur.h"
using namespace NWindows;
using namespace NFile;
@@ -36,8 +35,12 @@ using namespace NDir;
using namespace NCommandLineParser;
#ifdef _WIN32
HINSTANCE g_hInstance = 0;
extern
HINSTANCE g_hInstance;
HINSTANCE g_hInstance = NULL;
#endif
extern
int g_CodePage;
int g_CodePage = -1;
extern CStdOutStream *g_StdStream;
@@ -184,14 +187,14 @@ static void PrintHelp(void)
g_StdOut << kHelpString;
}
MY_ATTR_NORETURN
Z7_ATTR_NORETURN
static void ShowMessageAndThrowException(const char *message, NExitCode::EEnum code)
{
g_StdOut << message << endl;
throw code;
}
MY_ATTR_NORETURN
Z7_ATTR_NORETURN
static void PrintHelpAndExit() // yyy
{
PrintHelp();
@@ -370,12 +373,12 @@ int Main2(
}
}
bool yesToAll = parser[NKey::kYes].ThereIs;
const bool yesToAll = parser[NKey::kYes].ThereIs;
// NExtractMode::EEnum extractMode;
// bool isExtractGroupCommand = command.IsFromExtractGroup(extractMode);
bool passwordEnabled = parser[NKey::kPassword].ThereIs;
const bool passwordEnabled = parser[NKey::kPassword].ThereIs;
UString password;
if (passwordEnabled)
@@ -403,7 +406,7 @@ int Main2(
CCodecs *codecs = new CCodecs;
CMyComPtr<
#ifdef EXTERNAL_CODECS
#ifdef Z7_EXTERNAL_CODECS
ICompressCodecsInfo
#else
IUnknown
@@ -421,7 +424,7 @@ int Main2(
CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs;
ecs->Init(g_StdStream, &g_StdErr, g_StdStream);
#ifndef _NO_CRYPTO
#ifndef Z7_NO_CRYPTO
ecs->PasswordIsDefined = passwordEnabled;
ecs->Password = password;
#endif
@@ -430,7 +433,7 @@ int Main2(
COpenCallbackConsole openCallback;
openCallback.Init(g_StdStream, g_StdStream);
#ifndef _NO_CRYPTO
#ifndef Z7_NO_CRYPTO
openCallback.PasswordIsDefined = passwordEnabled;
openCallback.Password = password;
#endif
@@ -452,22 +455,33 @@ int Main2(
codecs, CObjectVector<COpenType>(), CIntVector(),
v1, v2,
wildcardCensorHead,
eo, ecs, ecs,
eo,
ecs, ecs, ecs,
// NULL, // hash
errorMessage, stat);
ecs->ClosePercents();
if (!errorMessage.IsEmpty())
{
(*g_StdStream) << endl << "Error: " << errorMessage;;
(*g_StdStream) << endl << "Error: " << errorMessage;
if (result == S_OK)
result = E_FAIL;
}
if (ecs->NumArcsWithError != 0 || ecs->NumFileErrors != 0)
if ( 0 != ecs->NumCantOpenArcs
|| 0 != ecs->NumArcsWithError
|| 0 != ecs->NumFileErrors
|| 0 != ecs->NumOpenArcErrors)
{
if (ecs->NumCantOpenArcs != 0)
(*g_StdStream) << endl << "Can't open as archive" << endl;
if (ecs->NumArcsWithError != 0)
(*g_StdStream) << endl << "Archive Errors" << endl;
if (ecs->NumFileErrors != 0)
(*g_StdStream) << endl << "Sub items Errors: " << ecs->NumFileErrors << endl;
if (ecs->NumOpenArcErrors != 0)
(*g_StdStream) << endl << "Open Errors: " << ecs->NumOpenArcErrors << endl;
return NExitCode::kFatalError;
}
if (result != S_OK)
@@ -489,7 +503,7 @@ int Main2(
wildcardCensorHead,
true, // enableHeaders
false, // techMode
#ifndef _NO_CRYPTO
#ifndef Z7_NO_CRYPTO
passwordEnabled, password,
#endif
numErrors, numWarnings);

View File

@@ -1,8 +1,11 @@
// StdAfx.h
#ifndef __STDAFX_H
#define __STDAFX_H
#ifndef ZIP7_INC_STDAFX_H
#define ZIP7_INC_STDAFX_H
#if defined(_MSC_VER) && _MSC_VER >= 1800
#pragma warning(disable : 4464) // relative include path contains '..'
#endif
#include "../../../Common/Common.h"
#endif

View File

@@ -3,9 +3,9 @@ MY_CONSOLE = 1
MY_FIXED = 1
CFLAGS = $(CFLAGS) \
-DEXTRACT_ONLY \
-DNO_READ_FROM_CODER \
-D_SFX \
-DZ7_EXTRACT_ONLY \
-DZ7_NO_READ_FROM_CODER \
-DZ7_SFX \
CURRENT_OBJS = \
$O\SfxCon.obj \
@@ -109,6 +109,7 @@ CRYPTO_OBJS = \
$O\MyAes.obj \
C_OBJS = \
$O\7zStream.obj \
$O\Alloc.obj \
$O\Bcj2.obj \
$O\Bra.obj \

View File

@@ -11,11 +11,20 @@ LOCAL_FLAGS_ST =
MT_OBJS =
ifdef SystemDrive
IS_MINGW = 1
else
ifdef SYSTEMDRIVE
# ifdef OS
IS_MINGW = 1
endif
endif
ifdef ST_MODE
LOCAL_FLAGS_ST = -D_7ZIP_ST
LOCAL_FLAGS_ST = -DZ7_ST
ifdef SystemDrive
ifdef IS_MINGW
MT_OBJS = \
$O/Threads.o \
@@ -35,7 +44,7 @@ endif
LOCAL_FLAGS_SYS =
ifdef SystemDrive
ifdef IS_MINGW
LOCAL_FLAGS_SYS = \
@@ -54,9 +63,9 @@ endif
LOCAL_FLAGS = \
$(LOCAL_FLAGS_ST) \
$(LOCAL_FLAGS_SYS) \
-DEXTRACT_ONLY \
-DNO_READ_FROM_CODER \
-D_SFX \
-DZ7_EXTRACT_ONLY \
-DZ7_NO_READ_FROM_CODER \
-DZ7_SFX \
CURRENT_OBJS = \
@@ -163,6 +172,7 @@ CRYPTO_OBJS = \
$O/MyAes.o \
C_OBJS = \
$O/7zStream.o \
$O/Alloc.o \
$O/Bcj2.o \
$O/Bra.o \
@@ -170,7 +180,6 @@ C_OBJS = \
$O/BraIA64.o \
$O/CpuArch.o \
$O/Delta.o \
\
$O/Lzma2Dec.o \
$O/Lzma2DecMt.o \
$O/LzmaDec.o \
@@ -185,7 +194,7 @@ C_OBJS = \
$O/AesOpt.o \
OBJS = \
$(LZMA_DEC_OPT_OBJS) \
$(LZMA_DEC_OPT_OBJS) \
$(C_OBJS) \
$(MT_OBJS) \
$(SYS_OBJS) \

View File

@@ -2,4 +2,8 @@
MY_VERSION_INFO_APP("7z Console SFX", "7z.sfx")
101 ICON "7z.ico"
101 ICON "7z.ico"
#ifndef UNDER_CE
1 24 MOVEABLE PURE "../../UI/Console/Console.manifest"
#endif