mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 07:14:56 -06:00
9.06 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
829409452d
commit
c99f3ebdd6
@@ -36,7 +36,7 @@ void CExtractCallbackImp::Init(IInArchive *archiveHandler,
|
||||
HRESULT CExtractCallbackImp::Open_CheckBreak()
|
||||
{
|
||||
#ifndef _NO_PROGRESS
|
||||
return ProgressDialog.ProgressSynch.ProcessStopAndPause();
|
||||
return ProgressDialog.Sync.ProcessStopAndPause();
|
||||
#else
|
||||
return S_OK;
|
||||
#endif
|
||||
@@ -50,7 +50,7 @@ HRESULT CExtractCallbackImp::Open_SetTotal(const UInt64 * /* numFiles */, const
|
||||
HRESULT CExtractCallbackImp::Open_SetCompleted(const UInt64 * /* numFiles */, const UInt64 * /* numBytes */)
|
||||
{
|
||||
#ifndef _NO_PROGRESS
|
||||
return ProgressDialog.ProgressSynch.ProcessStopAndPause();
|
||||
return ProgressDialog.Sync.ProcessStopAndPause();
|
||||
#else
|
||||
return S_OK;
|
||||
#endif
|
||||
@@ -59,7 +59,7 @@ HRESULT CExtractCallbackImp::Open_SetCompleted(const UInt64 * /* numFiles */, co
|
||||
STDMETHODIMP CExtractCallbackImp::SetTotal(UInt64 size)
|
||||
{
|
||||
#ifndef _NO_PROGRESS
|
||||
ProgressDialog.ProgressSynch.SetProgress(size, 0);
|
||||
ProgressDialog.Sync.SetProgress(size, 0);
|
||||
#endif
|
||||
return S_OK;
|
||||
}
|
||||
@@ -67,9 +67,9 @@ STDMETHODIMP CExtractCallbackImp::SetTotal(UInt64 size)
|
||||
STDMETHODIMP CExtractCallbackImp::SetCompleted(const UInt64 *completeValue)
|
||||
{
|
||||
#ifndef _NO_PROGRESS
|
||||
RINOK(ProgressDialog.ProgressSynch.ProcessStopAndPause());
|
||||
RINOK(ProgressDialog.Sync.ProcessStopAndPause());
|
||||
if (completeValue != NULL)
|
||||
ProgressDialog.ProgressSynch.SetPos(*completeValue);
|
||||
ProgressDialog.Sync.SetPos(*completeValue);
|
||||
#endif
|
||||
return S_OK;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ STDMETHODIMP CExtractCallbackImp::GetStream(UInt32 index,
|
||||
ISequentialOutStream **outStream, Int32 askExtractMode)
|
||||
{
|
||||
#ifndef _NO_PROGRESS
|
||||
if (ProgressDialog.ProgressSynch.GetStopped())
|
||||
if (ProgressDialog.Sync.GetStopped())
|
||||
return E_ABORT;
|
||||
#endif
|
||||
_outFileStream.Release();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// ExtractCallback.h
|
||||
|
||||
#ifndef __EXTRACTCALLBACK_H
|
||||
#define __EXTRACTCALLBACK_H
|
||||
#ifndef __EXTRACT_CALLBACK_H
|
||||
#define __EXTRACT_CALLBACK_H
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
@@ -66,9 +66,9 @@ public:
|
||||
UInt32 defaultAttributes);
|
||||
|
||||
#ifndef _NO_PROGRESS
|
||||
HRESULT StartProgressDialog(const UString &title)
|
||||
HRESULT StartProgressDialog(const UString &title, NWindows::CThread &thread)
|
||||
{
|
||||
ProgressDialog.Create(title, 0);
|
||||
ProgressDialog.Create(title, thread, 0);
|
||||
{
|
||||
#ifdef LANG
|
||||
ProgressDialog.SetText(LangLoadString(IDS_PROGRESS_EXTRACTING, 0x02000890));
|
||||
|
||||
@@ -19,9 +19,6 @@ static LPCWSTR kCantOpenArchive = L"Can not open the file as archive";
|
||||
|
||||
struct CThreadExtracting
|
||||
{
|
||||
#ifndef _NO_PROGRESS
|
||||
bool ShowProgress;
|
||||
#endif
|
||||
CCodecs *Codecs;
|
||||
UString FileName;
|
||||
UString DestFolder;
|
||||
@@ -33,7 +30,7 @@ struct CThreadExtracting
|
||||
HRESULT Result;
|
||||
UString ErrorMessage;
|
||||
|
||||
void Process()
|
||||
void Process2()
|
||||
{
|
||||
NFile::NFind::CFileInfoW fi;
|
||||
if (!fi.Find(FileName))
|
||||
@@ -67,15 +64,19 @@ struct CThreadExtracting
|
||||
|
||||
ExtractCallbackSpec->Init(ArchiveLink.GetArchive(), dirPath, L"Default", fi.MTime, 0);
|
||||
|
||||
#ifndef _NO_PROGRESS
|
||||
if (ShowProgress)
|
||||
ExtractCallbackSpec->ProgressDialog.WaitCreating();
|
||||
#endif
|
||||
Result = ArchiveLink.GetArchive()->Extract(0, (UInt32)-1 , BoolToInt(false), ExtractCallback);
|
||||
#ifndef _NO_PROGRESS
|
||||
if (ShowProgress)
|
||||
ExtractCallbackSpec->ProgressDialog.MyClose();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Process()
|
||||
{
|
||||
try
|
||||
{
|
||||
#ifndef _NO_PROGRESS
|
||||
CProgressCloser closer(ExtractCallbackSpec->ProgressDialog);
|
||||
#endif
|
||||
Process2();
|
||||
}
|
||||
catch(...) { Result = E_FAIL; }
|
||||
}
|
||||
|
||||
static THREAD_FUNC_DECL MyThreadFunction(void *param)
|
||||
@@ -100,9 +101,9 @@ HRESULT ExtractArchive(CCodecs *codecs,const UString &fileName, const UString &d
|
||||
|
||||
#ifndef _NO_PROGRESS
|
||||
|
||||
t.ShowProgress = showProgress;
|
||||
if (showProgress)
|
||||
{
|
||||
t.ExtractCallbackSpec->ProgressDialog.IconID = IDI_ICON;
|
||||
NWindows::CThread thread;
|
||||
RINOK(thread.Create(CThreadExtracting::MyThreadFunction, &t));
|
||||
|
||||
@@ -112,13 +113,13 @@ HRESULT ExtractArchive(CCodecs *codecs,const UString &fileName, const UString &d
|
||||
#else
|
||||
title = NWindows::MyLoadStringW(IDS_PROGRESS_EXTRACTING);
|
||||
#endif
|
||||
t.ExtractCallbackSpec->StartProgressDialog(title);
|
||||
t.ExtractCallbackSpec->StartProgressDialog(title, thread);
|
||||
}
|
||||
else
|
||||
|
||||
#endif
|
||||
{
|
||||
t.Process();
|
||||
t.Process2();
|
||||
}
|
||||
|
||||
errorMessage = t.ErrorMessage;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include <initguid.h>
|
||||
#include "Common/MyInitGuid.h"
|
||||
|
||||
#include "Common/CommandLineParser.h"
|
||||
#include "Common/StringConvert.h"
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "Windows/FileDir.h"
|
||||
#include "Windows/FileFind.h"
|
||||
#include "Windows/FileIO.h"
|
||||
#include "Windows/NtCheck.h"
|
||||
#include "Windows/ResourceString.h"
|
||||
|
||||
#include "../../UI/Explorer/MyMessages.h"
|
||||
@@ -38,8 +39,8 @@ static bool ReadDataString(LPCWSTR fileName, LPCSTR startID,
|
||||
const int kBufferSize = (1 << 12);
|
||||
|
||||
Byte buffer[kBufferSize];
|
||||
int signatureStartSize = lstrlenA(startID);
|
||||
int signatureEndSize = lstrlenA(endID);
|
||||
int signatureStartSize = MyStringLen(startID);
|
||||
int signatureEndSize = MyStringLen(endID);
|
||||
|
||||
UInt32 numBytesPrev = 0;
|
||||
bool writeMode = false;
|
||||
@@ -103,37 +104,32 @@ public:
|
||||
} g_CInstallIDInit;
|
||||
|
||||
|
||||
#ifndef UNDER_CE
|
||||
class CCurrentDirRestorer
|
||||
{
|
||||
CSysString m_CurrentDirectory;
|
||||
public:
|
||||
CCurrentDirRestorer()
|
||||
{ NFile::NDirectory::MyGetCurrentDirectory(m_CurrentDirectory); }
|
||||
~CCurrentDirRestorer()
|
||||
{ RestoreDirectory();}
|
||||
bool RestoreDirectory()
|
||||
{ return BOOLToBool(::SetCurrentDirectory(m_CurrentDirectory)); }
|
||||
CCurrentDirRestorer() { NFile::NDirectory::MyGetCurrentDirectory(m_CurrentDirectory); }
|
||||
~CCurrentDirRestorer() { RestoreDirectory();}
|
||||
bool RestoreDirectory() { return BOOLToBool(::SetCurrentDirectory(m_CurrentDirectory)); }
|
||||
};
|
||||
|
||||
#ifndef _UNICODE
|
||||
bool g_IsNT = false;
|
||||
static inline bool IsItWindowsNT()
|
||||
{
|
||||
OSVERSIONINFO versionInfo;
|
||||
versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
|
||||
if (!::GetVersionEx(&versionInfo))
|
||||
return false;
|
||||
return (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT);
|
||||
}
|
||||
#endif
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, LPSTR /* lpCmdLine */,int /* nCmdShow */)
|
||||
#define NT_CHECK_FAIL_ACTION ShowErrorMessage(L"Unsupported Windows version"); return 1;
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
#ifdef UNDER_CE
|
||||
LPWSTR
|
||||
#else
|
||||
LPSTR
|
||||
#endif
|
||||
/* lpCmdLine */,int /* nCmdShow */)
|
||||
{
|
||||
g_hInstance = (HINSTANCE)hInstance;
|
||||
#ifndef _UNICODE
|
||||
g_IsNT = IsItWindowsNT();
|
||||
#endif
|
||||
InitCommonControls();
|
||||
|
||||
NT_CHECK
|
||||
|
||||
// InitCommonControls();
|
||||
|
||||
UString archiveName, switches;
|
||||
#ifdef _SHELL_EXECUTE
|
||||
@@ -235,10 +231,11 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, LPSTR /
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef UNDER_CE
|
||||
CCurrentDirRestorer currentDirRestorer;
|
||||
|
||||
if (!SetCurrentDirectory(tempDir.GetPath()))
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
HANDLE hProcess = 0;
|
||||
#ifdef _SHELL_EXECUTE
|
||||
@@ -247,7 +244,11 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, LPSTR /
|
||||
CSysString filePath = GetSystemString(executeFile);
|
||||
SHELLEXECUTEINFO execInfo;
|
||||
execInfo.cbSize = sizeof(execInfo);
|
||||
execInfo.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_DDEWAIT;
|
||||
execInfo.fMask = SEE_MASK_NOCLOSEPROCESS
|
||||
#ifndef UNDER_CE
|
||||
| SEE_MASK_FLAG_DDEWAIT
|
||||
#endif
|
||||
;
|
||||
execInfo.hwnd = NULL;
|
||||
execInfo.lpVerb = NULL;
|
||||
execInfo.lpFile = filePath;
|
||||
|
||||
@@ -619,18 +619,6 @@ SOURCE=..\..\UI\Common\OpenArchive.h
|
||||
# Begin Group "File Manager"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Group "Dialog"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\FileManager\ProgressDialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\FileManager\ProgressDialog.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\FileManager\FormatUtils.cpp
|
||||
@@ -639,6 +627,14 @@ SOURCE=..\..\UI\FileManager\FormatUtils.cpp
|
||||
|
||||
SOURCE=..\..\UI\FileManager\FormatUtils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\FileManager\ProgressDialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\UI\FileManager\ProgressDialog.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "C"
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
PROG = 7zS.sfx
|
||||
LIBS = $(LIBS) user32.lib oleaut32.lib shell32.lib ole32.lib comctl32.lib
|
||||
CFLAGS = $(CFLAGS) -I ../../../ \
|
||||
-DNO_REGISTRY \
|
||||
-DEXTRACT_ONLY \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#define IDI_ICON3 159
|
||||
#define IDI_ICON 1
|
||||
|
||||
#define IDS_EXTRACTION_ERROR_TITLE 7
|
||||
#define IDS_EXTRACTION_ERROR_MESSAGE 8
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
MY_VERSION_INFO_APP("7z Setup SFX", "7zS.sfx")
|
||||
|
||||
IDI_ICON3 ICON "setup.ico"
|
||||
IDI_ICON ICON "setup.ico"
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
|
||||
Reference in New Issue
Block a user