mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 03:15:00 -06:00
4.20
This commit is contained in:
committed by
Kornel Lesiński
parent
8c1b5c7b7e
commit
3c510ba80b
@@ -13,7 +13,6 @@
|
||||
#include "Windows/FileFind.h"
|
||||
#include "Windows/FileDir.h"
|
||||
#include "Windows/FileName.h"
|
||||
#include "Windows/System.h"
|
||||
#include "Windows/Thread.h"
|
||||
#include "Windows/Window.h"
|
||||
|
||||
@@ -260,13 +259,18 @@ static UString GetSubFolderNameForExtract(const UString &archiveName)
|
||||
{
|
||||
int dotPos = archiveName.ReverseFind('.');
|
||||
if (dotPos >= 0)
|
||||
return archiveName.Left(dotPos);
|
||||
{
|
||||
UString res = archiveName.Left(dotPos);
|
||||
res.TrimRight();
|
||||
return res;
|
||||
}
|
||||
return archiveName + UString(L"~");
|
||||
}
|
||||
|
||||
STDMETHODIMP CZipContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu,
|
||||
UINT commandIDFirst, UINT commandIDLast, UINT flags)
|
||||
{
|
||||
LoadLangOneTime();
|
||||
if(_fileNames.Size() == 0)
|
||||
return E_FAIL;
|
||||
UINT currentCommandID = commandIDFirst;
|
||||
@@ -311,7 +315,6 @@ STDMETHODIMP CZipContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu,
|
||||
if(_fileNames.Size() == 1 && currentCommandID + 6 <= commandIDLast)
|
||||
{
|
||||
const UString &fileName = _fileNames.Front();
|
||||
|
||||
UString folderPrefix;
|
||||
NFile::NDirectory::GetOnlyDirPrefix(fileName, folderPrefix);
|
||||
|
||||
@@ -328,7 +331,28 @@ STDMETHODIMP CZipContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu,
|
||||
MyInsertMenu(popupMenu, subIndex++, currentCommandID++, GetSystemString(mainString));
|
||||
_commandMap.push_back(commandMapItem);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(_fileNames.Size() > 0 && currentCommandID + 10 <= commandIDLast)
|
||||
{
|
||||
bool thereAreFolders = false;
|
||||
for(int i = 0; i < _fileNames.Size(); i++)
|
||||
{
|
||||
NFile::NFind::CFileInfoW fileInfo;
|
||||
if (!NFile::NFind::FindFile(_fileNames[i], fileInfo))
|
||||
return E_FAIL;
|
||||
if (fileInfo.IsDirectory())
|
||||
thereAreFolders = true;
|
||||
}
|
||||
const UString &fileName = _fileNames.Front();
|
||||
if (!thereAreFolders)
|
||||
{
|
||||
UString folderPrefix;
|
||||
NFile::NDirectory::GetOnlyDirPrefix(fileName, folderPrefix);
|
||||
NFile::NFind::CFileInfoW fileInfo;
|
||||
if (!NFile::NFind::FindFile(fileName, fileInfo))
|
||||
return E_FAIL;
|
||||
// Extract
|
||||
if ((contextMenuFlags & NContextMenuFlags::kExtract) != 0)
|
||||
{
|
||||
@@ -357,14 +381,17 @@ STDMETHODIMP CZipContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu,
|
||||
CCommandMapItem commandMapItem;
|
||||
UString s;
|
||||
FillCommand2(kExtractTo, s, commandMapItem);
|
||||
UString folder = GetSubFolderNameForExtract(fileInfo.Name) +
|
||||
UString(L'\\');
|
||||
UString folder;
|
||||
if (_fileNames.Size() == 1)
|
||||
folder = GetSubFolderNameForExtract(fileInfo.Name);
|
||||
else
|
||||
folder = L'*';
|
||||
folder += L'\\';
|
||||
commandMapItem.Folder = folderPrefix + folder;
|
||||
s = MyFormatNew(s, folder);
|
||||
MyInsertMenu(popupMenu, subIndex++, currentCommandID++, GetSystemString(s));
|
||||
_commandMap.push_back(commandMapItem);
|
||||
}
|
||||
|
||||
// Test
|
||||
if ((contextMenuFlags & NContextMenuFlags::kTest) != 0)
|
||||
{
|
||||
@@ -374,11 +401,6 @@ STDMETHODIMP CZipContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu,
|
||||
_commandMap.push_back(commandMapItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(_fileNames.Size() > 0 && currentCommandID + 6 <= commandIDLast)
|
||||
{
|
||||
const UString &fileName = _fileNames.Front();
|
||||
UString archiveName = CreateArchiveName(fileName, _fileNames.Size() > 1, false);
|
||||
UString archiveName7z = archiveName + L".7z";
|
||||
UString archivePathPrefix;
|
||||
@@ -388,7 +410,8 @@ STDMETHODIMP CZipContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu,
|
||||
if ((contextMenuFlags & NContextMenuFlags::kCompress) != 0)
|
||||
{
|
||||
CCommandMapItem commandMapItem;
|
||||
commandMapItem.Archive = archivePathPrefix + archiveName;
|
||||
commandMapItem.Folder = archivePathPrefix;
|
||||
commandMapItem.Archive = archiveName;
|
||||
FillCommand(kCompress, mainString, commandMapItem);
|
||||
MyInsertMenu(popupMenu, subIndex++, currentCommandID++, GetSystemString(mainString));
|
||||
_commandMap.push_back(commandMapItem);
|
||||
@@ -401,7 +424,8 @@ STDMETHODIMP CZipContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu,
|
||||
CCommandMapItem commandMapItem;
|
||||
UString s;
|
||||
FillCommand2(kCompressTo, s, commandMapItem);
|
||||
commandMapItem.Archive = archivePathPrefix + archiveName7z;
|
||||
commandMapItem.Folder = archivePathPrefix;
|
||||
commandMapItem.Archive = archiveName7z;
|
||||
UString t = UString(L"\"") + archiveName7z + UString(L"\"");
|
||||
s = MyFormatNew(s, t);
|
||||
MyInsertMenu(popupMenu, subIndex++, currentCommandID++, GetSystemString(s));
|
||||
@@ -609,20 +633,20 @@ STDMETHODIMP CZipContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO commandInfo)
|
||||
params += L" \"";
|
||||
params += _fileNames[0];
|
||||
params += L"\"";
|
||||
MyCreateProcess(params);
|
||||
MyCreateProcess(params, 0);
|
||||
break;
|
||||
}
|
||||
case kExtract:
|
||||
case kExtractHere:
|
||||
case kExtractTo:
|
||||
{
|
||||
ExtractArchive(_fileNames[0], commandMapItem.Folder,
|
||||
ExtractArchives(_fileNames, commandMapItem.Folder,
|
||||
(commandInternalID == kExtract));
|
||||
break;
|
||||
}
|
||||
case kTest:
|
||||
{
|
||||
TestArchive(_fileNames[0]);
|
||||
TestArchives(_fileNames);
|
||||
break;
|
||||
}
|
||||
case kCompress:
|
||||
@@ -634,7 +658,8 @@ STDMETHODIMP CZipContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO commandInfo)
|
||||
(commandInternalID == kCompressToEmail);
|
||||
bool showDialog = (commandInternalID == kCompress) ||
|
||||
(commandInternalID == kCompressEmail);
|
||||
CompressFiles(commandMapItem.Archive, _fileNames, email, showDialog);
|
||||
CompressFiles(commandMapItem.Folder, commandMapItem.Archive,
|
||||
_fileNames, email, showDialog);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// ContextMenu.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __CONTEXTMENU_H
|
||||
#define __CONTEXTMENU_H
|
||||
|
||||
@@ -9,10 +7,14 @@
|
||||
DEFINE_GUID(CLSID_CZipContextMenu,
|
||||
0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00);
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "Common/String.h"
|
||||
|
||||
#include "../../FileManager/PluginInterface.h"
|
||||
|
||||
|
||||
|
||||
class CZipContextMenu:
|
||||
public IContextMenu,
|
||||
public IShellExtInit,
|
||||
@@ -89,4 +91,4 @@ private:
|
||||
CCommandMapItem &commandMapItem);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// ContextMenuFlags.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __SEVENZIP_CONTEXTMENUFLAGS_H
|
||||
#define __SEVENZIP_CONTEXTMENUFLAGS_H
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// DLLExports.cpp : Implementation of DLL Exports.
|
||||
// DLLExports.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
#include <ShlGuid.h>
|
||||
#include <windows.h>
|
||||
|
||||
// #include "../../Compress/Interface/CompressInterface.h"
|
||||
#include "../../IPassword.h"
|
||||
#include "../Agent/Agent.h"
|
||||
#include "../../FileManager/LangUtils.h"
|
||||
#include "Common/ComTry.h"
|
||||
|
||||
#include "ContextMenu.h"
|
||||
@@ -44,9 +44,9 @@ extern "C"
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)
|
||||
{
|
||||
// setlocale(LC_COLLATE, ".ACP");
|
||||
g_hInstance = hInstance;
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
g_hInstance = hInstance;
|
||||
#ifdef UNICODE
|
||||
if (!IsItWindowsNT())
|
||||
return FALSE;
|
||||
@@ -56,7 +56,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)
|
||||
}
|
||||
else if (dwReason == DLL_PROCESS_DETACH)
|
||||
_Module.Term();
|
||||
return TRUE; // ok
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -93,6 +93,7 @@ STDAPI CreateObject(
|
||||
const GUID *interfaceID,
|
||||
void **outObject)
|
||||
{
|
||||
LoadLangOneTime();
|
||||
COM_TRY_BEGIN
|
||||
*outObject = 0;
|
||||
if (*classID == CLSID_CAgentArchiveHandler)
|
||||
|
||||
@@ -182,6 +182,14 @@ SOURCE=.\StdAfx.h
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ArchiveExtractCallback.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ArchiveExtractCallback.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ArchiveName.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -190,6 +198,14 @@ SOURCE=..\Common\ArchiveName.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ArchiveOpenCallback.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ArchiveOpenCallback.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ArchiverInfo.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -266,6 +282,14 @@ SOURCE=..\Common\UpdateAction.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\UpdateCallback.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\UpdateCallback.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\UpdatePair.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -396,14 +420,6 @@ SOURCE=..\Agent\AgentProxy.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Agent\ArchiveExtractCallback.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Agent\ArchiveExtractCallback.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Agent\ArchiveFolder.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -416,39 +432,19 @@ SOURCE=..\Agent\ArchiveFolderOut.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Agent\ArchiveUpdateCallback.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Agent\ArchiveUpdateCallback.h
|
||||
SOURCE=..\Agent\IFileExtractCallback.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Agent\IFolderArchive.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Spec Interfaces"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Format\Common\ArchiveInterface.h
|
||||
SOURCE=..\Agent\UpdateCallbackAgent.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ArchiveStyleDirItemInfo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Compress\Interface\CompressInterface.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\FolderArchiveInterface.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Format\Common\FormatCryptoInterface.h
|
||||
SOURCE=..\Agent\UpdateCallbackAgent.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "FileManager"
|
||||
@@ -507,6 +503,14 @@ SOURCE=..\..\FileManager\RegistryUtils.h
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Alloc.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Alloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\IntToString.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -731,14 +735,6 @@ SOURCE=..\..\..\Windows\Synchronization.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\System.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\System.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Window.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -797,7 +793,7 @@ SOURCE=.\OptionsDialog.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RegistryContextMenu..cpp
|
||||
SOURCE=.\RegistryContextMenu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// FoldersPage.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __FOLDERSPAGE_H
|
||||
#define __FOLDERSPAGE_H
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// MyMessages.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __MYMESSAGES_H
|
||||
#define __MYMESSAGES_H
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// OptionsDialog.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __SEVENZIP_OPTIONSDIALOG_H
|
||||
#define __SEVENZIP_OPTIONSDIALOG_H
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "Windows/COM.h"
|
||||
#include "Windows/Synchronization.h"
|
||||
#include "Windows/Registry.h"
|
||||
#include "Windows/System.h"
|
||||
#include "Windows/FileName.h"
|
||||
|
||||
using namespace NWindows;
|
||||
@@ -1,7 +1,5 @@
|
||||
// RegistryContextMenu.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __REGISTRYCONTEXTMENU_H
|
||||
#define __REGISTRYCONTEXTMENU_H
|
||||
|
||||
@@ -14,5 +12,4 @@ namespace NZipRootRegistry {
|
||||
|
||||
// bool GetProgramDirPrefix(CSysString &folder);
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// StdAfx.h
|
||||
|
||||
#ifndef __STDAFX_H
|
||||
#define __STDAFX_H
|
||||
|
||||
#define _WIN32_WINNT 0x0400
|
||||
// it's hack for Windows NT supporting
|
||||
#define WINVER 0x0400
|
||||
|
||||
// #define _WIN32_IE 0x0500
|
||||
#include <windows.h>
|
||||
@@ -27,14 +30,4 @@ extern CComModule _Module;
|
||||
#include <shlguid.h>
|
||||
#include <regstr.h>
|
||||
|
||||
// #include <new.h>
|
||||
|
||||
#undef _MT
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
|
||||
#define _MT
|
||||
|
||||
#endif
|
||||
|
||||
@@ -143,15 +143,16 @@ void CSystemPage::OnNotifyHelp()
|
||||
ShowHelpWindow(NULL, kSystemTopic);
|
||||
}
|
||||
|
||||
bool CSystemPage::OnButtonClicked(int aButtonID, HWND aButtonHWND)
|
||||
bool CSystemPage::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
{
|
||||
switch(aButtonID)
|
||||
switch(buttonID)
|
||||
{
|
||||
case IDC_SYSTEM_CASCADED_MENU:
|
||||
case IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU:
|
||||
Changed();
|
||||
return true;
|
||||
}
|
||||
return CPropertyPage::OnButtonClicked(aButtonID, aButtonHWND);
|
||||
return CPropertyPage::OnButtonClicked(buttonID, buttonHWND);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// SystemPage.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __SYSTEMPAGE_H
|
||||
#define __SYSTEMPAGE_H
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 3,13,0,0
|
||||
PRODUCTVERSION 3,13,0,0
|
||||
FILEVERSION 4,20,0,0
|
||||
PRODUCTVERSION 4,20,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -87,14 +87,14 @@ BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", "Igor Pavlov\0"
|
||||
VALUE "FileDescription", "7-Zip Shell Extension\0"
|
||||
VALUE "FileVersion", "3, 13, 0, 0\0"
|
||||
VALUE "FileVersion", "4, 20, 0, 0\0"
|
||||
VALUE "InternalName", "7-zip\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 1999-2003 Igor Pavlov\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 1999-2005 Igor Pavlov\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "7-zip.dll\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "7-Zip\0"
|
||||
VALUE "ProductVersion", "3, 13, 0, 0\0"
|
||||
VALUE "ProductVersion", "4, 20, 0, 0\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
|
||||
Reference in New Issue
Block a user