refactor: rename versions/zstd to versions/zstd-bundle for consistency
Aligns the zstd NSIS wrapper directory with the naming convention used by
all other bundle directories (versions/25.01-bundle, 26.00-bundle, etc.).
Changes:
- git mv versions/zstd -> versions/zstd-bundle (20 project-owned files)
- Fix UI/NSIS/StdAfx.h: use relative include ../../Bundles/Nsis7z/pluginapi.h
instead of absolute-style 7zip/Bundles/Nsis7z/pluginapi.h (portable across
both Linux and Windows builds without extra include path)
Build tool updates:
- tools/legacy/build_plugin_zstd_vs2026.py: updated project_dir path
- tools/linux/build_plugin_linux.py:
* VERSION_LAYOUT zstd: zstd -> zstd-bundle
* VERSION_EXTRA_FLAGS zstd: -Wno-sign-compare -Wno-cast-function-type
(fast-lzma2 C vendor code)
* VERSION_EXTRA_CXXFLAGS zstd: -Wno-unused-parameter (NSIS wrapper)
* EXTRA_SYS_OBJS: inject MyWindows.o for zstd (LocalFileTimeToFileTime2)
* Remove 'zip_version != zstd' exception; auto-recreate symlinks for all
bundle versions including zstd
- tools/linux/setup_bundle_symlinks.py: add VENDOR_DIR mapping so 'zstd'
points to versions/7-zip-zstd (not versions/zstd which no longer exists)
- tools/linux/overlay/makefile.gcc: add EXTRA_SYS_OBJS ?= variable so
callers can inject additional objects without modifying the file
Linux build status after this commit:
python3 build_plugin.py --7zip-version zstd -> Build completed (all 3 configs)
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
// MainAr.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
// #include <locale.h>
|
||||
|
||||
#include "Common/Common.h"
|
||||
|
||||
#include "Windows/ErrorMsg.h"
|
||||
|
||||
#include "Common/StdOutStream.h"
|
||||
#include "Common/NewHandler.h"
|
||||
#include "Common/MyException.h"
|
||||
#include "Common/StringConvert.h"
|
||||
|
||||
#include "7zip/UI/Common/ExitCode.h"
|
||||
#include "7zip/UI/Common/ArchiveCommandLine.h"
|
||||
#include "ExtractCallbackConsole.h"
|
||||
#include "NSISBreak.h"
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#pragma warning(disable : 4996)
|
||||
|
||||
#ifndef _UNICODE
|
||||
bool g_IsNT = false;
|
||||
#endif
|
||||
#if !defined(_UNICODE) || !defined(_WIN64)
|
||||
static inline bool IsItWindowsNT()
|
||||
{
|
||||
OSVERSIONINFO versionInfo;
|
||||
versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
|
||||
if (!::GetVersionEx(&versionInfo))
|
||||
return false;
|
||||
return (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void DoInitialize()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
||||
#ifdef _UNICODE
|
||||
#ifndef _WIN64
|
||||
if (!IsItWindowsNT())
|
||||
{
|
||||
//(*g_StdStream) << "This program requires Windows NT/2000/2003/2008/XP/Vista";
|
||||
// return NExitCode::kFatalError;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
g_IsNT = IsItWindowsNT();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
extern int DoExtractArchive(UString archive, UString targetDir, bool overwrite, bool extractPathes, ExtractProgressHandler epc, const UStringVector& skipPatterns);
|
||||
extern int DoExtractArchiveWithFile(UString archive, UString targetDir, bool overwrite, bool extractPathes, ExtractProgressWithFileHandler epc, const UStringVector& skipPatterns);
|
||||
|
||||
int DoExtract(LPTSTR archive, LPTSTR dir, bool overwrite, bool expath, ExtractProgressHandler epc, const UStringVector& skipPatterns)
|
||||
{
|
||||
if (!archive || !dir) return -1;
|
||||
int res = 0;
|
||||
try
|
||||
{
|
||||
#ifdef UNICODE
|
||||
UString uarchive(archive);
|
||||
UString udir(dir);
|
||||
#else
|
||||
UString uarchive = MultiByteToUnicodeString(AString(archive));
|
||||
UString udir = MultiByteToUnicodeString(AString(dir));
|
||||
#endif
|
||||
res = DoExtractArchive(uarchive, udir, overwrite, expath, epc, skipPatterns);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int DoExtractWithFile(LPTSTR archive, LPTSTR dir, bool overwrite, bool expath, ExtractProgressWithFileHandler epc, const UStringVector& skipPatterns)
|
||||
{
|
||||
if (!archive || !dir) return -1;
|
||||
int res = 0;
|
||||
try
|
||||
{
|
||||
#ifdef UNICODE
|
||||
UString uarchive(archive);
|
||||
UString udir(dir);
|
||||
#else
|
||||
UString uarchive = MultiByteToUnicodeString(AString(archive));
|
||||
UString udir = MultiByteToUnicodeString(AString(dir));
|
||||
#endif
|
||||
res = DoExtractArchiveWithFile(uarchive, udir, overwrite, expath, epc, skipPatterns);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user