mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-10 00:07:06 -06:00
9.34
This commit is contained in:
committed by
Kornel Lesiński
parent
83f8ddcc5b
commit
f08f4dcc3c
29
CPP/7zip/Bundles/SFXSetup/ExtractCallback.cpp → CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp
Executable file → Normal file
29
CPP/7zip/Bundles/SFXSetup/ExtractCallback.cpp → CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp
Executable file → Normal file
@@ -1,18 +1,19 @@
|
||||
// ExtractCallback.h
|
||||
// ExtractCallbackSfx.h
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Common/Wildcard.h"
|
||||
#include "../../../Common/Wildcard.h"
|
||||
|
||||
#include "Windows/FileDir.h"
|
||||
#include "Windows/FileFind.h"
|
||||
#include "Windows/FileName.h"
|
||||
#include "Windows/PropVariant.h"
|
||||
#include "../../../Windows/FileDir.h"
|
||||
#include "../../../Windows/FileFind.h"
|
||||
#include "../../../Windows/FileName.h"
|
||||
#include "../../../Windows/PropVariant.h"
|
||||
|
||||
#include "ExtractCallback.h"
|
||||
#include "ExtractCallbackSfx.h"
|
||||
|
||||
using namespace NWindows;
|
||||
using namespace NFile;
|
||||
using namespace NDir;
|
||||
|
||||
static LPCWSTR kCantDeleteFile = L"Can not delete output file";
|
||||
static LPCWSTR kCantOpenFile = L"Can not open output file";
|
||||
@@ -78,10 +79,10 @@ STDMETHODIMP CExtractCallbackImp::SetCompleted(const UInt64 *completeValue)
|
||||
void CExtractCallbackImp::CreateComplexDirectory(const UStringVector &dirPathParts)
|
||||
{
|
||||
FString fullPath = _directoryPath;
|
||||
for (int i = 0; i < dirPathParts.Size(); i++)
|
||||
FOR_VECTOR (i, dirPathParts)
|
||||
{
|
||||
fullPath += us2fs(dirPathParts[i]);
|
||||
NDirectory::MyCreateDirectory(fullPath);
|
||||
CreateDir(fullPath);
|
||||
fullPath += FCHAR_PATH_SEPARATOR;
|
||||
}
|
||||
}
|
||||
@@ -161,16 +162,16 @@ STDMETHODIMP CExtractCallbackImp::GetStream(UInt32 index,
|
||||
_diskFilePath = fullProcessedPath;
|
||||
|
||||
if (isAnti)
|
||||
NDirectory::MyRemoveDirectory(_diskFilePath);
|
||||
RemoveDir(_diskFilePath);
|
||||
else
|
||||
NDirectory::SetDirTime(_diskFilePath, NULL, NULL, &_processedFileInfo.MTime);
|
||||
SetDirTime(_diskFilePath, NULL, NULL, &_processedFileInfo.MTime);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
NFind::CFileInfo fileInfo;
|
||||
if (fileInfo.Find(fullProcessedPath))
|
||||
{
|
||||
if (!NDirectory::DeleteFileAlways(fullProcessedPath))
|
||||
if (!DeleteFileAlways(fullProcessedPath))
|
||||
{
|
||||
_message = kCantDeleteFile;
|
||||
return E_FAIL;
|
||||
@@ -216,7 +217,7 @@ STDMETHODIMP CExtractCallbackImp::SetOperationResult(Int32 resultEOperationResul
|
||||
_outFileStream.Release();
|
||||
switch(resultEOperationResult)
|
||||
{
|
||||
case NArchive::NExtract::NOperationResult::kUnSupportedMethod:
|
||||
case NArchive::NExtract::NOperationResult::kUnsupportedMethod:
|
||||
_message = kUnsupportedMethod;
|
||||
break;
|
||||
default:
|
||||
@@ -232,6 +233,6 @@ STDMETHODIMP CExtractCallbackImp::SetOperationResult(Int32 resultEOperationResul
|
||||
}
|
||||
_outFileStream.Release();
|
||||
if (_extractMode)
|
||||
NDirectory::MySetFileAttributes(_diskFilePath, _processedFileInfo.Attributes);
|
||||
SetFileAttrib(_diskFilePath, _processedFileInfo.Attributes);
|
||||
return S_OK;
|
||||
}
|
||||
16
CPP/7zip/Bundles/SFXSetup/ExtractCallback.h → CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h
Executable file → Normal file
16
CPP/7zip/Bundles/SFXSetup/ExtractCallback.h → CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h
Executable file → Normal file
@@ -1,17 +1,19 @@
|
||||
// ExtractCallback.h
|
||||
// ExtractCallbackSfx.h
|
||||
|
||||
#ifndef __EXTRACT_CALLBACK_H
|
||||
#define __EXTRACT_CALLBACK_H
|
||||
#ifndef __EXTRACT_CALLBACK_SFX_H
|
||||
#define __EXTRACT_CALLBACK_SFX_H
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
#include "Windows/ResourceString.h"
|
||||
#include "../../../Windows/ResourceString.h"
|
||||
|
||||
#include "../../Archive/IArchive.h"
|
||||
|
||||
#include "../../Common/FileStreams.h"
|
||||
#include "../../ICoder.h"
|
||||
|
||||
#include "../../UI/FileManager/LangUtils.h"
|
||||
|
||||
#ifndef _NO_PROGRESS
|
||||
#include "../../UI/FileManager/ProgressDialog.h"
|
||||
#endif
|
||||
@@ -70,11 +72,7 @@ public:
|
||||
{
|
||||
ProgressDialog.Create(title, thread, 0);
|
||||
{
|
||||
#ifdef LANG
|
||||
ProgressDialog.SetText(LangLoadString(IDS_PROGRESS_EXTRACTING, 0x02000890));
|
||||
#else
|
||||
ProgressDialog.SetText(NWindows::MyLoadStringW(IDS_PROGRESS_EXTRACTING));
|
||||
#endif
|
||||
ProgressDialog.SetText(LangString(IDS_PROGRESS_EXTRACTING));
|
||||
}
|
||||
|
||||
ProgressDialog.Show(SW_SHOWNORMAL);
|
||||
35
CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp
Executable file → Normal file
35
CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp
Executable file → Normal file
@@ -2,18 +2,21 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Windows/FileDir.h"
|
||||
#include "Windows/FileName.h"
|
||||
#include "Windows/Thread.h"
|
||||
#include "../../../Windows/FileDir.h"
|
||||
#include "../../../Windows/FileName.h"
|
||||
#include "../../../Windows/Thread.h"
|
||||
|
||||
#include "../../UI/Common/OpenArchive.h"
|
||||
|
||||
#include "../../UI/FileManager/FormatUtils.h"
|
||||
#include "../../UI/FileManager/LangUtils.h"
|
||||
|
||||
#include "ExtractCallback.h"
|
||||
#include "ExtractCallbackSfx.h"
|
||||
#include "ExtractEngine.h"
|
||||
|
||||
using namespace NWindows;
|
||||
using namespace NFile;
|
||||
using namespace NDir;
|
||||
|
||||
static LPCWSTR kCantFindArchive = L"Can not find archive file";
|
||||
static LPCWSTR kCantOpenArchive = L"Can not open the file as archive";
|
||||
@@ -33,15 +36,23 @@ struct CThreadExtracting
|
||||
|
||||
void Process2()
|
||||
{
|
||||
NFile::NFind::CFileInfo fi;
|
||||
NFind::CFileInfo fi;
|
||||
if (!fi.Find(FileName))
|
||||
{
|
||||
ErrorMessage = kCantFindArchive;
|
||||
Result = E_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
CObjectVector<COpenType> incl;
|
||||
CIntVector excl;
|
||||
COpenOptions options;
|
||||
options.codecs = Codecs;
|
||||
options.types = &incl;
|
||||
options.excludedFormats = !
|
||||
options.filePath = fs2us(FileName);
|
||||
|
||||
Result = ArchiveLink.Open2(Codecs, CIntVector(), false, NULL, fs2us(FileName), ExtractCallbackSpec);
|
||||
Result = ArchiveLink.Open2(options, ExtractCallbackSpec);
|
||||
if (Result != S_OK)
|
||||
{
|
||||
if (Result != S_OK)
|
||||
@@ -50,9 +61,9 @@ struct CThreadExtracting
|
||||
}
|
||||
|
||||
FString dirPath = DestFolder;
|
||||
NFile::NName::NormalizeDirPathPrefix(dirPath);
|
||||
NName::NormalizeDirPathPrefix(dirPath);
|
||||
|
||||
if (!NFile::NDirectory::CreateComplexDirectory(dirPath))
|
||||
if (!CreateComplexDir(dirPath))
|
||||
{
|
||||
ErrorMessage = MyFormatNew(IDS_CANNOT_CREATE_FOLDER,
|
||||
#ifdef LANG
|
||||
@@ -65,7 +76,7 @@ struct CThreadExtracting
|
||||
|
||||
ExtractCallbackSpec->Init(ArchiveLink.GetArchive(), dirPath, L"Default", fi.MTime, 0);
|
||||
|
||||
Result = ArchiveLink.GetArchive()->Extract(0, (UInt32)-1 , BoolToInt(false), ExtractCallback);
|
||||
Result = ArchiveLink.GetArchive()->Extract(0, (UInt32)(Int32)-1 , BoolToInt(false), ExtractCallback);
|
||||
}
|
||||
|
||||
void Process()
|
||||
@@ -109,11 +120,7 @@ HRESULT ExtractArchive(CCodecs *codecs, const FString &fileName, const FString &
|
||||
RINOK(thread.Create(CThreadExtracting::MyThreadFunction, &t));
|
||||
|
||||
UString title;
|
||||
#ifdef LANG
|
||||
title = LangLoadString(IDS_PROGRESS_EXTRACTING, 0x02000890);
|
||||
#else
|
||||
title = NWindows::MyLoadStringW(IDS_PROGRESS_EXTRACTING);
|
||||
#endif
|
||||
LangString(IDS_PROGRESS_EXTRACTING, title);
|
||||
t.ExtractCallbackSpec->StartProgressDialog(title, thread);
|
||||
}
|
||||
else
|
||||
|
||||
0
CPP/7zip/Bundles/SFXSetup/ExtractEngine.h
Executable file → Normal file
0
CPP/7zip/Bundles/SFXSetup/ExtractEngine.h
Executable file → Normal file
30
CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp
Executable file → Normal file
30
CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp
Executable file → Normal file
@@ -44,7 +44,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /Gz /MT /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MT /W4 /WX /GX /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
@@ -71,7 +71,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 "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MTd /W4 /WX /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
@@ -98,7 +98,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "_SFX" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W4 /WX /GX /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
@@ -173,10 +173,6 @@ SOURCE=..\..\Archive\7z\7zHandler.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Archive\7z\7zHeader.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Archive\7z\7zHeader.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -401,11 +397,11 @@ SOURCE=..\..\..\Windows\DLL.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Error.cpp
|
||||
SOURCE=..\..\..\Windows\ErrorMsg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Error.h
|
||||
SOURCE=..\..\..\Windows\ErrorMsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -541,6 +537,10 @@ SOURCE=..\..\Common\ProgressUtils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\PropId.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Common\StreamBinder.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -641,6 +641,10 @@ SOURCE=..\..\UI\FileManager\FormatUtils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\FileManager\LangUtils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\FileManager\ProgressDialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -722,11 +726,11 @@ SOURCE=..\..\..\..\C\Threads.h
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ExtractCallback.cpp
|
||||
SOURCE=.\ExtractCallbackSfx.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ExtractCallback.h
|
||||
SOURCE=.\ExtractCallbackSfx.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -738,11 +742,11 @@ SOURCE=.\ExtractEngine.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Main.cpp
|
||||
SOURCE=.\setup.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\setup.ico
|
||||
SOURCE=.\SfxSetup.cpp
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
|
||||
0
CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw
Executable file → Normal file
0
CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw
Executable file → Normal file
91
CPP/7zip/Bundles/SFXSetup/Main.cpp → CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp
Executable file → Normal file
91
CPP/7zip/Bundles/SFXSetup/Main.cpp → CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp
Executable file → Normal file
@@ -2,19 +2,20 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Common/MyInitGuid.h"
|
||||
#include "../../../Common/MyInitGuid.h"
|
||||
|
||||
#include "Common/CommandLineParser.h"
|
||||
#include "Common/StringConvert.h"
|
||||
#include "Common/TextConfig.h"
|
||||
#include "../../../Common/CommandLineParser.h"
|
||||
#include "../../../Common/StringConvert.h"
|
||||
#include "../../../Common/TextConfig.h"
|
||||
|
||||
#include "Windows/DLL.h"
|
||||
#include "Windows/FileDir.h"
|
||||
#include "Windows/FileFind.h"
|
||||
#include "Windows/FileIO.h"
|
||||
#include "Windows/FileName.h"
|
||||
#include "Windows/NtCheck.h"
|
||||
#include "Windows/ResourceString.h"
|
||||
#include "../../../Windows/DLL.h"
|
||||
#include "../../../Windows/ErrorMsg.h"
|
||||
#include "../../../Windows/FileDir.h"
|
||||
#include "../../../Windows/FileFind.h"
|
||||
#include "../../../Windows/FileIO.h"
|
||||
#include "../../../Windows/FileName.h"
|
||||
#include "../../../Windows/NtCheck.h"
|
||||
#include "../../../Windows/ResourceString.h"
|
||||
|
||||
#include "../../UI/Explorer/MyMessages.h"
|
||||
|
||||
@@ -23,6 +24,8 @@
|
||||
#include "resource.h"
|
||||
|
||||
using namespace NWindows;
|
||||
using namespace NFile;
|
||||
using namespace NDir;
|
||||
|
||||
HINSTANCE g_hInstance;
|
||||
|
||||
@@ -34,7 +37,7 @@ static bool ReadDataString(CFSTR fileName, LPCSTR startID,
|
||||
LPCSTR endID, AString &stringResult)
|
||||
{
|
||||
stringResult.Empty();
|
||||
NFile::NIO::CInFile inFile;
|
||||
NIO::CInFile inFile;
|
||||
if (!inFile.Open(fileName))
|
||||
return false;
|
||||
const int kBufferSize = (1 << 12);
|
||||
@@ -105,19 +108,20 @@ public:
|
||||
} g_CInstallIDInit;
|
||||
|
||||
|
||||
#ifndef UNDER_CE
|
||||
class CCurrentDirRestorer
|
||||
{
|
||||
FString m_CurrentDirectory;
|
||||
public:
|
||||
CCurrentDirRestorer() { NFile::NDirectory::MyGetCurrentDirectory(m_CurrentDirectory); }
|
||||
~CCurrentDirRestorer() { RestoreDirectory();}
|
||||
bool RestoreDirectory() const { return NFile::NDirectory::MySetCurrentDirectory(m_CurrentDirectory); }
|
||||
};
|
||||
#endif
|
||||
|
||||
#define NT_CHECK_FAIL_ACTION ShowErrorMessage(L"Unsupported Windows version"); return 1;
|
||||
|
||||
static void ShowErrorMessageSpec(const UString &name)
|
||||
{
|
||||
UString message = NError::MyFormatMessage(::GetLastError());
|
||||
int pos = message.Find(L"%1");
|
||||
if (pos >= 0)
|
||||
{
|
||||
message.Delete(pos, 2);
|
||||
message.Insert(pos, name);
|
||||
}
|
||||
ShowErrorMessage(NULL, message);
|
||||
}
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
#ifdef UNDER_CE
|
||||
LPWSTR
|
||||
@@ -143,10 +147,10 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
|
||||
switches.Trim();
|
||||
bool assumeYes = false;
|
||||
if (switches.Left(2).CompareNoCase(UString(L"-y")) == 0)
|
||||
if (MyStringCompareNoCase_N(switches, L"-y", 2) == 0)
|
||||
{
|
||||
assumeYes = true;
|
||||
switches = switches.Mid(2);
|
||||
switches = switches.Ptr(2);
|
||||
switches.Trim();
|
||||
}
|
||||
|
||||
@@ -173,7 +177,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
UString friendlyName = GetTextConfigValue(pairs, L"Title");
|
||||
UString installPrompt = GetTextConfigValue(pairs, L"BeginPrompt");
|
||||
UString progress = GetTextConfigValue(pairs, L"Progress");
|
||||
if (progress.CompareNoCase(L"no") == 0)
|
||||
if (progress.IsEqualToNoCase(L"no"))
|
||||
showProgress = false;
|
||||
int index = FindTextConfigItem(pairs, L"Directory");
|
||||
if (index >= 0)
|
||||
@@ -188,11 +192,11 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
|
||||
#ifdef _SHELL_EXECUTE
|
||||
executeFile = GetTextConfigValue(pairs, L"ExecuteFile");
|
||||
executeParameters = GetTextConfigValue(pairs, L"ExecuteParameters") + switches;
|
||||
executeParameters = GetTextConfigValue(pairs, L"ExecuteParameters");
|
||||
#endif
|
||||
}
|
||||
|
||||
NFile::NDirectory::CTempDir tempDir;
|
||||
CTempDir tempDir;
|
||||
if (!tempDir.Create(kTempDirPrefix))
|
||||
{
|
||||
if (!assumeYes)
|
||||
@@ -209,7 +213,8 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
return 1;
|
||||
}
|
||||
|
||||
FString tempDirPath = tempDir.GetPath();
|
||||
const FString tempDirPath = tempDir.GetPath();
|
||||
// tempDirPath = L"M:\\1\\"; // to test low disk space
|
||||
{
|
||||
bool isCorrupt = false;
|
||||
UString errorMessage;
|
||||
@@ -222,11 +227,15 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
{
|
||||
if (result == S_FALSE || isCorrupt)
|
||||
{
|
||||
errorMessage = NWindows::MyLoadStringW(IDS_EXTRACTION_ERROR_MESSAGE);
|
||||
NWindows::MyLoadString(IDS_EXTRACTION_ERROR_MESSAGE, errorMessage);
|
||||
result = E_FAIL;
|
||||
}
|
||||
if (result != E_ABORT && !errorMessage.IsEmpty())
|
||||
::MessageBoxW(0, errorMessage, NWindows::MyLoadStringW(IDS_EXTRACTION_ERROR_TITLE), MB_ICONERROR);
|
||||
if (result != E_ABORT)
|
||||
{
|
||||
if (errorMessage.IsEmpty())
|
||||
errorMessage = NError::MyFormatMessage(result);
|
||||
::MessageBoxW(0, errorMessage, NWindows::MyLoadString(IDS_EXTRACTION_ERROR_TITLE), MB_ICONERROR);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -234,7 +243,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
|
||||
#ifndef UNDER_CE
|
||||
CCurrentDirRestorer currentDirRestorer;
|
||||
if (!NFile::NDirectory::MySetCurrentDirectory(tempDir.GetPath()))
|
||||
if (!SetCurrentDir(tempDirPath))
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
@@ -255,7 +264,11 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
execInfo.lpFile = filePath;
|
||||
|
||||
if (!switches.IsEmpty())
|
||||
{
|
||||
if (!executeParameters.IsEmpty())
|
||||
executeParameters += L' ';
|
||||
executeParameters += switches;
|
||||
}
|
||||
|
||||
CSysString parametersSys = GetSystemString(executeParameters);
|
||||
if (parametersSys.IsEmpty())
|
||||
@@ -282,7 +295,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
if (appLaunched.IsEmpty())
|
||||
{
|
||||
appLaunched = L"setup.exe";
|
||||
if (!NFile::NFind::DoesFileExist(us2fs(appLaunched)))
|
||||
if (!NFind::DoesFileExist(us2fs(appLaunched)))
|
||||
{
|
||||
if (!assumeYes)
|
||||
ShowErrorMessage(L"Can not find setup.exe");
|
||||
@@ -292,10 +305,12 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
|
||||
{
|
||||
FString s2 = tempDirPath;
|
||||
NFile::NName::NormalizeDirPathPrefix(s2);
|
||||
NName::NormalizeDirPathPrefix(s2);
|
||||
appLaunched.Replace(L"%%T" WSTRING_PATH_SEPARATOR, fs2us(s2));
|
||||
}
|
||||
|
||||
UString appNameForError = appLaunched; // actually we need to rtemove parameters also
|
||||
|
||||
appLaunched.Replace(L"%%T", fs2us(tempDirPath));
|
||||
|
||||
if (!switches.IsEmpty())
|
||||
@@ -322,7 +337,11 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
if (createResult == 0)
|
||||
{
|
||||
if (!assumeYes)
|
||||
ShowLastErrorMessage();
|
||||
{
|
||||
// we print name of exe file, if error message is
|
||||
// ERROR_BAD_EXE_FORMAT: "%1 is not a valid Win32 application".
|
||||
ShowErrorMessageSpec(appNameForError);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
::CloseHandle(processInformation.hThread);
|
||||
0
CPP/7zip/Bundles/SFXSetup/StdAfx.cpp
Executable file → Normal file
0
CPP/7zip/Bundles/SFXSetup/StdAfx.cpp
Executable file → Normal file
7
CPP/7zip/Bundles/SFXSetup/StdAfx.h
Executable file → Normal file
7
CPP/7zip/Bundles/SFXSetup/StdAfx.h
Executable file → Normal file
@@ -3,8 +3,11 @@
|
||||
#ifndef __STDAFX_H
|
||||
#define __STDAFX_H
|
||||
|
||||
#include "../../../Common/MyWindows.h"
|
||||
#include "../../../Common/NewHandler.h"
|
||||
#include "../../../Common/Common.h"
|
||||
|
||||
#include <commctrl.h>
|
||||
|
||||
// #define printf(x) NO_PRINTF_(x)
|
||||
// #define sprintf(x) NO_SPRINTF_(x)
|
||||
|
||||
#endif
|
||||
|
||||
66
CPP/7zip/Bundles/SFXSetup/makefile
Executable file → Normal file
66
CPP/7zip/Bundles/SFXSetup/makefile
Executable file → Normal file
@@ -1,14 +1,14 @@
|
||||
PROG = 7zS.sfx
|
||||
CFLAGS = $(CFLAGS) -I ../../../ \
|
||||
CFLAGS = $(CFLAGS) \
|
||||
-DNO_REGISTRY \
|
||||
-DEXTRACT_ONLY \
|
||||
-DNO_READ_FROM_CODER \
|
||||
-D_SFX \
|
||||
-D_NO_CRYPTO \
|
||||
|
||||
SFX_WIN_OBJS = \
|
||||
$O\Main.obj \
|
||||
$O\ExtractCallback.obj \
|
||||
CURRENT_OBJS = \
|
||||
$O\SfxSetup.obj \
|
||||
$O\ExtractCallbackSfx.obj \
|
||||
$O\ExtractEngine.obj \
|
||||
|
||||
COMMON_OBJS = \
|
||||
@@ -25,7 +25,7 @@ COMMON_OBJS = \
|
||||
|
||||
WIN_OBJS = \
|
||||
$O\DLL.obj \
|
||||
$O\Error.obj \
|
||||
$O\ErrorMsg.obj \
|
||||
$O\FileDir.obj \
|
||||
$O\FileFind.obj \
|
||||
$O\FileIO.obj \
|
||||
@@ -47,6 +47,7 @@ WIN_CTRL_OBJS = \
|
||||
$O\LockedStream.obj \
|
||||
$O\OutBuffer.obj \
|
||||
$O\ProgressUtils.obj \
|
||||
$O\PropId.obj \
|
||||
$O\StreamBinder.obj \
|
||||
$O\StreamObjects.obj \
|
||||
$O\StreamUtils.obj \
|
||||
@@ -58,6 +59,9 @@ UI_COMMON_OBJS = \
|
||||
$O\LoadCodecs.obj \
|
||||
$O\OpenArchive.obj \
|
||||
|
||||
EXPLORER_OBJS = \
|
||||
$O\MyMessages.obj \
|
||||
|
||||
FM_OBJS = \
|
||||
$O\FormatUtils.obj \
|
||||
$O\ProgressDialog.obj \
|
||||
@@ -74,7 +78,6 @@ AR_COMMON_OBJS = \
|
||||
$O\7zExtract.obj \
|
||||
$O\7zFolderOutStream.obj \
|
||||
$O\7zHandler.obj \
|
||||
$O\7zHeader.obj \
|
||||
$O\7zIn.obj \
|
||||
$O\7zRegister.obj \
|
||||
|
||||
@@ -101,53 +104,4 @@ C_OBJS = \
|
||||
|
||||
!include "../../Crc.mak"
|
||||
|
||||
OBJS = \
|
||||
$O\StdAfx.obj \
|
||||
$(SFX_WIN_OBJS) \
|
||||
$(COMMON_OBJS) \
|
||||
$(WIN_OBJS) \
|
||||
$(WIN_CTRL_OBJS) \
|
||||
$(7ZIP_COMMON_OBJS) \
|
||||
$(UI_COMMON_OBJS) \
|
||||
$(FM_OBJS)\
|
||||
$(AR_COMMON_OBJS) \
|
||||
$(7Z_OBJS) \
|
||||
$(COMPRESS_OBJS) \
|
||||
$O\MyMessages.obj \
|
||||
$(C_OBJS) \
|
||||
$(ASM_OBJS) \
|
||||
$O\resource.res
|
||||
|
||||
|
||||
!include "../../../Build.mak"
|
||||
|
||||
$(SFX_WIN_OBJS): $(*B).cpp
|
||||
$(COMPL)
|
||||
|
||||
$(COMMON_OBJS): ../../../Common/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(WIN_OBJS): ../../../Windows/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(WIN_CTRL_OBJS): ../../../Windows/Control/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(UI_COMMON_OBJS): ../../UI/Common/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(FM_OBJS): ../../UI/FileManager//$(*B).cpp
|
||||
$(COMPL)
|
||||
$(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp
|
||||
$(COMPL)
|
||||
|
||||
$(7Z_OBJS): ../../Archive/7z/$(*B).cpp
|
||||
$(COMPL)
|
||||
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
|
||||
$(COMPL)
|
||||
|
||||
$O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp
|
||||
$(COMPL)
|
||||
|
||||
$(C_OBJS): ../../../../C/$(*B).c
|
||||
$(COMPL_O2)
|
||||
|
||||
!include "../../Asm.mak"
|
||||
!include "../../7zip.mak"
|
||||
|
||||
10
CPP/7zip/Bundles/SFXSetup/resource.h
Executable file → Normal file
10
CPP/7zip/Bundles/SFXSetup/resource.h
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
#define IDI_ICON 1
|
||||
#define IDI_ICON 1
|
||||
|
||||
#define IDS_EXTRACTION_ERROR_TITLE 7
|
||||
#define IDS_EXTRACTION_ERROR_MESSAGE 8
|
||||
#define IDS_CANNOT_CREATE_FOLDER 9
|
||||
#define IDS_PROGRESS_EXTRACTING 69
|
||||
#define IDS_EXTRACTION_ERROR_TITLE 7
|
||||
#define IDS_EXTRACTION_ERROR_MESSAGE 8
|
||||
#define IDS_CANNOT_CREATE_FOLDER 3003
|
||||
#define IDS_PROGRESS_EXTRACTING 3300
|
||||
|
||||
8
CPP/7zip/Bundles/SFXSetup/resource.rc
Executable file → Normal file
8
CPP/7zip/Bundles/SFXSetup/resource.rc
Executable file → Normal file
@@ -7,10 +7,10 @@ IDI_ICON ICON "setup.ico"
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_EXTRACTION_ERROR_TITLE "Extraction Failed"
|
||||
IDS_EXTRACTION_ERROR_MESSAGE "File is corrupt"
|
||||
IDS_CANNOT_CREATE_FOLDER "Cannot create folder '{0}'"
|
||||
IDS_PROGRESS_EXTRACTING "Extracting"
|
||||
IDS_EXTRACTION_ERROR_TITLE "Extraction Failed"
|
||||
IDS_EXTRACTION_ERROR_MESSAGE "File is corrupt"
|
||||
IDS_CANNOT_CREATE_FOLDER "Cannot create folder '{0}'"
|
||||
IDS_PROGRESS_EXTRACTING "Extracting"
|
||||
END
|
||||
|
||||
#include "../../UI/FileManager/ProgressDialog.rc"
|
||||
|
||||
0
CPP/7zip/Bundles/SFXSetup/setup.ico
Executable file → Normal file
0
CPP/7zip/Bundles/SFXSetup/setup.ico
Executable file → Normal file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user