summaryrefslogtreecommitdiffstats
path: root/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager
diff options
context:
space:
mode:
Diffstat (limited to 'installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager')
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/App.cpp910
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/App.h344
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/AppState.h114
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ClassDefs.cpp17
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog.cpp53
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog.h25
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialogRes.h4
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog_rc.cpp57
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog.cpp82
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog.h30
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialogRes.h8
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog_rc.cpp73
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ExtractCallback.cpp478
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ExtractCallback.h150
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FM.cpp914
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FM_rc.cpp970
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSDrives.h.out49
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolder.cpp701
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolder.h120
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolderCopy.cpp523
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp165
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h9
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FormatUtils.cpp40
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FormatUtils.h18
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/HelpUtils.h10
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/IFolder.h157
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/LangUtils.cpp208
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/LangUtils.h41
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog.cpp96
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog.h32
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialogRes.h3
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog_rc.cpp55
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog.cpp76
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog.h22
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialogRes.h3
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog_rc.cpp81
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MyLoadMenu.cpp733
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MyLoadMenu.h20
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/NetFolder.h.OUT56
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OpenCallback.cpp122
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OpenCallback.h92
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog.cpp126
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog.h34
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialogRes.h19
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog_rc.cpp96
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/Panel.cpp1100
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/Panel.h577
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelCopy.cpp228
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelCrc.cpp368
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelFolderChange.cpp597
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelItemOpen.cpp621
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelItems.cpp828
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelListNotify.cpp429
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelMenu.cpp621
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelOperations.cpp470
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSelect.cpp305
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSort.cpp163
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSplitFile.cpp528
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog.cpp50
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog.h21
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialogRes.h4
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog_rc.cpp63
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PluginInterface.h42
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PluginLoader.h32
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgramLocation.cpp20
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgramLocation.h10
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2.cpp507
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2.h242
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2Res.h26
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2_rc.cpp171
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialogRes.h3
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyName.cpp109
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyName.h10
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyNameRes.h52
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryAssociations.cpp301
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryAssociations.h44
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryPlugins.h32
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryUtils.cpp152
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryUtils.h46
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RootFolder.cpp278
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RootFolder.h38
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog.cpp89
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog.h27
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialogRes.h8
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog_rc.cpp79
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitUtils.cpp85
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitUtils.h15
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/StringUtils.cpp68
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/StringUtils.h13
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SysIconUtils.cpp167
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SysIconUtils.h51
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/TextPairs.cpp189
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/TextPairs.h31
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/UpdateCallback100.cpp106
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/UpdateCallback100.h72
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ViewSettings.cpp426
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ViewSettings.h100
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Add2PNG.h20
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/AddPNG.h22
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Copy2PNG.h22
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/CopyPNG.h26
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Delete2PNG.h23
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/DeletePNG.h26
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Extract2PNG.h18
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/ExtractPNG.h18
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Info2PNG.h21
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/InfoPNG.h22
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Move2PNG.h21
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/MovePNG.h25
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/ParentFolder.h91
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Test2PNG.h21
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/TestPNG.h25
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/resource.h168
-rw-r--r--installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/wxFM.cpp345
114 files changed, 19464 insertions, 0 deletions
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/App.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/App.cpp
new file mode 100644
index 000000000..a6103f404
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/App.cpp
@@ -0,0 +1,910 @@
+// App.cpp
+
+#include "StdAfx.h"
+
+#include "resource.h"
+#include "OverwriteDialogRes.h"
+
+#include "Common/IntToString.h"
+#include "Common/StringConvert.h"
+
+#include "Windows/COM.h"
+#include "Windows/Error.h"
+#include "Windows/FileDir.h"
+#include "Windows/PropVariant.h"
+#include "Windows/PropVariantConversions.h"
+#include "Windows/Thread.h"
+
+#include "App.h"
+#include "CopyDialog.h"
+#include "ExtractCallback.h"
+#include "FormatUtils.h"
+#include "IFolder.h"
+#include "LangUtils.h"
+#include "RegistryUtils.h"
+#include "ViewSettings.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NFind;
+
+extern DWORD g_ComCtl32Version;
+extern HINSTANCE g_hInstance;
+
+static LPCWSTR kTempDirPrefix = L"7zE";
+
+void CPanelCallbackImp::OnTab()
+{
+ if (g_App.NumPanels != 1)
+ _app->Panels[1 - _index].SetFocusToList();
+ _app->RefreshTitle();
+}
+
+void CPanelCallbackImp::SetFocusToPath(int index)
+{
+ int newPanelIndex = index;
+ if (g_App.NumPanels == 1)
+ newPanelIndex = g_App.LastFocusedPanel;
+ // FIXME _app->Panels[newPanelIndex]._headerComboBox.SetFocus();
+ _app->RefreshTitle();
+}
+
+
+void CPanelCallbackImp::OnCopy(bool move, bool copyToSame) { _app->OnCopy(move, copyToSame, _index); }
+void CPanelCallbackImp::OnSetSameFolder() { _app->OnSetSameFolder(_index); }
+void CPanelCallbackImp::OnSetSubFolder() { _app->OnSetSubFolder(_index); }
+void CPanelCallbackImp::PanelWasFocused() { _app->SetFocusedPanel(_index); _app->RefreshTitle(_index); }
+void CPanelCallbackImp::DragBegin() { /* FIXME _app->DragBegin(_index);*/ }
+void CPanelCallbackImp::DragEnd() { /* FIXME _app->DragEnd();*/ }
+void CPanelCallbackImp::RefreshTitle(bool always) { _app->RefreshTitle(_index, always); }
+
+void CApp::SetListSettings()
+{
+ bool showDots = ReadShowDots();
+ bool showRealFileIcons = ReadShowRealFileIcons();
+
+ DWORD extendedStyle =0; /* FIXME = LVS_EX_HEADERDRAGDROP;
+ if (ReadFullRow())
+ extendedStyle |= LVS_EX_FULLROWSELECT;
+ if (ReadShowGrid())
+ extendedStyle |= LVS_EX_GRIDLINES;
+ */
+ bool mySelectionMode = ReadAlternativeSelection();
+
+ /*
+ if (ReadSingleClick())
+ {
+ extendedStyle |= LVS_EX_ONECLICKACTIVATE
+ | LVS_EX_TRACKSELECT;
+ if (ReadUnderline())
+ extendedStyle |= LVS_EX_UNDERLINEHOT;
+ }
+ */
+
+ for (int i = 0; i < kNumPanelsMax; i++)
+ {
+ CPanel &panel = Panels[i];
+ panel._mySelectMode = mySelectionMode;
+ panel._showDots = showDots;
+ panel._showRealFileIcons = showRealFileIcons;
+ panel._exStyle = extendedStyle;
+
+ /* FIXME
+ DWORD style = (DWORD)panel._listView.GetStyle();
+ if (mySelectionMode)
+ style |= LVS_SINGLESEL;
+ else
+ style &= ~LVS_SINGLESEL;
+ panel._listView.SetStyle(style);
+ */
+ panel.SetExtendedStyle();
+ }
+}
+
+void CApp::SetShowSystemMenu()
+{
+ ShowSystemMenu = ReadShowSystemMenu();
+}
+
+void CApp::CreateOnePanel(int panelIndex, const UString &mainPath, bool &archiveIsOpened, bool &encrypted)
+{
+ if (PanelsCreated[panelIndex])
+ return;
+ m_PanelCallbackImp[panelIndex].Init(this, panelIndex);
+ UString path;
+ if (mainPath.IsEmpty())
+ {
+ if (!::ReadPanelPath(panelIndex, path))
+ path.Empty();
+ }
+ else
+ path = mainPath;
+ int id = 1000 + 100 * panelIndex;
+ Panels[panelIndex].Create(_window, _window,
+ id, path, &m_PanelCallbackImp[panelIndex], &AppState, archiveIsOpened, encrypted);
+ PanelsCreated[panelIndex] = true;
+}
+
+#if _WIN32
+static void CreateToolbar(
+ HWND parent,
+ NWindows::NControl::CImageList &imageList,
+ NWindows::NControl::CToolBar &toolBar,
+ bool LargeButtons)
+{
+ toolBar.Attach(::CreateWindowEx(0,
+ TOOLBARCLASSNAME,
+ NULL, 0
+ | WS_VISIBLE
+ | TBSTYLE_FLAT
+ | TBSTYLE_TOOLTIPS
+ | WS_CHILD
+ | CCS_NOPARENTALIGN
+ | CCS_NORESIZE
+ | CCS_NODIVIDER
+ // | TBSTYLE_AUTOSIZE
+ // | CCS_ADJUSTABLE
+ ,0,0,0,0, parent, NULL, g_hInstance, NULL));
+
+ // TB_BUTTONSTRUCTSIZE message, which is required for
+ // backward compatibility.
+ toolBar.ButtonStructSize();
+
+ imageList.Create(
+ LargeButtons ? 48: 24,
+ LargeButtons ? 36: 24,
+ ILC_MASK, 0, 0);
+ toolBar.SetImageList(0, imageList);
+}
+#endif
+
+struct CButtonInfo
+{
+ UINT commandID;
+ UINT BitmapResID;
+ UINT Bitmap2ResID;
+ UINT StringResID;
+ UINT32 LangID;
+ UString GetText()const { return LangString(StringResID, LangID); };
+};
+
+static CButtonInfo g_StandardButtons[] =
+{
+ { IDM_COPY_TO, IDB_COPY, IDB_COPY2, IDS_BUTTON_COPY, 0x03020420},
+ { IDM_MOVE_TO, IDB_MOVE, IDB_MOVE2, IDS_BUTTON_MOVE, 0x03020421},
+ { IDM_DELETE, IDB_DELETE, IDB_DELETE2, IDS_BUTTON_DELETE, 0x03020422} ,
+ { IDM_FILE_PROPERTIES, IDB_INFO, IDB_INFO2, IDS_BUTTON_INFO, 0x03020423}
+};
+
+static CButtonInfo g_ArchiveButtons[] =
+{
+ { kAddCommand, IDB_ADD, IDB_ADD2, IDS_ADD, 0x03020400},
+ { kExtractCommand, IDB_EXTRACT, IDB_EXTRACT2, IDS_EXTRACT, 0x03020401},
+ { kTestCommand , IDB_TEST, IDB_TEST2, IDS_TEST, 0x03020402}
+};
+
+bool SetButtonText(UINT32 commandID, CButtonInfo *buttons, int numButtons, UString &s)
+{
+ for (int i = 0; i < numButtons; i++)
+ {
+ const CButtonInfo &b = buttons[i];
+ if (b.commandID == commandID)
+ {
+ s = b.GetText();
+ return true;
+ }
+ }
+ return false;
+}
+
+void SetButtonText(UINT32 commandID, UString &s)
+{
+ if (SetButtonText(commandID, g_StandardButtons,
+ sizeof(g_StandardButtons) / sizeof(g_StandardButtons[0]), s))
+ return;
+ SetButtonText(commandID, g_ArchiveButtons,
+ sizeof(g_ArchiveButtons) / sizeof(g_ArchiveButtons[0]), s);
+}
+
+#ifdef _WIN32
+static void AddButton(
+ NControl::CImageList &imageList,
+ NControl::CToolBar &toolBar,
+ CButtonInfo &butInfo,
+ bool showText,
+ bool large)
+{
+ TBBUTTON but;
+ but.iBitmap = 0;
+ but.idCommand = butInfo.commandID;
+ but.fsState = TBSTATE_ENABLED;
+ but.fsStyle = BTNS_BUTTON
+ // | BTNS_AUTOSIZE
+ ;
+ but.dwData = 0;
+
+ UString s = butInfo.GetText();
+ but.iString = 0;
+ if (showText)
+ but.iString = (INT_PTR)(LPCWSTR)s;
+
+ but.iBitmap = imageList.GetImageCount();
+ HBITMAP b = ::LoadBitmap(g_hInstance,
+ large ?
+ MAKEINTRESOURCE(butInfo.BitmapResID):
+ MAKEINTRESOURCE(butInfo.Bitmap2ResID));
+ if (b != 0)
+ {
+ imageList.AddMasked(b, RGB(255, 0, 255));
+ ::DeleteObject(b);
+ }
+ #ifdef _UNICODE
+ toolBar.AddButton(1, &but);
+ #else
+ toolBar.AddButtonW(1, &but);
+ #endif
+}
+
+static void AddBand(NControl::CReBar &reBar, NControl::CToolBar &toolBar)
+{
+ SIZE size;
+ toolBar.GetMaxSize(&size);
+
+ RECT rect;
+ toolBar.GetWindowRect(&rect);
+
+ REBARBANDINFO rbBand;
+ rbBand.cbSize = sizeof(REBARBANDINFO); // Required
+ rbBand.fMask = RBBIM_STYLE
+ | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE;
+ rbBand.fStyle = RBBS_CHILDEDGE; // RBBS_NOGRIPPER;
+ rbBand.cxMinChild = size.cx; // rect.right - rect.left;
+ rbBand.cyMinChild = size.cy; // rect.bottom - rect.top;
+ rbBand.cyChild = rbBand.cyMinChild;
+ rbBand.cx = rbBand.cxMinChild;
+ rbBand.cxIdeal = rbBand.cxMinChild;
+ rbBand.hwndChild = toolBar;
+ reBar.InsertBand(-1, &rbBand);
+}
+
+void CApp::ReloadToolbars()
+{
+ if (!_rebar)
+ return;
+ HWND parent = _rebar;
+
+ while(_rebar.GetBandCount() > 0)
+ _rebar.DeleteBand(0);
+
+ _archiveToolBar.Destroy();
+ _archiveButtonsImageList.Destroy();
+
+ _standardButtonsImageList.Destroy();
+ _standardToolBar.Destroy();
+
+ if (ShowArchiveToolbar)
+ {
+ CreateToolbar(parent, _archiveButtonsImageList, _archiveToolBar, LargeButtons);
+ for (int i = 0; i < sizeof(g_ArchiveButtons) / sizeof(g_ArchiveButtons[0]); i++)
+ AddButton(_archiveButtonsImageList, _archiveToolBar, g_ArchiveButtons[i],
+ ShowButtonsLables, LargeButtons);
+ AddBand(_rebar, _archiveToolBar);
+ }
+
+ if (ShowStandardToolbar)
+ {
+ CreateToolbar(parent, _standardButtonsImageList, _standardToolBar, LargeButtons);
+ for (int i = 0; i < sizeof(g_StandardButtons) / sizeof(g_StandardButtons[0]); i++)
+ AddButton(_standardButtonsImageList, _standardToolBar, g_StandardButtons[i],
+ ShowButtonsLables, LargeButtons);
+ AddBand(_rebar, _standardToolBar);
+ }
+}
+#endif
+
+void CApp::ReloadRebar(HWND hwnd)
+{
+#ifdef _WIN32
+ _rebar.Destroy();
+ if (!ShowArchiveToolbar && !ShowStandardToolbar)
+ return;
+ if (g_ComCtl32Version >= MAKELONG(71, 4))
+ {
+ INITCOMMONCONTROLSEX icex;
+ icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+ icex.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES;
+ InitCommonControlsEx(&icex);
+
+ _rebar.Attach(::CreateWindowEx(WS_EX_TOOLWINDOW,
+ REBARCLASSNAME,
+ NULL,
+ WS_VISIBLE
+ | WS_BORDER
+ | WS_CHILD
+ | WS_CLIPCHILDREN
+ | WS_CLIPSIBLINGS
+ // | CCS_NODIVIDER
+ // | CCS_NOPARENTALIGN // it's bead for moveing of two bands
+ // | CCS_TOP
+ | RBS_VARHEIGHT
+ | RBS_BANDBORDERS
+ // | RBS_AUTOSIZE
+ ,0,0,0,0, hwnd, NULL, g_hInstance, NULL));
+ }
+ if (_rebar == 0)
+ return;
+ REBARINFO rbi;
+ rbi.cbSize = sizeof(REBARINFO); // Required when using this struct.
+ rbi.fMask = 0;
+ rbi.himl = (HIMAGELIST)NULL;
+ _rebar.SetBarInfo(&rbi);
+ ReloadToolbars();
+#endif // #ifdef _WIN32
+}
+
+void CApp::Create(HWND hwnd, const UString &mainPath, int xSizes[2], bool &archiveIsOpened, bool &encrypted)
+{
+#ifdef _WIN32
+ ReadToolbar();
+ ReloadRebar(hwnd);
+#endif
+
+ int i;
+ for (i = 0; i < kNumPanelsMax; i++)
+ PanelsCreated[i] = false;
+
+ _window.Attach(hwnd);
+ AppState.Read();
+ SetListSettings();
+ SetShowSystemMenu();
+ if (LastFocusedPanel >= kNumPanelsMax)
+ LastFocusedPanel = 0;
+
+ CListMode listMode;
+ ReadListMode(listMode);
+ for (i = 0; i < kNumPanelsMax; i++)
+ {
+ Panels[i]._ListViewMode = listMode.Panels[i];
+ Panels[i]._xSize = xSizes[i];
+ }
+ for (i = 0; i < kNumPanelsMax; i++)
+ if (NumPanels > 1 || i == LastFocusedPanel)
+ {
+ if (NumPanels == 1)
+ Panels[i]._xSize = xSizes[0] + xSizes[1];
+ bool archiveIsOpened2 = false;
+ bool encrypted2 = false;
+ bool mainPanel = (i == LastFocusedPanel);
+ CreateOnePanel(i, mainPanel ? mainPath : L"", archiveIsOpened2, encrypted2);
+ if (mainPanel)
+ {
+ archiveIsOpened = archiveIsOpened2;
+ encrypted = encrypted2;
+ }
+ }
+ SetFocusedPanel(LastFocusedPanel);
+ Panels[LastFocusedPanel].SetFocusToList();
+}
+
+extern void MoveSubWindows(HWND hWnd);
+
+void CApp::SwitchOnOffOnePanel()
+{
+ if (NumPanels == 1)
+ {
+ NumPanels++;
+ bool archiveIsOpened, encrypted;
+ CreateOnePanel(1 - LastFocusedPanel, UString(), archiveIsOpened, encrypted);
+ // FIXME Panels[1 - LastFocusedPanel].Enable(true);
+ // FIXME Panels[1 - LastFocusedPanel].Show(SW_SHOWNORMAL);
+ }
+ else
+ {
+ NumPanels--;
+ // FIXME Panels[1 - LastFocusedPanel].Enable(false);
+ // FIXME Panels[1 - LastFocusedPanel].Show(SW_HIDE);
+ }
+ MoveSubWindows(_window);
+}
+
+void CApp::Save()
+{
+ AppState.Save();
+ CListMode listMode;
+ for (int i = 0; i < kNumPanelsMax; i++)
+ {
+ const CPanel &panel = Panels[i];
+ UString path;
+ if (panel._parentFolders.IsEmpty())
+ path = panel._currentFolderPrefix;
+ else
+ path = GetFolderPath(panel._parentFolders[0].ParentFolder);
+ SavePanelPath(i, path);
+ listMode.Panels[i] = panel.GetListViewMode();
+ }
+ SaveListMode(listMode);
+}
+
+void CApp::Release()
+{
+ // It's for unloading COM dll's: don't change it.
+ for (int i = 0; i < kNumPanelsMax; i++)
+ Panels[i].Release();
+}
+
+static bool IsThereFolderOfPath(const UString &path)
+{
+ CFileInfoW fileInfo;
+ if (!FindFile(path, fileInfo))
+ return false;
+ return fileInfo.IsDir();
+}
+
+// reduces path to part that exists on disk
+static void ReducePathToRealFileSystemPath(UString &path)
+{
+ while(!path.IsEmpty())
+ {
+ if (IsThereFolderOfPath(path))
+ {
+ NName::NormalizeDirPathPrefix(path);
+ break;
+ }
+ int pos = path.ReverseFind(CHAR_PATH_SEPARATOR);
+ if (pos < 0)
+ path.Empty();
+ else
+ {
+ path = path.Left(pos + 1);
+ if (path.Length() == 3 && path[1] == L':')
+ break;
+ if (path.Length() > 2 && path[0] == CHAR_PATH_SEPARATOR && path[1] == CHAR_PATH_SEPARATOR)
+ {
+ int nextPos = path.Find(CHAR_PATH_SEPARATOR, 2); // pos after \\COMPNAME
+ if (nextPos > 0 && path.Find(CHAR_PATH_SEPARATOR, nextPos + 1) == pos)
+ break;
+ }
+ path = path.Left(pos);
+ }
+ }
+}
+
+// return true for dir\, if dir exist
+static bool CheckFolderPath(const UString &path)
+{
+ UString pathReduced = path;
+ ReducePathToRealFileSystemPath(pathReduced);
+ return (pathReduced == path);
+}
+
+static bool IsPathAbsolute(const UString &path)
+{
+ if ((path.Length() >= 1 && path[0] == WCHAR_PATH_SEPARATOR) ||
+ (path.Length() >= 3 && path[1] == L':' && path[2] == WCHAR_PATH_SEPARATOR))
+ return true;
+ return false;
+}
+
+extern UString ConvertSizeToString(UInt64 value);
+
+static UString AddSizeValue(UInt64 size)
+{
+ return MyFormatNew(IDS_FILE_SIZE, 0x02000982, ConvertSizeToString(size));
+}
+
+static void AddValuePair1(UINT resourceID, UInt32 langID, UInt64 size, UString &s)
+{
+ s += LangString(resourceID, langID);
+ s += L" ";
+ s += AddSizeValue(size);
+ s += L"\n";
+}
+
+void AddValuePair2(UINT resourceID, UInt32 langID, UInt64 num, UInt64 size, UString &s)
+{
+ if (num == 0)
+ return;
+ s += LangString(resourceID, langID);
+ s += L" ";
+ s += ConvertSizeToString(num);
+
+ if (size != (UInt64)(Int64)-1)
+ {
+ s += L" ( ";
+ s += AddSizeValue(size);
+ s += L" )";
+ }
+ s += L"\n";
+}
+
+static void AddPropValueToSum(IFolderFolder *folder, int index, PROPID propID, UInt64 &sum)
+{
+ if (sum == (UInt64)(Int64)-1)
+ return;
+ NCOM::CPropVariant prop;
+ folder->GetProperty(index, propID, &prop);
+ switch(prop.vt)
+ {
+ case VT_UI4:
+ case VT_UI8:
+ sum += ConvertPropVariantToUInt64(prop);
+ break;
+ default:
+ sum = (UInt64)(Int64)-1;
+ }
+}
+
+UString CPanel::GetItemsInfoString(const CRecordVector<UInt32> &indices)
+{
+ UString info;
+ UInt64 numDirs, numFiles, filesSize, foldersSize;
+ numDirs = numFiles = filesSize = foldersSize = 0;
+ int i;
+ for (i = 0; i < indices.Size(); i++)
+ {
+ int index = indices[i];
+ if (IsItemFolder(index))
+ {
+ AddPropValueToSum(_folder, index, kpidSize, foldersSize);
+ numDirs++;
+ }
+ else
+ {
+ AddPropValueToSum(_folder, index, kpidSize, filesSize);
+ numFiles++;
+ }
+ }
+
+ AddValuePair2(IDS_FOLDERS_COLON, 0x02000321, numDirs, foldersSize, info);
+ AddValuePair2(IDS_FILES_COLON, 0x02000320, numFiles, filesSize, info);
+ int numDefined = ((foldersSize != (UInt64)(Int64)-1) && foldersSize != 0) ? 1: 0;
+ numDefined += ((filesSize != (UInt64)(Int64)-1) && filesSize != 0) ? 1: 0;
+ if (numDefined == 2)
+ AddValuePair1(IDS_SIZE_COLON, 0x02000322, filesSize + foldersSize, info);
+
+ info += L"\n";
+ info += _currentFolderPrefix;
+
+ for (i = 0; i < indices.Size() && i < kCopyDialog_NumInfoLines - 6; i++)
+ {
+ info += L"\n ";
+ int index = indices[i];
+ info += GetItemRelPath(index);
+ if (IsItemFolder(index))
+ info += L'\\';
+ }
+ if (i != indices.Size())
+ info += L"\n ...";
+ return info;
+}
+
+void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex)
+{
+ int destPanelIndex = (NumPanels <= 1) ? srcPanelIndex : (1 - srcPanelIndex);
+ CPanel &srcPanel = Panels[srcPanelIndex];
+ CPanel &destPanel = Panels[destPanelIndex];
+
+ CPanel::CDisableTimerProcessing disableTimerProcessing1(destPanel);
+ CPanel::CDisableTimerProcessing disableTimerProcessing2(srcPanel);
+
+ if (!srcPanel.DoesItSupportOperations())
+ {
+ srcPanel.MessageBox(LangString(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208));
+ return;
+ }
+
+ CRecordVector<UInt32> indices;
+ UString destPath;
+ bool useDestPanel = false;
+
+ {
+ if (copyToSame)
+ {
+ int focusedItem = srcPanel._listView.GetFocusedItem();
+ if (focusedItem < 0)
+ return;
+ int realIndex = srcPanel.GetRealItemIndex(focusedItem);
+ if (realIndex == kParentIndex)
+ return;
+ indices.Add(realIndex);
+ destPath = srcPanel.GetItemName(realIndex);
+ }
+ else
+ {
+ srcPanel.GetOperatedItemIndices(indices);
+ if (indices.Size() == 0)
+ return;
+ destPath = destPanel._currentFolderPrefix;
+ if (NumPanels == 1)
+ ReducePathToRealFileSystemPath(destPath);
+ }
+
+ CCopyDialog copyDialog;
+ UStringVector copyFolders;
+ ReadCopyHistory(copyFolders);
+
+ copyDialog.Strings = copyFolders;
+ copyDialog.Value = destPath;
+
+ copyDialog.Title = move ?
+ LangString(IDS_MOVE, 0x03020202):
+ LangString(IDS_COPY, 0x03020201);
+ copyDialog.Static = move ?
+ LangString(IDS_MOVE_TO, 0x03020204):
+ LangString(IDS_COPY_TO, 0x03020203);
+
+ copyDialog.Info = srcPanel.GetItemsInfoString(indices);
+
+ if (copyDialog.Create(srcPanel.GetParent()) == IDCANCEL)
+ return;
+
+ destPath = copyDialog.Value;
+
+ if (destPath.IsEmpty())
+ {
+ srcPanel.MessageBox(LangString(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208));
+ return;
+ }
+
+ if (!IsPathAbsolute(destPath))
+ {
+ if (!srcPanel.IsFSFolder())
+ {
+ srcPanel.MessageBox(LangString(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208));
+ return;
+ }
+ destPath = srcPanel._currentFolderPrefix + destPath;
+ }
+
+ printf("destPath='%ls'\n",(const wchar_t *)destPath);
+#ifdef _WIN32
+ if (destPath.Length() > 0 && destPath[0] == CHAR_PATH_SEPARATOR)
+ if (destPath.Length() == 1 || destPath[1] != CHAR_PATH_SEPARATOR)
+ {
+ srcPanel.MessageBox(LangString(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208));
+ return;
+ }
+#endif
+
+ if (indices.Size() > 1 || (destPath.Length() > 0 && destPath.ReverseFind(CHAR_PATH_SEPARATOR) == destPath.Length() - 1) ||
+ IsThereFolderOfPath(destPath))
+ {
+ NDirectory::CreateComplexDirectory(destPath);
+ NName::NormalizeDirPathPrefix(destPath);
+ if (!CheckFolderPath(destPath))
+ {
+ if (NumPanels < 2 || destPath != destPanel._currentFolderPrefix || !destPanel.DoesItSupportOperations())
+ {
+ srcPanel.MessageBox(LangString(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208));
+ return;
+ }
+ useDestPanel = true;
+ }
+ }
+ else
+ {
+ int pos = destPath.ReverseFind(CHAR_PATH_SEPARATOR);
+ if (pos >= 0)
+ {
+ UString prefix = destPath.Left(pos + 1);
+ NDirectory::CreateComplexDirectory(prefix);
+ if (!CheckFolderPath(prefix))
+ {
+ srcPanel.MessageBox(LangString(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208));
+ return;
+ }
+ }
+ }
+
+ AddUniqueStringToHeadOfList(copyFolders, destPath);
+ while (copyFolders.Size() > 20)
+ copyFolders.DeleteBack();
+ SaveCopyHistory(copyFolders);
+ }
+
+ bool useSrcPanel = (!useDestPanel || !srcPanel.IsFSFolder() || destPanel.IsFSFolder());
+ bool useTemp = useSrcPanel && useDestPanel;
+ // FIXME NFile::NDirectory::CTempDirectoryW tempDirectory;
+ UString tempDirPrefix;
+ if (useTemp)
+ {
+ /* FIXME
+ tempDirectory.Create(kTempDirPrefix);
+ tempDirPrefix = tempDirectory.GetPath();
+ NFile::NName::NormalizeDirPathPrefix(tempDirPrefix);
+ */
+ printf("useTemp : Not Implemented\n");
+ exit(EXIT_FAILURE);
+ }
+
+ CSelectedState srcSelState;
+ CSelectedState destSelState;
+ srcPanel.SaveSelectedState(srcSelState);
+ destPanel.SaveSelectedState(destSelState);
+
+ HRESULT result;
+ if (useSrcPanel)
+ {
+ UString folder = useTemp ? tempDirPrefix : destPath;
+ result = srcPanel.CopyTo(indices, folder, move, true, 0);
+ if (result != S_OK)
+ {
+ disableTimerProcessing1.Restore();
+ disableTimerProcessing2.Restore();
+ // For Password:
+ srcPanel.SetFocusToList();
+ if (result != E_ABORT)
+ srcPanel.MessageBoxError(result, L"Error");
+ return;
+ }
+ }
+
+ if (useDestPanel)
+ {
+ UStringVector filePaths;
+ UString folderPrefix;
+ if (useTemp)
+ folderPrefix = tempDirPrefix;
+ else
+ folderPrefix = srcPanel._currentFolderPrefix;
+ filePaths.Reserve(indices.Size());
+ for(int i = 0; i < indices.Size(); i++)
+ filePaths.Add(srcPanel.GetItemRelPath(indices[i]));
+
+ result = destPanel.CopyFrom(folderPrefix, filePaths, true, 0);
+
+ if (result != S_OK)
+ {
+ disableTimerProcessing1.Restore();
+ disableTimerProcessing2.Restore();
+ // For Password:
+ srcPanel.SetFocusToList();
+ if (result != E_ABORT)
+ srcPanel.MessageBoxError(result, L"Error");
+ return;
+ }
+ }
+
+ RefreshTitleAlways();
+ if (copyToSame || move)
+ {
+ srcPanel.RefreshListCtrl(srcSelState);
+ }
+ if (!copyToSame)
+ {
+ destPanel.RefreshListCtrl(destSelState);
+ srcPanel.KillSelection();
+ }
+ disableTimerProcessing1.Restore();
+ disableTimerProcessing2.Restore();
+ srcPanel.SetFocusToList();
+}
+
+void CApp::OnSetSameFolder(int srcPanelIndex)
+{
+ if (NumPanels <= 1)
+ return;
+ const CPanel &srcPanel = Panels[srcPanelIndex];
+ CPanel &destPanel = Panels[1 - srcPanelIndex];
+ destPanel.BindToPathAndRefresh(srcPanel._currentFolderPrefix);
+}
+
+void CApp::OnSetSubFolder(int srcPanelIndex)
+{
+ if (NumPanels <= 1)
+ return;
+ const CPanel &srcPanel = Panels[srcPanelIndex];
+ CPanel &destPanel = Panels[1 - srcPanelIndex];
+
+ int focusedItem = srcPanel._listView.GetFocusedItem();
+ if (focusedItem < 0)
+ return;
+ int realIndex = srcPanel.GetRealItemIndex(focusedItem);
+ if (!srcPanel.IsItemFolder(realIndex))
+ return;
+
+
+ /*
+ UString string = srcPanel._currentFolderPrefix +
+ srcPanel.GetItemName(realIndex) + WCHAR_PATH_SEPARATOR;
+ destPanel.BindToFolder(string);
+ */
+ CMyComPtr<IFolderFolder> newFolder;
+ if (realIndex == kParentIndex)
+ {
+ if (srcPanel._folder->BindToParentFolder(&newFolder) != S_OK)
+ return;
+ }
+ else
+ {
+ if (srcPanel._folder->BindToFolder(realIndex, &newFolder) != S_OK)
+ return;
+ }
+ destPanel.CloseOpenFolders();
+ destPanel._folder = newFolder;
+ destPanel.RefreshListCtrl();
+}
+
+/*
+int CApp::GetFocusedPanelIndex() const
+{
+ return LastFocusedPanel;
+ HWND hwnd = ::GetFocus();
+ for (;;)
+ {
+ if (hwnd == 0)
+ return 0;
+ for (int i = 0; i < kNumPanelsMax; i++)
+ {
+ if (PanelsCreated[i] &&
+ ((HWND)Panels[i] == hwnd || Panels[i]._listView == hwnd))
+ return i;
+ }
+ hwnd = GetParent(hwnd);
+ }
+}
+ */
+
+static UString g_ToolTipBuffer;
+static CSysString g_ToolTipBufferSys;
+
+#ifdef _WIN32
+void CApp::OnNotify(int /* ctrlID */, LPNMHDR pnmh)
+{
+ if (pnmh->hwndFrom == _rebar)
+ {
+ switch(pnmh->code)
+ {
+ case RBN_HEIGHTCHANGE:
+ {
+ MoveSubWindows(g_HWND);
+ return;
+ }
+ }
+ return ;
+ }
+ else
+ {
+ if (pnmh->code == TTN_GETDISPINFO)
+ {
+ LPNMTTDISPINFO info = (LPNMTTDISPINFO)pnmh;
+ info->hinst = 0;
+ g_ToolTipBuffer.Empty();
+ SetButtonText((UINT32)info->hdr.idFrom, g_ToolTipBuffer);
+ g_ToolTipBufferSys = GetSystemString(g_ToolTipBuffer);
+ info->lpszText = (LPTSTR)(LPCTSTR)g_ToolTipBufferSys;
+ return;
+ }
+ #ifndef _UNICODE
+ if (pnmh->code == TTN_GETDISPINFOW)
+ {
+ LPNMTTDISPINFOW info = (LPNMTTDISPINFOW)pnmh;
+ info->hinst = 0;
+ g_ToolTipBuffer.Empty();
+ SetButtonText((UINT32)info->hdr.idFrom, g_ToolTipBuffer);
+ info->lpszText = (LPWSTR)(LPCWSTR)g_ToolTipBuffer;
+ return;
+ }
+ #endif
+ }
+}
+#endif
+
+void CApp::RefreshTitle(bool always)
+{
+ UString path = GetFocusedPanel()._currentFolderPrefix;
+ if (path.IsEmpty())
+ path += LangString(IDS_APP_TITLE, 0x03000000);
+ if (!always && path == PrevTitle)
+ return;
+ PrevTitle = path;
+ NWindows::MySetWindowText(_window, path);
+}
+
+void CApp::RefreshTitle(int panelIndex, bool always)
+{
+ if (panelIndex != GetFocusedPanelIndex())
+ return;
+ RefreshTitle(always);
+}
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/App.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/App.h
new file mode 100644
index 000000000..f0c9a933f
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/App.h
@@ -0,0 +1,344 @@
+// App.h
+
+#ifndef __APP_H
+#define __APP_H
+
+#include "Panel.h"
+#include "AppState.h"
+// FIXME #include "Windows/Control/ImageList.h"
+
+class CApp;
+
+extern CApp g_App;
+extern HWND g_HWND;
+
+const int kNumPanelsMax = 2;
+
+extern void MoveSubWindows(HWND hWnd);
+
+enum
+{
+ kAddCommand = kToolbarStartID,
+ kExtractCommand,
+ kTestCommand
+};
+
+class CPanelCallbackImp: public CPanelCallback
+{
+ CApp *_app;
+ int _index;
+public:
+ void Init(CApp *app, int index)
+ {
+ _app = app;
+ _index = index;
+ }
+ virtual void OnTab();
+ virtual void SetFocusToPath(int index);
+ virtual void OnCopy(bool move, bool copyToSame);
+ virtual void OnSetSameFolder();
+ virtual void OnSetSubFolder();
+ virtual void PanelWasFocused();
+ virtual void DragBegin();
+ virtual void DragEnd();
+ virtual void RefreshTitle(bool always);
+};
+
+class CApp;
+
+#if _WIN32
+class CDropTarget:
+ public IDropTarget,
+ public CMyUnknownImp
+{
+ CMyComPtr<IDataObject> m_DataObject;
+ UStringVector m_SourcePaths;
+ int m_SelectionIndex;
+ bool m_DropIsAllowed; // = true, if data contain fillist
+ bool m_PanelDropIsAllowed; // = false, if current target_panel is source_panel.
+ // check it only if m_DropIsAllowed == true
+ int m_SubFolderIndex;
+ UString m_SubFolderName;
+
+ CPanel *m_Panel;
+ bool m_IsAppTarget; // true, if we want to drop to app window (not to panel).
+
+ bool m_SetPathIsOK;
+
+ bool IsItSameDrive() const;
+
+ void QueryGetData(IDataObject *dataObject);
+ bool IsFsFolderPath() const;
+ DWORD GetEffect(DWORD keyState, POINTL pt, DWORD allowedEffect);
+ void RemoveSelection();
+ void PositionCursor(POINTL ptl);
+ UString GetTargetPath() const;
+ bool SetPath(bool enablePath) const;
+ bool SetPath();
+
+public:
+ MY_UNKNOWN_IMP1_MT(IDropTarget)
+ STDMETHOD(DragEnter)(IDataObject * dataObject, DWORD keyState,
+ POINTL pt, DWORD *effect);
+ STDMETHOD(DragOver)(DWORD keyState, POINTL pt, DWORD * effect);
+ STDMETHOD(DragLeave)();
+ STDMETHOD(Drop)(IDataObject * dataObject, DWORD keyState,
+ POINTL pt, DWORD *effect);
+
+ CDropTarget():
+ TargetPanelIndex(-1),
+ SrcPanelIndex(-1),
+ m_IsAppTarget(false),
+ m_Panel(0),
+ App(0),
+ m_PanelDropIsAllowed(false),
+ m_DropIsAllowed(false),
+ m_SelectionIndex(-1),
+ m_SubFolderIndex(-1),
+ m_SetPathIsOK(false) {}
+
+ CApp *App;
+ int SrcPanelIndex; // index of D&D source_panel
+ int TargetPanelIndex; // what panel to use as target_panel of Application
+};
+#endif
+
+class CApp
+{
+public:
+ NWindows::CWindow _window;
+ bool ShowSystemMenu;
+ int NumPanels;
+ int LastFocusedPanel;
+
+ bool ShowStandardToolbar;
+ bool ShowArchiveToolbar;
+ bool ShowButtonsLables;
+ bool LargeButtons;
+
+ CAppState AppState;
+ CPanelCallbackImp m_PanelCallbackImp[kNumPanelsMax];
+ CPanel Panels[kNumPanelsMax];
+ bool PanelsCreated[kNumPanelsMax];
+
+#ifdef _WIN32
+ NWindows::NControl::CImageList _archiveButtonsImageList;
+ NWindows::NControl::CImageList _standardButtonsImageList;
+
+ NWindows::NControl::CReBar _rebar;
+ NWindows::NControl::CToolBar _archiveToolBar;
+ NWindows::NControl::CToolBar _standardToolBar;
+
+ CDropTarget *_dropTargetSpec;
+ CMyComPtr<IDropTarget> _dropTarget;
+
+ void CreateDragTarget()
+ {
+ _dropTargetSpec = new CDropTarget();
+ _dropTarget = _dropTargetSpec;
+ _dropTargetSpec->App = (this);
+ }
+#endif
+
+ void SetFocusedPanel(int index)
+ {
+ LastFocusedPanel = index;
+ // FIXME _dropTargetSpec->TargetPanelIndex = LastFocusedPanel;
+ }
+
+#ifdef _WIN32
+ void DragBegin(int panelIndex)
+ {
+ _dropTargetSpec->TargetPanelIndex = (NumPanels > 1) ? 1 - panelIndex : panelIndex;
+ _dropTargetSpec->SrcPanelIndex = panelIndex;
+ }
+
+ void DragEnd()
+ {
+ _dropTargetSpec->TargetPanelIndex = LastFocusedPanel;
+ _dropTargetSpec->SrcPanelIndex = -1;
+ }
+#endif
+
+
+ void OnCopy(bool move, bool copyToSame, int srcPanelIndex);
+ void OnSetSameFolder(int srcPanelIndex);
+ void OnSetSubFolder(int srcPanelIndex);
+
+ void CreateOnePanel(int panelIndex, const UString &mainPath, bool &archiveIsOpened, bool &encrypted);
+ void Create(HWND hwnd, const UString &mainPath, int xSizes[2], bool &archiveIsOpened, bool &encrypted);
+ void Read();
+ void Save();
+ void Release();
+
+
+ /*
+ void SetFocus(int panelIndex)
+ { Panels[panelIndex].SetFocusToList(); }
+ */
+ void SetFocusToLastItem()
+ { Panels[LastFocusedPanel].SetFocusToLastRememberedItem(); }
+
+ int GetFocusedPanelIndex() const { return LastFocusedPanel; }
+
+ bool IsPanelVisible(int index) const { return (NumPanels > 1 || index == LastFocusedPanel); }
+
+ /*
+ void SetCurrentIndex()
+ { CurrentPanel = GetFocusedPanelIndex(); }
+ */
+
+ CApp(): NumPanels(2), LastFocusedPanel(0) {}
+ CPanel &GetFocusedPanel()
+ { return Panels[GetFocusedPanelIndex()]; }
+
+ // File Menu
+ void OpenItem()
+ { GetFocusedPanel().OpenSelectedItems(true); }
+ void OpenItemInside()
+ { GetFocusedPanel().OpenFocusedItemAsInternal(); }
+ void OpenItemOutside()
+ { GetFocusedPanel().OpenSelectedItems(false); }
+ void EditItem()
+ { GetFocusedPanel().EditItem(); }
+ void Rename()
+ { GetFocusedPanel().RenameFile(); }
+ void CopyTo()
+ { OnCopy(false, false, GetFocusedPanelIndex()); }
+ void MoveTo()
+ { OnCopy(true, false, GetFocusedPanelIndex()); }
+ void Delete(bool toRecycleBin)
+ { GetFocusedPanel().DeleteItems(toRecycleBin); }
+ void CalculateCrc();
+ void Split();
+ void Combine();
+ void Properties()
+ { GetFocusedPanel().Properties(); }
+ void Comment()
+ { GetFocusedPanel().ChangeComment(); }
+
+ void CreateFolder()
+ { GetFocusedPanel().CreateFolder(); }
+ void CreateFile()
+ { GetFocusedPanel().CreateFile(); }
+
+ // Edit
+ void EditCut()
+ { GetFocusedPanel().EditCut(); }
+ void EditCopy()
+ { GetFocusedPanel().EditCopy(); }
+ void EditPaste()
+ { GetFocusedPanel().EditPaste(); }
+
+ void SelectAll(bool selectMode)
+ { GetFocusedPanel().SelectAll(selectMode); }
+ void InvertSelection()
+ { GetFocusedPanel().InvertSelection(); }
+ void SelectSpec(bool selectMode)
+ { GetFocusedPanel().SelectSpec(selectMode); }
+ void SelectByType(bool selectMode)
+ { GetFocusedPanel().SelectByType(selectMode); }
+
+ void RefreshStatusBar()
+ { GetFocusedPanel().RefreshStatusBar(); }
+
+ void SetListViewMode(UINT32 index)
+ { GetFocusedPanel().SetListViewMode(index); }
+ UINT32 GetListViewMode()
+ { return GetFocusedPanel().GetListViewMode(); }
+
+ void SortItemsWithPropID(PROPID propID)
+ { GetFocusedPanel().SortItemsWithPropID(propID); }
+
+ void OpenRootFolder()
+ { GetFocusedPanel().OpenDrivesFolder(); }
+ void OpenParentFolder()
+ { GetFocusedPanel().OpenParentFolder(); }
+ void FoldersHistory()
+ { GetFocusedPanel().FoldersHistory(); }
+ void RefreshView()
+ { GetFocusedPanel().OnReload(); }
+ void RefreshAllPanels()
+ {
+ for (int i = 0; i < NumPanels; i++)
+ {
+ int index = i;
+ if (NumPanels == 1)
+ index = LastFocusedPanel;
+ Panels[index].OnReload();
+ }
+ }
+ void SetListSettings();
+ void SetShowSystemMenu();
+ void SwitchOnOffOnePanel();
+ bool GetFlatMode() { return Panels[LastFocusedPanel].GetFlatMode(); }
+ void ChangeFlatMode() { Panels[LastFocusedPanel].ChangeFlatMode(); }
+
+ void OpenBookmark(int index)
+ { GetFocusedPanel().OpenBookmark(index); }
+ void SetBookmark(int index)
+ { GetFocusedPanel().SetBookmark(index); }
+
+ void ReloadRebar(HWND hwnd);
+ void ReloadToolbars();
+ void ReadToolbar()
+ {
+ UINT32 mask = ReadToolbarsMask();
+ ShowButtonsLables = ((mask & 1) != 0);
+ LargeButtons = ((mask & 2) != 0);
+ ShowStandardToolbar = ((mask & 4) != 0);
+ ShowArchiveToolbar = ((mask & 8) != 0);
+ }
+ void SaveToolbar()
+ {
+ UINT32 mask = 0;
+ if (ShowButtonsLables) mask |= 1;
+ if (LargeButtons) mask |= 2;
+ if (ShowStandardToolbar) mask |= 4;
+ if (ShowArchiveToolbar) mask |= 8;
+ SaveToolbarsMask(mask);
+ }
+ void SwitchStandardToolbar()
+ {
+ ShowStandardToolbar = !ShowStandardToolbar;
+ SaveToolbar();
+ ReloadRebar(g_HWND);
+ MoveSubWindows(_window);
+ }
+ void SwitchArchiveToolbar()
+ {
+ ShowArchiveToolbar = !ShowArchiveToolbar;
+ SaveToolbar();
+ ReloadRebar(g_HWND);
+ MoveSubWindows(_window);
+ }
+ void SwitchButtonsLables()
+ {
+ ShowButtonsLables = !ShowButtonsLables;
+ SaveToolbar();
+ ReloadRebar(g_HWND);
+ MoveSubWindows(_window);
+ }
+ void SwitchLargeButtons()
+ {
+ LargeButtons = !LargeButtons;
+ SaveToolbar();
+ ReloadRebar(g_HWND);
+ MoveSubWindows(_window);
+ }
+
+ void AddToArchive() { GetFocusedPanel().AddToArchive(); }
+ void ExtractArchives() { GetFocusedPanel().ExtractArchives(); }
+ void TestArchives() { GetFocusedPanel().TestArchives(); }
+
+#ifdef _WIN32
+ void OnNotify(int ctrlID, LPNMHDR pnmh);
+#endif
+
+ UString PrevTitle;
+ void RefreshTitle(bool always = false);
+ void RefreshTitleAlways() { RefreshTitle(true); }
+ void RefreshTitle(int panelIndex, bool always = false);
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/AppState.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/AppState.h
new file mode 100644
index 000000000..7b59d4547
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/AppState.h
@@ -0,0 +1,114 @@
+// AppState.h
+
+#ifndef __APPSTATE_H
+#define __APPSTATE_H
+
+#include "Windows/Synchronization.h"
+
+void inline AddUniqueStringToHead(UStringVector &list,
+ const UString &string)
+{
+ for(int i = 0; i < list.Size();)
+ if (string.CompareNoCase(list[i]) == 0)
+ list.Delete(i);
+ else
+ i++;
+ list.Insert(0, string);
+}
+
+class CFastFolders
+{
+ NWindows::NSynchronization::CCriticalSection _criticalSection;
+public:
+ UStringVector Strings;
+ void SetString(int index, const UString &string)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
+ while(Strings.Size() <= index)
+ Strings.Add(UString());
+ Strings[index] = string;
+ }
+ UString GetString(int index)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
+ if (index >= Strings.Size())
+ return UString();
+ return Strings[index];
+ }
+ void Save()
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
+ SaveFastFolders(Strings);
+ }
+ void Read()
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
+ ReadFastFolders(Strings);
+ }
+};
+
+class CFolderHistory
+{
+ NWindows::NSynchronization::CCriticalSection _criticalSection;
+ UStringVector Strings;
+ void Normalize()
+ {
+ const int kMaxSize = 100;
+ if (Strings.Size() > kMaxSize)
+ Strings.Delete(kMaxSize, Strings.Size() - kMaxSize);
+ }
+
+public:
+
+ void GetList(UStringVector &foldersHistory)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
+ foldersHistory = Strings;
+ }
+
+ void AddString(const UString &string)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
+ AddUniqueStringToHead(Strings, string);
+ Normalize();
+ }
+
+ void RemoveAll()
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
+ Strings.Clear();
+ }
+
+ void Save()
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
+ SaveFolderHistory(Strings);
+ }
+
+ void Read()
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
+ ReadFolderHistory(Strings);
+ Normalize();
+ }
+};
+
+struct CAppState
+{
+ CFastFolders FastFolders;
+ CFolderHistory FolderHistory;
+ void Save()
+ {
+ FastFolders.Save();
+ FolderHistory.Save();
+ }
+ void Read()
+ {
+ FastFolders.Read();
+ FolderHistory.Read();
+ }
+};
+
+
+#endif
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ClassDefs.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ClassDefs.cpp
new file mode 100644
index 000000000..5b4401a10
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ClassDefs.cpp
@@ -0,0 +1,17 @@
+// ClassDefs.cpp
+
+#include "StdAfx.h"
+
+#include <initguid.h>
+
+#include "IFolder.h"
+#include "../../IPassword.h"
+#include "PluginInterface.h"
+#include "ExtractCallback.h"
+#include "../../ICoder.h"
+
+#include "../Agent/Agent.h"
+
+// {23170F69-40C1-278A-1000-000100020000}
+DEFINE_GUID(CLSID_CZipContextMenu,
+0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00);
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog.cpp
new file mode 100644
index 000000000..807a5dd25
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog.cpp
@@ -0,0 +1,53 @@
+// ComboDialog.cpp
+
+#include "StdAfx.h"
+#include "ComboDialog.h"
+
+#include "Windows/Control/Static.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+using namespace NWindows;
+
+#ifdef LANG
+static CIDLangPair kIDLangPairs[] =
+{
+ { IDOK, 0x02000702 },
+ { IDCANCEL, 0x02000710 }
+};
+#endif
+
+bool CComboDialog::OnInit()
+{
+ #ifdef LANG
+ LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
+ #endif
+ _comboBox.Attach(GetItem(IDC_COMBO_COMBO));
+
+ /*
+ // why it doesn't work ?
+ DWORD style = _comboBox.GetStyle();
+ if (Sorted)
+ style |= CBS_SORT;
+ else
+ style &= ~CBS_SORT;
+ _comboBox.SetStyle(style);
+ */
+ SetText(Title);
+
+ NControl::CStatic staticContol;
+ staticContol.Attach(GetItem(IDC_COMBO_STATIC));
+ staticContol.SetText(Static);
+ _comboBox.SetText(Value);
+ for(int i = 0; i < Strings.Size(); i++)
+ _comboBox.AddString(Strings[i]);
+ return CModalDialog::OnInit();
+}
+
+void CComboDialog::OnOK()
+{
+ _comboBox.GetText(Value);
+ CModalDialog::OnOK();
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog.h
new file mode 100644
index 000000000..0a1addc54
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog.h
@@ -0,0 +1,25 @@
+// ComboDialog.h
+
+#ifndef __COMBODIALOG_H
+#define __COMBODIALOG_H
+
+#include "Windows/Control/Dialog.h"
+#include "Windows/Control/ComboBox.h"
+#include "ComboDialogRes.h"
+
+class CComboDialog: public NWindows::NControl::CModalDialog
+{
+ NWindows::NControl::CComboBox _comboBox;
+ virtual void OnOK();
+ virtual bool OnInit();
+public:
+ // bool Sorted;
+ UString Title;
+ UString Static;
+ UString Value;
+ UStringVector Strings;
+ // CComboDialog(): Sorted(false) {};
+ INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_DIALOG_COMBO, parentWindow); }
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialogRes.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialogRes.h
new file mode 100644
index 000000000..b5111ddfd
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialogRes.h
@@ -0,0 +1,4 @@
+#define IDD_DIALOG_COMBO 200
+
+#define IDC_COMBO_STATIC 1000
+#define IDC_COMBO_COMBO 1001
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog_rc.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog_rc.cpp
new file mode 100644
index 000000000..086d0a4b4
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ComboDialog_rc.cpp
@@ -0,0 +1,57 @@
+// PasswordDialog.cpp
+
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+// for all others, include the necessary headers (this file is usually all you
+// need because it includes almost all "standard" wxWidgets headers)
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "Windows/Control/DialogImpl.h"
+
+#include "ComboDialogRes.h"
+
+class ComboDialogImpl : public NWindows::NControl::CModalDialogImpl
+{
+ public:
+ ComboDialogImpl(NWindows::NControl::CModalDialog *dialog,wxWindow * parent,int id) : CModalDialogImpl(dialog, parent, id, wxT("Combo"))
+ {
+
+ wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
+
+
+ topsizer->Add(new wxStaticText(this, IDC_COMBO_STATIC, _T("")) , 0 ,wxALL | wxALIGN_LEFT, 5 );
+
+
+ wxArrayString pathArray;
+ wxComboBox *combo = new wxComboBox(this, IDC_COMBO_COMBO, wxEmptyString, wxDefaultPosition, wxSize(200,-1), pathArray, wxCB_DROPDOWN|wxCB_SORT);
+
+ topsizer->Add(combo, 0 ,wxALL | wxALIGN_LEFT, 5 );
+
+ topsizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxALL|wxEXPAND, 5);
+
+ this->OnInit();
+
+ SetSizer(topsizer); // use the sizer for layout
+ topsizer->SetSizeHints(this); // set size hints to honour minimum size
+ }
+private:
+ // Any class wishing to process wxWindows events must use this macro
+ DECLARE_EVENT_TABLE()
+};
+
+REGISTER_DIALOG(IDD_DIALOG_COMBO,ComboDialog,0)
+
+BEGIN_EVENT_TABLE(ComboDialogImpl, wxDialog)
+ EVT_BUTTON(wxID_ANY, CModalDialogImpl::OnAnyButton)
+ EVT_CHECKBOX(wxID_ANY, CModalDialogImpl::OnAnyButton)
+END_EVENT_TABLE()
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog.cpp
new file mode 100644
index 000000000..2bf603019
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog.cpp
@@ -0,0 +1,82 @@
+// CopyDialog.cpp
+
+#include "StdAfx.h"
+#include "CopyDialog.h"
+
+#include "Common/StringConvert.h"
+
+#include "Windows/Control/Static.h"
+#include "Windows/Shell.h"
+#include "Windows/FileName.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+using namespace NWindows;
+
+#ifdef LANG
+static CIDLangPair kIDLangPairs[] =
+{
+ { IDOK, 0x02000702 },
+ { IDCANCEL, 0x02000710 }
+};
+#endif
+
+bool CCopyDialog::OnInit()
+{
+ #ifdef LANG
+ LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
+ #endif
+ _path.Attach(GetItem(IDC_COPY_COMBO));
+ SetText(Title);
+
+ NControl::CStatic staticContol;
+ staticContol.Attach(GetItem(IDC_COPY_STATIC));
+ staticContol.SetText(Static);
+ for (int i = 0; i < Strings.Size(); i++)
+ _path.AddString(Strings[i]);
+ _path.SetText(Value);
+ SetItemText(IDC_COPY_INFO, Info);
+ return CModalDialog::OnInit();
+}
+
+bool CCopyDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ switch(buttonID)
+ {
+ case IDC_COPY_SET_PATH:
+ OnButtonSetPath();
+ return true;
+ }
+ return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
+}
+
+void CCopyDialog::OnButtonSetPath()
+{
+ UString currentPath;
+ _path.GetText(currentPath);
+
+ /*
+ #ifdef LANG
+ UString title = LangLoadString(IDS_EXTRACT_SET_FOLDER, 0x02000881);
+ #else
+ UString title = MyLoadString(IDS_EXTRACT_SET_FOLDER);
+ #endif
+ */
+ UString title = LangStringSpec(IDS_SET_FOLDER, 0x03020209);
+ // UString title = L"Specify a location for output folder";
+
+ UString resultPath;
+ if (!NShell::BrowseForFolder(HWND(*this), title, currentPath, resultPath))
+ return;
+ NFile::NName::NormalizeDirPathPrefix(resultPath);
+ _path.SetCurSel(-1);
+ _path.SetText(resultPath);
+}
+
+void CCopyDialog::OnOK()
+{
+ _path.GetText(Value);
+ CModalDialog::OnOK();
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog.h
new file mode 100644
index 000000000..55872f1c1
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog.h
@@ -0,0 +1,30 @@
+// CopyDialog.h
+
+#ifndef __COPYDIALOG_H
+#define __COPYDIALOG_H
+
+#include "Windows/Control/Dialog.h"
+#include "Windows/Control/ComboBox.h"
+#include "CopyDialogRes.h"
+
+const int kCopyDialog_NumInfoLines = 11;
+
+class CCopyDialog: public NWindows::NControl::CModalDialog
+{
+ NWindows::NControl::CComboBox _path;
+ virtual void OnOK();
+ virtual bool OnInit();
+ void OnButtonSetPath();
+ bool OnButtonClicked(int buttonID, HWND buttonHWND);
+public:
+ UString Title;
+ UString Static;
+ UString Value;
+ UStringVector Strings;
+
+ UString Info;
+
+ INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_DIALOG_COPY, parentWindow); }
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialogRes.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialogRes.h
new file mode 100644
index 000000000..900bf29f3
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialogRes.h
@@ -0,0 +1,8 @@
+#define IDD_DIALOG_COPY 202
+
+#define IDC_COPY_STATIC 1000
+#define IDC_COPY_COMBO 1001
+#define IDC_COPY_SET_PATH 1002
+#define IDC_COPY_INFO 1003
+
+#define IDS_SET_FOLDER 210
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog_rc.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog_rc.cpp
new file mode 100644
index 000000000..700a78a5f
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/CopyDialog_rc.cpp
@@ -0,0 +1,73 @@
+// PasswordDialog.cpp
+
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+// for all others, include the necessary headers (this file is usually all you
+// need because it includes almost all "standard" wxWidgets headers)
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "Windows/Control/DialogImpl.h"
+
+#include "CopyDialogRes.h"
+
+class CopyDialogImpl : public NWindows::NControl::CModalDialogImpl
+{
+ public:
+ CopyDialogImpl(NWindows::NControl::CModalDialog *dialog,wxWindow * parent,int id) : CModalDialogImpl(dialog, parent, id, wxT("Copy"))
+ {
+
+ wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
+
+
+ topsizer->Add(new wxStaticText(this, IDC_COPY_STATIC, _T("")) , 0 ,wxALL | wxALIGN_LEFT, 5 );
+
+
+ {
+ wxBoxSizer *pathSizer = new wxBoxSizer(wxHORIZONTAL);
+
+ wxArrayString pathArray;
+ wxComboBox *combo = new wxComboBox(this, IDC_COPY_COMBO, wxEmptyString, wxDefaultPosition, wxSize(600,-1), pathArray, wxCB_DROPDOWN|wxCB_SORT);
+ wxButton *button = new wxButton(this, IDC_COPY_SET_PATH, wxT("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
+ pathSizer->Add(combo, 1, wxLEFT|wxRIGHT|wxEXPAND, 5);
+ pathSizer->Add(button, 0, wxLEFT|wxRIGHT|wxEXPAND, 5);
+
+ topsizer->Add(pathSizer, 0 ,wxALL | wxALIGN_LEFT, 5 );
+ }
+
+ topsizer->Add(new wxStaticText(this, IDC_COPY_INFO, _T("line1\nline2\nline3\nline4\n")) , 0 ,wxALL | wxALIGN_LEFT, 5 );
+
+ topsizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxALL|wxEXPAND, 5);
+
+ this->OnInit();
+
+ SetSizer(topsizer); // use the sizer for layout
+ topsizer->SetSizeHints(this); // set size hints to honour minimum size
+ }
+private:
+ // Any class wishing to process wxWindows events must use this macro
+ DECLARE_EVENT_TABLE()
+};
+
+static CStringTable g_stringTable[] =
+{
+ { IDS_SET_FOLDER, L"Specify a location for output folder." },
+ { 0 , 0 }
+};
+
+
+REGISTER_DIALOG(IDD_DIALOG_COPY,CopyDialog,g_stringTable)
+
+BEGIN_EVENT_TABLE(CopyDialogImpl, wxDialog)
+ EVT_BUTTON(wxID_ANY, CModalDialogImpl::OnAnyButton)
+ EVT_CHECKBOX(wxID_ANY, CModalDialogImpl::OnAnyButton)
+END_EVENT_TABLE()
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ExtractCallback.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ExtractCallback.cpp
new file mode 100644
index 000000000..9902e9a1d
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ExtractCallback.cpp
@@ -0,0 +1,478 @@
+// ExtractCallback.h
+
+#include "StdAfx.h"
+
+#include "Common/Wildcard.h"
+#include "Common/StringConvert.h"
+
+#include "Windows/Error.h"
+#include "Windows/FileDir.h"
+#include "Windows/FileFind.h"
+#include "Windows/ResourceString.h"
+
+#include "../../Common/FilePathAutoRename.h"
+
+#include "../GUI/ExtractRes.h"
+#include "../GUI/resource.h"
+
+#include "ExtractCallback.h"
+#include "FormatUtils.h"
+#include "MessagesDialog.h"
+#include "OverwriteDialog.h"
+#ifndef _NO_CRYPTO
+#include "PasswordDialog.h"
+#endif
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NFind;
+
+CExtractCallbackImp::~CExtractCallbackImp()
+{
+ if (ShowMessages && !Messages.IsEmpty())
+ {
+ CMessagesDialog messagesDialog;
+ messagesDialog.Messages = &Messages;
+ messagesDialog.Create(ParentWindow);
+ }
+}
+
+void CExtractCallbackImp::Init()
+{
+ Messages.Clear();
+ NumArchiveErrors = 0;
+ #ifndef _SFX
+ NumFolders = NumFiles = 0;
+ NeedAddFile = false;
+ #endif
+}
+
+void CExtractCallbackImp::AddErrorMessage(LPCWSTR message)
+{
+ Messages.Add(message);
+}
+
+STDMETHODIMP CExtractCallbackImp::SetNumFiles(UInt64
+ #ifndef _SFX
+ numFiles
+ #endif
+ )
+{
+ #ifndef _SFX
+ ProgressDialog.ProgressSynch.SetNumFilesTotal(numFiles);
+ #endif
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::SetTotal(UInt64 total)
+{
+ ProgressDialog.ProgressSynch.SetProgress(total, 0);
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::SetCompleted(const UInt64 *value)
+{
+ RINOK(ProgressDialog.ProgressSynch.ProcessStopAndPause());
+ if (value != NULL)
+ ProgressDialog.ProgressSynch.SetPos(*value);
+ return S_OK;
+}
+
+HRESULT CExtractCallbackImp::Open_CheckBreak()
+{
+ return ProgressDialog.ProgressSynch.ProcessStopAndPause();
+}
+
+HRESULT CExtractCallbackImp::Open_SetTotal(const UInt64 * /* numFiles */, const UInt64 * /* numBytes */)
+{
+ // if (numFiles != NULL) ProgressDialog.ProgressSynch.SetNumFilesTotal(*numFiles);
+ return S_OK;
+}
+
+HRESULT CExtractCallbackImp::Open_SetCompleted(const UInt64 * /* numFiles */, const UInt64 * /* numBytes */)
+{
+ RINOK(ProgressDialog.ProgressSynch.ProcessStopAndPause());
+ // if (numFiles != NULL) ProgressDialog.ProgressSynch.SetNumFilesCur(*numFiles);
+ return S_OK;
+}
+
+#ifndef _NO_CRYPTO
+
+HRESULT CExtractCallbackImp::Open_CryptoGetTextPassword(BSTR *password)
+{
+ return CryptoGetTextPassword(password);
+}
+
+HRESULT CExtractCallbackImp::Open_GetPasswordIfAny(UString &password)
+{
+ if (PasswordIsDefined)
+ password = Password;
+ return S_OK;
+}
+
+bool CExtractCallbackImp::Open_WasPasswordAsked()
+{
+ return PasswordWasAsked;
+}
+
+void CExtractCallbackImp::Open_ClearPasswordWasAskedFlag()
+{
+ PasswordWasAsked = false;
+}
+
+#endif
+
+
+#ifndef _SFX
+STDMETHODIMP CExtractCallbackImp::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
+{
+ ProgressDialog.ProgressSynch.SetRatioInfo(inSize, outSize);
+ return S_OK;
+}
+#endif
+
+/*
+STDMETHODIMP CExtractCallbackImp::SetTotalFiles(UInt64 total)
+{
+ ProgressDialog.ProgressSynch.SetNumFilesTotal(total);
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::SetCompletedFiles(const UInt64 *value)
+{
+ if (value != NULL)
+ ProgressDialog.ProgressSynch.SetNumFilesCur(*value);
+ return S_OK;
+}
+*/
+
+STDMETHODIMP CExtractCallbackImp::AskOverwrite(
+ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
+ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
+ Int32 *answer)
+{
+ COverwriteDialog dialog;
+
+ dialog.OldFileInfo.Time = *existTime;
+ dialog.OldFileInfo.SizeIsDefined = (existSize != NULL);
+ if (dialog.OldFileInfo.SizeIsDefined)
+ dialog.OldFileInfo.Size = *existSize;
+ dialog.OldFileInfo.Name = existName;
+
+ if (newTime == 0)
+ dialog.NewFileInfo.TimeIsDefined = false;
+ else
+ {
+ dialog.NewFileInfo.TimeIsDefined = true;
+ dialog.NewFileInfo.Time = *newTime;
+ }
+
+ dialog.NewFileInfo.SizeIsDefined = (newSize != NULL);
+ if (dialog.NewFileInfo.SizeIsDefined)
+ dialog.NewFileInfo.Size = *newSize;
+ dialog.NewFileInfo.Name = newName;
+
+ /*
+ NOverwriteDialog::NResult::EEnum writeAnswer =
+ NOverwriteDialog::Execute(oldFileInfo, newFileInfo);
+ */
+ INT_PTR writeAnswer = dialog.Create(ProgressDialog); // ParentWindow doesn't work with 7z
+
+ switch(writeAnswer)
+ {
+ case IDCANCEL: *answer = NOverwriteAnswer::kCancel; return E_ABORT;
+ case IDYES: *answer = NOverwriteAnswer::kYes; break;
+ case IDNO: *answer = NOverwriteAnswer::kNo; break;
+ case IDC_BUTTON_OVERWRITE_YES_TO_ALL: *answer = NOverwriteAnswer::kYesToAll; break;
+ case IDC_BUTTON_OVERWRITE_NO_TO_ALL: *answer = NOverwriteAnswer::kNoToAll; break;
+ case IDC_BUTTON_OVERWRITE_AUTO_RENAME: *answer = NOverwriteAnswer::kAutoRename; break;
+ default: return E_FAIL;
+ }
+ return S_OK;
+}
+
+
+STDMETHODIMP CExtractCallbackImp::PrepareOperation(const wchar_t *name, bool isFolder, Int32 /* askExtractMode */, const UInt64 * /* position */)
+{
+ _isFolder = isFolder;
+ return SetCurrentFilePath2(name);
+}
+
+STDMETHODIMP CExtractCallbackImp::MessageError(const wchar_t *message)
+{
+ AddErrorMessage(message);
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::ShowMessage(const wchar_t *message)
+{
+ AddErrorMessage(message);
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::SetOperationResult(Int32 operationResult, bool encrypted)
+{
+ switch(operationResult)
+ {
+ case NArchive::NExtract::NOperationResult::kOK:
+ break;
+ default:
+ {
+ UINT messageID;
+ UInt32 langID;
+ switch(operationResult)
+ {
+ case NArchive::NExtract::NOperationResult::kUnSupportedMethod:
+ messageID = IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_UNSUPPORTED_METHOD;
+ langID = 0x02000A91;
+ break;
+ case NArchive::NExtract::NOperationResult::kDataError:
+ messageID = encrypted ?
+ IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_DATA_ERROR_ENCRYPTED:
+ IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_DATA_ERROR;
+ langID = encrypted ? 0x02000A94 : 0x02000A92;
+ break;
+ case NArchive::NExtract::NOperationResult::kCRCError:
+ messageID = encrypted ?
+ IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_CRC_ENCRYPTED:
+ IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_CRC;
+ langID = encrypted ? 0x02000A95 : 0x02000A93;
+ break;
+ default:
+ return E_FAIL;
+ }
+ if (_needWriteArchivePath)
+ {
+ AddErrorMessage(_currentArchivePath);
+ _needWriteArchivePath = false;
+ }
+ AddErrorMessage(
+ MyFormatNew(messageID,
+ #ifdef LANG
+ langID,
+ #endif
+ _currentFilePath));
+ }
+ }
+ #ifndef _SFX
+ if (_isFolder)
+ NumFolders++;
+ else
+ NumFiles++;
+ ProgressDialog.ProgressSynch.SetNumFilesCur(NumFiles);
+ #endif
+ return S_OK;
+}
+
+////////////////////////////////////////
+// IExtractCallbackUI
+
+HRESULT CExtractCallbackImp::BeforeOpen(const wchar_t *name)
+{
+ #ifndef _SFX
+ ProgressDialog.ProgressSynch.SetTitleFileName(name);
+ #endif
+ _currentArchivePath = name;
+ return S_OK;
+}
+
+HRESULT CExtractCallbackImp::SetCurrentFilePath2(const wchar_t *path)
+{
+ _currentFilePath = path;
+ #ifndef _SFX
+ ProgressDialog.ProgressSynch.SetCurrentFileName(path);
+ #endif
+ return S_OK;
+}
+
+HRESULT CExtractCallbackImp::SetCurrentFilePath(const wchar_t *path)
+{
+ #ifndef _SFX
+ if (NeedAddFile)
+ NumFiles++;
+ NeedAddFile = true;
+ ProgressDialog.ProgressSynch.SetNumFilesCur(NumFiles);
+ #endif
+ return SetCurrentFilePath2(path);
+}
+
+HRESULT CExtractCallbackImp::OpenResult(const wchar_t *name, HRESULT result, bool encrypted)
+{
+ if (result != S_OK)
+ {
+ UString message;
+ if (result == S_FALSE)
+ {
+ message = MyFormatNew(encrypted ? IDS_CANT_OPEN_ENCRYPTED_ARCHIVE : IDS_CANT_OPEN_ARCHIVE,
+ #ifdef LANG
+ (encrypted ? 0x0200060A : 0x02000609),
+ #endif
+ name);
+ }
+ else
+ {
+ message = name;
+ message += L": ";
+ UString message2;
+ if (result == E_OUTOFMEMORY)
+ message2 =
+ #ifdef LANG
+ LangString(IDS_MEM_ERROR, 0x0200060B);
+ #else
+ MyLoadStringW(IDS_MEM_ERROR);
+ #endif
+ else
+ NError::MyFormatMessage(result, message2);
+ message += message2;
+ }
+ MessageError(message);
+ NumArchiveErrors++;
+ }
+ _currentArchivePath = name;
+ _needWriteArchivePath = true;
+ return S_OK;
+}
+
+HRESULT CExtractCallbackImp::ThereAreNoFiles()
+{
+ return S_OK;
+}
+
+HRESULT CExtractCallbackImp::ExtractResult(HRESULT result)
+{
+ if (result == S_OK)
+ return result;
+ NumArchiveErrors++;
+ if (result == E_ABORT || result == ERROR_DISK_FULL)
+ return result;
+ MessageError(_currentFilePath);
+ MessageError(NError::MyFormatMessageW(result));
+ return S_OK;
+}
+
+#ifndef _NO_CRYPTO
+
+HRESULT CExtractCallbackImp::SetPassword(const UString &password)
+{
+ PasswordIsDefined = true;
+ Password = password;
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::CryptoGetTextPassword(BSTR *password)
+{
+ PasswordWasAsked = true;
+ if (!PasswordIsDefined)
+ {
+ CPasswordDialog dialog;
+ if (dialog.Create(ProgressDialog) == IDCANCEL)
+ return E_ABORT;
+ Password = dialog.Password;
+ PasswordIsDefined = true;
+ }
+ return StringToBstr(Password, password);
+}
+
+#endif
+
+// IExtractCallBack3
+STDMETHODIMP CExtractCallbackImp::AskWrite(
+ const wchar_t *srcPath, Int32 srcIsFolder,
+ const FILETIME *srcTime, const UInt64 *srcSize,
+ const wchar_t *destPath,
+ BSTR *destPathResult,
+ Int32 *writeAnswer)
+{
+ UString destPathResultTemp = destPath;
+
+ // RINOK(StringToBstr(destPath, destPathResult));
+
+ *destPathResult = 0;
+ *writeAnswer = BoolToInt(false);
+
+ UString destPathSpec = destPath;
+ UString destPathSys = destPathSpec;
+ bool srcIsFolderSpec = IntToBool(srcIsFolder);
+ CFileInfoW destFileInfo;
+ if (destFileInfo.Find(destPathSys))
+ {
+ if (srcIsFolderSpec)
+ {
+ if (!destFileInfo.IsDir())
+ {
+ UString message = UString(L"can not replace file \'")
+ + destPathSpec +
+ UString(L"\' with folder with same name");
+ RINOK(MessageError(message));
+ return E_ABORT;
+ }
+ *writeAnswer = BoolToInt(false);
+ return S_OK;
+ }
+ if (destFileInfo.IsDir())
+ {
+ UString message = UString(L"can not replace folder \'")
+ + destPathSpec +
+ UString(L"\' with file with same name");
+ RINOK(MessageError(message));
+ return E_FAIL;
+ }
+
+ switch(OverwriteMode)
+ {
+ case NExtract::NOverwriteMode::kSkipExisting:
+ return S_OK;
+ case NExtract::NOverwriteMode::kAskBefore:
+ {
+ Int32 overwiteResult;
+ RINOK(AskOverwrite(
+ destPathSpec,
+ &destFileInfo.MTime, &destFileInfo.Size,
+ srcPath,
+ srcTime, srcSize,
+ &overwiteResult));
+ switch(overwiteResult)
+ {
+ case NOverwriteAnswer::kCancel:
+ return E_ABORT;
+ case NOverwriteAnswer::kNo:
+ return S_OK;
+ case NOverwriteAnswer::kNoToAll:
+ OverwriteMode = NExtract::NOverwriteMode::kSkipExisting;
+ return S_OK;
+ case NOverwriteAnswer::kYesToAll:
+ OverwriteMode = NExtract::NOverwriteMode::kWithoutPrompt;
+ break;
+ case NOverwriteAnswer::kYes:
+ break;
+ case NOverwriteAnswer::kAutoRename:
+ OverwriteMode = NExtract::NOverwriteMode::kAutoRename;
+ break;
+ default:
+ return E_FAIL;
+ }
+ }
+ }
+ if (OverwriteMode == NExtract::NOverwriteMode::kAutoRename)
+ {
+ if (!AutoRenamePath(destPathSys))
+ {
+ UString message = UString(L"can not create name of file ")
+ + destPathSys;
+ RINOK(MessageError(message));
+ return E_ABORT;
+ }
+ destPathResultTemp = destPathSys;
+ }
+ else
+ if (!NFile::NDirectory::DeleteFileAlways(destPathSys))
+ {
+ UString message = UString(L"can not delete output file ")
+ + destPathSys;
+ RINOK(MessageError(message));
+ return E_ABORT;
+ }
+ }
+ *writeAnswer = BoolToInt(true);
+ return StringToBstr(destPathResultTemp, destPathResult);
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ExtractCallback.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ExtractCallback.h
new file mode 100644
index 000000000..ee46222a2
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ExtractCallback.h
@@ -0,0 +1,150 @@
+// ExtractCallback.h
+
+#ifndef __EXTRACTCALLBACK_H
+#define __EXTRACTCALLBACK_H
+
+#include "../Agent/IFolderArchive.h"
+#include "Common/MyString.h"
+#include "../Common/ArchiveOpenCallback.h"
+
+#ifdef _SFX
+#include "ProgressDialog.h"
+#else
+#include "ProgressDialog2.h"
+#endif
+
+#include "Windows/ResourceString.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+#ifndef _NO_CRYPTO
+#include "../../IPassword.h"
+#endif
+#include "Common/MyCom.h"
+#include "IFolder.h"
+
+class CExtractCallbackImp:
+ public IExtractCallbackUI,
+ public IOpenCallbackUI,
+ public IFolderOperationsExtractCallback,
+ // public IFolderArchiveExtractCallback, // mkultiple from IProgress
+ #ifndef _SFX
+ public ICompressProgressInfo,
+ #endif
+ #ifndef _NO_CRYPTO
+ public ICryptoGetTextPassword,
+ #endif
+ public CMyUnknownImp
+{
+public:
+ MY_QUERYINTERFACE_BEGIN2(IFolderOperationsExtractCallback)
+ MY_QUERYINTERFACE_ENTRY(IFolderArchiveExtractCallback)
+ #ifndef _SFX
+ MY_QUERYINTERFACE_ENTRY(ICompressProgressInfo)
+ #endif
+ #ifndef _NO_CRYPTO
+ MY_QUERYINTERFACE_ENTRY(ICryptoGetTextPassword)
+ #endif
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+ #ifndef _SFX
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+ #endif
+
+ INTERFACE_IProgress(;)
+ INTERFACE_IOpenCallbackUI(;)
+
+ // IFolderArchiveExtractCallback
+ // STDMETHOD(SetTotalFiles)(UInt64 total);
+ // STDMETHOD(SetCompletedFiles)(const UInt64 *value);
+ STDMETHOD(AskOverwrite)(
+ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
+ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
+ Int32 *answer);
+ STDMETHOD (PrepareOperation)(const wchar_t *name, bool isFolder, Int32 askExtractMode, const UInt64 *position);
+
+ STDMETHOD(MessageError)(const wchar_t *message);
+ STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted);
+
+ // IExtractCallbackUI
+
+ HRESULT BeforeOpen(const wchar_t *name);
+ HRESULT OpenResult(const wchar_t *name, HRESULT result, bool encrypted);
+ HRESULT ThereAreNoFiles();
+ HRESULT ExtractResult(HRESULT result);
+
+ #ifndef _NO_CRYPTO
+ HRESULT SetPassword(const UString &password);
+ #endif
+
+ // IFolderOperationsExtractCallback
+ STDMETHOD(AskWrite)(
+ const wchar_t *srcPath,
+ Int32 srcIsFolder,
+ const FILETIME *srcTime,
+ const UInt64 *srcSize,
+ const wchar_t *destPathRequest,
+ BSTR *destPathResult,
+ Int32 *writeAnswer);
+ STDMETHOD(ShowMessage)(const wchar_t *message);
+ STDMETHOD(SetCurrentFilePath)(const wchar_t *filePath);
+ STDMETHOD(SetNumFiles)(UInt64 numFiles);
+
+ // ICryptoGetTextPassword
+ #ifndef _NO_CRYPTO
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+ #endif
+
+private:
+ // bool _extractMode;
+ UString _currentArchivePath;
+ bool _needWriteArchivePath;
+
+ UString _currentFilePath;
+ bool _isFolder;
+
+ // void CreateComplexDirectory(const UStringVector &aDirPathParts);
+
+ HRESULT SetCurrentFilePath2(const wchar_t *filePath);
+ void AddErrorMessage(LPCWSTR message);
+public:
+ CProgressDialog ProgressDialog;
+ UStringVector Messages;
+ bool ShowMessages;
+ #ifndef _SFX
+ UInt64 NumFolders;
+ UInt64 NumFiles;
+ bool NeedAddFile;
+ #endif
+ HWND ParentWindow;
+ INT_PTR StartProgressDialog(const UString &title)
+ {
+ return ProgressDialog.Create(title, ParentWindow);
+ }
+ UInt32 NumArchiveErrors;
+ NExtract::NOverwriteMode::EEnum OverwriteMode;
+
+ #ifndef _NO_CRYPTO
+ bool PasswordIsDefined;
+ bool PasswordWasAsked;
+ UString Password;
+ #endif
+
+ CExtractCallbackImp():
+ #ifndef _NO_CRYPTO
+ PasswordIsDefined(false),
+ PasswordWasAsked(false),
+ #endif
+ OverwriteMode(NExtract::NOverwriteMode::kAskBefore),
+ ParentWindow(0),
+ ShowMessages(true)
+ {}
+
+ ~CExtractCallbackImp();
+ void Init();
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FM.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FM.cpp
new file mode 100644
index 000000000..6c81d4b60
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FM.cpp
@@ -0,0 +1,914 @@
+// FM.cpp
+
+#include "StdAfx.h"
+
+#include "resource.h"
+#include "Panel.h"
+
+extern "C"
+{
+ #include "../../../../C/Alloc.h"
+}
+
+#include "Common/Defs.h"
+#include "Common/StringConvert.h"
+// #include "Common/CommandLineParser.h"
+
+// FIXME #include "Windows/Control/Toolbar.h"
+#include "Windows/Error.h"
+#include "Windows/COM.h"
+#include "Windows/DLL.h"
+// FIXME #include "Windows/Security.h"
+// FIXME #include "Windows/MemoryLock.h"
+
+#include "ViewSettings.h"
+#include "../GUI/ExtractRes.h"
+
+#include "App.h"
+#include "StringUtils.h"
+
+#include "MyLoadMenu.h"
+#include "LangUtils.h"
+#include "FormatUtils.h"
+#include "RegistryUtils.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NFind;
+// using namespace NCommandLineParser;
+
+#define MAX_LOADSTRING 100
+
+#define MENU_HEIGHT 26
+
+#ifndef _UNICODE
+bool g_IsNT = false;
+#endif
+HINSTANCE g_hInstance;
+HWND g_HWND;
+bool g_OpenArchive = false;
+static UString g_MainPath;
+
+const int kNumDefaultPanels = 1;
+
+const int kSplitterWidth = 4;
+int kSplitterRateMax = 1 << 16;
+
+// bool OnMenuCommand(HWND hWnd, int id);
+
+static void local_WM_CREATE(HWND hWnd);
+
+#ifdef _WIN32
+static UString GetProgramPath()
+{
+ UString s;
+ NDLL::MyGetModuleFileName(g_hInstance, s);
+ return s;
+}
+
+UString GetProgramFolderPrefix()
+{
+ UString path = GetProgramPath();
+ int pos = path.ReverseFind(WCHAR_PATH_SEPARATOR);
+ return path.Left(pos + 1);
+}
+
+
+class CSplitterPos
+{
+ int _ratio; // 10000 is max
+ int _pos;
+ int _fullWidth;
+ void SetRatioFromPos(HWND hWnd)
+ { _ratio = (_pos + kSplitterWidth / 2) * kSplitterRateMax /
+ MyMax(GetWidth(hWnd), 1); }
+public:
+ int GetPos() const
+ { return _pos; }
+ int GetWidth(HWND hWnd) const
+ {
+ RECT rect;
+ ::GetClientRect(hWnd, &rect);
+ return rect.right;
+ }
+ void SetRatio(HWND hWnd, int aRatio)
+ {
+ _ratio = aRatio;
+ SetPosFromRatio(hWnd);
+ }
+ void SetPosPure(HWND hWnd, int pos)
+ {
+ int posMax = GetWidth(hWnd) - kSplitterWidth;
+ if (pos > posMax)
+ pos = posMax;
+ if (pos < 0)
+ pos = 0;
+ _pos = pos;
+ }
+ void SetPos(HWND hWnd, int pos)
+ {
+ _fullWidth = GetWidth(hWnd);
+ SetPosPure(hWnd, pos);
+ SetRatioFromPos(hWnd);
+ }
+ void SetPosFromRatio(HWND hWnd)
+ {
+ int fullWidth = GetWidth(hWnd);
+ if (_fullWidth != fullWidth)
+ {
+ _fullWidth = fullWidth;
+ SetPosPure(hWnd, GetWidth(hWnd) * _ratio / kSplitterRateMax - kSplitterWidth / 2);
+ }
+ }
+};
+#endif
+
+bool g_CanChangeSplitter = false;
+UINT32 g_SplitterPos = 0;
+// FIXME CSplitterPos g_Splitter;
+bool g_PanelsInfoDefined = false;
+
+int g_StartCaptureMousePos;
+int g_StartCaptureSplitterPos;
+
+CApp g_App;
+
+void MoveSubWindows(HWND hWnd);
+void OnSize(HWND hWnd);
+
+// FIXME LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
+
+const wchar_t *kWindowClass = L"FM";
+
+#ifndef _UNICODE
+static bool IsItWindowsNT()
+{
+ OSVERSIONINFO versionInfo;
+ versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
+ if (!::GetVersionEx(&versionInfo))
+ return false;
+ return (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT);
+}
+#endif
+
+// FUNCTION: InitInstance(HANDLE, int)
+BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
+{
+ CWindow wnd;
+
+ g_hInstance = hInstance;
+
+ ReloadLangSmart();
+
+ // LoadString(hInstance, IDS_CLASS, windowClass, MAX_LOADSTRING);
+
+ // LoadString(hInstance, IDS_APP_TITLE, title, MAX_LOADSTRING);
+ UString title = LangString(IDS_APP_TITLE, 0x03000000);
+
+ /*
+ //If it is already running, then focus on the window
+ hWnd = FindWindow(windowClass, title);
+ if (hWnd)
+ {
+ SetForegroundWindow ((HWND) (((DWORD)hWnd) | 0x01));
+ return 0;
+ }
+ */
+
+#ifdef _WIN32
+ WNDCLASSW wc;
+
+ // wc.style = CS_HREDRAW | CS_VREDRAW;
+ wc.style = 0;
+ wc.lpfnWndProc = (WNDPROC) WndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = hInstance;
+ wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_FAM));
+
+ // wc.hCursor = LoadCursor (NULL, IDC_ARROW);
+ wc.hCursor = ::LoadCursor(0, IDC_SIZEWE);
+ // wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
+ wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
+
+ wc.lpszMenuName = MAKEINTRESOURCEW(IDM_MENU);
+ wc.lpszClassName = kWindowClass;
+
+ MyRegisterClass(&wc);
+
+ // RECT rect;
+ // GetClientRect(hWnd, &rect);
+
+ DWORD style = WS_OVERLAPPEDWINDOW;
+ // DWORD style = 0;
+
+ RECT rect;
+ bool maximized = false;
+ int x , y, xSize, ySize;
+ x = y = xSize = ySize = CW_USEDEFAULT;
+ bool windowPosIsRead = ReadWindowSize(rect, maximized);
+
+ if (windowPosIsRead)
+ {
+ // x = rect.left;
+ // y = rect.top;
+ xSize = rect.right - rect.left;
+ ySize = rect.bottom - rect.top;
+ }
+#endif
+
+ UINT32 numPanels, currentPanel;
+ g_PanelsInfoDefined = ReadPanelsInfo(numPanels, currentPanel, g_SplitterPos);
+ if (g_PanelsInfoDefined)
+ {
+ if (numPanels < 1 || numPanels > 2)
+ numPanels = kNumDefaultPanels;
+ if (currentPanel >= 2)
+ currentPanel = 0;
+ }
+ else
+ {
+ numPanels = kNumDefaultPanels;
+ currentPanel = 0;
+ }
+ g_App.NumPanels = numPanels;
+ g_App.LastFocusedPanel = currentPanel;
+
+#ifdef _WIN32 // FIXME
+ if (!wnd.Create(kWindowClass, title, style,
+ x, y, xSize, ySize, NULL, NULL, hInstance, NULL))
+ return FALSE;
+ g_HWND = (HWND)wnd;
+#else
+ {
+ extern HWND myCreateAndShowMainWindow(LPCTSTR title,void (*fct)(HWND));
+ g_HWND = myCreateAndShowMainWindow(title,local_WM_CREATE);
+ }
+#endif
+
+#ifdef _WIN32
+ WINDOWPLACEMENT placement;
+ placement.length = sizeof(placement);
+ if (wnd.GetPlacement(&placement))
+ {
+ if (nCmdShow == SW_SHOWNORMAL || nCmdShow == SW_SHOW ||
+ nCmdShow == SW_SHOWDEFAULT)
+ {
+ if (maximized)
+ placement.showCmd = SW_SHOWMAXIMIZED;
+ else
+ placement.showCmd = SW_SHOWNORMAL;
+ }
+ else
+ placement.showCmd = nCmdShow;
+ if (windowPosIsRead)
+ placement.rcNormalPosition = rect;
+ wnd.SetPlacement(&placement);
+ // window.Show(nCmdShow);
+ }
+ else
+ wnd.Show(nCmdShow);
+#endif
+ return TRUE;
+}
+
+/*
+static void GetCommands(const UString &aCommandLine, UString &aCommands)
+{
+ UString aProgramName;
+ aCommands.Empty();
+ bool aQuoteMode = false;
+ for (int i = 0; i < aCommandLine.Length(); i++)
+ {
+ wchar_t aChar = aCommandLine[i];
+ if (aChar == L'\"')
+ aQuoteMode = !aQuoteMode;
+ else if (aChar == L' ' && !aQuoteMode)
+ {
+ if (!aQuoteMode)
+ {
+ i++;
+ break;
+ }
+ }
+ else
+ aProgramName += aChar;
+ }
+ aCommands = aCommandLine.Mid(i);
+}
+*/
+
+#ifdef _WIN32
+DWORD GetDllVersion(LPCTSTR lpszDllName)
+{
+ HINSTANCE hinstDll;
+ DWORD dwVersion = 0;
+ hinstDll = LoadLibrary(lpszDllName);
+ if(hinstDll)
+ {
+ DLLGETVERSIONPROC pDllGetVersion;
+ pDllGetVersion = (DLLGETVERSIONPROC) GetProcAddress(hinstDll, "DllGetVersion");
+
+ /*Because some DLLs might not implement this function, you
+ must test for it explicitly. Depending on the particular
+ DLL, the lack of a DllGetVersion function can be a useful
+ indicator of the version.
+ */
+ if(pDllGetVersion)
+ {
+ DLLVERSIONINFO dvi;
+ HRESULT hr;
+
+ ZeroMemory(&dvi, sizeof(dvi));
+ dvi.cbSize = sizeof(dvi);
+
+ hr = (*pDllGetVersion)(&dvi);
+
+ if(SUCCEEDED(hr))
+ {
+ dwVersion = MAKELONG(dvi.dwMinorVersion, dvi.dwMajorVersion);
+ }
+ }
+ FreeLibrary(hinstDll);
+ }
+ return dwVersion;
+}
+
+DWORD g_ComCtl32Version;
+#endif
+
+/*
+#ifndef _WIN64
+typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
+
+static bool IsWow64()
+{
+ LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(
+ GetModuleHandle("kernel32"), "IsWow64Process");
+ if (fnIsWow64Process == NULL)
+ return false;
+ BOOL isWow;
+ if (!fnIsWow64Process(GetCurrentProcess(),&isWow))
+ return false;
+ return isWow != FALSE;
+}
+#endif
+*/
+
+#ifdef _WIN32
+bool IsLargePageSupported()
+{
+ #ifdef _WIN64
+ return true;
+ #else
+ OSVERSIONINFO versionInfo;
+ versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
+ if (!::GetVersionEx(&versionInfo))
+ return false;
+ if (versionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || versionInfo.dwMajorVersion < 5)
+ return false;
+ if (versionInfo.dwMajorVersion > 5)
+ return true;
+ if (versionInfo.dwMinorVersion < 1)
+ return false;
+ if (versionInfo.dwMinorVersion > 1)
+ return true;
+ // return IsWow64();
+ return false;
+ #endif
+}
+
+static void SetMemoryLock()
+{
+ if (!IsLargePageSupported())
+ return;
+ // if (ReadLockMemoryAdd())
+ NSecurity::AddLockMemoryPrivilege();
+
+ if (ReadLockMemoryEnable())
+ NSecurity::EnableLockMemoryPrivilege();
+}
+#endif
+
+/*
+static const int kNumSwitches = 1;
+
+namespace NKey {
+enum Enum
+{
+ kOpenArachive = 0,
+};
+
+}
+
+static const CSwitchForm kSwitchForms[kNumSwitches] =
+ {
+ { L"SOA", NSwitchType::kSimple, false },
+ };
+*/
+
+// int APIENTRY WinMain2(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, LPSTR /* lpCmdLine */, int /* nCmdShow */);
+
+#ifdef _WIN32
+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, LPSTR /* lpCmdLine */, int nCmdShow)
+{
+ #ifndef _UNICODE
+ g_IsNT = IsItWindowsNT();
+ #endif
+
+ #ifdef _WIN32
+ SetLargePageSize();
+ #endif
+
+ InitCommonControls();
+
+ g_ComCtl32Version = ::GetDllVersion(TEXT("comctl32.dll"));
+
+ // OleInitialize is required for drag and drop.
+ OleInitialize(NULL);
+ // Maybe needs CoInitializeEx also ?
+ // NCOM::CComInitializer comInitializer;
+
+ UString programString, commandsString;
+ // MessageBoxW(0, GetCommandLineW(), L"", 0);
+ SplitStringToTwoStrings(GetCommandLineW(), programString, commandsString);
+
+ commandsString.Trim();
+ UString paramString, tailString;
+ SplitStringToTwoStrings(commandsString, paramString, tailString);
+ paramString.Trim();
+
+ if (!paramString.IsEmpty())
+ {
+ g_MainPath = paramString;
+ // return WinMain2(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
+
+ // MessageBoxW(0, paramString, L"", 0);
+ }
+ /*
+ UStringVector commandStrings;
+ NCommandLineParser::SplitCommandLine(GetCommandLineW(), commandStrings);
+ NCommandLineParser::CParser parser(kNumSwitches);
+ try
+ {
+ parser.ParseStrings(kSwitchForms, commandStrings);
+ const UStringVector &nonSwitchStrings = parser.NonSwitchStrings;
+ if(nonSwitchStrings.Size() > 1)
+ {
+ g_MainPath = nonSwitchStrings[1];
+ // g_OpenArchive = parser[NKey::kOpenArachive].ThereIs;
+ CFileInfoW fileInfo;
+ if (FindFile(g_MainPath, fileInfo))
+ {
+ if (!fileInfo.IsDir())
+ g_OpenArchive = true;
+ }
+ }
+ }
+ catch(...) { }
+ */
+
+
+ SetMemoryLock();
+
+ MSG msg;
+ if (!InitInstance (hInstance, nCmdShow))
+ return FALSE;
+
+ MyLoadMenu(g_HWND);
+
+ #ifndef _UNICODE
+ if (g_IsNT)
+ {
+ HACCEL hAccels = LoadAcceleratorsW(hInstance, MAKEINTRESOURCEW(IDR_ACCELERATOR1));
+ while (GetMessageW(&msg, NULL, 0, 0))
+ {
+ if (TranslateAcceleratorW(g_HWND, hAccels, &msg) == 0)
+ {
+ TranslateMessage(&msg);
+ DispatchMessageW(&msg);
+ }
+ }
+ }
+ else
+ #endif
+ {
+ HACCEL hAccels = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ACCELERATOR1));
+ while (GetMessage(&msg, NULL, 0, 0))
+ {
+ if (TranslateAccelerator(g_HWND, hAccels, &msg) == 0)
+ {
+ // if (g_Hwnd != NULL || !IsDialogMessage(g_Hwnd, &msg))
+ // if (!IsDialogMessage(g_Hwnd, &msg))
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+ }
+
+ g_HWND = 0;
+ OleUninitialize();
+ return (int)msg.wParam;
+}
+
+static void SaveWindowInfo(HWND aWnd)
+{
+ /*
+ RECT rect;
+ if (!::GetWindowRect(aWnd, &rect))
+ return;
+ */
+ WINDOWPLACEMENT placement;
+ placement.length = sizeof(placement);
+ if (!::GetWindowPlacement(aWnd, &placement))
+ return;
+ SaveWindowSize(placement.rcNormalPosition,
+ BOOLToBool(::IsZoomed(aWnd)));
+ SavePanelsInfo(g_App.NumPanels, g_App.LastFocusedPanel,
+ g_Splitter.GetPos());
+}
+#else
+int Main1(int argc,TCHAR **argv)
+{
+ if (argc >= 2)
+ {
+ g_MainPath = argv[1];
+ }
+
+ if (!InitInstance (0, 0))
+ return FALSE;
+
+ MyLoadMenu(g_HWND);
+
+ // FIXME : install Accelerators ?
+
+ return 0;
+}
+
+#endif
+
+void ExecuteCommand(UINT commandID)
+{
+ printf("FM - ExecuteCommand(%d)\n",commandID);
+ switch (commandID)
+ {
+ case kAddCommand:
+ g_App.AddToArchive();
+ break;
+ case kExtractCommand:
+ g_App.ExtractArchives();
+ break;
+ case kTestCommand:
+ g_App.TestArchives();
+ break;
+ }
+}
+
+#ifdef _WIN32
+LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ int wmId, wmEvent;
+ switch (message)
+ {
+ case WM_COMMAND:
+ wmId = LOWORD(wParam);
+ wmEvent = HIWORD(wParam);
+ if ((HWND) lParam != NULL && wmEvent != 0)
+ break;
+ if (wmId >= kToolbarStartID)
+ {
+ ExecuteCommand(wmId);
+ return 0;
+ }
+ if (OnMenuCommand(hWnd, wmId))
+ return 0;
+ break;
+ case WM_INITMENUPOPUP:
+ OnMenuActivating(hWnd, HMENU(wParam), LOWORD(lParam));
+ break;
+
+ /*
+ It doesn't help
+ case WM_EXITMENULOOP:
+ {
+ OnMenuUnActivating(hWnd);
+ break;
+ }
+ case WM_UNINITMENUPOPUP:
+ OnMenuUnActivating(hWnd, HMENU(wParam), lParam);
+ break;
+ */
+
+ case WM_CREATE:
+ {
+
+ /*
+ INITCOMMONCONTROLSEX icex;
+ icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+ icex.dwICC = ICC_BAR_CLASSES;
+ InitCommonControlsEx(&icex);
+
+ // Toolbar buttons used to create the first 4 buttons.
+ TBBUTTON tbb [ ] =
+ {
+ // {0, 0, TBSTATE_ENABLED, BTNS_SEP, 0L, 0},
+ // {VIEW_PARENTFOLDER, kParentFolderID, TBSTATE_ENABLED, BTNS_BUTTON, 0L, 0},
+ // {0, 0, TBSTATE_ENABLED, BTNS_SEP, 0L, 0},
+ {VIEW_NEWFOLDER, ID_FILE_CREATEFOLDER, TBSTATE_ENABLED, BTNS_BUTTON, 0L, 0},
+ };
+
+ int baseID = 100;
+ NWindows::NControl::CToolBar aToolBar;
+ aToolBar.Attach(::CreateToolbarEx (hWnd,
+ WS_CHILD | WS_BORDER | WS_VISIBLE | TBSTYLE_TOOLTIPS, // | TBSTYLE_FLAT
+ baseID + 2, 11,
+ (HINSTANCE)HINST_COMMCTRL, IDB_VIEW_SMALL_COLOR,
+ (LPCTBBUTTON)&tbb, sizeof(tbb) / sizeof(tbb[0]),
+ 0, 0, 100, 30, sizeof (TBBUTTON)));
+ */
+ // HCURSOR cursor = ::LoadCursor(0, IDC_SIZEWE);
+ // ::SetCursor(cursor);
+
+ if (g_PanelsInfoDefined)
+ g_Splitter.SetPos(hWnd, g_SplitterPos);
+ else
+ {
+ g_Splitter.SetRatio(hWnd, kSplitterRateMax / 2);
+ g_SplitterPos = g_Splitter.GetPos();
+ }
+
+ RECT rect;
+ ::GetClientRect(hWnd, &rect);
+ int xSize = rect.right;
+ int xSizes[2];
+ xSizes[0] = g_Splitter.GetPos();
+ xSizes[1] = xSize - kSplitterWidth - xSizes[0];
+ if (xSizes[1] < 0)
+ xSizes[1] = 0;
+
+ g_App.CreateDragTarget();
+ bool archiveIsOpened;
+ bool encrypted;
+ bool needOpenFile = false;
+ if (!g_MainPath.IsEmpty() /* && g_OpenArchive */)
+ {
+ NFile::NFind::CFileInfoW fileInfo;
+ if (NFile::NFind::FindFile(g_MainPath, fileInfo))
+ if (!fileInfo.IsDir())
+ needOpenFile = true;
+ }
+ g_App.Create(hWnd, g_MainPath, xSizes, archiveIsOpened, encrypted);
+
+ if (needOpenFile && !archiveIsOpened)
+ {
+ UString message;
+ if (encrypted)
+ message = MyFormatNew(IDS_CANT_OPEN_ENCRYPTED_ARCHIVE, 0x0200060A, g_MainPath);
+ else
+ message = MyFormatNew(IDS_CANT_OPEN_ARCHIVE, 0x02000609, g_MainPath);
+ MessageBoxW(0, message, L"7-zip", MB_ICONERROR);
+ return -1;
+ }
+ // g_SplitterPos = 0;
+
+ // ::DragAcceptFiles(hWnd, TRUE);
+ RegisterDragDrop(hWnd, g_App._dropTarget);
+
+ break;
+ }
+ case WM_DESTROY:
+ {
+ // ::DragAcceptFiles(hWnd, FALSE);
+ RevokeDragDrop(hWnd);
+ g_App._dropTarget.Release();
+
+ g_App.Save();
+ g_App.Release();
+ SaveWindowInfo(hWnd);
+ PostQuitMessage(0);
+ break;
+ }
+ /*
+ case WM_MOVE:
+ {
+ break;
+ }
+ */
+ case WM_LBUTTONDOWN:
+ g_StartCaptureMousePos = LOWORD(lParam);
+ g_StartCaptureSplitterPos = g_Splitter.GetPos();
+ ::SetCapture(hWnd);
+ break;
+ case WM_LBUTTONUP:
+ {
+ ::ReleaseCapture();
+ break;
+ }
+ case WM_MOUSEMOVE:
+ {
+ if ((wParam & MK_LBUTTON) != 0 && ::GetCapture() == hWnd)
+ {
+ g_Splitter.SetPos(hWnd, g_StartCaptureSplitterPos +
+ (short)LOWORD(lParam) - g_StartCaptureMousePos);
+ MoveSubWindows(hWnd);
+ }
+ break;
+ }
+
+ case WM_SIZE:
+ {
+ if (g_CanChangeSplitter)
+ g_Splitter.SetPosFromRatio(hWnd);
+ else
+ {
+ g_Splitter.SetPos(hWnd, g_SplitterPos );
+ g_CanChangeSplitter = true;
+ }
+
+ OnSize(hWnd);
+ /*
+ int xSize = LOWORD(lParam);
+ int ySize = HIWORD(lParam);
+ // int xSplitter = 2;
+ int xWidth = g_SplitPos;
+ // int xSplitPos = xWidth;
+ g_Panel[0]._listView.MoveWindow(0, 0, xWidth, ySize);
+ g_Panel[1]._listView.MoveWindow(xSize - xWidth, 0, xWidth, ySize);
+ */
+ return 0;
+ break;
+ }
+ case WM_SETFOCUS:
+ // g_App.SetFocus(g_App.LastFocusedPanel);
+ g_App.SetFocusToLastItem();
+ break;
+ /*
+ case WM_ACTIVATE:
+ {
+ int fActive = LOWORD(wParam);
+ switch (fActive)
+ {
+ case WA_INACTIVE:
+ {
+ // g_FocusIndex = g_App.LastFocusedPanel;
+ // g_App.LastFocusedPanel = g_App.GetFocusedPanelIndex();
+ // return 0;
+ }
+ }
+ break;
+ }
+ */
+ /*
+ case kLangWasChangedMessage:
+ MyLoadMenu(g_HWND);
+ return 0;
+ */
+
+ /*
+ case WM_SETTINGCHANGE:
+ break;
+ */
+ case WM_NOTIFY:
+ {
+ g_App.OnNotify((int)wParam, (LPNMHDR)lParam);
+ break;
+ }
+ /*
+ case WM_DROPFILES:
+ {
+ g_App.GetFocusedPanel().CompressDropFiles((HDROP)wParam);
+ return 0 ;
+ }
+ */
+ }
+ #ifndef _UNICODE
+ if (g_IsNT)
+ return DefWindowProcW(hWnd, message, wParam, lParam);
+ else
+ #endif
+ return DefWindowProc(hWnd, message, wParam, lParam);
+
+}
+
+void OnSize(HWND hWnd)
+{
+ /*
+ if (g_App._rebar)
+ {
+ RECT rect;
+ ::GetClientRect(hWnd, &rect);
+ int xSize = rect.right;
+ int ySize = rect.bottom;
+ // rect.bottom = 0;
+ // g_App._rebar.SizeToRect(&rect);
+ // g_App._rebar.Move(0, 0, xSize, ySize);
+ }
+ */
+ MoveSubWindows(hWnd);
+}
+
+int Window_GetRealHeight(NWindows::CWindow &w)
+{
+ RECT rect;
+ WINDOWPLACEMENT placement;
+ w.GetWindowRect(&rect);
+ int res = rect.bottom - rect.top;
+ if (w.GetPlacement(&placement))
+ res += placement.rcNormalPosition.top;
+ return res;
+}
+#else // _WIN32
+static void local_WM_CREATE(HWND hWnd)
+ {
+ printf("**local_WM_CREATE**\n");
+#if 0
+ if (g_PanelsInfoDefined)
+ g_Splitter.SetPos(hWnd, g_SplitterPos);
+ else
+ {
+ g_Splitter.SetRatio(hWnd, kSplitterRateMax / 2);
+ g_SplitterPos = g_Splitter.GetPos();
+ }
+
+ RECT rect;
+ ::GetClientRect(hWnd, &rect);
+ int xSize = rect.right;
+ int xSizes[2];
+ xSizes[0] = g_Splitter.GetPos();
+ xSizes[1] = xSize - kSplitterWidth - xSizes[0];
+ if (xSizes[1] < 0)
+ xSizes[1] = 0;
+
+ g_App.CreateDragTarget();
+#else
+ int xSizes[2] = { 0,0 };
+#endif
+ bool archiveIsOpened;
+ bool encrypted;
+ bool needOpenFile = false;
+ if (!g_MainPath.IsEmpty() /* && g_OpenArchive */)
+ {
+ NFile::NFind::CFileInfoW fileInfo;
+ if (NFile::NFind::FindFile(g_MainPath, fileInfo))
+ if (!fileInfo.IsDir())
+ needOpenFile = true;
+ }
+ g_App.Create(hWnd, g_MainPath, xSizes, archiveIsOpened, encrypted);
+
+ if (needOpenFile && !archiveIsOpened)
+ {
+ UString message;
+ if (encrypted)
+ message = MyFormatNew(IDS_CANT_OPEN_ENCRYPTED_ARCHIVE, 0x0200060A, g_MainPath);
+ else
+ message = MyFormatNew(IDS_CANT_OPEN_ARCHIVE, 0x02000609, g_MainPath);
+ MessageBoxW(0, message, L"7-zip", MB_ICONERROR);
+ return ;// -1;
+ }
+ // g_SplitterPos = 0;
+
+ // FIXME RegisterDragDrop(hWnd, g_App._dropTarget);
+
+}
+
+void main_WM_DESTROY()
+{
+ // RevokeDragDrop(hWnd);
+ // g_App._dropTarget.Release();
+printf("main_WM_DESTROY\n");
+ g_App.Save();
+ g_App.Release();
+ // SaveWindowInfo(hWnd);
+ // PostQuitMessage(0);
+}
+#endif
+
+void MoveSubWindows(HWND hWnd)
+{
+#ifdef _WIN32
+ RECT rect;
+ ::GetClientRect(hWnd, &rect);
+ int xSize = rect.right;
+ int headerSize = 0;
+ if (g_App._rebar)
+ headerSize = Window_GetRealHeight(g_App._rebar);
+ int ySize = MyMax((int)(rect.bottom - headerSize), 0);
+
+ if (g_App.NumPanels > 1)
+ {
+ g_App.Panels[0].Move(0, headerSize, g_Splitter.GetPos(), ySize);
+ int xWidth1 = g_Splitter.GetPos() + kSplitterWidth;
+ g_App.Panels[1].Move(xWidth1, headerSize, xSize - xWidth1, ySize);
+ }
+ else
+ {
+ /*
+ int otherPanel = 1 - g_App.LastFocusedPanel;
+ if (g_App.PanelsCreated[otherPanel])
+ g_App.Panels[otherPanel].Move(0, headerSize, 0, ySize);
+ */
+ g_App.Panels[g_App.LastFocusedPanel].Move(0, headerSize, xSize, ySize);
+ }
+#endif
+}
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FM_rc.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FM_rc.cpp
new file mode 100644
index 000000000..53d242c6a
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FM_rc.cpp
@@ -0,0 +1,970 @@
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+#include "wx/mimetype.h"
+#include "wx/artprov.h"
+#include "wx/imaglist.h"
+
+#include "resource.h"
+
+#include "App.h"
+
+#include "Windows/Control/DialogImpl.h"
+#include "Windows/Control/ListView.h"
+#include "Windows/Control/Window2.h"
+
+// FIXME
+#undef IDCLOSE
+#define IDCLOSE wxID_EXIT
+
+#define static const
+#include "../GUI/p7zip_32.xpm"
+#undef static
+
+extern HWND g_HWND;
+
+#define BASE_ID_PANEL_1 (1000 + 100 * 0)
+#define BASE_ID_PANEL_2 (1000 + 100 * 1)
+
+////////////////////////////////////// Tool bar images
+#include "res/AddPNG.h"
+#include "res/Add2PNG.h"
+#include "res/ExtractPNG.h"
+#include "res/Extract2PNG.h"
+#include "res/TestPNG.h"
+#include "res/Test2PNG.h"
+#include "res/CopyPNG.h"
+#include "res/Copy2PNG.h"
+#include "res/MovePNG.h"
+#include "res/Move2PNG.h"
+#include "res/DeletePNG.h"
+#include "res/Delete2PNG.h"
+#include "res/InfoPNG.h"
+#include "res/Info2PNG.h"
+
+#include <wx/mstream.h>
+#define wxGetBitmapFromMemory(name) _wxGetBitmapFromMemory(name ## _png, sizeof(name ## _png))
+
+static inline wxBitmap _wxGetBitmapFromMemory(const unsigned char *data, int length) {
+ wxMemoryInputStream is(data, length);
+ return wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1);
+}
+
+///////////////////////////////////// SevenZipPanel.h /////////////////////
+
+#include <wx/listctrl.h>
+
+typedef wxListCtrl CExplorerListCtrl;
+
+class MyFrame;
+
+class SevenZipPanel : public wxPanel
+{
+ static int count;
+
+ CExplorerListCtrl *m_pListCtrlExplorer;
+ NWindows::NControl::CWindow2 *_wList;
+
+
+ wxBitmapButton *m_pBmpButtonParentFolder;
+ wxComboBox *m_pComboBoxPath;
+ wxStatusBar *m_pStatusBar;
+
+ MyFrame *m_frame;
+
+ wxImageList imgList;
+
+ int _panelIndex;
+
+ // wxString m_currentDirectory;
+
+ // int m_nbDirs;
+
+ // wxString m_prompt;
+
+public:
+ SevenZipPanel(MyFrame *frame, wxWindow *parent,int id,int panelIndex);
+
+ void registerWindow2(NWindows::NControl::CWindow2 *w)
+ {
+ _wList = w;
+ _wList->OnMessage(WM_CREATE,0,0);
+ }
+
+ void OnAnyButton( wxCommandEvent &event );
+ void OnSelected(wxListEvent& event);
+ void OnDeselected(wxListEvent& event);
+ void OnActivated(wxListEvent& event);
+ void OnFocused(wxListEvent& event);
+ void OnLeftDownBeginDrag(wxListEvent& event);
+ void OnRightClick(wxListEvent& event);
+ void OnColumnClick(wxListEvent& event);
+
+ void OnLeftDown(wxMouseEvent &event );
+ void OnRightDown(wxMouseEvent &event );
+
+ void WriteText(const wxString& text) {
+ printf("DEBUG : %ls\n",(const wchar_t *)text);
+ }
+
+ /* Don't work ...
+ void OnCloseWindow(wxCloseEvent& WXUNUSED(event)) {
+ _wList->OnDestroy();
+ }
+ */
+
+ void evt_destroy() {
+ _wList->OnDestroy();
+ }
+
+
+private:
+ DECLARE_EVENT_TABLE()
+};
+
+
+
+///////////////////////////////////// SevenZipPanel.h /////////////////////
+
+
+
+class MyFrame: public wxFrame
+{
+public:
+ // ctor
+ MyFrame(void (*fct)(HWND),wxFrame *frame, const wxString& title, int x, int y, int w, int h);
+ // virtual ~MyFrame();
+
+ void registerWindow2(int baseID,NWindows::NControl::CWindow2 *w)
+ {
+ printf("MyFrame::registerWindow2(%d,%p)\n",baseID,w);
+ switch (baseID)
+ {
+ case BASE_ID_PANEL_1: _panel1->registerWindow2(w); break;
+ case BASE_ID_PANEL_2: _panel2->registerWindow2(w); break;
+ default: printf("FIXME - MyFrame::registerWindow2\n");
+ }
+ }
+
+ void PopulateToolbar(wxToolBar* toolBar);
+ void RecreateToolbar();
+
+
+protected:
+ // callbacks
+ void OnWorkerEvent(wxCommandEvent& event);
+ void OnAnyMenu(wxCommandEvent& event)
+ {
+ extern bool OnMenuCommand(HWND hWnd, int id);
+ extern void ExecuteCommand(UINT commandID);
+
+ int wmId = event.GetId();
+
+ if (wmId >= kToolbarStartID)
+ {
+ ExecuteCommand(wmId);
+ return ; // 0;
+ }
+ OnMenuCommand(this, wmId);
+ }
+ void OnCloseWindow(wxCloseEvent& WXUNUSED(event))
+ {
+ if (_panel1) _panel1->evt_destroy();
+ if (_panel2) _panel2->evt_destroy();
+
+ extern void main_WM_DESTROY();
+ main_WM_DESTROY();
+ Destroy();
+ }
+private:
+ SevenZipPanel * _panel1;
+ SevenZipPanel * _panel2;
+ DECLARE_EVENT_TABLE()
+};
+
+enum {
+ WORKER_EVENT=100 // this one gets sent from the worker thread
+};
+
+BEGIN_EVENT_TABLE(MyFrame, wxFrame)
+ EVT_MENU(WORKER_EVENT, MyFrame::OnWorkerEvent)
+ EVT_MENU(wxID_ANY, MyFrame::OnAnyMenu)
+ EVT_CLOSE(MyFrame::OnCloseWindow)
+END_EVENT_TABLE()
+
+// My frame constructor
+MyFrame::MyFrame(void (*wm_create)(HWND),wxFrame *frame, const wxString& title,
+ int x, int y, int w, int h)
+ : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
+{
+printf("===MyFrame::MyFrame===BEGIN===\n");
+
+ this->SetIcon(wxICON(p7zip_32));
+
+ g_HWND = this; // FIXME
+
+ wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
+
+ _panel1 = new SevenZipPanel(this,this,BASE_ID_PANEL_1,0); // FIXME panelIndex = 0
+ _panel2 = 0;
+ topsizer->Add(
+ _panel1,
+ 1, // make vertically stretchable
+ wxEXPAND | // make horizontally stretchable
+ wxALL, // and make border all around
+ 0 ); // set border width to 10
+
+ // Create the toolbar
+ // FIXME RecreateToolbar();
+printf("===MyFrame::MyFrame===WM_CREATE===\n");
+ wm_create(this);
+
+ // Create the toolbar // FIXME
+ RecreateToolbar();
+
+
+printf("===MyFrame::MyFrame===SIZER===\n");
+
+ SetSizer( topsizer ); // use the sizer for layout
+
+ topsizer->SetSizeHints( this ); // set size hints to honour minimum size
+printf("===MyFrame::MyFrame===END===\n");
+}
+
+void myCreateHandle(int n);
+void MyFrame::OnWorkerEvent(wxCommandEvent& event)
+{
+ int n = event.GetInt();
+ myCreateHandle(n);
+}
+
+wxWindow * g_window=0;
+HWND myCreateAndShowMainWindow(LPCTSTR title,void (*fct)(HWND))
+{
+ MyFrame *frame = new MyFrame(fct,(wxFrame *)NULL, title, 50, 50, 450, 340);
+ // Don't Show the frame !
+ frame->Show(true); // FIXME
+
+ // FIXME : SetTopWindow(g_HWND);
+
+ g_window = frame;
+
+ return frame;
+}
+
+
+class myToolBar
+{
+ wxToolBar * m_toolbar;
+
+ bool m_bShowText;
+
+public:
+ myToolBar(wxToolBar * toolbar,bool bShowText ) : m_toolbar(toolbar), m_bShowText(bShowText) { }
+
+ myToolBar* AddTool(int toolId, const wxString& label, const wxBitmap& bitmap1, const wxString& shortHelpString = _T(""), wxItemKind kind = wxITEM_NORMAL)
+ {
+ wxString text = wxEmptyString;
+ if (m_bShowText) text = label;
+
+ wxSize tb_size = m_toolbar->GetToolBitmapSize();
+ int tb_witdh = tb_size.GetWidth();
+ int tb_height = tb_size.GetHeight();
+
+ if ((bitmap1.GetWidth() > tb_witdh) || ( bitmap1.GetHeight()> tb_height))
+ {
+ wxBitmap bmp(bitmap1.ConvertToImage().Scale(tb_witdh, tb_height));
+ m_toolbar->AddTool(toolId,text,bmp,shortHelpString,kind);
+ }
+ else
+ {
+ m_toolbar->AddTool(toolId,text,bitmap1,shortHelpString,kind);
+ }
+
+ return this;
+ }
+
+ void SetToolBitmapSize(const wxSize& size)
+ {
+ m_toolbar->SetToolBitmapSize(size);
+ }
+
+ bool Realize()
+ {
+ return m_toolbar->Realize();
+ }
+
+ void AddSeparator() { m_toolbar->AddSeparator(); }
+};
+
+void MyFrame::PopulateToolbar(wxToolBar* p_toolBar)
+{/*
+ toolBar->AddTool(wxID_NEW, _T("New"),toolBarBitmaps[Tool_new], wxNullBitmap, wxITEM_NORMAL,
+ _T("New file"), _T("This is help for new file tool"));
+ */
+ myToolBar toolBar(p_toolBar,true);
+
+ const int kWidth = 24;
+ const int kHeight = 24;
+
+ // FIXME toolBar->SetToolBitmapSize(wxSize(24,24));
+ toolBar.SetToolBitmapSize(wxSize(kWidth,kHeight));
+ toolBar.AddTool(kAddCommand, wxT("Add"), wxGetBitmapFromMemory(ADD2));
+ toolBar.AddTool(kExtractCommand,wxT("Extract"), wxGetBitmapFromMemory(EXTRACT2));
+ toolBar.AddTool(kTestCommand, wxT("Test"), wxGetBitmapFromMemory(TEST2));
+
+ toolBar.AddSeparator();
+
+ toolBar.AddTool(IDM_COPY_TO, wxT("Copy"), wxGetBitmapFromMemory(COPY2));
+ toolBar.AddTool(IDM_MOVE_TO, wxT("Move"), wxGetBitmapFromMemory(MOVE2));
+ toolBar.AddTool(IDM_DELETE, wxT("Delete"), wxGetBitmapFromMemory(DELETE2));
+ toolBar.AddTool(IDM_FILE_PROPERTIES, wxT("Info"), wxGetBitmapFromMemory(INFO2));
+
+ ////////////////////////////////////////////////////////
+
+ /* FIXME
+ if (g_mimeDatabase)
+ {
+ toolBar.AddSeparator();
+
+ TryMime(&toolBar, _T("txt"));
+ TryMime(&toolBar, _T("rar"));
+ TryMime(&toolBar, _T("7z"));
+ }
+
+ toolBar.AddSeparator();
+
+ wxIcon i_plus = wxArtProvider::GetIcon(wxART_ADD_BOOKMARK , wxART_TOOLBAR , wxSize(kWidth,kHeight));
+ toolBar.AddTool(wxID_ANY, wxT("Add Bookmark"), i_plus);
+
+ wxIcon i_go_up_dir = wxArtProvider::GetIcon(wxART_GO_DIR_UP , wxART_TOOLBAR , wxSize(kWidth,kHeight));
+ toolBar.AddTool(wxID_ANY, wxT("Go up dir"), i_go_up_dir);
+
+ wxIcon i_folder = wxArtProvider::GetIcon(wxART_FOLDER , wxART_TOOLBAR , wxSize(kWidth,kHeight));
+ toolBar.AddTool(wxID_ANY, wxT("Folder"), i_folder);
+
+ wxIcon i_missing_image = wxArtProvider::GetIcon(wxART_MISSING_IMAGE , wxART_TOOLBAR , wxSize(kWidth,kHeight));
+ toolBar.AddTool(wxID_ANY, wxT("missing image"), i_missing_image);
+ */
+
+ ///////////////////////////////////////////////////////
+
+ toolBar.Realize();
+
+ // toolBar->SetRows(!(toolBar->IsVertical()) ? m_rows : 10 / m_rows);
+}
+void MyFrame::RecreateToolbar()
+{
+ // delete and recreate the toolbar
+ wxToolBar *toolBar = GetToolBar();
+ // long style = toolBar ? toolBar->GetWindowStyle() : TOOLBAR_STYLE;
+
+ SetToolBar(NULL);
+
+ delete toolBar;
+ /*
+ style &= ~(wxTB_HORIZONTAL | wxTB_VERTICAL | wxTB_BOTTOM | wxTB_RIGHT | wxTB_HORZ_LAYOUT);
+ switch( m_toolbarPosition )
+ {
+ case TOOLBAR_LEFT:style |= wxTB_LEFT; break;
+ case TOOLBAR_TOP: style |= wxTB_TOP;break;
+ case TOOLBAR_RIGHT:style |= wxTB_RIGHT;break;
+ case TOOLBAR_BOTTOM:style |= wxTB_BOTTOM;break;
+ }
+ */
+ long style = wxTB_FLAT | wxTB_NODIVIDER | wxTB_TEXT; // TOOLBAR_STYLE | wxTB_TOP;
+ /*
+ if ( m_showTooltips ) style &= ~wxTB_NO_TOOLTIPS;
+ else style |= wxTB_NO_TOOLTIPS;
+
+ if ( style & wxTB_TEXT && !(style & wxTB_NOICONS) && m_horzText ) style |= wxTB_HORZ_LAYOUT;
+ */
+ toolBar = CreateToolBar(style, wxID_ANY);
+
+ PopulateToolbar(toolBar);
+}
+
+void registerWindow2(int baseID,NWindows::NControl::CWindow2 *w)
+{
+ MyFrame * f = (MyFrame *) g_HWND;
+ f->registerWindow2(baseID,w);
+
+}
+
+
+/////////////////////////////////////////////////////////
+#include "LangUtils.h"
+
+static const UINT kOpenBookmarkMenuID = 730; // FIXME / duplicate
+static const UINT kSetBookmarkMenuID = 740;
+
+
+void rc_MyLoadMenu(HWND hWnd)
+{
+ wxFrame *hwnd = (wxFrame *)hWnd;
+ wxMenu *m;
+ wxMenu *m_file = m = new wxMenu;
+ {
+ m->Append(IDM_FILE_OPEN, _T("&Open\tEnter"));
+ m->Append(IDM_FILE_OPEN_INSIDE,_T("Open &Inside\tCtrl+PgDn"));
+ m->Append(IDM_FILE_OPEN_OUTSIDE,_T("Open O&utside\tShift+Enter"));
+ m->Append(IDM_FILE_EDIT,_T("&Edit\tF4"));
+ m->AppendSeparator();
+ m->Append(IDM_RENAME,_T("Rena&me\tF2"));
+ m->Append(IDM_COPY_TO,_T("&Copy To...\tF5"));
+ m->Append(IDM_MOVE_TO,_T("&Move To...\tF6"));
+ m->Append(IDM_DELETE,_T("&Delete\tDel"));
+ m->AppendSeparator();
+ m->Append(IDM_FILE_SPLIT,_T("&Split file..."));
+ m->Append(IDM_FILE_COMBINE,_T("Com&bine files..."));
+ m->AppendSeparator();
+ m->Append(IDM_FILE_PROPERTIES,_T("P&roperties\tAlt+Enter"));
+ m->Append(IDM_FILE_COMMENT,_T("Comme&nt\tCtrl+Z"));
+ m->Append(IDM_FILE_CRC,_T("Calculate checksum"));
+ m->AppendSeparator();
+ m->Append(IDM_CREATE_FOLDER,_T("Create Folder\tF7"));
+ m->Append(IDM_CREATE_FILE,_T("Create File\tCtrl+N"));
+ m->AppendSeparator();
+ m->Append(IDCLOSE,_T("E&xit\tAlt+F4"));
+ }
+ wxMenu *m_edit = m = new wxMenu;
+ {
+ m->Append(IDM_EDIT_CUT, _T("Cu&t\tCtrl+X"))->Enable(true); // GRAYED
+ // m->Enable(IDM_EDIT_CUT, false);
+ m->Append(IDM_EDIT_COPY, _T("&Copy\tCtrl+C"))->Enable(true); // GRAYED
+ m->Append(IDM_EDIT_PASTE, _T("&Paste\tCtrl+V"))->Enable(true); // GRAYED
+ m->AppendSeparator();
+ m->Append(IDM_SELECT_ALL, _T("Select &All\tShift+[Grey +]"));
+ m->Append(IDM_DESELECT_ALL, _T("Deselect All\tShift+[Grey -]"));
+ m->Append(IDM_INVERT_SELECTION, _T("&Invert Selection\tGrey *"));
+ m->Append(IDM_SELECT, _T("Select...\tGrey +"));
+ m->Append(IDM_DESELECT, _T("Deselect...\tGrey -"));
+ m->Append(IDM_SELECT_BY_TYPE, _T("Select by Type\tAlt+[Grey+]"));
+ m->Append(IDM_DESELECT_BY_TYPE, _T("Deselect by Type\tAlt+[Grey -]"));
+ }
+ wxMenu *m_view = m = new wxMenu;
+ {
+ m->AppendRadioItem(IDM_VIEW_LARGE_ICONS, _T("Lar&ge Icons\tCtrl+1"));
+ m->AppendRadioItem(IDM_VIEW_SMALL_ICONS, _T("S&mall Icons\tCtrl+2"));
+ m->AppendRadioItem(IDM_VIEW_LIST, _T("&List\tCtrl+3"));
+ m->AppendRadioItem(IDM_VIEW_DETAILS, _T("&Details\tCtrl+4"))->Check(true); // CHECKED
+ m->AppendSeparator();
+ m->Append(IDM_VIEW_ARANGE_BY_NAME, _T("Name\tCtrl+F3"));
+ m->Append(IDM_VIEW_ARANGE_BY_TYPE, _T("Type\tCtrl+F4"));
+ m->Append(IDM_VIEW_ARANGE_BY_DATE, _T("Date\tCtrl+F5"));
+ m->Append(IDM_VIEW_ARANGE_BY_SIZE, _T("Size\tCtrl+F6"));
+ m->Append(IDM_VIEW_ARANGE_NO_SORT, _T("Unsorted\tCtrl+F7"));
+ m->AppendSeparator();
+ m->AppendCheckItem(IDM_VIEW_FLAT_VIEW, _T("Flat View"));
+ m->AppendCheckItem(IDM_VIEW_TWO_PANELS, _T("&2 Panels\tF9"));
+
+ {
+ wxMenu* subMenu = new wxMenu;
+ subMenu->AppendCheckItem(IDM_VIEW_ARCHIVE_TOOLBAR, _T("Archive Toolbar"));
+ subMenu->AppendCheckItem(IDM_VIEW_STANDARD_TOOLBAR, _T("Standard Toolbar"));
+ subMenu->AppendSeparator();
+ subMenu->AppendCheckItem(IDM_VIEW_TOOLBARS_LARGE_BUTTONS, _T("Large Buttons"));
+ subMenu->AppendCheckItem(IDM_VIEW_TOOLBARS_SHOW_BUTTONS_TEXT, _T("Show Buttons Text"));
+ m->Append(12112, _T("Toolbars"), subMenu); // FIXME ID ?
+ }
+ m->AppendSeparator();
+ m->Append(IDM_OPEN_ROOT_FOLDER, _T("Open Root Folder\t" STRING_PATH_SEPARATOR));
+ m->Append(IDM_OPEN_PARENT_FOLDER, _T("Up One Level\tBackspace"));
+ m->Append(IDM_FOLDERS_HISTORY, _T("Folders History...\tAlt+F12"));
+ m->AppendSeparator();
+ m->Append(IDM_VIEW_REFRESH, _T("&Refresh\tCtrl+R"));
+ }
+ wxMenu *m_favorites = m = new wxMenu;
+ {
+ {
+ wxMenu* subMenu = new wxMenu;
+ for (int i = 0; i < 10; i++)
+ {
+ UString s = LangString(IDS_BOOKMARK, 0x03000720);
+ s += L" ";
+ wchar_t c = (wchar_t)(L'0' + i);
+ s += c;
+ s += L"\tAlt+Shift+";
+ s += c;
+ subMenu->Append( kSetBookmarkMenuID + i, wxString(s));
+ }
+
+ m->Append(12111, _T("&Add folder to Favorites as"), subMenu); // FIXME ID ?
+ }
+ m->AppendSeparator();
+ for (int i = 0; i < 10; i++)
+ {
+ UString path = g_App.AppState.FastFolders.GetString(i);
+ const int kMaxSize = 100;
+ const int kFirstPartSize = kMaxSize / 2;
+ if (path.Length() > kMaxSize)
+ {
+ path = path.Left(kFirstPartSize) + UString(L" ... ") +
+ path.Right(kMaxSize - kFirstPartSize);
+ }
+ UString s = path;
+ if (s.IsEmpty())
+ s = L"-";
+ s += L"\tAlt+";
+ s += (wchar_t)(L'0' + i);
+ // menu.AppendItem(MF_STRING, kOpenBookmarkMenuID + i, s);
+ m->Append( kOpenBookmarkMenuID + i, wxString(s));
+ }
+
+ }
+ wxMenu *m_tools = m = new wxMenu;
+ {
+ m->Append(IDM_OPTIONS, _T("&Options..."));
+ m->Append(IDM_BENCHMARK, _T("&Benchmark"));
+ }
+ wxMenu *m_help = m = new wxMenu;
+ {
+ m->Append(IDM_HELP_CONTENTS, _T("&Contents...\tF1"));
+ m->AppendSeparator();
+ m->Append(IDM_ABOUT, _T("&About 7-Zip..."));
+ }
+
+ wxMenuBar *menuBar = new wxMenuBar;
+
+ menuBar->Append(m_file, _T("&File"));
+ menuBar->Append(m_edit, _T("&Edit"));
+ menuBar->Append(m_view, _T("&View"));
+ menuBar->Append(m_favorites, _T("F&avorites"));
+ menuBar->Append(m_tools, _T("&Tools"));
+ menuBar->Append(m_help, _T("&Help"));
+ hwnd->SetMenuBar(menuBar);
+}
+
+//////////////////////////////////////////////////////////////////
+
+
+static CStringTable g_stringTable[] =
+{
+ /* resource.rc */
+ /***************/
+ { IDS_APP_TITLE, L"7-Zip File Manager" },
+
+ { IDS_COPY , L"Copy" },
+ { IDS_MOVE , L"Move" },
+ { IDS_COPY_TO , L"Copy to:" },
+ { IDS_MOVE_TO , L"Move to:" },
+ { IDS_COPYING , L"Copying..." },
+ { IDS_MOVING , L"Moving..." },
+ { IDS_CANNOT_COPY , L"You cannot move or copy items for such folders." },
+ { IDS_SPLITTING , L"Splitting..." },
+ { IDS_SPLIT_CONFIRM_TITLE , L"Confirm Splitting" },
+ { IDS_SPLIT_CONFIRM_MESSAGE , L"Are you sure you want to split file into {0} volumes?" },
+ { IDS_SPLIT_VOL_MUST_BE_SMALLER , L"Volume size must be smaller than size of original file" },
+
+ { IDS_COMBINE , L"Combine Files" },
+ { IDS_COMBINE_TO , L"&Combine to:" },
+ { IDS_COMBINING , L"Combining..." },
+ { IDS_COMBINE_SELECT_ONE_FILE , L"Select only first file" },
+
+ { IDS_CHECKSUM_CALCULATING , L"Checksum calculating..." },
+ { IDS_CHECKSUM_INFORMATION , L"Checksum information" },
+ { IDS_CHECKSUM_CRC_DATA , L"CRC checksum for data:" },
+ { IDS_CHECKSUM_CRC_DATA_NAMES , L"CRC checksum for data and names:" },
+
+ { IDS_SCANNING , L"Scanning..." },
+
+ { IDS_PROPERTIES , L"Properties" },
+
+ { IDS_OPERATION_IS_NOT_SUPPORTED , L"Operation is not supported." },
+
+ { IDS_CONFIRM_FILE_DELETE , L"Confirm File Delete" },
+ { IDS_CONFIRM_FOLDER_DELETE , L"Confirm Folder Delete" },
+ { IDS_CONFIRM_ITEMS_DELETE , L"Confirm Multiple File Delete" },
+ { IDS_WANT_TO_DELETE_FILE , L"Are you sure you want to delete '{0}'?" },
+ { IDS_WANT_TO_DELETE_FOLDER , L"Are you sure you want to delete the folder '{0}' and all its contents?" },
+ { IDS_WANT_TO_DELETE_ITEMS , L"Are you sure you want to delete these {0} items?" },
+ { IDS_DELETING , L"Deleting..." },
+ { IDS_ERROR_DELETING , L"Error Deleting File or Folder" },
+ { IDS_RENAMING , L"Renaming..." },
+ { IDS_ERROR_RENAMING , L"Error Renaming File or Folder" },
+ { IDS_CONFIRM_FILE_COPY , L"Confirm File Copy" },
+ { IDS_WANT_TO_COPY_FILES , L"Are you sure you want to copy files to archive" },
+
+ { IDS_CREATE_FOLDER , L"Create Folder" },
+ { IDS_CREATE_FOLDER_NAME , L"Folder name:" },
+ { IDS_CREATE_FOLDER_DEFAULT_NAME , L"New Folder" },
+ { IDS_CREATE_FOLDER_ERROR , L"Error Creating Folder" },
+ { IDS_CREATE_FILE , L"Create File" },
+ { IDS_CREATE_FILE_NAME , L"File Name:" },
+ { IDS_CREATE_FILE_DEFAULT_NAME , L"New File" },
+ { IDS_CREATE_FILE_ERROR , L"Error Creating File" },
+ { IDS_SELECT , L"Select" },
+ { IDS_DESELECT , L"Deselect" },
+ { IDS_SELECT_MASK , L"Mask:" },
+ { IDS_FOLDERS_HISTORY , L"Folders History" },
+ { IDS_N_SELECTED_ITEMS , L"{0} object(s) selected" },
+ { IDS_FILES_COLON , L"Files:" },
+ { IDS_FOLDERS_COLON , L"Folders:" },
+ { IDS_SIZE_COLON , L"Size:" },
+
+ { IDS_PROP_TOTAL_SIZE , L"Total Size" },
+ { IDS_PROP_FREE_SPACE , L"Free Space" },
+ { IDS_PROP_CLUSTER_SIZE , L"Cluster Size" },
+ { IDS_PROP_VOLUME_NAME , L"Label" },
+ { IDS_PROP_LOCAL_NAME , L"Local Name" },
+ { IDS_PROP_PROVIDER , L"Provider" },
+ { IDS_OPTIONS , L"Options" },
+ { IDS_COMMENT , L"Comment" },
+ { IDS_COMMENT2 , L"&Comment:" },
+ { IDS_SYSTEM , L"System" },
+ { IDS_TOO_MANY_ITEMS , L"Too many items" },
+ { IDS_WANT_UPDATE_MODIFIED_FILE , L"File '{0}' was modified.\nDo you want to update it in the archive?" },
+ { IDS_CANNOT_UPDATE_FILE , L"Can not update file\n'{0}'" },
+ { IDS_CANNOT_START_EDITOR , L"Cannot start editor." },
+ { IDS_OPENNING , L"Opening..." },
+ { IDS_ADD , L"Add" },
+ { IDS_EXTRACT , L"Extract" },
+ { IDS_TEST , L"Test" },
+ { IDS_BUTTON_COPY , L"Copy" },
+ { IDS_BUTTON_MOVE , L"Move" },
+ { IDS_BUTTON_DELETE , L"Delete" },
+ { IDS_BUTTON_INFO , L"Info" },
+ { IDS_BOOKMARK , L"Bookmark" },
+ { IDS_COMPUTER , L"Computer" },
+ { IDS_NETWORK , L"Network" },
+
+ { IDS_PROGRESS_TESTING , L"Testing" },
+ { IDS_MESSAGE_NO_ERRORS , L"There are no errors" },
+
+ { 0 , 0 }
+};
+
+REGISTER_STRINGTABLE(g_stringTable)
+
+/////////////////////////////////////////////////////
+
+#include "res/ParentFolder.h"
+
+ SevenZipPanel::SevenZipPanel(MyFrame *frame, wxWindow *parent,int id,int panelIndex) :
+ wxPanel(parent,id) , m_frame(frame), _wList(0)
+ {
+ _panelIndex = panelIndex;
+
+ int _baseID = id; // FIXME
+ int _listID = _baseID + 1;
+ int _comboBoxID = _baseID + 3;
+ int _statusBarID = _comboBoxID + 1;
+ int kParentFolderID = 100; // FIXME Panel.h
+
+
+ ///Sizer for adding the controls created by users
+ wxBoxSizer* pMainSizer = new wxBoxSizer(wxVERTICAL);
+ int sizes[] = {150, 250, 350, -1};
+ wxArrayString pathArray;
+ wxBoxSizer *pPathSizer = new wxBoxSizer(wxHORIZONTAL);
+ m_pBmpButtonParentFolder = new wxBitmapButton(this, kParentFolderID, wxGetBitmapFromMemory(PARENT_FOLDER), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW);
+ m_pComboBoxPath = new wxComboBox(this, _comboBoxID, wxEmptyString, wxDefaultPosition, wxSize(300,-1), pathArray, wxCB_DROPDOWN | wxCB_SORT );
+ pPathSizer->Add(m_pBmpButtonParentFolder, 0, wxALL|wxEXPAND, 0);
+ pPathSizer->Add(m_pComboBoxPath, 1, wxALL|wxEXPAND, 5);
+
+ m_pListCtrlExplorer = new CExplorerListCtrl(this,_listID,wxDefaultPosition, wxSize(300,300),
+ wxLC_REPORT |
+ wxSUNKEN_BORDER | wxLC_EDIT_LABELS);
+
+ printf("DEBUG : new CExplorerListCtrl(id=%d) => %p\n",_listID,m_pListCtrlExplorer);
+
+ m_pStatusBar = new wxStatusBar(this, _statusBarID);
+ m_pStatusBar->SetFieldsCount(4, sizes);
+ pMainSizer->Add(pPathSizer, 0, wxALL|wxEXPAND, 0);
+ pMainSizer->Add(m_pListCtrlExplorer, 1, wxALL|wxEXPAND, 0);
+ pMainSizer->Add(m_pStatusBar, 0, wxALL|wxEXPAND, 0);
+ SetSizer(pMainSizer);
+ SetAutoLayout (true);
+ Layout();
+
+
+ // m_pListCtrlExplorer->SetDropTarget(new DnDFile(this));
+
+ }
+
+ void SevenZipPanel::OnAnyButton( wxCommandEvent &event )
+ {
+ count++;
+
+ int id = event.GetId();
+
+ wxString msg = wxString::Format(_T("P %d : button %d \n"), count,id);
+
+ WriteText(msg);
+
+ _wList->OnMessage(WM_COMMAND , id , 0);
+ }
+
+ void SevenZipPanel::OnSelected(wxListEvent& event)
+ {
+ const wxListItem & item = event.GetItem();
+ count++;
+
+ wxString msg = wxString::Format(_T("P %d : OnSelected %d \n"), count,event.GetId());
+
+ WriteText(msg);
+
+ NMLISTVIEW info;
+ info.hdr.hwndFrom = m_pListCtrlExplorer;
+ info.hdr.code = LVN_ITEMCHANGED;
+ info.uOldState = 0;
+ info.uNewState = LVIS_SELECTED;
+ info.lParam = item.GetData(); // event.GetIndex(); // FIXME ? event.GetData();
+ _wList->OnMessage(WM_NOTIFY , event.GetId() , (LPARAM)&info);
+ /*
+ if ( GetWindowStyle() & wxLC_REPORT )
+ {
+ wxListItem info;
+ info.m_itemId = event.m_itemIndex;
+ info.m_col = 1;
+ info.m_mask = wxLIST_MASK_TEXT;
+ if ( GetItem(info) )
+ {
+ wxLogMessage(wxT("Value of the 2nd field of the selected item: %s"),
+ info.m_text.c_str());
+ }
+ else
+ {
+ wxFAIL_MSG(wxT("wxListCtrl::GetItem() failed"));
+ }
+ }
+ */
+ }
+
+ void SevenZipPanel::OnDeselected(wxListEvent& event)
+ {
+ const wxListItem & item = event.GetItem();
+ count++;
+ wxString msg = wxString::Format(_T("P %d : OnDeselected %d \n"), count,event.GetId());
+ WriteText(msg);
+
+ NMLISTVIEW info;
+ info.hdr.hwndFrom = m_pListCtrlExplorer;
+ info.hdr.code = LVN_ITEMCHANGED;
+ info.uOldState = LVIS_SELECTED;
+ info.uNewState = 0;
+ info.lParam = item.GetData(); // event.GetIndex(); // FIXME ? event.GetData();
+ _wList->OnMessage(WM_NOTIFY , event.GetId() , (LPARAM)&info);
+ }
+
+ void SevenZipPanel::OnColumnClick(wxListEvent& event)
+ {
+ count++;
+ wxString msg = wxString::Format(_T("P %d : OnColumnClick %d col=%d\n"), count,event.GetId(),event.GetColumn());
+ WriteText(msg);
+
+ NMLISTVIEW info;
+ info.hdr.hwndFrom = m_pListCtrlExplorer;
+ info.hdr.code = LVN_COLUMNCLICK;
+ info.iSubItem = event.GetColumn();
+ _wList->OnMessage(WM_NOTIFY , event.GetId() , (LPARAM)&info);
+
+ }
+
+
+ void SevenZipPanel::OnActivated(wxListEvent& event)
+ {
+ count++;
+
+ int ind = event.GetIndex();
+
+ NMHDR info;
+ info.hwndFrom = m_pListCtrlExplorer;
+ info.code = NM_DBLCLK;
+ _wList->OnMessage(WM_NOTIFY , event.GetId() , (LPARAM)&info);
+
+ /*
+ if ((ind >= 0) && ( ind < m_nbDirs))
+ {
+ wxString msg = wxString::Format(_T("P %d : OnActivated %d : DIR = %d\n"), count,event.GetId(),ind);
+ WriteText(msg);
+
+ wxString name = m_pListCtrlExplorer->GetItemText(ind);
+
+ wxFileName filename (m_currentDirectory,name);
+ BinPath(filename.GetFullPath());
+
+ }
+ else
+ */
+ {
+ wxString msg = wxString::Format(_T("P %d : OnActivated %d : FILE = %d\n"), count,event.GetId(),ind);
+ WriteText(msg);
+ }
+
+
+ }
+
+ void SevenZipPanel::OnFocused(wxListEvent& event)
+ {
+ count++;
+
+ wxString msg = wxString::Format(_T("P %d : OnFocused %d \n"), count,event.GetId());
+
+ WriteText(msg);
+
+ event.Skip();
+ }
+
+ void SevenZipPanel::OnLeftDownBeginDrag(wxListEvent& event)
+ {
+ count++;
+
+ wxString msg = wxString::Format(_T("P %d : OnLeftDownBeginDrag %d \n"), count,event.GetId());
+ WriteText(msg);
+
+#if 0
+ if ( m_pListCtrlExplorer->GetSelectedItemCount() < 1) return ;
+
+ // start drag operation
+ wxFileDataObject filesData;
+
+
+ long item = -1;
+ for ( ;; )
+ {
+ item = m_pListCtrlExplorer->GetNextItem(item,
+ wxLIST_NEXT_ALL,
+ wxLIST_STATE_SELECTED);
+ if ( item == -1 )
+ break;
+
+ // this item is selected - do whatever is needed with it
+ // wxLogMessage("Item %ld is selected.", item);
+ wxString file = m_currentDirectory + _T("/") + m_pListCtrlExplorer->GetItemText(item);
+
+ filesData.AddFile(file);
+
+ }
+
+ msg = wxString::Format(_T("P %d : wxDropSource %d \n"), count,event.GetId());
+ WriteText(msg);
+
+ wxDropSource source(filesData, this,
+ wxDROP_ICON(dnd_copy),
+ wxDROP_ICON(dnd_move),
+ wxDROP_ICON(dnd_none));
+
+ int flags = 0;
+ /*
+ if ( m_moveByDefault )
+ flags |= wxDrag_DefaultMove;
+ else if ( m_moveAllow )
+ flags |= wxDrag_AllowMove;
+ */
+ flags |= wxDrag_AllowMove;
+
+ msg = wxString::Format(_T("P %d : DoDragDrop %d \n"), count,event.GetId());
+ WriteText(msg);
+
+
+ wxDragResult result = source.DoDragDrop(flags);
+
+
+ const wxChar *pc;
+ switch ( result )
+ {
+ case wxDragError: pc = _T("Error!"); break;
+ case wxDragNone: pc = _T("Nothing"); break;
+ case wxDragCopy: pc = _T("Copied"); break;
+ case wxDragMove: pc = _T("Moved"); break;
+ case wxDragCancel: pc = _T("Cancelled"); break;
+ default: pc = _T("Huh?"); break;
+ }
+
+ WriteText(wxString(_T(" Drag result: ")) + pc);
+#endif
+ }
+
+void SevenZipPanel::OnLeftDown(wxMouseEvent &WXUNUSED(event) )
+{
+ WriteText(_T("OnLeftDown"));
+#if 0
+ if ( !m_strText.empty() )
+ {
+ // start drag operation
+ wxTextDataObject textData(m_strText);
+ wxDropSource source(textData, this,
+ wxDROP_ICON(dnd_copy),
+ wxDROP_ICON(dnd_move),
+ wxDROP_ICON(dnd_none));
+
+ int flags = 0;
+ if ( m_moveByDefault )
+ flags |= wxDrag_DefaultMove;
+ else if ( m_moveAllow )
+ flags |= wxDrag_AllowMove;
+
+ wxDragResult result = source.DoDragDrop(flags);
+
+#if wxUSE_STATUSBAR
+ const wxChar *pc;
+ switch ( result )
+ {
+ case wxDragError: pc = _T("Error!"); break;
+ case wxDragNone: pc = _T("Nothing"); break;
+ case wxDragCopy: pc = _T("Copied"); break;
+ case wxDragMove: pc = _T("Moved"); break;
+ case wxDragCancel: pc = _T("Cancelled"); break;
+ default: pc = _T("Huh?"); break;
+ }
+
+ SetStatusText(wxString(_T("Drag result: ")) + pc);
+#else
+ wxUnusedVar(result);
+#endif // wxUSE_STATUSBAR
+ }
+#endif // wxUSE_DRAG_AND_DROP
+}
+
+void SevenZipPanel::OnRightClick(wxListEvent& event)
+{
+ wxPoint point = event.GetPoint();
+
+ WriteText(_T("OnRightClick"));
+ wxMenu menu; // (_T("Dnd sample menu"));
+
+ menu.Append(wxID_ANY, _T("&Test drag..."));
+ menu.AppendSeparator();
+ menu.Append(wxID_ANY, _T("item1"));
+ menu.Append(wxID_ANY, _T("item2"));
+ menu.Append(wxID_ANY, _T("item3"));
+ menu.Append(wxID_ANY, _T("&About"));
+
+ PopupMenu( &menu, point.x, point.y );
+}
+
+int SevenZipPanel::count = 0;
+
+BEGIN_EVENT_TABLE(SevenZipPanel, wxPanel)
+// EVT_MENU(wxID_ANY, SevenZipPanel::OnAnyMenu)
+// EVT_LISTBOX (wxID_ANY, MyPanel::OnListBox)
+// EVT_LISTBOX_DCLICK(wxID_ANY, MyPanel::OnAnyListBoxDoubleClick)
+EVT_BUTTON (wxID_ANY, SevenZipPanel::OnAnyButton)
+
+ // EVT_CLOSE(SevenZipPanel::OnCloseWindow)
+
+/////////////////
+EVT_LIST_ITEM_SELECTED(wxID_ANY, SevenZipPanel::OnSelected)
+EVT_LIST_ITEM_DESELECTED(wxID_ANY, SevenZipPanel::OnDeselected)
+EVT_LIST_ITEM_ACTIVATED(wxID_ANY, SevenZipPanel::OnActivated)
+EVT_LIST_ITEM_FOCUSED(wxID_ANY, SevenZipPanel::OnFocused)
+
+EVT_LIST_BEGIN_DRAG(wxID_ANY, SevenZipPanel::OnLeftDownBeginDrag)
+EVT_LIST_ITEM_RIGHT_CLICK(wxID_ANY, SevenZipPanel::OnRightClick)
+
+EVT_LIST_COL_CLICK(wxID_ANY, SevenZipPanel::OnColumnClick)
+
+END_EVENT_TABLE()
+
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSDrives.h.out b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSDrives.h.out
new file mode 100644
index 000000000..84db5b7e2
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSDrives.h.out
@@ -0,0 +1,49 @@
+// FSDrives.h
+
+#ifndef __FSDRIVES_H
+#define __FSDRIVES_H
+
+#include "Common/MyString.h"
+#include "Common/Types.h"
+#include "Common/MyCom.h"
+#include "Windows/FileFind.h"
+#include "Windows/PropVariant.h"
+
+#include "IFolder.h"
+
+struct CDriveInfo
+{
+ UString Name;
+ UString FullSystemName;
+ bool KnownSizes;
+ UInt64 DriveSize;
+ UInt64 FreeSpace;
+ UInt64 ClusterSize;
+ UString Type;
+ UString VolumeName;
+ UString FileSystemName;
+};
+
+class CFSDrives:
+ public IFolderFolder,
+ public IFolderGetSystemIconIndex,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP1(
+ IFolderGetSystemIconIndex
+ )
+
+ INTERFACE_FolderFolder(;)
+
+ STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex);
+
+private:
+ HRESULT BindToFolderSpec(const wchar_t *name, IFolderFolder **resultFolder);
+ CObjectVector<CDriveInfo> _drives;
+ bool _volumeMode;
+public:
+ void Init() { _volumeMode = false;}
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolder.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolder.cpp
new file mode 100644
index 000000000..9c2aaa613
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolder.cpp
@@ -0,0 +1,701 @@
+// FSFolder.cpp
+
+#include "StdAfx.h"
+
+#include "FSFolder.h"
+
+#include "Common/StringConvert.h"
+#include "Common/UTFConvert.h"
+#include "Common/ComTry.h"
+
+#include "Windows/Defs.h"
+#include "Windows/PropVariant.h"
+#include "Windows/FileDir.h"
+#include "Windows/FileIO.h"
+
+#include "../../PropID.h"
+
+#include "SysIconUtils.h"
+#ifdef _WIN32
+#include "FSDrives.h"
+#include "NetFolder.h"
+#endif
+
+namespace NWindows {
+namespace NFile {
+
+bool GetLongPath(LPCWSTR path, UString &longPath);
+
+}}
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NFind;
+
+namespace NFsFolder {
+
+static STATPROPSTG kProperties[] =
+{
+ { NULL, kpidName, VT_BSTR},
+ // { NULL, kpidIsDir, VT_BOOL},
+ { NULL, kpidSize, VT_UI8},
+ { NULL, kpidMTime, VT_FILETIME},
+ { NULL, kpidCTime, VT_FILETIME},
+ { NULL, kpidATime, VT_FILETIME},
+ { NULL, kpidAttrib, VT_UI4},
+ { NULL, kpidPackSize, VT_UI8},
+ { NULL, kpidComment, VT_BSTR},
+ { NULL, kpidPrefix, VT_BSTR}
+};
+
+HRESULT CFSFolder::Init(const UString &path, IFolderFolder *parentFolder)
+{
+ _parentFolder = parentFolder;
+ _path = path;
+
+#ifdef _WIN32
+ _findChangeNotification.FindFirst(_path, false,
+ FILE_NOTIFY_CHANGE_FILE_NAME |
+ FILE_NOTIFY_CHANGE_DIR_NAME |
+ FILE_NOTIFY_CHANGE_ATTRIBUTES |
+ FILE_NOTIFY_CHANGE_SIZE |
+ FILE_NOTIFY_CHANGE_LAST_WRITE /*|
+ FILE_NOTIFY_CHANGE_LAST_ACCESS |
+ FILE_NOTIFY_CHANGE_CREATION |
+ FILE_NOTIFY_CHANGE_SECURITY */);
+ if (!_findChangeNotification.IsHandleAllocated())
+ {
+ DWORD lastError = GetLastError();
+ CFindFile findFile;
+ CFileInfoW fileInfo;
+ if (!findFile.FindFirst(_path + UString(L"*"), fileInfo))
+ return lastError;
+ }
+#endif
+ return S_OK;
+}
+
+HRESULT GetFolderSize(const UString &path, UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress)
+{
+ RINOK(progress->SetCompleted(NULL));
+ numFiles = numFolders = size = 0;
+ CEnumeratorW enumerator(path + UString(WSTRING_PATH_SEPARATOR L"*"));
+ CFileInfoW fileInfo;
+ while (enumerator.Next(fileInfo))
+ {
+ if (fileInfo.IsDir())
+ {
+ UInt64 subFolders, subFiles, subSize;
+ RINOK(GetFolderSize(path + UString(WSTRING_PATH_SEPARATOR) + fileInfo.Name, subFolders, subFiles, subSize, progress));
+ numFolders += subFolders;
+ numFolders++;
+ numFiles += subFiles;
+ size += subSize;
+ }
+ else
+ {
+ numFiles++;
+ size += fileInfo.Size;
+ }
+ }
+ return S_OK;
+}
+
+HRESULT CFSFolder::LoadSubItems(CDirItem &dirItem, const UString &path)
+{
+ {
+ CEnumeratorW enumerator(path + L"*");
+ CDirItem fileInfo;
+ while (enumerator.Next(fileInfo))
+ {
+ fileInfo.CompressedSizeIsDefined = false;
+ /*
+ if (!GetCompressedFileSize(_path + fileInfo.Name,
+ fileInfo.CompressedSize))
+ fileInfo.CompressedSize = fileInfo.Size;
+ */
+ if (fileInfo.IsDir())
+ {
+ // fileInfo.Size = GetFolderSize(_path + fileInfo.Name);
+ fileInfo.Size = 0;
+ }
+ dirItem.Files.Add(fileInfo);
+ }
+ }
+ if (!_flatMode)
+ return S_OK;
+
+ for (int i = 0; i < dirItem.Files.Size(); i++)
+ {
+ CDirItem &item = dirItem.Files[i];
+ if (item.IsDir())
+ LoadSubItems(item, path + item.Name + WCHAR_PATH_SEPARATOR);
+ }
+ return S_OK;
+}
+
+void CFSFolder::AddRefs(CDirItem &dirItem)
+{
+ int i;
+ for (i = 0; i < dirItem.Files.Size(); i++)
+ {
+ CDirItem &item = dirItem.Files[i];
+ item.Parent = &dirItem;
+ _refs.Add(&item);
+ }
+ if (!_flatMode)
+ return;
+ for (i = 0; i < dirItem.Files.Size(); i++)
+ {
+ CDirItem &item = dirItem.Files[i];
+ if (item.IsDir())
+ AddRefs(item);
+ }
+}
+
+STDMETHODIMP CFSFolder::LoadItems()
+{
+ // OutputDebugString(TEXT("Start\n"));
+ INT32 dummy;
+ WasChanged(&dummy);
+ Clear();
+ RINOK(LoadSubItems(_root, _path));
+ AddRefs(_root);
+
+ // OutputDebugString(TEXT("Finish\n"));
+ _commentsAreLoaded = false;
+ return S_OK;
+}
+
+static const wchar_t *kDescriptionFileName = L"descript.ion";
+
+bool CFSFolder::LoadComments()
+{
+ if (_commentsAreLoaded)
+ return true;
+ _comments.Clear();
+ _commentsAreLoaded = true;
+ NIO::CInFile file;
+ if (!file.Open(_path + kDescriptionFileName))
+ return false;
+ UInt64 length;
+ if (!file.GetLength(length))
+ return false;
+ if (length >= (1 << 28))
+ return false;
+ AString s;
+ char *p = s.GetBuffer((int)((size_t)length + 1));
+ UInt32 processedSize;
+ file.Read(p, (UInt32)length, processedSize);
+ p[length] = 0;
+ s.ReleaseBuffer();
+ if (processedSize != length)
+ return false;
+ file.Close();
+ UString unicodeString;
+ if (!ConvertUTF8ToUnicode(s, unicodeString))
+ return false;
+ return _comments.ReadFromString(unicodeString);
+}
+
+static bool IsAscii(const UString &testString)
+{
+ for (int i = 0; i < testString.Length(); i++)
+ if (testString[i] >= 0x80)
+ return false;
+ return true;
+}
+
+bool CFSFolder::SaveComments()
+{
+ NIO::COutFile file;
+ if (!file.Create(_path + kDescriptionFileName, true))
+ return false;
+ UString unicodeString;
+ _comments.SaveToString(unicodeString);
+ AString utfString;
+ ConvertUnicodeToUTF8(unicodeString, utfString);
+ UInt32 processedSize;
+ if (!IsAscii(unicodeString))
+ {
+ Byte bom [] = { 0xEF, 0xBB, 0xBF, 0x0D, 0x0A };
+ file.Write(bom , sizeof(bom), processedSize);
+ }
+ file.Write(utfString, utfString.Length(), processedSize);
+ _commentsAreLoaded = false;
+ return true;
+}
+
+STDMETHODIMP CFSFolder::GetNumberOfItems(UInt32 *numItems)
+{
+ *numItems = _refs.Size();
+ return S_OK;
+}
+
+/*
+STDMETHODIMP CFSFolder::GetNumberOfSubFolders(UInt32 *numSubFolders)
+{
+ UInt32 numSubFoldersLoc = 0;
+ for (int i = 0; i < _files.Size(); i++)
+ if (_files[i].IsDir())
+ numSubFoldersLoc++;
+ *numSubFolders = numSubFoldersLoc;
+ return S_OK;
+}
+*/
+
+#ifdef _WIN32
+bool MyGetCompressedFileSizeW(LPCWSTR fileName, UInt64 &size)
+{
+ DWORD highPart;
+ DWORD lowPart = ::GetCompressedFileSizeW(fileName, &highPart);
+ if (lowPart == INVALID_FILE_SIZE && ::GetLastError() != NO_ERROR)
+ {
+ #ifdef WIN_LONG_PATH
+ {
+ UString longPath;
+ if (GetLongPath(fileName, longPath))
+ lowPart = ::GetCompressedFileSizeW(longPath, &highPart);
+ }
+ #endif
+ if (lowPart == INVALID_FILE_SIZE && ::GetLastError() != NO_ERROR)
+ return false;
+ }
+ size = (UInt64(highPart) << 32) | lowPart;
+ return true;
+}
+#endif
+
+STDMETHODIMP CFSFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIANT *value)
+{
+ NCOM::CPropVariant prop;
+ if (itemIndex >= (UInt32)_refs.Size())
+ return E_INVALIDARG;
+ CDirItem &fileInfo = *_refs[itemIndex];
+ switch(propID)
+ {
+ case kpidIsDir: prop = fileInfo.IsDir(); break;
+ case kpidName: prop = fileInfo.Name; break;
+ case kpidSize: if (!fileInfo.IsDir()) prop = fileInfo.Size; break;
+ case kpidPackSize:
+ if (!fileInfo.CompressedSizeIsDefined)
+ {
+ fileInfo.CompressedSizeIsDefined = true;
+#ifdef _WIN32
+ if (fileInfo.IsDir () ||
+ !MyGetCompressedFileSizeW(_path + GetRelPath(fileInfo), fileInfo.CompressedSize))
+#endif
+ fileInfo.CompressedSize = fileInfo.Size;
+ }
+ prop = fileInfo.CompressedSize;
+ break;
+ case kpidAttrib: prop = (UInt32)fileInfo.Attrib; break;
+ case kpidCTime: prop = fileInfo.CTime; break;
+ case kpidATime: prop = fileInfo.ATime; break;
+ case kpidMTime: prop = fileInfo.MTime; break;
+ case kpidComment:
+ {
+ LoadComments();
+ UString comment;
+ if (_comments.GetValue(GetRelPath(fileInfo), comment))
+ prop = comment;
+ break;
+ }
+ case kpidPrefix:
+ {
+ if (_flatMode)
+ {
+ prop = GetPrefix(fileInfo);
+ }
+ break;
+ }
+ }
+ prop.Detach(value);
+ return S_OK;
+}
+
+HRESULT CFSFolder::BindToFolderSpec(const wchar_t *name, IFolderFolder **resultFolder)
+{
+ *resultFolder = 0;
+ CFSFolder *folderSpec = new CFSFolder;
+ CMyComPtr<IFolderFolder> subFolder = folderSpec;
+ RINOK(folderSpec->Init(_path + name + UString(WCHAR_PATH_SEPARATOR), 0));
+ *resultFolder = subFolder.Detach();
+ return S_OK;
+}
+
+UString CFSFolder::GetPrefix(const CDirItem &item) const
+{
+ UString path;
+ CDirItem *cur = item.Parent;
+ while (cur->Parent != 0)
+ {
+ path = cur->Name + UString(WCHAR_PATH_SEPARATOR) + path;
+ cur = cur->Parent;
+ }
+ return path;
+}
+
+UString CFSFolder::GetRelPath(const CDirItem &item) const
+{
+ return GetPrefix(item) + item.Name;
+}
+
+STDMETHODIMP CFSFolder::BindToFolder(UInt32 index, IFolderFolder **resultFolder)
+{
+ *resultFolder = 0;
+ const CDirItem &fileInfo = *_refs[index];
+ if (!fileInfo.IsDir())
+ return E_INVALIDARG;
+ return BindToFolderSpec(GetRelPath(fileInfo), resultFolder);
+}
+
+STDMETHODIMP CFSFolder::BindToFolder(const wchar_t *name, IFolderFolder **resultFolder)
+{
+ return BindToFolderSpec(name, resultFolder);
+}
+
+STDMETHODIMP CFSFolder::BindToParentFolder(IFolderFolder **resultFolder)
+{
+ *resultFolder = 0;
+ if (_parentFolder)
+ {
+ CMyComPtr<IFolderFolder> parentFolder = _parentFolder;
+ *resultFolder = parentFolder.Detach();
+ return S_OK;
+ }
+ if (_path.IsEmpty())
+ return E_INVALIDARG;
+ printf("CFSFolder::BindToParentFolder path='%ls'\n",(const wchar_t *)_path);
+ int pos = _path.ReverseFind(WCHAR_PATH_SEPARATOR);
+ if (pos < 0 || pos != _path.Length() - 1)
+ return E_FAIL;
+ UString parentPath = _path.Left(pos);
+ printf("CFSFolder::BindToParentFolder parentPath='%ls'\n",(const wchar_t *)parentPath);
+ pos = parentPath.ReverseFind(WCHAR_PATH_SEPARATOR);
+ if (pos < 0)
+ {
+#ifdef _WIN32
+ parentPath.Empty();
+ CFSDrives *drivesFolderSpec = new CFSDrives;
+ CMyComPtr<IFolderFolder> drivesFolder = drivesFolderSpec;
+ drivesFolderSpec->Init();
+ *resultFolder = drivesFolder.Detach();
+#else
+ parentPath = WSTRING_PATH_SEPARATOR;
+ CFSFolder *parentFolderSpec = new CFSFolder;
+ CMyComPtr<IFolderFolder> parentFolder = parentFolderSpec;
+ printf("CFSFolder::BindToParentFolder Init-0 with parentPath='%ls'\n",(const wchar_t *)parentPath);
+ RINOK(parentFolderSpec->Init(parentPath, 0));
+ *resultFolder = parentFolder.Detach();
+#endif
+ return S_OK;
+ }
+ UString parentPathReduced = parentPath.Left(pos);
+ parentPath = parentPath.Left(pos + 1);
+ pos = parentPathReduced.ReverseFind(WCHAR_PATH_SEPARATOR);
+ if (pos == 1)
+ {
+#ifdef _WIN32
+ if (parentPath[0] != WCHAR_PATH_SEPARATOR)
+ return E_FAIL;
+ CNetFolder *netFolderSpec = new CNetFolder;
+ CMyComPtr<IFolderFolder> netFolder = netFolderSpec;
+ netFolderSpec->Init(parentPath);
+ *resultFolder = netFolder.Detach();
+#else
+ parentPath = WSTRING_PATH_SEPARATOR;
+ CFSFolder *parentFolderSpec = new CFSFolder;
+ CMyComPtr<IFolderFolder> parentFolder = parentFolderSpec;
+ printf("CFSFolder::BindToParentFolder Init-1 with parentPath='%ls'\n",(const wchar_t *)parentPath);
+ RINOK(parentFolderSpec->Init(parentPath, 0));
+ *resultFolder = parentFolder.Detach();
+#endif // ifdef _WIN32
+ return S_OK;
+ }
+ CFSFolder *parentFolderSpec = new CFSFolder;
+ CMyComPtr<IFolderFolder> parentFolder = parentFolderSpec;
+ printf("CFSFolder::BindToParentFolder Init-2 with parentPath='%ls'\n",(const wchar_t *)parentPath);
+ RINOK(parentFolderSpec->Init(parentPath, 0));
+ *resultFolder = parentFolder.Detach();
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::GetNumberOfProperties(UInt32 *numProperties)
+{
+ *numProperties = sizeof(kProperties) / sizeof(kProperties[0]);
+ if (!_flatMode)
+ (*numProperties)--;
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::GetPropertyInfo(UInt32 index,
+ BSTR *name, PROPID *propID, VARTYPE *varType)
+{
+ if (index >= sizeof(kProperties) / sizeof(kProperties[0]))
+ return E_INVALIDARG;
+ const STATPROPSTG &prop = kProperties[index];
+ *propID = prop.propid;
+ *varType = prop.vt;
+ *name = 0;
+ return S_OK;
+}
+
+
+STDMETHODIMP CFSFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value)
+{
+ COM_TRY_BEGIN
+ NWindows::NCOM::CPropVariant prop;
+ switch(propID)
+ {
+ case kpidType: prop = L"FSFolder"; break;
+ case kpidPath: prop = _path; break;
+ }
+ prop.Detach(value);
+ return S_OK;
+ COM_TRY_END
+}
+
+STDMETHODIMP CFSFolder::WasChanged(INT32 *wasChanged)
+{
+ bool wasChangedMain = false;
+#ifdef _WIN32
+ for (;;)
+ {
+ if (!_findChangeNotification.IsHandleAllocated())
+ {
+ *wasChanged = BoolToInt(false);
+ return S_OK;
+ }
+
+ DWORD waitResult = ::WaitForSingleObject(_findChangeNotification, 0);
+ bool wasChangedLoc = (waitResult == WAIT_OBJECT_0);
+ if (wasChangedLoc)
+ {
+ _findChangeNotification.FindNext();
+ wasChangedMain = true;
+ }
+ else
+ break;
+ }
+#endif
+ *wasChanged = BoolToInt(wasChangedMain);
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::Clone(IFolderFolder **resultFolder)
+{
+ CFSFolder *fsFolderSpec = new CFSFolder;
+ CMyComPtr<IFolderFolder> folderNew = fsFolderSpec;
+ fsFolderSpec->Init(_path, 0);
+ *resultFolder = folderNew.Detach();
+ return S_OK;
+}
+
+HRESULT CFSFolder::GetItemsFullSize(const UInt32 *indices, UInt32 numItems,
+ UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress)
+{
+ numFiles = numFolders = size = 0;
+ UInt32 i;
+ for (i = 0; i < numItems; i++)
+ {
+ int index = indices[i];
+ if (index >= _refs.Size())
+ return E_INVALIDARG;
+ const CDirItem &fileInfo = *_refs[index];
+ if (fileInfo.IsDir())
+ {
+ UInt64 subFolders, subFiles, subSize;
+ RINOK(GetFolderSize(_path + GetRelPath(fileInfo), subFolders, subFiles, subSize, progress));
+ numFolders += subFolders;
+ numFolders++;
+ numFiles += subFiles;
+ size += subSize;
+ }
+ else
+ {
+ numFiles++;
+ size += fileInfo.Size;
+ }
+ }
+ return S_OK;
+}
+
+HRESULT CFSFolder::GetItemFullSize(int index, UInt64 &size, IProgress *progress)
+{
+ const CDirItem &fileInfo = *_refs[index];
+ if (fileInfo.IsDir())
+ {
+ /*
+ CMyComPtr<IFolderFolder> subFolder;
+ RINOK(BindToFolder(index, &subFolder));
+ CMyComPtr<IFolderReload> aFolderReload;
+ subFolder.QueryInterface(&aFolderReload);
+ aFolderReload->Reload();
+ UInt32 numItems;
+ RINOK(subFolder->GetNumberOfItems(&numItems));
+ CMyComPtr<IFolderGetItemFullSize> aGetItemFullSize;
+ subFolder.QueryInterface(&aGetItemFullSize);
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ UInt64 size;
+ RINOK(aGetItemFullSize->GetItemFullSize(i, &size));
+ *totalSize += size;
+ }
+ */
+ UInt64 numFolders, numFiles;
+ return GetFolderSize(_path + GetRelPath(fileInfo), numFolders, numFiles, size, progress);
+ }
+ size = fileInfo.Size;
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::GetItemFullSize(UInt32 index, PROPVARIANT *value, IProgress *progress)
+{
+ NCOM::CPropVariant prop;
+ if (index >= (UInt32)_refs.Size())
+ return E_INVALIDARG;
+ UInt64 size = 0;
+ HRESULT result = GetItemFullSize(index, size, progress);
+ prop = size;
+ prop.Detach(value);
+ return result;
+}
+
+HRESULT CFSFolder::GetComplexName(const wchar_t *name, UString &resultPath)
+{
+ UString newName = name;
+ resultPath = _path + newName;
+ if (newName.Length() < 1)
+ return S_OK;
+ if (newName[0] == WCHAR_PATH_SEPARATOR)
+ {
+ resultPath = newName;
+ return S_OK;
+ }
+ if (newName.Length() < 2)
+ return S_OK;
+ if (newName[1] == L':')
+ resultPath = newName;
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::CreateFolder(const wchar_t *name, IProgress * /* progress */)
+{
+ UString processedName;
+ RINOK(GetComplexName(name, processedName));
+ if(NDirectory::MyCreateDirectory(processedName))
+ return S_OK;
+ if(::GetLastError() == ERROR_ALREADY_EXISTS)
+ return ::GetLastError();
+ if (!NDirectory::CreateComplexDirectory(processedName))
+ return ::GetLastError();
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::CreateFile(const wchar_t *name, IProgress * /* progress */)
+{
+ UString processedName;
+ RINOK(GetComplexName(name, processedName));
+ NIO::COutFile outFile;
+ if (!outFile.Create(processedName, false))
+ return ::GetLastError();
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::Rename(UInt32 index, const wchar_t *newName, IProgress * /* progress */)
+{
+ const CDirItem &fileInfo = *_refs[index];
+ const UString fullPrefix = _path + GetPrefix(fileInfo);
+ if (!NDirectory::MyMoveFile(fullPrefix + fileInfo.Name, fullPrefix + newName))
+ return GetLastError();
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::Delete(const UInt32 *indices, UInt32 numItems,IProgress *progress)
+{
+#ifdef _WIN32
+ RINOK(progress->SetTotal(numItems));
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ const CDirItem &fileInfo = *_refs[indices[i]];
+ const UString fullPath = _path + GetRelPath(fileInfo);
+ bool result;
+ if (fileInfo.IsDir())
+ result = NDirectory::RemoveDirectoryWithSubItems(fullPath);
+ else
+ result = NDirectory::DeleteFileAlways(fullPath);
+ if (!result)
+ return GetLastError();
+ UInt64 completed = i;
+ RINOK(progress->SetCompleted(&completed));
+ }
+#endif
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::SetProperty(UInt32 index, PROPID propID,
+ const PROPVARIANT *value, IProgress * /* progress */)
+{
+ if (index >= (UInt32)_refs.Size())
+ return E_INVALIDARG;
+ CDirItem &fileInfo = *_refs[index];
+ if (fileInfo.Parent->Parent != 0)
+ return E_NOTIMPL;
+ switch(propID)
+ {
+ case kpidComment:
+ {
+ UString filename = fileInfo.Name;
+ filename.Trim();
+ if (value->vt == VT_EMPTY)
+ _comments.DeletePair(filename);
+ else if (value->vt == VT_BSTR)
+ {
+ CTextPair pair;
+ pair.ID = filename;
+ pair.ID.Trim();
+ pair.Value = value->bstrVal;
+ pair.Value.Trim();
+ if (pair.Value.IsEmpty())
+ _comments.DeletePair(filename);
+ else
+ _comments.AddPair(pair);
+ }
+ else
+ return E_INVALIDARG;
+ SaveComments();
+ break;
+ }
+ default:
+ return E_NOTIMPL;
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::GetSystemIconIndex(UInt32 index, INT32 *iconIndex)
+{
+#ifdef _WIN32
+ if (index >= (UInt32)_refs.Size())
+ return E_INVALIDARG;
+ const CDirItem &fileInfo = *_refs[index];
+ *iconIndex = 0;
+ int iconIndexTemp;
+ if (GetRealIconIndex(_path + GetRelPath(fileInfo), fileInfo.Attributes, iconIndexTemp) != 0)
+ {
+ *iconIndex = iconIndexTemp;
+ return S_OK;
+ }
+ return GetLastError();
+#endif
+ *iconIndex = 0;
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::SetFlatMode(Int32 flatMode)
+{
+ _flatMode = IntToBool(flatMode);
+ return S_OK;
+}
+
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolder.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolder.h
new file mode 100644
index 000000000..4f65f9771
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolder.h
@@ -0,0 +1,120 @@
+// FSFolder.h
+
+#ifndef __FSFOLDER_H
+#define __FSFOLDER_H
+
+#include "Common/MyString.h"
+#include "Common/MyCom.h"
+#include "Windows/FileFind.h"
+#include "Windows/PropVariant.h"
+
+#include "IFolder.h"
+
+#include "TextPairs.h"
+
+namespace NFsFolder {
+
+class CFSFolder;
+
+struct CFileInfoEx: public NWindows::NFile::NFind::CFileInfoW
+{
+ bool CompressedSizeIsDefined;
+ UInt64 CompressedSize;
+};
+
+struct CDirItem;
+
+struct CDirItem: public CFileInfoEx
+{
+ CDirItem *Parent;
+ CObjectVector<CDirItem> Files;
+
+ CDirItem(): Parent(0) {}
+ void Clear()
+ {
+ Files.Clear();
+ Parent = 0;
+ }
+};
+
+class CFSFolder:
+ public IFolderFolder,
+ public IFolderWasChanged,
+ public IFolderOperations,
+ // public IFolderOperationsDeleteToRecycleBin,
+ public IFolderGetItemFullSize,
+ public IFolderClone,
+ public IFolderGetSystemIconIndex,
+ public IFolderSetFlatMode,
+ public CMyUnknownImp
+{
+ UInt64 GetSizeOfItem(int anIndex) const;
+public:
+ MY_QUERYINTERFACE_BEGIN
+ MY_QUERYINTERFACE_ENTRY(IFolderWasChanged)
+ // MY_QUERYINTERFACE_ENTRY(IFolderOperationsDeleteToRecycleBin)
+ MY_QUERYINTERFACE_ENTRY(IFolderOperations)
+ MY_QUERYINTERFACE_ENTRY(IFolderGetItemFullSize)
+ MY_QUERYINTERFACE_ENTRY(IFolderClone)
+ MY_QUERYINTERFACE_ENTRY(IFolderGetSystemIconIndex)
+ MY_QUERYINTERFACE_ENTRY(IFolderSetFlatMode)
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+
+ INTERFACE_FolderFolder(;)
+ INTERFACE_FolderOperations(;)
+
+ STDMETHOD(WasChanged)(INT32 *wasChanged);
+ STDMETHOD(Clone)(IFolderFolder **resultFolder);
+ STDMETHOD(GetItemFullSize)(UInt32 index, PROPVARIANT *value, IProgress *progress);
+
+ STDMETHOD(SetFlatMode)(Int32 flatMode);
+
+ STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex);
+
+private:
+ UString _path;
+ CDirItem _root;
+ CRecordVector<CDirItem *> _refs;
+
+ CMyComPtr<IFolderFolder> _parentFolder;
+
+ bool _commentsAreLoaded;
+ CPairsStorage _comments;
+
+ bool _flatMode;
+
+ // FIXME NWindows::NFile::NFind::CFindChangeNotification _findChangeNotification;
+
+ HRESULT GetItemsFullSize(const UInt32 *indices, UInt32 numItems,
+ UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress);
+ HRESULT GetItemFullSize(int index, UInt64 &size, IProgress *progress);
+ HRESULT GetComplexName(const wchar_t *name, UString &resultPath);
+ HRESULT BindToFolderSpec(const wchar_t *name, IFolderFolder **resultFolder);
+
+ bool LoadComments();
+ bool SaveComments();
+ HRESULT LoadSubItems(CDirItem &dirItem, const UString &path);
+ void AddRefs(CDirItem &dirItem);
+public:
+ HRESULT Init(const UString &path, IFolderFolder *parentFolder);
+
+ CFSFolder() : _flatMode(false) {}
+
+ UString GetPrefix(const CDirItem &item) const;
+ UString GetRelPath(const CDirItem &item) const;
+ UString GetRelPath(UInt32 index) const { return GetRelPath(*_refs[index]); }
+
+ void Clear()
+ {
+ _root.Clear();
+ _refs.Clear();
+ }
+};
+
+HRESULT GetFolderSize(const UString &path, UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress);
+
+}
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolderCopy.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolderCopy.cpp
new file mode 100644
index 000000000..db1ba2ba4
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FSFolderCopy.cpp
@@ -0,0 +1,523 @@
+// FSFolderCopy.cpp
+
+#include "StdAfx.h"
+
+// FIXME #include <Winbase.h>
+
+#include "FSFolder.h"
+#include "Windows/FileDir.h"
+#include "Windows/Error.h"
+
+#include "Common/StringConvert.h"
+
+#include "../../Common/FilePathAutoRename.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NFind;
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NFsFolder {
+
+/*
+static bool IsItWindows2000orHigher()
+{
+ OSVERSIONINFO versionInfo;
+ versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
+ if (!::GetVersionEx(&versionInfo))
+ return false;
+ return (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) &&
+ (versionInfo.dwMajorVersion >= 5);
+}
+*/
+
+struct CProgressInfo
+{
+ UInt64 StartPos;
+ IProgress *Progress;
+};
+
+#ifdef _WIN32
+
+static DWORD CALLBACK CopyProgressRoutine(
+ LARGE_INTEGER /* TotalFileSize */, // file size
+ LARGE_INTEGER TotalBytesTransferred, // bytes transferred
+ LARGE_INTEGER /* StreamSize */, // bytes in stream
+ LARGE_INTEGER /* StreamBytesTransferred */, // bytes transferred for stream
+ DWORD /* dwStreamNumber */, // current stream
+ DWORD /* dwCallbackReason */, // callback reason
+ HANDLE /* hSourceFile */, // handle to source file
+ HANDLE /* hDestinationFile */, // handle to destination file
+ LPVOID lpData // from CopyFileEx
+)
+{
+ CProgressInfo &progressInfo = *(CProgressInfo *)lpData;
+ UInt64 completed = progressInfo.StartPos + TotalBytesTransferred.QuadPart;
+ if (progressInfo.Progress->SetCompleted(&completed) != S_OK)
+ return PROGRESS_CANCEL;
+ return PROGRESS_CONTINUE;
+}
+
+typedef BOOL (WINAPI * CopyFileExPointer)(
+ IN LPCSTR lpExistingFileName,
+ IN LPCSTR lpNewFileName,
+ IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
+ IN LPVOID lpData OPTIONAL,
+ IN LPBOOL pbCancel OPTIONAL,
+ IN DWORD dwCopyFlags
+ );
+
+typedef BOOL (WINAPI * CopyFileExPointerW)(
+ IN LPCWSTR lpExistingFileName,
+ IN LPCWSTR lpNewFileName,
+ IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
+ IN LPVOID lpData OPTIONAL,
+ IN LPBOOL pbCancel OPTIONAL,
+ IN DWORD dwCopyFlags
+ );
+
+#ifndef _UNICODE
+static inline UINT GetCurrentCodePage() { return ::AreFileApisANSI() ? CP_ACP : CP_OEMCP; }
+static CSysString GetSysPath(LPCWSTR sysPath)
+ { return UnicodeStringToMultiByte(sysPath, GetCurrentCodePage()); }
+#endif
+
+#endif
+
+static bool MyCopyFile(LPCWSTR existingFile, LPCWSTR newFile, IProgress *progress, UInt64 &completedSize)
+{
+#ifdef _WIN32
+ CProgressInfo progressInfo;
+ progressInfo.Progress = progress;
+ progressInfo.StartPos = completedSize;
+ BOOL CancelFlag = FALSE;
+ #ifndef _UNICODE
+ if (g_IsNT)
+ #endif
+ {
+ CopyFileExPointerW copyFunctionW = (CopyFileExPointerW)
+ ::GetProcAddress(::GetModuleHandleW(L"kernel32.dll"),
+ "CopyFileExW");
+ if (copyFunctionW == 0)
+ return false;
+ if (copyFunctionW(existingFile, newFile, CopyProgressRoutine,
+ &progressInfo, &CancelFlag, COPY_FILE_FAIL_IF_EXISTS))
+ return true;
+ #ifdef WIN_LONG_PATH
+ UString longPathExisting, longPathNew;
+ if (!NDirectory::GetLongPaths(existingFile, newFile, longPathExisting, longPathNew))
+ return false;
+ if (copyFunctionW(longPathExisting, longPathNew, CopyProgressRoutine,
+ &progressInfo, &CancelFlag, COPY_FILE_FAIL_IF_EXISTS))
+ return true;
+ #endif
+ return false;
+ }
+ #ifndef _UNICODE
+ else
+ {
+ CopyFileExPointer copyFunction = (CopyFileExPointer)
+ ::GetProcAddress(::GetModuleHandleA("kernel32.dll"),
+ "CopyFileExA");
+ if (copyFunction != 0)
+ {
+ if (copyFunction(GetSysPath(existingFile), GetSysPath(newFile),
+ CopyProgressRoutine,&progressInfo, &CancelFlag, COPY_FILE_FAIL_IF_EXISTS))
+ return true;
+ if (::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return false;
+ }
+ return BOOLToBool(::CopyFile(GetSysPath(existingFile), GetSysPath(newFile), TRUE));
+ }
+ #endif
+#else
+ extern bool wxw_CopyFile(LPCWSTR existingFile, LPCWSTR newFile, bool overwrite);
+ return wxw_CopyFile(existingFile, newFile, true);
+#endif
+}
+
+#ifdef _WIN32
+typedef BOOL (WINAPI * MoveFileWithProgressPointer)(
+ IN LPCWSTR lpExistingFileName,
+ IN LPCWSTR lpNewFileName,
+ IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
+ IN LPVOID lpData OPTIONAL,
+ IN DWORD dwFlags
+ );
+#endif
+
+static bool MyMoveFile(LPCWSTR existingFile, LPCWSTR newFile, IProgress *progress, UInt64 &completedSize)
+{
+#ifdef _WIN32
+ // if (IsItWindows2000orHigher())
+ // {
+ CProgressInfo progressInfo;
+ progressInfo.Progress = progress;
+ progressInfo.StartPos = completedSize;
+
+ MoveFileWithProgressPointer moveFunction = (MoveFileWithProgressPointer)
+ ::GetProcAddress(::GetModuleHandle(TEXT("kernel32.dll")),
+ "MoveFileWithProgressW");
+ if (moveFunction != 0)
+ {
+ if (moveFunction(
+ existingFile, newFile, CopyProgressRoutine,
+ &progressInfo, MOVEFILE_COPY_ALLOWED))
+ return true;
+ if (::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ {
+ #ifdef WIN_LONG_PATH
+ UString longPathExisting, longPathNew;
+ if (!NDirectory::GetLongPaths(existingFile, newFile, longPathExisting, longPathNew))
+ return false;
+ if (moveFunction(longPathExisting, longPathNew, CopyProgressRoutine,
+ &progressInfo, MOVEFILE_COPY_ALLOWED))
+ return true;
+ #endif
+ if (::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return false;
+ }
+ }
+ // }
+ // else
+#endif
+ return NDirectory::MyMoveFile(existingFile, newFile);
+}
+
+static HRESULT MyCopyFile(
+ const UString &srcPath,
+ const CFileInfoW &srcFileInfo,
+ const UString &destPathSpec,
+ IFolderOperationsExtractCallback *callback,
+ UInt64 &completedSize)
+{
+ UString destPath = destPathSpec;
+ if (destPath.CompareNoCase(srcPath) == 0)
+ {
+ UString message = UString(L"can not move file \'") + destPath + UString(L"\' onto itself");
+ RINOK(callback->ShowMessage(message));
+ return E_ABORT;
+ }
+
+ INT32 writeAskResult;
+ CMyComBSTR destPathResult;
+ RINOK(callback->AskWrite(
+ srcPath,
+ BoolToInt(false),
+ &srcFileInfo.MTime, &srcFileInfo.Size,
+ destPath,
+ &destPathResult,
+ &writeAskResult));
+ if (IntToBool(writeAskResult))
+ {
+ UString destPathNew = UString(destPathResult);
+ RINOK(callback->SetCurrentFilePath(srcPath));
+ if (!MyCopyFile(srcPath, destPathNew, callback, completedSize))
+ {
+ UString message = NError::MyFormatMessageW(GetLastError()) +
+ UString(L" \'") +
+ UString(destPathNew) +
+ UString(L"\'");
+ RINOK(callback->ShowMessage(message));
+ return E_ABORT;
+ }
+ }
+ completedSize += srcFileInfo.Size;
+ return callback->SetCompleted(&completedSize);
+}
+
+static HRESULT CopyFolder(
+ const UString &srcPath,
+ const UString &destPathSpec,
+ IFolderOperationsExtractCallback *callback,
+ UInt64 &completedSize)
+{
+ RINOK(callback->SetCompleted(&completedSize));
+
+ UString destPath = destPathSpec;
+ int len = srcPath.Length();
+ if (destPath.Length() >= len && srcPath.CompareNoCase(destPath.Left(len)) == 0)
+ {
+ if (destPath.Length() == len || destPath[len] == WCHAR_PATH_SEPARATOR)
+ {
+ UString message = UString(L"can not copy folder \'") +
+ destPath + UString(L"\' onto itself");
+ RINOK(callback->ShowMessage(message));
+ return E_ABORT;
+ }
+ }
+
+ if (!NDirectory::CreateComplexDirectory(destPath))
+ {
+ UString message = UString(L"can not create folder ") + destPath;
+ RINOK(callback->ShowMessage(message));
+ return E_ABORT;
+ }
+ CEnumeratorW enumerator(srcPath + UString(WSTRING_PATH_SEPARATOR L"*"));
+ CFileInfoEx fileInfo;
+ while (enumerator.Next(fileInfo))
+ {
+ const UString srcPath2 = srcPath + UString(WSTRING_PATH_SEPARATOR) + fileInfo.Name;
+ const UString destPath2 = destPath + UString(WSTRING_PATH_SEPARATOR) + fileInfo.Name;
+ if (fileInfo.IsDir())
+ {
+ RINOK(CopyFolder(srcPath2, destPath2, callback, completedSize));
+ }
+ else
+ {
+ RINOK(MyCopyFile(srcPath2, fileInfo, destPath2, callback, completedSize));
+ }
+ }
+ return S_OK;
+}
+
+
+STDMETHODIMP CFSFolder::CopyTo(const UInt32 *indices, UInt32 numItems,
+ const wchar_t *path, IFolderOperationsExtractCallback *callback)
+{
+ if (numItems == 0)
+ return S_OK;
+
+ UInt64 numFolders, numFiles, totalSize;
+ GetItemsFullSize(indices, numItems, numFolders, numFiles, totalSize, callback);
+ RINOK(callback->SetTotal(totalSize));
+ RINOK(callback->SetNumFiles(numFiles));
+
+ UString destPath = path;
+ if (destPath.IsEmpty())
+ return E_INVALIDARG;
+ bool directName = (destPath[destPath.Length() - 1] != WCHAR_PATH_SEPARATOR);
+ if (directName)
+ {
+ if (numItems > 1)
+ return E_INVALIDARG;
+ }
+ /*
+ // doesn't work in network
+ else
+ if (!NDirectory::CreateComplexDirectory(destPath)))
+ {
+ DWORD lastError = ::GetLastError();
+ UString message = UString(L"can not create folder ") +
+ destPath;
+ RINOK(callback->ShowMessage(message));
+ return E_ABORT;
+ }
+ */
+
+ UInt64 completedSize = 0;
+ RINOK(callback->SetCompleted(&completedSize));
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ const CDirItem &fileInfo = *_refs[indices[i]];
+ UString destPath2 = destPath;
+ if (!directName)
+ destPath2 += fileInfo.Name;
+ UString srcPath = _path + GetPrefix(fileInfo) + fileInfo.Name;
+ if (fileInfo.IsDir())
+ {
+ RINOK(CopyFolder(srcPath, destPath2, callback, completedSize));
+ }
+ else
+ {
+ RINOK(MyCopyFile(srcPath, fileInfo, destPath2, callback, completedSize));
+ }
+ }
+ return S_OK;
+}
+
+/////////////////////////////////////////////////
+// Move Operations
+
+HRESULT MyMoveFile(
+ const UString &srcPath,
+ const CFileInfoW &srcFileInfo,
+ const UString &destPathSpec,
+ IFolderOperationsExtractCallback *callback,
+ UInt64 &completedSize)
+{
+ UString destPath = destPathSpec;
+ if (destPath.CompareNoCase(srcPath) == 0)
+ {
+ UString message = UString(L"can not move file \'")
+ + destPath +
+ UString(L"\' onto itself");
+ RINOK(callback->ShowMessage(message));
+ return E_ABORT;
+ }
+
+ INT32 writeAskResult;
+ CMyComBSTR destPathResult;
+ RINOK(callback->AskWrite(
+ srcPath,
+ BoolToInt(false),
+ &srcFileInfo.MTime, &srcFileInfo.Size,
+ destPath,
+ &destPathResult,
+ &writeAskResult));
+ if (IntToBool(writeAskResult))
+ {
+ UString destPathNew = UString(destPathResult);
+ RINOK(callback->SetCurrentFilePath(srcPath));
+ if (!MyMoveFile(srcPath, destPathNew, callback, completedSize))
+ {
+ UString message = UString(L"can not move to file ") + destPathNew;
+ RINOK(callback->ShowMessage(message));
+ }
+ }
+ completedSize += srcFileInfo.Size;
+ RINOK(callback->SetCompleted(&completedSize));
+ return S_OK;
+}
+
+HRESULT MyMoveFolder(
+ const UString &srcPath,
+ const UString &destPathSpec,
+ IFolderOperationsExtractCallback *callback,
+ UInt64 &completedSize)
+{
+ UString destPath = destPathSpec;
+ int len = srcPath.Length();
+ if (destPath.Length() >= len && srcPath.CompareNoCase(destPath.Left(len)) == 0)
+ {
+ if (destPath.Length() == len || destPath[len] == WCHAR_PATH_SEPARATOR)
+ {
+ UString message = UString(L"can not move folder \'") +
+ destPath + UString(L"\' onto itself");
+ RINOK(callback->ShowMessage(message));
+ return E_ABORT;
+ }
+ }
+
+ if (MyMoveFile(srcPath, destPath, callback, completedSize))
+ return S_OK;
+
+ if (!NDirectory::CreateComplexDirectory(destPath))
+ {
+ UString message = UString(L"can not create folder ") + destPath;
+ RINOK(callback->ShowMessage(message));
+ return E_ABORT;
+ }
+ {
+ CEnumeratorW enumerator(srcPath + UString(WSTRING_PATH_SEPARATOR L"*"));
+ CFileInfoEx fileInfo;
+ while (enumerator.Next(fileInfo))
+ {
+ const UString srcPath2 = srcPath + UString(WSTRING_PATH_SEPARATOR) + fileInfo.Name;
+ const UString destPath2 = destPath + UString(WSTRING_PATH_SEPARATOR) + fileInfo.Name;
+ if (fileInfo.IsDir())
+ {
+ RINOK(MyMoveFolder(srcPath2, destPath2, callback, completedSize));
+ }
+ else
+ {
+ RINOK(MyMoveFile(srcPath2, fileInfo, destPath2, callback, completedSize));
+ }
+ }
+ }
+ if (!NDirectory::MyRemoveDirectory(srcPath))
+ {
+ UString message = UString(L"can not remove folder") + srcPath;
+ RINOK(callback->ShowMessage(message));
+ return E_ABORT;
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::MoveTo(
+ const UInt32 *indices,
+ UInt32 numItems,
+ const wchar_t *path,
+ IFolderOperationsExtractCallback *callback)
+{
+ if (numItems == 0)
+ return S_OK;
+
+ UInt64 numFolders, numFiles, totalSize;
+ GetItemsFullSize(indices, numItems, numFolders, numFiles, totalSize, callback);
+ RINOK(callback->SetTotal(totalSize));
+ RINOK(callback->SetNumFiles(numFiles));
+
+ UString destPath = path;
+ if (destPath.IsEmpty())
+ return E_INVALIDARG;
+ bool directName = (destPath[destPath.Length() - 1] != WCHAR_PATH_SEPARATOR);
+ if (directName)
+ {
+ if (numItems > 1)
+ return E_INVALIDARG;
+ }
+ else
+ if (!NDirectory::CreateComplexDirectory(destPath))
+ {
+ UString message = UString(L"can not create folder ") +
+ destPath;
+ RINOK(callback->ShowMessage(message));
+ return E_ABORT;
+ }
+
+ UInt64 completedSize = 0;
+ RINOK(callback->SetCompleted(&completedSize));
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ const CDirItem &fileInfo = *_refs[indices[i]];
+ UString destPath2 = destPath;
+ if (!directName)
+ destPath2 += fileInfo.Name;
+ UString srcPath = _path + GetPrefix(fileInfo) + fileInfo.Name;
+ if (fileInfo.IsDir())
+ {
+ RINOK(MyMoveFolder(srcPath, destPath2, callback, completedSize));
+ }
+ else
+ {
+ RINOK(MyMoveFile(srcPath, fileInfo, destPath2, callback, completedSize));
+ }
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CFSFolder::CopyFrom(const wchar_t * /* fromFolderPath */,
+ const wchar_t ** /* itemsPaths */, UInt32 /* numItems */, IProgress * /* progress */)
+{
+ /*
+ UInt64 numFolders, numFiles, totalSize;
+ numFiles = numFolders = totalSize = 0;
+ UInt32 i;
+ for (i = 0; i < numItems; i++)
+ {
+ UString path = (UString)fromFolderPath + itemsPaths[i];
+
+ CFileInfoW fileInfo;
+ if (!FindFile(path, fileInfo))
+ return ::GetLastError();
+ if (fileInfo.IsDir())
+ {
+ UInt64 subFolders, subFiles, subSize;
+ RINOK(GetFolderSize(path + UString(WSTRING_PATH_SEPARATOR) + fileInfo.Name, subFolders, subFiles, subSize, progress));
+ numFolders += subFolders;
+ numFolders++;
+ numFiles += subFiles;
+ totalSize += subSize;
+ }
+ else
+ {
+ numFiles++;
+ totalSize += fileInfo.Size;
+ }
+ }
+ RINOK(progress->SetTotal(totalSize));
+ RINOK(callback->SetNumFiles(numFiles));
+ for (i = 0; i < numItems; i++)
+ {
+ UString path = (UString)fromFolderPath + itemsPaths[i];
+ }
+ return S_OK;
+ */
+ return E_NOTIMPL;
+}
+
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp
new file mode 100644
index 000000000..cfc15d383
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp
@@ -0,0 +1,165 @@
+// FileFolderPluginOpen.cpp
+
+#include "StdAfx.h"
+
+#include "resource.h"
+
+#include "Windows/Thread.h"
+
+#include "../Agent/Agent.h"
+
+#include "LangUtils.h"
+#include "OpenCallback.h"
+#include "PluginLoader.h"
+#include "RegistryAssociations.h"
+#include "RegistryPlugins.h"
+
+using namespace NWindows;
+using namespace NRegistryAssociations;
+
+struct CThreadArchiveOpen
+{
+ UString Path;
+ CMyComPtr<IInStream> InStream;
+ CMyComPtr<IFolderManager> FolderManager;
+ CMyComPtr<IProgress> OpenCallback;
+ COpenArchiveCallback *OpenCallbackSpec;
+
+ CMyComPtr<IFolderFolder> Folder;
+ HRESULT Result;
+
+ void Process()
+ {
+ OpenCallbackSpec->ProgressDialog.WaitCreating();
+ Result = FolderManager->OpenFolderFile(InStream, Path, &Folder, OpenCallback);
+ OpenCallbackSpec->ProgressDialog.MyClose();
+ }
+
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
+ {
+ ((CThreadArchiveOpen *)param)->Process();
+ return 0;
+ }
+};
+
+static int FindPlugin(const CObjectVector<CPluginInfo> &plugins,
+ const UString &pluginName)
+{
+ for (int i = 0; i < plugins.Size(); i++)
+ if (plugins[i].Name.CompareNoCase(pluginName) == 0)
+ return i;
+ return -1;
+}
+
+HRESULT OpenFileFolderPlugin(
+ IInStream *inStream,
+ const UString &path,
+ HMODULE *module,
+ IFolderFolder **resultFolder,
+ HWND parentWindow,
+ bool &encrypted, UString &password)
+{
+#ifdef _WIN32
+ CObjectVector<CPluginInfo> plugins;
+ ReadFileFolderPluginInfoList(plugins);
+#endif
+
+ UString extension, name, pureName, dot;
+
+ int slashPos = path.ReverseFind(WCHAR_PATH_SEPARATOR);
+ UString dirPrefix;
+ UString fileName;
+ if (slashPos >= 0)
+ {
+ dirPrefix = path.Left(slashPos + 1);
+ fileName = path.Mid(slashPos + 1);
+ }
+ else
+ fileName = path;
+
+ NFile::NName::SplitNameToPureNameAndExtension(fileName, pureName, dot, extension);
+
+#ifdef _WIN32
+ if (!extension.IsEmpty())
+ {
+ CExtInfo extInfo;
+ if (ReadInternalAssociation(extension, extInfo))
+ {
+ for (int i = extInfo.Plugins.Size() - 1; i >= 0; i--)
+ {
+ int pluginIndex = FindPlugin(plugins, extInfo.Plugins[i]);
+ if (pluginIndex >= 0)
+ {
+ const CPluginInfo plugin = plugins[pluginIndex];
+ plugins.Delete(pluginIndex);
+ plugins.Insert(0, plugin);
+ }
+ }
+ }
+ }
+
+ for (int i = 0; i < plugins.Size(); i++)
+ {
+ const CPluginInfo &plugin = plugins[i];
+ if (!plugin.ClassIDDefined)
+ continue;
+#endif // #ifdef _WIN32
+ CPluginLibrary library;
+
+ CThreadArchiveOpen t;
+
+#ifdef _WIN32
+ if (plugin.FilePath.IsEmpty())
+ t.FolderManager = new CArchiveFolderManager;
+ else if (library.LoadAndCreateManager(plugin.FilePath, plugin.ClassID, &t.FolderManager) != S_OK)
+ continue;
+#else
+ t.FolderManager = new CArchiveFolderManager;
+#endif
+
+ t.OpenCallbackSpec = new COpenArchiveCallback;
+ t.OpenCallback = t.OpenCallbackSpec;
+ t.OpenCallbackSpec->PasswordIsDefined = encrypted;
+ t.OpenCallbackSpec->Password = password;
+ t.OpenCallbackSpec->ParentWindow = parentWindow;
+
+ if (inStream)
+ t.OpenCallbackSpec->SetSubArchiveName(fileName);
+ else
+ t.OpenCallbackSpec->LoadFileInfo(dirPrefix, fileName);
+
+ t.InStream = inStream;
+ t.Path = path;
+
+ UString progressTitle = LangString(IDS_OPENNING, 0x03020283);
+ t.OpenCallbackSpec->ProgressDialog.MainWindow = parentWindow;
+ t.OpenCallbackSpec->ProgressDialog.MainTitle = LangString(IDS_APP_TITLE, 0x03000000);
+ t.OpenCallbackSpec->ProgressDialog.MainAddTitle = progressTitle + UString(L" ");
+
+ NWindows::CThread thread;
+ if (thread.Create(CThreadArchiveOpen::MyThreadFunction, &t) != S_OK)
+ throw 271824;
+ t.OpenCallbackSpec->StartProgressDialog(progressTitle);
+
+ if (t.Result == E_ABORT)
+ return t.Result;
+
+ if (t.Result == S_OK)
+ {
+ // if (openCallbackSpec->PasswordWasAsked)
+ {
+ encrypted = t.OpenCallbackSpec->PasswordIsDefined;
+ password = t.OpenCallbackSpec->Password;
+ }
+ *module = library.Detach();
+ *resultFolder = t.Folder.Detach();
+ return S_OK;
+ }
+
+ if (t.Result != S_FALSE)
+ return t.Result;
+#ifdef _WIN32
+ }
+#endif
+ return S_FALSE;
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h
new file mode 100644
index 000000000..692417ba1
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h
@@ -0,0 +1,9 @@
+// FileFolderPluginOpen.h
+
+#ifndef __FILE_FOLDER_PLUGIN_OPEN_H
+#define __FILE_FOLDER_PLUGIN_OPEN_H
+
+HRESULT OpenFileFolderPlugin(IInStream *inStream, const UString &path,
+ HMODULE *module, IFolderFolder **resultFolder, HWND parentWindow, bool &encrypted, UString &password);
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FormatUtils.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FormatUtils.cpp
new file mode 100644
index 000000000..98bb043ef
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FormatUtils.cpp
@@ -0,0 +1,40 @@
+// FormatUtils.cpp
+
+#include "StdAfx.h"
+
+#include "FormatUtils.h"
+#include "Common/IntToString.h"
+#include "Windows/ResourceString.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+UString NumberToString(UInt64 number)
+{
+ wchar_t numberString[32];
+ ConvertUInt64ToString(number, numberString);
+ return numberString;
+}
+
+UString MyFormatNew(const UString &format, const UString &argument)
+{
+ UString result = format;
+ result.Replace(L"{0}", argument);
+ return result;
+}
+
+UString MyFormatNew(UINT resourceID,
+ #ifdef LANG
+ UInt32 langID,
+ #endif
+ const UString &argument)
+{
+ return MyFormatNew(
+ #ifdef LANG
+ LangString(resourceID, langID),
+ #else
+ NWindows::MyLoadStringW(resourceID),
+ #endif
+ argument);
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FormatUtils.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FormatUtils.h
new file mode 100644
index 000000000..70a444347
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/FormatUtils.h
@@ -0,0 +1,18 @@
+// FormatUtils.h
+
+#ifndef __FORMATUTILS_H
+#define __FORMATUTILS_H
+
+#include "Common/Types.h"
+#include "Common/MyString.h"
+
+UString NumberToString(UInt64 number);
+
+UString MyFormatNew(const UString &format, const UString &argument);
+UString MyFormatNew(UINT resourceID,
+ #ifdef LANG
+ UInt32 langID,
+ #endif
+ const UString &argument);
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/HelpUtils.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/HelpUtils.h
new file mode 100644
index 000000000..2a7b85aff
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/HelpUtils.h
@@ -0,0 +1,10 @@
+// HelpUtils.h
+
+#ifndef __HELPUTILS_H
+#define __HELPUTILS_H
+
+#include "Common/MyString.h"
+
+void ShowHelpWindow(HWND hwnd, LPCWSTR topicFile);
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/IFolder.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/IFolder.h
new file mode 100644
index 000000000..b301f5134
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/IFolder.h
@@ -0,0 +1,157 @@
+// IFolder.h
+
+#ifndef __IFOLDER_H
+#define __IFOLDER_H
+
+#include "../../IProgress.h"
+#include "../../IStream.h"
+
+#define FOLDER_INTERFACE_SUB(i, b, x) DECL_INTERFACE_SUB(i, b, 8, x)
+#define FOLDER_INTERFACE(i, x) FOLDER_INTERFACE_SUB(i, IUnknown, x)
+
+namespace NPlugin
+{
+ enum
+ {
+ kName = 0,
+ kType,
+ kClassID,
+ kOptionsClassID
+ };
+}
+
+#define INTERFACE_FolderFolder(x) \
+ STDMETHOD(LoadItems)() x; \
+ STDMETHOD(GetNumberOfItems)(UInt32 *numItems) x; \
+ STDMETHOD(GetProperty)(UInt32 itemIndex, PROPID propID, PROPVARIANT *value) x; \
+ STDMETHOD(BindToFolder)(UInt32 index, IFolderFolder **resultFolder) x; \
+ STDMETHOD(BindToFolder)(const wchar_t *name, IFolderFolder **resultFolder) x; \
+ STDMETHOD(BindToParentFolder)(IFolderFolder **resultFolder) x; \
+ STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties) x; \
+ STDMETHOD(GetPropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) x; \
+ STDMETHOD(GetFolderProperty)(PROPID propID, PROPVARIANT *value) x; \
+
+FOLDER_INTERFACE(IFolderFolder, 0x00)
+{
+ INTERFACE_FolderFolder(PURE)
+};
+
+FOLDER_INTERFACE(IFolderWasChanged, 0x04)
+{
+ STDMETHOD(WasChanged)(Int32 *wasChanged) PURE;
+};
+
+FOLDER_INTERFACE_SUB(IFolderOperationsExtractCallback, IProgress, 0x0B)
+{
+ // STDMETHOD(SetTotalFiles)(UInt64 total) PURE;
+ // STDMETHOD(SetCompletedFiles)(const UInt64 *completedValue) PURE;
+ STDMETHOD(AskWrite)(
+ const wchar_t *srcPath,
+ Int32 srcIsFolder,
+ const FILETIME *srcTime,
+ const UInt64 *srcSize,
+ const wchar_t *destPathRequest,
+ BSTR *destPathResult,
+ Int32 *writeAnswer) PURE;
+ STDMETHOD(ShowMessage)(const wchar_t *message) PURE;
+ STDMETHOD(SetCurrentFilePath)(const wchar_t *filePath) PURE;
+ STDMETHOD(SetNumFiles)(UInt64 numFiles) PURE;
+};
+
+#define INTERFACE_FolderOperations(x) \
+ STDMETHOD(CreateFolder)(const wchar_t *name, IProgress *progress) x; \
+ STDMETHOD(CreateFile)(const wchar_t *name, IProgress *progress) x; \
+ STDMETHOD(Rename)(UInt32 index, const wchar_t *newName, IProgress *progress) x; \
+ STDMETHOD(Delete)(const UInt32 *indices, UInt32 numItems, IProgress *progress) x; \
+ STDMETHOD(CopyTo)(const UInt32 *indices, UInt32 numItems, \
+ const wchar_t *path, IFolderOperationsExtractCallback *callback) x; \
+ STDMETHOD(MoveTo)(const UInt32 *indices, UInt32 numItems, \
+ const wchar_t *path, IFolderOperationsExtractCallback *callback) x; \
+ STDMETHOD(CopyFrom)(const wchar_t *fromFolderPath, \
+ const wchar_t **itemsPaths, UInt32 numItems, IProgress *progress) x; \
+ STDMETHOD(SetProperty)(UInt32 index, PROPID propID, const PROPVARIANT *value, IProgress *progress) x; \
+
+FOLDER_INTERFACE(IFolderOperations, 0x06)
+{
+ INTERFACE_FolderOperations(PURE)
+};
+
+/*
+FOLDER_INTERFACE2(IFolderOperationsDeleteToRecycleBin, 0x06, 0x03)
+{
+ STDMETHOD(DeleteToRecycleBin)(const UInt32 *indices, UInt32 numItems, IProgress *progress) PURE;
+};
+*/
+
+FOLDER_INTERFACE(IFolderGetSystemIconIndex, 0x07)
+{
+ STDMETHOD(GetSystemIconIndex)(UInt32 index, Int32 *iconIndex) PURE;
+};
+
+FOLDER_INTERFACE(IFolderGetItemFullSize, 0x08)
+{
+ STDMETHOD(GetItemFullSize)(UInt32 index, PROPVARIANT *value, IProgress *progress) PURE;
+};
+
+FOLDER_INTERFACE(IFolderClone, 0x09)
+{
+ STDMETHOD(Clone)(IFolderFolder **resultFolder) PURE;
+};
+
+FOLDER_INTERFACE(IFolderSetFlatMode, 0x0A)
+{
+ STDMETHOD(SetFlatMode)(Int32 flatMode) PURE;
+};
+
+#define INTERFACE_FolderProperties(x) \
+ STDMETHOD(GetNumberOfFolderProperties)(UInt32 *numProperties) x; \
+ STDMETHOD(GetFolderPropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) x; \
+
+FOLDER_INTERFACE(IFolderProperties, 0x0E)
+{
+ INTERFACE_FolderProperties(PURE)
+};
+
+#define INTERFACE_IFolderArchiveProperties(x) \
+ STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) x; \
+ STDMETHOD(GetNumberOfArchiveProperties)(UInt32 *numProperties) x; \
+ STDMETHOD(GetArchivePropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) x;
+
+FOLDER_INTERFACE(IFolderArchiveProperties, 0x0C)
+{
+ INTERFACE_IFolderArchiveProperties(PURE)
+};
+
+FOLDER_INTERFACE(IGetFolderArchiveProperties, 0x0D)
+{
+ STDMETHOD(GetFolderArchiveProperties)(IFolderArchiveProperties **object) PURE;
+};
+
+#define FOLDER_MANAGER_INTERFACE(i, x) DECL_INTERFACE(i, 9, x)
+
+#define INTERFACE_IFolderManager(x) \
+ STDMETHOD(OpenFolderFile)(IInStream *inStream, const wchar_t *filePath, IFolderFolder **resultFolder, IProgress *progress) x; \
+ STDMETHOD(GetExtensions)(BSTR *extensions) x; \
+ STDMETHOD(GetIconPath)(const wchar_t *ext, BSTR *iconPath, Int32 *iconIndex) x; \
+
+ // STDMETHOD(GetTypes)(BSTR *types) PURE;
+ // STDMETHOD(CreateFolderFile)(const wchar_t *type, const wchar_t *filePath, IProgress *progress) PURE;
+
+FOLDER_MANAGER_INTERFACE(IFolderManager, 0x04)
+{
+ INTERFACE_IFolderManager(PURE);
+};
+
+
+#define IMP_IFolderFolder_GetProp(k) \
+ (UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) \
+ { if(index >= sizeof(k) / sizeof(k[0])) return E_INVALIDARG; \
+ const STATPROPSTG &srcItem = k[index]; \
+ *propID = srcItem.propid; *varType = srcItem.vt; *name = 0; return S_OK; } \
+
+#define IMP_IFolderFolder_Props(c) \
+ STDMETHODIMP c::GetNumberOfProperties(UInt32 *numProperties) \
+ { *numProperties = sizeof(kProps) / sizeof(kProps[0]); return S_OK; } \
+ STDMETHODIMP c::GetPropertyInfo IMP_IFolderFolder_GetProp(kProps)
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/LangUtils.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/LangUtils.cpp
new file mode 100644
index 000000000..52f853489
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/LangUtils.cpp
@@ -0,0 +1,208 @@
+// LangUtils.cpp
+
+#include "StdAfx.h"
+
+#include "LangUtils.h"
+#include "Common/StringConvert.h"
+#include "Common/StringToInt.h"
+#include "Windows/Synchronization.h"
+#include "Windows/Window.h"
+#include "Windows/FileFind.h"
+#include "RegistryUtils.h"
+#include "ProgramLocation.h"
+
+using namespace NWindows;
+
+static CLang g_Lang;
+UString g_LangID;
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+void ReloadLang()
+{
+ ReadRegLang(g_LangID);
+ g_Lang.Clear();
+ if (!g_LangID.IsEmpty() && g_LangID != L"-")
+ {
+ UString langPath = g_LangID;
+ if (langPath.Find(WCHAR_PATH_SEPARATOR) < 0)
+ {
+ if (langPath.Find(L'.') < 0)
+ langPath += L".txt";
+ UString folderPath;
+ if (GetProgramFolderPath(folderPath))
+ langPath = folderPath + UString(L"Lang" WSTRING_PATH_SEPARATOR) + langPath;
+ }
+ g_Lang.Open(langPath);
+ }
+}
+
+static bool g_Loaded = false;
+static NSynchronization::CCriticalSection g_CriticalSection;
+
+void LoadLangOneTime()
+{
+ NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+ if (g_Loaded)
+ return;
+ g_Loaded = true;
+ ReloadLang();
+}
+
+void LangSetDlgItemsText(HWND dialogWindow, CIDLangPair *idLangPairs, int numItems)
+{
+ for (int i = 0; i < numItems; i++)
+ {
+ const CIDLangPair &idLangPair = idLangPairs[i];
+ UString message;
+ if (g_Lang.GetMessage(idLangPair.LangID, message))
+ {
+ NWindows::CWindow window(GetDlgItem(dialogWindow, idLangPair.ControlID));
+ window.SetText(message);
+ }
+ }
+}
+
+void LangSetWindowText(HWND window, UInt32 langID)
+{
+ UString message;
+ if (g_Lang.GetMessage(langID, message))
+ MySetWindowText(window, message);
+}
+
+UString LangString(UInt32 langID)
+{
+ UString message;
+ if (g_Lang.GetMessage(langID, message))
+ return message;
+ return UString();
+}
+
+UString LangString(UINT resourceID, UInt32 langID)
+{
+ UString message;
+ if (g_Lang.GetMessage(langID, message))
+ return message;
+ return NWindows::MyLoadStringW(resourceID);
+}
+
+void LoadLangs(CObjectVector<CLangEx> &langs)
+{
+ langs.Clear();
+ UString folderPath;
+ if (!::GetProgramFolderPath(folderPath))
+ return;
+ folderPath += L"Lang" WSTRING_PATH_SEPARATOR;
+ NWindows::NFile::NFind::CEnumeratorW enumerator(folderPath + L"*.txt");
+ NWindows::NFile::NFind::CFileInfoW fileInfo;
+ while (enumerator.Next(fileInfo))
+ {
+ if (fileInfo.IsDir())
+ continue;
+ CLangEx lang;
+ UString filePath = folderPath + fileInfo.Name;
+ const int kExtSize = 4;
+ const UString ext = fileInfo.Name.Right(kExtSize);
+ if (ext.CompareNoCase(L".txt") != 0)
+ continue;
+ lang.ShortName = fileInfo.Name.Left(fileInfo.Name.Length() - kExtSize);
+ if (lang.Lang.Open(filePath))
+ langs.Add(lang);
+ }
+}
+
+bool SplidID(const UString &id, WORD &primID, WORD &subID)
+{
+ primID = 0;
+ subID = 0;
+ const wchar_t *start = id;
+ const wchar_t *end;
+ UInt64 value = ConvertStringToUInt64(start, &end);
+ if (start == end)
+ return false;
+ primID = (WORD)value;
+ if (*end == 0)
+ return true;
+ if (*end != L'-')
+ return false;
+ start = end + 1;
+ value = ConvertStringToUInt64(start, &end);
+ if (start == end)
+ return false;
+ subID = (WORD)value;
+ return (*end == 0);
+}
+
+typedef LANGID (WINAPI *GetUserDefaultUILanguageP)();
+
+void FindMatchLang(UString &shortName)
+{
+ shortName.Empty();
+
+ LANGID SystemDefaultLangID = GetSystemDefaultLangID(); // Lang for non-Unicode in XP64
+ LANGID UserDefaultLangID = GetUserDefaultLangID(); // Standarts and formats in XP64
+
+ if (SystemDefaultLangID != UserDefaultLangID)
+ return;
+ LANGID langID = UserDefaultLangID;
+ /*
+ LANGID SystemDefaultUILanguage; // english in XP64
+ LANGID UserDefaultUILanguage; // english in XP64
+
+ GetUserDefaultUILanguageP fn = (GetUserDefaultUILanguageP)GetProcAddress(
+ GetModuleHandle("kernel32"), "GetUserDefaultUILanguage");
+ if (fn != NULL)
+ UserDefaultUILanguage = fn();
+ fn = (GetUserDefaultUILanguageP)GetProcAddress(
+ GetModuleHandle("kernel32"), "GetSystemDefaultUILanguage");
+ if (fn != NULL)
+ SystemDefaultUILanguage = fn();
+ */
+
+ WORD primLang = (WORD)(PRIMARYLANGID(langID));
+ WORD subLang = (WORD)(SUBLANGID(langID));
+ CObjectVector<CLangEx> langs;
+ LoadLangs(langs);
+ for (int i = 0; i < langs.Size(); i++)
+ {
+ const CLangEx &lang = langs[i];
+ UString id;
+ if (lang.Lang.GetMessage(0x00000002, id))
+ {
+ WORD primID;
+ WORD subID;
+ if (SplidID(id, primID, subID))
+ if (primID == primLang)
+ {
+ if (subID == 0)
+ shortName = lang.ShortName;
+ if (subLang == subID)
+ {
+ shortName = lang.ShortName;
+ return;
+ }
+ }
+ }
+ }
+}
+
+void ReloadLangSmart()
+{
+ #ifndef _UNICODE
+ if (g_IsNT)
+ #endif
+ {
+ ReadRegLang(g_LangID);
+ if (g_LangID.IsEmpty())
+ {
+ UString shortName;
+ FindMatchLang(shortName);
+ if (shortName.IsEmpty())
+ shortName = L"-";
+ SaveRegLang(shortName);
+ }
+ }
+ ReloadLang();
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/LangUtils.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/LangUtils.h
new file mode 100644
index 000000000..40debdfe4
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/LangUtils.h
@@ -0,0 +1,41 @@
+// LangUtils.h
+
+#ifndef __LANGUTILS_H
+#define __LANGUTILS_H
+
+#include "Common/Lang.h"
+#include "Windows/ResourceString.h"
+
+extern UString g_LangID;
+
+struct CIDLangPair
+{
+ int ControlID;
+ UInt32 LangID;
+};
+
+void ReloadLang();
+void LoadLangOneTime();
+void ReloadLangSmart();
+
+struct CLangEx
+{
+ CLang Lang;
+ UString ShortName;
+};
+
+void LoadLangs(CObjectVector<CLangEx> &langs);
+
+void LangSetDlgItemsText(HWND dialogWindow, CIDLangPair *idLangPairs, int numItems);
+void LangSetWindowText(HWND window, UInt32 langID);
+
+UString LangString(UInt32 langID);
+UString LangString(UINT resourceID, UInt32 langID);
+
+#ifdef LANG
+#define LangStringSpec(resourceID, langID) LangString(resourceID, langID)
+#else
+#define LangStringSpec(resourceID, langID) NWindows::MyLoadStringW(resourceID)
+#endif
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog.cpp
new file mode 100644
index 000000000..667e6acc0
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog.cpp
@@ -0,0 +1,96 @@
+// ListViewDialog.cpp
+
+#include "StdAfx.h"
+#include "ListViewDialog.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+static CIDLangPair kIDLangPairs[] =
+{
+ { IDOK, 0x02000702 },
+ { IDCANCEL, 0x02000710 }
+};
+#endif
+
+bool CListViewDialog::OnInit()
+{
+ #ifdef LANG
+ LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
+ #endif
+ _listView.Attach(GetItem(IDC_LISTVIEW_LIST));
+ SetText(Title);
+
+ LVCOLUMN columnInfo;
+ columnInfo.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
+ columnInfo.fmt = LVCFMT_LEFT;
+ columnInfo.iSubItem = 0;
+ columnInfo.cx = 1000;
+
+ _listView.InsertColumn(0, &columnInfo);
+
+ for (int i = 0; i < Strings.Size(); i++)
+ _listView.InsertItem(i, Strings[i]);
+
+ if (Strings.Size() > 0)
+ _listView.SetItemState(0, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+ StringsWereChanged = false;
+ return CModalDialog::OnInit();
+}
+
+#ifdef _WIN32 // FIXME
+bool CListViewDialog::OnNotify(UINT /* controlID */, LPNMHDR header)
+{
+ if (header->hwndFrom != _listView)
+ return false;
+ switch(header->code)
+ {
+ case LVN_KEYDOWN:
+ {
+ LPNMLVKEYDOWN keyDownInfo = LPNMLVKEYDOWN(header);
+ switch(keyDownInfo->wVKey)
+ {
+ case VK_DELETE:
+ {
+ if (!DeleteIsAllowed)
+ return false;
+ int focusedIndex = _listView.GetFocusedItem();
+ if (focusedIndex < 0)
+ focusedIndex = 0;
+ for (;;)
+ {
+ int index = _listView.GetNextSelectedItem(-1);
+ if (index < 0)
+ break;
+ StringsWereChanged = true;
+ _listView.DeleteItem(index);
+ Strings.Delete(index);
+ }
+ if (focusedIndex >= _listView.GetItemCount())
+ focusedIndex = _listView.GetItemCount() - 1;
+ if (focusedIndex >= 0)
+ _listView.SetItemState(focusedIndex, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
+ return true;
+ }
+ case 'A':
+ {
+ bool ctrl = (::GetKeyState(VK_CONTROL) & 0x8000) != 0;
+ if (ctrl)
+ {
+ int numItems = _listView.GetItemCount();
+ for (int i = 0; i < numItems; i++)
+ _listView.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+}
+#endif
+
+void CListViewDialog::OnOK()
+{
+ FocusedItemIndex = _listView.GetFocusedItem();
+ CModalDialog::OnOK();
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog.h
new file mode 100644
index 000000000..f27b81697
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog.h
@@ -0,0 +1,32 @@
+// ListViewDialog.h
+
+#ifndef __LISTVIEWDIALOG_H
+#define __LISTVIEWDIALOG_H
+
+#include "Windows/Control/Dialog.h"
+#include "Windows/Control/ListView.h"
+#include "ListViewDialogRes.h"
+
+class CListViewDialog: public NWindows::NControl::CModalDialog
+{
+ NWindows::NControl::CListView _listView;
+ virtual void OnOK();
+ virtual bool OnInit();
+#ifdef _WIN32 // FIXME
+ virtual bool OnNotify(UINT controlID, LPNMHDR header);
+#endif
+
+public:
+ UString Title;
+ bool DeleteIsAllowed;
+ UStringVector Strings;
+ bool StringsWereChanged;
+ int FocusedItemIndex;
+
+ INT_PTR Create(HWND wndParent = 0) { return CModalDialog::Create(IDD_DIALOG_LISTVIEW, wndParent); }
+
+ CListViewDialog(): DeleteIsAllowed(false) {}
+
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialogRes.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialogRes.h
new file mode 100644
index 000000000..440d14b02
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialogRes.h
@@ -0,0 +1,3 @@
+#define IDD_DIALOG_LISTVIEW 201
+
+#define IDC_LISTVIEW_LIST 1000
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog_rc.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog_rc.cpp
new file mode 100644
index 000000000..3b707ec31
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ListViewDialog_rc.cpp
@@ -0,0 +1,55 @@
+// PasswordDialog.cpp
+
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+// for all others, include the necessary headers (this file is usually all you
+// need because it includes almost all "standard" wxWidgets headers)
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "Windows/Control/DialogImpl.h"
+
+#include "ListViewDialogRes.h"
+
+class CListViewDialogImpl : public NWindows::NControl::CModalDialogImpl
+{
+ public:
+ CListViewDialogImpl(NWindows::NControl::CModalDialog *dialog,wxWindow * parent,int id) :
+ CModalDialogImpl(dialog,parent, id, wxT("ListView"), wxDefaultPosition, wxDefaultSize,
+ wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX | wxMINIMIZE_BOX)
+
+ {
+
+ wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
+
+ wxListCtrl *list = new wxListCtrl(this, IDC_LISTVIEW_LIST, wxDefaultPosition, wxSize(645,195), wxLC_REPORT | wxLC_NO_HEADER);
+
+ topsizer->Add(list, 1, wxALL|wxEXPAND, 5);
+
+ topsizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxALL|wxEXPAND, 5);
+
+ this->OnInit();
+
+ SetSizer(topsizer); // use the sizer for layout
+ topsizer->SetSizeHints(this); // set size hints to honour minimum size
+ }
+private:
+ // Any class wishing to process wxWindows events must use this macro
+ DECLARE_EVENT_TABLE()
+};
+
+REGISTER_DIALOG(IDD_DIALOG_LISTVIEW,CListViewDialog,0)
+
+BEGIN_EVENT_TABLE(CListViewDialogImpl, wxDialog)
+ EVT_BUTTON(wxID_ANY, CModalDialogImpl::OnAnyButton)
+ EVT_CHECKBOX(wxID_ANY, CModalDialogImpl::OnAnyButton)
+END_EVENT_TABLE()
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog.cpp
new file mode 100644
index 000000000..201c0bae7
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog.cpp
@@ -0,0 +1,76 @@
+// MessagesDialog.cpp
+
+#include "StdAfx.h"
+#include "MessagesDialog.h"
+#include "Common/StringConvert.h"
+#include "Common/IntToString.h"
+#include "Windows/ResourceString.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+using namespace NWindows;
+
+#ifdef LANG
+static CIDLangPair kIDLangPairs[] =
+{
+ { IDOK, 0x02000713 }
+};
+#endif
+
+void CMessagesDialog::AddMessageDirect(LPCWSTR message)
+{
+ int itemIndex = _messageList.GetItemCount();
+ wchar_t sz[32];
+ ConvertInt64ToString(itemIndex, sz);
+ _messageList.InsertItem(itemIndex, sz);
+ _messageList.SetSubItem(itemIndex, 1, message);
+}
+
+void CMessagesDialog::AddMessage(LPCWSTR message)
+{
+ UString s = message;
+ while (!s.IsEmpty())
+ {
+ int pos = s.Find(L'\n');
+ if (pos < 0)
+ break;
+ AddMessageDirect(s.Left(pos));
+ s.Delete(0, pos + 1);
+ }
+ AddMessageDirect(s);
+}
+
+bool CMessagesDialog::OnInit()
+{
+ #ifdef LANG
+ LangSetWindowText(HWND(*this), 0x02000A00);
+ LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
+ #endif
+ _messageList.Attach(GetItem(IDC_MESSAGE_LIST));
+ _messageList.SetUnicodeFormat(true);
+
+ _messageList.InsertColumn(0, L"#", 30);
+
+ const UString s =
+ #ifdef LANG
+ LangString(IDS_MESSAGES_DIALOG_MESSAGE_COLUMN, 0x02000A80);
+ #else
+ MyLoadStringW(IDS_MESSAGES_DIALOG_MESSAGE_COLUMN);
+ #endif
+
+ _messageList.InsertColumn(1, s, 600);
+
+ for(int i = 0; i < Messages->Size(); i++)
+ AddMessage((*Messages)[i]);
+
+ /*
+ if(_messageList.GetItemCount() > 0)
+ {
+ UINT aState = LVIS_SELECTED | LVIS_FOCUSED;
+ _messageList.SetItemState(0, aState, aState);
+ }
+ */
+ return CModalDialog::OnInit();
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog.h
new file mode 100644
index 000000000..6df0d46cc
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog.h
@@ -0,0 +1,22 @@
+// MessagesDialog.h
+
+#ifndef __MESSAGESDIALOG_H
+#define __MESSAGESDIALOG_H
+
+#include "MessagesDialogRes.h"
+
+#include "Windows/Control/Dialog.h"
+#include "Windows/Control/ListView.h"
+
+class CMessagesDialog: public NWindows::NControl::CModalDialog
+{
+ NWindows::NControl::CListView _messageList;
+ void AddMessageDirect(LPCWSTR message);
+ void AddMessage(LPCWSTR message);
+ virtual bool OnInit();
+public:
+ const UStringVector *Messages;
+ INT_PTR Create(HWND parent = 0) { return CModalDialog::Create(IDD_DIALOG_MESSAGES, parent); }
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialogRes.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialogRes.h
new file mode 100644
index 000000000..39d49f573
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialogRes.h
@@ -0,0 +1,3 @@
+#define IDS_MESSAGES_DIALOG_MESSAGE_COLUMN 503
+#define IDD_DIALOG_MESSAGES 503
+#define IDC_MESSAGE_LIST 1000
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog_rc.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog_rc.cpp
new file mode 100644
index 000000000..bd1fb1f06
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MessagesDialog_rc.cpp
@@ -0,0 +1,81 @@
+// MessagesDialog_rc.cpp
+
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+// for all others, include the necessary headers (this file is usually all you
+// need because it includes almost all "standard" wxWidgets headers)
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "Windows/Control/DialogImpl.h"
+#include "MessagesDialogRes.h"
+
+/*
+IDD_DIALOG_MESSAGES DIALOG 0, 0, xSize, ySize MY_MODAL_DIALOG_STYLE
+CAPTION "7-Zip: Diagnostic messages"
+MY_FONT
+BEGIN
+ DEFPUSHBUTTON "&Close", IDOK, bXPos, bYPos, bXSize, bYSize
+ CONTROL "List1",IDC_MESSAGE_LIST,"SysListView32",
+ LVS_REPORT | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,
+ marg, marg, xSize2, ySize2 - bYSize - 6
+END
+
+STRINGTABLE
+BEGIN
+ IDS_MESSAGES_DIALOG_MESSAGE_COLUMN "Message"
+END
+*/
+
+class CMessagesDialogImpl : public NWindows::NControl::CModalDialogImpl
+{
+ public:
+ CMessagesDialogImpl(NWindows::NControl::CModalDialog *dialog,wxWindow * parent , int id) :
+ CModalDialogImpl(dialog,parent, id, wxT("7-Zip: Diagnostic messages"), wxDefaultPosition, wxDefaultSize,
+ wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX | wxMINIMIZE_BOX)
+ {
+ wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
+
+ wxListCtrl *list = new wxListCtrl(this, IDC_MESSAGE_LIST, wxDefaultPosition, wxSize(645,195), wxLC_REPORT );
+
+#if 0
+ list->InsertColumn(0, wxT("Col1"), wxLIST_FORMAT_LEFT);
+ list->InsertColumn(1, wxT("Col2"), wxLIST_FORMAT_RIGHT);
+ list->InsertItem(0, wxT("#1"));
+ list->SetItem(0, 1, L"message 1");
+ list->InsertItem(1, wxT("#2"));
+ list->SetItem(1, 1, L"message 2");
+#endif
+ topsizer->Add(list , 1, wxALL|wxEXPAND, 5);
+ topsizer->Add(new wxButton(this, wxID_OK, _T("&Close")) , 0, wxALL | wxALIGN_RIGHT, 5);
+
+ this->OnInit();
+
+ SetSizer(topsizer); // use the sizer for layout
+ topsizer->SetSizeHints(this); // set size hints to honour minimum size
+ }
+private:
+ // Any class wishing to process wxWindows events must use this macro
+ DECLARE_EVENT_TABLE()
+};
+
+static CStringTable g_stringTable[] =
+{
+ { IDS_MESSAGES_DIALOG_MESSAGE_COLUMN, L"Message" },
+ { 0 , 0 }
+};
+
+REGISTER_DIALOG(IDD_DIALOG_MESSAGES,CMessagesDialog,g_stringTable)
+
+BEGIN_EVENT_TABLE(CMessagesDialogImpl, wxDialog)
+ EVT_BUTTON(wxID_ANY, CModalDialogImpl::OnAnyButton)
+END_EVENT_TABLE()
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MyLoadMenu.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MyLoadMenu.cpp
new file mode 100644
index 000000000..839e1f8c7
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MyLoadMenu.cpp
@@ -0,0 +1,733 @@
+// MyLoadMenu
+
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+typedef wxMenuBar * HMENU;
+
+#include "Common/StringConvert.h"
+
+// FIXME #include "Windows/Menu.h"
+#include "Windows/Error.h"
+// FIXME #include "Windows/Clipboard.h"
+
+#include "../../PropID.h"
+
+#include "resource.h"
+#include "App.h"
+// FIXME #include "AboutDialog.h"
+#include "../Common/CompressCall.h"
+
+#include "HelpUtils.h"
+#include "LangUtils.h"
+#include "PluginInterface.h"
+
+static const UINT kOpenBookmarkMenuID = 730;
+static const UINT kSetBookmarkMenuID = 740;
+
+extern HINSTANCE g_hInstance;
+
+static LPCWSTR kFMHelpTopic = L"fm/index.htm";
+
+extern void OptionsDialog(HWND hwndOwner, HINSTANCE hInstance);
+
+using namespace NWindows;
+
+static const int kFileMenuIndex = 0;
+static const int kEditMenuIndex = 1;
+static const int kViewMenuIndex = 2;
+static const int kBookmarksMenuIndex = kViewMenuIndex + 1;
+
+struct CStringLangPair
+{
+ wchar_t *String;
+ UINT32 LangID;
+};
+
+static CStringLangPair kStringLangPairs[] =
+{
+ { L"&File", 0x03000102 },
+ { L"&Edit", 0x03000103 },
+ { L"&View", 0x03000104 },
+ { L"&Bookmarks", 0x03000107 },
+ { L"&Tools", 0x03000105 },
+ { L"&Help", 0x03000106 },
+};
+
+UINT32 kAddToFavoritesLangID = 0x03000710;
+UINT32 kToolbarsLangID = 0x03000451;
+
+/*
+static int FindStringLangItem(const UString &anItem)
+{
+ for (int i = 0; i < sizeof(kStringLangPairs) /
+ sizeof(kStringLangPairs[0]); i++)
+ if (anItem.CompareNoCase(kStringLangPairs[i].String) == 0)
+ return i;
+ return -1;
+}
+*/
+
+static CIDLangPair kIDLangPairs[] =
+{
+ // File
+ { IDM_FILE_OPEN, 0x03000210 },
+ { IDM_FILE_OPEN_INSIDE, 0x03000211 },
+ { IDM_FILE_OPEN_OUTSIDE, 0x03000212 },
+ // { IDM_FILE_VIEW, 0x03000220 }, // FIXME : does not exist !
+ { IDM_FILE_EDIT, 0x03000221 },
+ { IDM_RENAME, 0x03000230 },
+ { IDM_COPY_TO, 0x03000231 },
+ { IDM_MOVE_TO, 0x03000232 },
+ { IDM_DELETE, 0x03000233 },
+ { IDM_FILE_PROPERTIES, 0x03000240 },
+ { IDM_FILE_COMMENT, 0x03000241 },
+ { IDM_FILE_CRC, 0x03000242 },
+ { IDM_FILE_SPLIT, 0x03000270 },
+ { IDM_FILE_COMBINE, 0x03000271 },
+ { IDM_CREATE_FOLDER, 0x03000250 },
+ { IDM_CREATE_FILE, 0x03000251 },
+ // FIXME { IDCLOSE, 0x03000260 },
+
+ // Edit
+ { IDM_EDIT_CUT, 0x03000320 },
+ { IDM_EDIT_COPY, 0x03000321 },
+ { IDM_EDIT_PASTE, 0x03000322 },
+
+ { IDM_SELECT_ALL, 0x03000330 },
+ { IDM_DESELECT_ALL, 0x03000331 },
+ { IDM_INVERT_SELECTION, 0x03000332 },
+ { IDM_SELECT, 0x03000333 },
+ { IDM_DESELECT, 0x03000334 },
+ { IDM_SELECT_BY_TYPE, 0x03000335 },
+ { IDM_DESELECT_BY_TYPE, 0x03000336 },
+
+ { IDM_VIEW_LARGE_ICONS, 0x03000410 },
+ { IDM_VIEW_SMALL_ICONS, 0x03000411 },
+ { IDM_VIEW_LIST, 0x03000412 },
+ { IDM_VIEW_DETAILS, 0x03000413 },
+
+ { IDM_VIEW_ARANGE_BY_NAME, 0x02000204 },
+ { IDM_VIEW_ARANGE_BY_TYPE, 0x02000214 },
+ { IDM_VIEW_ARANGE_BY_DATE, 0x0200020C },
+ { IDM_VIEW_ARANGE_BY_SIZE, 0x02000207 },
+ { IDM_VIEW_ARANGE_NO_SORT, 0x03000420 },
+
+ { IDM_OPEN_ROOT_FOLDER, 0x03000430 },
+ { IDM_OPEN_PARENT_FOLDER, 0x03000431 },
+ { IDM_FOLDERS_HISTORY, 0x03000432 },
+
+ { IDM_VIEW_REFRESH, 0x03000440 },
+
+ { IDM_VIEW_FLAT_VIEW, 0x03000449 },
+ { IDM_VIEW_TWO_PANELS, 0x03000450 },
+ { IDM_VIEW_ARCHIVE_TOOLBAR, 0x03000460 },
+ { IDM_VIEW_STANDARD_TOOLBAR, 0x03000461 },
+ { IDM_VIEW_TOOLBARS_LARGE_BUTTONS, 0x03000462 },
+ { IDM_VIEW_TOOLBARS_SHOW_BUTTONS_TEXT, 0x03000463 },
+
+ { IDM_OPTIONS, 0x03000510 },
+ { IDM_BENCHMARK, 0x03000511 },
+
+ { IDM_HELP_CONTENTS, 0x03000610 },
+ { IDM_ABOUT, 0x03000620 },
+
+ { 12111 , 0x03000710 }, // FIXME kAddToFavoritesLangID
+ { 12112 , 0x03000451 } // FIXME kToolbarsLangID
+};
+
+
+#ifdef _WIN32
+static int FindLangItem(int ControlID)
+{
+ for (int i = 0; i < sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]); i++)
+ if (kIDLangPairs[i].ControlID == ControlID)
+ return i;
+ return -1;
+}
+#endif
+
+
+/*
+static bool g_IsNew_fMask = true;
+
+class CInit_fMask
+{
+public:
+ CInit_fMask()
+ {
+ g_IsNew_fMask = false;
+ OSVERSIONINFO vi;
+ vi.dwOSVersionInfoSize = sizeof(vi);
+ if (::GetVersionEx(&vi))
+ {
+ g_IsNew_fMask = (vi.dwMajorVersion > 4 ||
+ (vi.dwMajorVersion == 4 && vi.dwMinorVersion > 0));
+ }
+ g_IsNew_fMask = false;
+ }
+} g_Init_fMask;
+
+// it's hack for supporting Windows NT
+// constants are from WinUser.h
+
+#if(WINVER < 0x0500)
+#define MIIM_STRING 0x00000040
+#define MIIM_BITMAP 0x00000080
+#define MIIM_FTYPE 0x00000100
+#endif
+
+static UINT Get_fMaskForString()
+{
+ return g_IsNew_fMask ? MIIM_STRING : MIIM_TYPE;
+}
+
+static UINT Get_fMaskForFTypeAndString()
+{
+ return g_IsNew_fMask ? (MIIM_STRING | MIIM_FTYPE) : MIIM_TYPE;
+}
+*/
+
+#ifdef _WIN32
+static UINT Get_fMaskForString()
+{
+ return MIIM_TYPE;
+}
+
+static UINT Get_fMaskForFTypeAndString()
+{
+ return MIIM_TYPE;
+}
+#endif
+
+
+static void MyChangeItem(wxMenuItem * mi,int LangID)
+{
+ UString newString = LangString(LangID);
+ if (newString.IsEmpty())
+ return;
+ wxString ss = mi->GetItemLabel();
+ UString shorcutString((const wchar_t *)ss); // = item.StringValue;
+ int tabPos = shorcutString.ReverseFind(wchar_t('\t'));
+ if (tabPos >= 0)
+ newString += shorcutString.Mid(tabPos);
+ // printf("Change Menu : %ls => %ls\n",(const wchar_t *)ss,(const wchar_t *)newString);
+ mi->SetItemLabel((const wchar_t *)newString);
+
+}
+
+static void MyChangeMenu(HMENU menuLoc, int level, int menuIndex)
+{
+ // Sets the label of the top-level menus
+ for (int i1= 0; i1< sizeof(kStringLangPairs) / sizeof(kStringLangPairs[0]); i1++)
+ {
+ UString newString = LangString(kStringLangPairs[i1].LangID);
+ if (! newString.IsEmpty()) menuLoc->SetMenuLabel(i1, (const TCHAR *)newString);
+ }
+
+ // sub-menu items
+ for (int i = 0; i < sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]); i++)
+ {
+ wxMenuItem * mi = menuLoc->FindItem(kIDLangPairs[i].ControlID);
+ if (mi)
+ {
+ MyChangeItem(mi,kIDLangPairs[i].LangID);
+ }
+ else
+ printf("Change Menu : id=%d index=%d<>\n",kIDLangPairs[i].ControlID,i);
+ }
+}
+
+#ifdef _WIN32
+CMenu g_FileMenu;
+
+class CFileMenuDestroyer
+{
+public:
+ ~CFileMenuDestroyer()
+ {
+ if ((HMENU)g_FileMenu != 0)
+ g_FileMenu.Destroy();
+ }
+} g_FileMenuDestroyer;
+#endif
+
+
+void MyLoadMenu(HWND hWnd)
+{
+#ifdef _WIN32
+ if ((HMENU)g_FileMenu != 0)
+ g_FileMenu.Destroy();
+ HMENU oldMenu = ::GetMenu(hWnd);
+ HMENU baseMenu = ::LoadMenu(g_hInstance, MAKEINTRESOURCE(IDM_MENU));
+ ::SetMenu(hWnd, baseMenu);
+ ::DestroyMenu(oldMenu);
+ if (!g_LangID.IsEmpty())
+ {
+ HMENU menuOld = ::GetMenu(hWnd);
+ MyChangeMenu(menuOld, 0, 0);
+ }
+ ::DrawMenuBar(hWnd);
+#else
+ extern void rc_MyLoadMenu(HWND hWnd);
+ rc_MyLoadMenu(hWnd);
+ if (!g_LangID.IsEmpty())
+ {
+ HMENU menuOld = ((wxFrame *)hWnd)->GetMenuBar(); // ::GetMenu(hWnd);
+ MyChangeMenu(menuOld, 0, 0);
+ }
+#endif
+}
+
+#ifdef _WIN32
+extern HWND g_HWND;
+void MyLoadMenu()
+{
+ MyLoadMenu(g_HWND);
+}
+
+static void CopyMenu(HMENU srcMenuSpec, HMENU destMenuSpec)
+{
+ CMenu srcMenu;
+ srcMenu.Attach(srcMenuSpec);
+ CMenu destMenu;
+ destMenu.Attach(destMenuSpec);
+ int startPos = 0;
+ for (int i = 0; i < srcMenu.GetItemCount(); i++)
+ {
+ CMenuItem item;
+ item.fMask = MIIM_STATE | MIIM_ID | Get_fMaskForFTypeAndString();
+ item.fType = MFT_STRING;
+ if (srcMenu.GetItem(i, true, item))
+ if (destMenu.InsertItem(startPos, true, item))
+ startPos++;
+ }
+}
+
+void OnMenuActivating(HWND /* hWnd */, HMENU hMenu, int position)
+{
+ if (::GetSubMenu(::GetMenu(g_HWND), position) != hMenu)
+ return;
+ if (position == kFileMenuIndex)
+ {
+ if ((HMENU)g_FileMenu == 0)
+ {
+ g_FileMenu.CreatePopup();
+ CopyMenu(hMenu, g_FileMenu);
+ }
+ CMenu menu;
+ menu.Attach(hMenu);
+ while (menu.GetItemCount() > 0)
+ {
+ if (!menu.RemoveItem(0, MF_BYPOSITION))
+ break;
+ }
+ // CopyMenu(g_FileMenu, hMenu);
+ g_App.GetFocusedPanel().CreateFileMenu(hMenu);
+ }
+ else if (position == kEditMenuIndex)
+ {
+ /*
+ CMenu menu;
+ menu.Attach(hMenu);
+ menu.EnableItem(IDM_EDIT_CUT, MF_ENABLED);
+ menu.EnableItem(IDM_EDIT_COPY, MF_ENABLED);
+ menu.EnableItem(IDM_EDIT_PASTE, IsClipboardFormatAvailableHDROP() ? MF_ENABLED : MF_GRAYED);
+ */
+ }
+ else if (position == kViewMenuIndex)
+ {
+ // View;
+ CMenu menu;
+ menu.Attach(hMenu);
+ menu.CheckRadioItem(IDM_VIEW_LARGE_ICONS, IDM_VIEW_DETAILS,
+ IDM_VIEW_LARGE_ICONS + g_App.GetListViewMode(), MF_BYCOMMAND);
+ menu.CheckItem(IDM_VIEW_TWO_PANELS, MF_BYCOMMAND |
+ ((g_App.NumPanels == 2) ? MF_CHECKED : MF_UNCHECKED));
+ menu.CheckItem(IDM_VIEW_FLAT_VIEW, MF_BYCOMMAND |
+ ((g_App.GetFlatMode()) ? MF_CHECKED : MF_UNCHECKED));
+ menu.CheckItem(IDM_VIEW_ARCHIVE_TOOLBAR, MF_BYCOMMAND |
+ (g_App.ShowArchiveToolbar ? MF_CHECKED : MF_UNCHECKED));
+ menu.CheckItem(IDM_VIEW_STANDARD_TOOLBAR, MF_BYCOMMAND |
+ (g_App.ShowStandardToolbar ? MF_CHECKED : MF_UNCHECKED));
+ menu.CheckItem(IDM_VIEW_TOOLBARS_LARGE_BUTTONS, MF_BYCOMMAND |
+ (g_App.LargeButtons ? MF_CHECKED : MF_UNCHECKED));
+ menu.CheckItem(IDM_VIEW_TOOLBARS_SHOW_BUTTONS_TEXT, MF_BYCOMMAND |
+ (g_App.ShowButtonsLables ? MF_CHECKED : MF_UNCHECKED));
+ }
+ else if (position == kBookmarksMenuIndex)
+ {
+ CMenu menu;
+ menu.Attach(hMenu);
+
+ CMenu subMenu;
+ subMenu.Attach(menu.GetSubMenu(0));
+ while (subMenu.GetItemCount() > 0)
+ subMenu.RemoveItem(subMenu.GetItemCount() - 1, MF_BYPOSITION);
+ int i;
+ for (i = 0; i < 10; i++)
+ {
+ UString s = LangString(IDS_BOOKMARK, 0x03000720);
+ s += L" ";
+ wchar_t c = (wchar_t)(L'0' + i);
+ s += c;
+ s += L"\tAlt+Shift+";
+ s += c;
+ subMenu.AppendItem(MF_STRING, kSetBookmarkMenuID + i, s);
+ }
+
+ while (menu.GetItemCount() > 2)
+ menu.RemoveItem(menu.GetItemCount() - 1, MF_BYPOSITION);
+
+ for (i = 0; i < 10; i++)
+ {
+ UString path = g_App.AppState.FastFolders.GetString(i);
+ const int kMaxSize = 100;
+ const int kFirstPartSize = kMaxSize / 2;
+ if (path.Length() > kMaxSize)
+ {
+ path = path.Left(kFirstPartSize) + UString(L" ... ") +
+ path.Right(kMaxSize - kFirstPartSize);
+ }
+ UString s = path;
+ if (s.IsEmpty())
+ s = L"-";
+ s += L"\tAlt+";
+ s += (wchar_t)(L'0' + i);
+ menu.AppendItem(MF_STRING, kOpenBookmarkMenuID + i, s);
+ }
+ }
+}
+
+/*
+It doesn't help
+void OnMenuUnActivating(HWND hWnd, HMENU hMenu, int id)
+{
+ if (::GetSubMenu(::GetMenu(g_HWND), 0) != hMenu)
+ return;
+ // g_App.GetFocusedPanel()._contextMenu.Release();
+}
+
+void OnMenuUnActivating(HWND hWnd)
+{
+}
+*/
+
+
+void LoadFileMenu(HMENU hMenu, int startPos, bool /* forFileMode */, bool programMenu)
+{
+ {
+ CMenu srcMenu;
+ srcMenu.Attach(::GetSubMenu(::GetMenu(g_HWND), 0));
+ if ((HMENU)g_FileMenu == 0)
+ {
+ g_FileMenu.CreatePopup();
+ CopyMenu(srcMenu, g_FileMenu);
+ }
+ }
+
+ CMenu destMenu;
+ destMenu.Attach(hMenu);
+
+ for (int i = 0; i < g_FileMenu.GetItemCount(); i++)
+ {
+ CMenuItem item;
+
+ item.fMask = MIIM_STATE | MIIM_ID | Get_fMaskForFTypeAndString();
+ item.fType = MFT_STRING;
+ if (g_FileMenu.GetItem(i, true, item))
+ {
+ if (!programMenu)
+ if (item.wID == IDCLOSE)
+ continue;
+ /*
+ bool createItem = (item.wID == IDM_CREATE_FOLDER || item.wID == IDM_CREATE_FILE);
+ if (forFileMode)
+ {
+ if (createItem)
+ continue;
+ }
+ else
+ {
+ if (!createItem)
+ continue;
+ }
+ */
+ if (destMenu.InsertItem(startPos, true, item))
+ startPos++;
+ }
+ }
+ while (destMenu.GetItemCount() > 0)
+ {
+ CMenuItem item;
+ item.fMask = MIIM_TYPE;
+ item.fType = 0;
+ // item.dwTypeData = 0;
+ int lastIndex = destMenu.GetItemCount() - 1;
+ if (!destMenu.GetItem(lastIndex, true, item))
+ break;
+ if(item.fType != MFT_SEPARATOR)
+ break;
+ if (!destMenu.RemoveItem(lastIndex, MF_BYPOSITION))
+ break;
+ }
+}
+#endif
+
+bool ExecuteFileCommand(int id)
+{
+ if (id >= kPluginMenuStartID)
+ {
+#ifdef _WIN32
+ g_App.GetFocusedPanel().InvokePluginCommand(id);
+ g_App.GetFocusedPanel()._sevenZipContextMenu.Release();
+ g_App.GetFocusedPanel()._systemContextMenu.Release();
+#endif
+ return true;
+ }
+
+ switch (id)
+ {
+ // File
+ case IDM_FILE_OPEN:
+ g_App.OpenItem();
+ break;
+ case IDM_FILE_OPEN_INSIDE:
+ g_App.OpenItemInside();
+ break;
+ case IDM_FILE_OPEN_OUTSIDE:
+ g_App.OpenItemOutside();
+ break;
+ case IDM_FILE_VIEW:
+ break;
+ case IDM_FILE_EDIT:
+ g_App.EditItem();
+ break;
+ case IDM_RENAME:
+ g_App.Rename();
+ break;
+ case IDM_COPY_TO:
+ g_App.CopyTo();
+ break;
+ case IDM_MOVE_TO:
+ g_App.MoveTo();
+ break;
+ case IDM_DELETE:
+ {
+#ifdef _WIN32 // FIXME
+ bool shift = (::GetKeyState(VK_SHIFT) & 0x8000) != 0;
+ g_App.Delete(!shift);
+#endif
+ break;
+ }
+ case IDM_FILE_CRC:
+ g_App.CalculateCrc();
+ break;
+ case IDM_FILE_SPLIT:
+ g_App.Split();
+ break;
+ case IDM_FILE_COMBINE:
+ g_App.Combine();
+ break;
+ case IDM_FILE_PROPERTIES:
+ g_App.Properties();
+ break;
+ case IDM_FILE_COMMENT:
+ g_App.Comment();
+ break;
+
+ case IDM_CREATE_FOLDER:
+ g_App.CreateFolder();
+ break;
+ case IDM_CREATE_FILE:
+ g_App.CreateFile();
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+bool OnMenuCommand(HWND hWnd, int id)
+{
+ printf("DEBUG : OnMenuCommand(%p,id=%d)-0\n",hWnd,id);
+
+ if (ExecuteFileCommand(id))
+ return true;
+
+ printf("DEBUG : OnMenuCommand(%p,id=%d)-1\n",hWnd,id);
+
+ switch (id)
+ {
+ // File
+ /* FIXME
+ case IDCLOSE:
+ SendMessage(hWnd, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), (LPARAM)hWnd);
+ SendMessage (hWnd, WM_CLOSE, 0, 0);
+ break;
+ */
+
+ // Edit
+ case IDM_EDIT_CUT:
+ g_App.EditCut();
+ break;
+ case IDM_EDIT_COPY:
+ g_App.EditCopy();
+ break;
+ case IDM_EDIT_PASTE:
+ g_App.EditPaste();
+ break;
+ case IDM_SELECT_ALL:
+ g_App.SelectAll(true);
+ g_App.RefreshStatusBar();
+ break;
+ case IDM_DESELECT_ALL:
+ g_App.SelectAll(false);
+ g_App.RefreshStatusBar();
+ break;
+ case IDM_INVERT_SELECTION:
+ g_App.InvertSelection();
+ g_App.RefreshStatusBar();
+ break;
+ case IDM_SELECT:
+ g_App.SelectSpec(true);
+ g_App.RefreshStatusBar();
+ break;
+ case IDM_DESELECT:
+ g_App.SelectSpec(false);
+ g_App.RefreshStatusBar();
+ break;
+ case IDM_SELECT_BY_TYPE:
+ g_App.SelectByType(true);
+ g_App.RefreshStatusBar();
+ break;
+ case IDM_DESELECT_BY_TYPE:
+ g_App.SelectByType(false);
+ g_App.RefreshStatusBar();
+ break;
+
+ //View
+ case IDM_VIEW_LARGE_ICONS:
+ case IDM_VIEW_SMALL_ICONS:
+ case IDM_VIEW_LIST:
+ case IDM_VIEW_DETAILS:
+ {
+ UINT index = id - IDM_VIEW_LARGE_ICONS;
+ if (index < 4)
+ {
+ g_App.SetListViewMode(index);
+ /*
+ CMenu menu;
+ menu.Attach(::GetSubMenu(::GetMenu(hWnd), kViewMenuIndex));
+ menu.CheckRadioItem(IDM_VIEW_LARGE_ICONS, IDM_VIEW_DETAILS,
+ id, MF_BYCOMMAND);
+ */
+ }
+ break;
+ }
+ case IDM_VIEW_ARANGE_BY_NAME:
+ {
+ g_App.SortItemsWithPropID(kpidName);
+ break;
+ }
+ case IDM_VIEW_ARANGE_BY_TYPE:
+ {
+ g_App.SortItemsWithPropID(kpidExtension);
+ break;
+ }
+ case IDM_VIEW_ARANGE_BY_DATE:
+ {
+ g_App.SortItemsWithPropID(kpidMTime);
+ break;
+ }
+ case IDM_VIEW_ARANGE_BY_SIZE:
+ {
+ g_App.SortItemsWithPropID(kpidSize);
+ break;
+ }
+ case IDM_VIEW_ARANGE_NO_SORT:
+ {
+ g_App.SortItemsWithPropID(kpidNoProperty);
+ break;
+ }
+
+ case IDM_OPEN_ROOT_FOLDER:
+ g_App.OpenRootFolder();
+ break;
+ case IDM_OPEN_PARENT_FOLDER:
+ g_App.OpenParentFolder();
+ break;
+ case IDM_FOLDERS_HISTORY:
+ g_App.FoldersHistory();
+ break;
+ case IDM_VIEW_REFRESH:
+ g_App.RefreshView();
+ break;
+ case IDM_VIEW_FLAT_VIEW:
+ g_App.ChangeFlatMode();
+ break;
+ case IDM_VIEW_TWO_PANELS:
+ g_App.SwitchOnOffOnePanel();
+ break;
+ case IDM_VIEW_STANDARD_TOOLBAR:
+ g_App.SwitchStandardToolbar();
+ break;
+ case IDM_VIEW_ARCHIVE_TOOLBAR:
+ g_App.SwitchArchiveToolbar();
+ break;
+ case IDM_VIEW_TOOLBARS_SHOW_BUTTONS_TEXT:
+ g_App.SwitchButtonsLables();
+ break;
+ case IDM_VIEW_TOOLBARS_LARGE_BUTTONS:
+ g_App.SwitchLargeButtons();
+ break;
+
+ // Tools
+ case IDM_OPTIONS:
+ // FIXME OptionsDialog(hWnd, g_hInstance);
+ break;
+
+ case IDM_BENCHMARK:
+ Benchmark();
+ break;
+ // Help
+ case IDM_HELP_CONTENTS:
+ ShowHelpWindow(NULL, kFMHelpTopic);
+ break;
+ case IDM_ABOUT:
+ {
+ /* FIXME
+ CAboutDialog dialog;
+ dialog.Create(hWnd);
+ */
+ printf("IDM_ABOUT ...\n");
+ break;
+ }
+ default:
+ {
+ if (id >= kOpenBookmarkMenuID && id <= kOpenBookmarkMenuID + 9)
+ {
+ g_App.OpenBookmark(id - kOpenBookmarkMenuID);
+ return true;
+ }
+ else if (id >= kSetBookmarkMenuID && id <= kSetBookmarkMenuID + 9)
+ {
+ g_App.SetBookmark(id - kSetBookmarkMenuID);
+ return true;
+ }
+ return false;
+ }
+ }
+ return true;
+}
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MyLoadMenu.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MyLoadMenu.h
new file mode 100644
index 000000000..9dae77f00
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/MyLoadMenu.h
@@ -0,0 +1,20 @@
+// MyLoadMenu.h
+
+#ifndef __MYLOADMENU_H
+#define __MYLOADMENU_H
+
+class myHMENU; // FIXME
+typedef myHMENU * HMENU; // FIXME
+
+void OnMenuActivating(HWND hWnd, HMENU hMenu, int position);
+// void OnMenuUnActivating(HWND hWnd, HMENU hMenu, int id);
+// void OnMenuUnActivating(HWND hWnd);
+
+void MyLoadMenu(HWND hWnd);
+bool OnMenuCommand(HWND hWnd, int id);
+void MyLoadMenu();
+void LoadFileMenu(HMENU hMenu, int startPos, bool programMenu,
+ bool isFsFolder, int numItems, bool allAreFiles);
+bool ExecuteFileCommand(int id);
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/NetFolder.h.OUT b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/NetFolder.h.OUT
new file mode 100644
index 000000000..384e7f190
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/NetFolder.h.OUT
@@ -0,0 +1,56 @@
+// NetFolder.h
+
+#ifndef __NETFOLDER_H
+#define __NETFOLDER_H
+
+#include "Common/MyString.h"
+#include "Common/Buffer.h"
+#include "Common/MyCom.h"
+#include "Windows/PropVariant.h"
+// FIXME #include "Windows/Net.h"
+
+#include "IFolder.h"
+
+struct CResourceEx // FIXME : public NWindows::NNet::CResourceW
+{
+ UString Name;
+};
+
+class CNetFolder:
+ public IFolderFolder,
+ public IFolderGetSystemIconIndex,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP1(
+ IFolderGetSystemIconIndex
+ )
+
+ INTERFACE_FolderFolder(;)
+
+ STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex);
+
+private:
+#ifdef _WIN32
+ NWindows::NNet::CResourceW _netResource;
+ NWindows::NNet::CResourceW *_netResourcePointer;
+#else
+ int _netResource;
+ int *_netResourcePointer;
+#endif
+
+ CObjectVector<CResourceEx> _items;
+
+ CMyComPtr<IFolderFolder> _parentFolder;
+ UString _path;
+
+public:
+ void Init(const UString &path);
+#ifdef _WIN32
+ void Init(const NWindows::NNet::CResourceW *netResource,
+ IFolderFolder *parentFolder, const UString &path);
+ CNetFolder(): _netResourcePointer(0) {}
+#endif
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OpenCallback.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OpenCallback.cpp
new file mode 100644
index 000000000..a275f89bc
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OpenCallback.cpp
@@ -0,0 +1,122 @@
+// OpenCallback.cpp
+
+#include "StdAfx.h"
+
+#include "Common/StringConvert.h"
+
+#include "Windows/PropVariant.h"
+
+#include "../../Common/FileStreams.h"
+
+#include "OpenCallback.h"
+#include "PasswordDialog.h"
+
+using namespace NWindows;
+
+STDMETHODIMP COpenArchiveCallback::SetTotal(const UInt64 *numFiles, const UInt64 *numBytes)
+{
+ RINOK(ProgressDialog.ProgressSynch.ProcessStopAndPause());
+ {
+ NSynchronization::CCriticalSectionLock lock(_criticalSection);
+ if (numFiles != NULL)
+ {
+ ProgressDialog.ProgressSynch.SetNumFilesTotal(*numFiles);
+ ProgressDialog.ProgressSynch.SetBytesProgressMode(false);
+ }
+ if (numBytes != NULL)
+ ProgressDialog.ProgressSynch.SetNumBytesTotal(*numBytes);
+ }
+ return S_OK;
+}
+
+STDMETHODIMP COpenArchiveCallback::SetCompleted(const UInt64 *numFiles, const UInt64 *numBytes)
+{
+ RINOK(ProgressDialog.ProgressSynch.ProcessStopAndPause());
+ NSynchronization::CCriticalSectionLock lock(_criticalSection);
+ if (numFiles != NULL)
+ ProgressDialog.ProgressSynch.SetNumFilesCur(*numFiles);
+ if (numBytes != NULL)
+ ProgressDialog.ProgressSynch.SetPos(*numBytes);
+ return S_OK;
+}
+
+STDMETHODIMP COpenArchiveCallback::SetTotal(const UInt64 total)
+{
+ RINOK(ProgressDialog.ProgressSynch.ProcessStopAndPause());
+ ProgressDialog.ProgressSynch.SetNumBytesTotal(total);
+ return S_OK;
+}
+
+STDMETHODIMP COpenArchiveCallback::SetCompleted(const UInt64 *completed)
+{
+ RINOK(ProgressDialog.ProgressSynch.ProcessStopAndPause());
+ if (completed != NULL)
+ ProgressDialog.ProgressSynch.SetPos(*completed);
+ return S_OK;
+}
+
+STDMETHODIMP COpenArchiveCallback::GetProperty(PROPID propID, PROPVARIANT *value)
+{
+ NCOM::CPropVariant prop;
+ if (_subArchiveMode)
+ {
+ switch(propID)
+ {
+ case kpidName: prop = _subArchiveName; break;
+ }
+ }
+ else
+ {
+ switch(propID)
+ {
+ case kpidName: prop = _fileInfo.Name; break;
+ case kpidIsDir: prop = _fileInfo.IsDir(); break;
+ case kpidSize: prop = _fileInfo.Size; break;
+ case kpidAttrib: prop = (UInt32)_fileInfo.Attrib; break;
+ case kpidCTime: prop = _fileInfo.CTime; break;
+ case kpidATime: prop = _fileInfo.ATime; break;
+ case kpidMTime: prop = _fileInfo.MTime; break;
+ }
+ }
+ prop.Detach(value);
+ return S_OK;
+}
+
+STDMETHODIMP COpenArchiveCallback::GetStream(const wchar_t *name,
+ IInStream **inStream)
+{
+ *inStream = NULL;
+ if (_subArchiveMode)
+ return S_FALSE;
+
+ NFile::NFind::CFileInfoW fileInfo;
+
+ UString fullPath = _folderPrefix + name;
+ if (!fileInfo.Find(fullPath))
+ return S_FALSE;
+ _fileInfo = fileInfo;
+ if (_fileInfo.IsDir())
+ return S_FALSE;
+ CInFileStream *inFile = new CInFileStream;
+ CMyComPtr<IInStream> inStreamTemp = inFile;
+ if (!inFile->Open(fullPath))
+ return ::GetLastError();
+ *inStream = inStreamTemp.Detach();
+ return S_OK;
+}
+
+STDMETHODIMP COpenArchiveCallback::CryptoGetTextPassword(BSTR *password)
+{
+ PasswordWasAsked = true;
+ if (!PasswordIsDefined)
+ {
+ CPasswordDialog dialog;
+
+ if (dialog.Create(ProgressDialog) == IDCANCEL)
+ return E_ABORT;
+
+ Password = dialog.Password;
+ PasswordIsDefined = true;
+ }
+ return StringToBstr(Password, password);
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OpenCallback.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OpenCallback.h
new file mode 100644
index 000000000..5f0fbefc1
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OpenCallback.h
@@ -0,0 +1,92 @@
+// OpenCallback.h
+
+#ifndef __OPENCALLBACK_H
+#define __OPENCALLBACK_H
+
+#include "Common/MyCom.h"
+#include "Common/MyString.h"
+
+#include "Windows/FileFind.h"
+
+#include "../../IPassword.h"
+
+#include "../../Archive/IArchive.h"
+
+#ifdef _SFX
+#include "ProgressDialog.h"
+#else
+#include "ProgressDialog2.h"
+#endif
+
+
+class COpenArchiveCallback:
+ public IArchiveOpenCallback,
+ public IArchiveOpenVolumeCallback,
+ public IArchiveOpenSetSubArchiveName,
+ public IProgress,
+ public ICryptoGetTextPassword,
+ public CMyUnknownImp
+{
+ UString _folderPrefix;
+ NWindows::NFile::NFind::CFileInfoW _fileInfo;
+ NWindows::NSynchronization::CCriticalSection _criticalSection;
+ bool _subArchiveMode;
+ UString _subArchiveName;
+
+public:
+ bool PasswordIsDefined;
+ bool PasswordWasAsked;
+ UString Password;
+ HWND ParentWindow;
+ CProgressDialog ProgressDialog;
+
+ MY_UNKNOWN_IMP5(
+ IArchiveOpenCallback,
+ IArchiveOpenVolumeCallback,
+ IArchiveOpenSetSubArchiveName,
+ IProgress,
+ ICryptoGetTextPassword)
+
+ INTERFACE_IProgress(;)
+ INTERFACE_IArchiveOpenCallback(;)
+ INTERFACE_IArchiveOpenVolumeCallback(;)
+
+ // ICryptoGetTextPassword
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+
+ STDMETHOD(SetSubArchiveName(const wchar_t *name))
+ {
+ _subArchiveMode = true;
+ _subArchiveName = name;
+ return S_OK;
+ }
+
+ COpenArchiveCallback():
+ ParentWindow(0)
+ {
+ _subArchiveMode = false;
+ PasswordIsDefined = false;
+ PasswordWasAsked = false;
+ }
+ /*
+ void Init()
+ {
+ PasswordIsDefined = false;
+ _subArchiveMode = false;
+ }
+ */
+ void LoadFileInfo(const UString &folderPrefix, const UString &fileName)
+ {
+ _folderPrefix = folderPrefix;
+ if (!_fileInfo.Find(_folderPrefix + fileName))
+ throw 1;
+ }
+ void ShowMessage(const UInt64 *completed);
+
+ INT_PTR StartProgressDialog(const UString &title)
+ {
+ return ProgressDialog.Create(title, ParentWindow);
+ }
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog.cpp
new file mode 100644
index 000000000..2d6bc5217
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog.cpp
@@ -0,0 +1,126 @@
+// OverwriteDialog.cpp
+
+#include "StdAfx.h"
+
+#include "OverwriteDialog.h"
+
+#include "Common/StringConvert.h"
+#include "Windows/FileName.h"
+#include "Windows/Defs.h"
+#include "Windows/ResourceString.h"
+#include "Windows/Control/Static.h"
+#include "Windows/PropVariantConversions.h"
+
+#include "FormatUtils.h"
+
+// #include "../resource.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+using namespace NWindows;
+
+#ifdef LANG
+static CIDLangPair kIDLangPairs[] =
+{
+ { IDC_STATIC_OVERWRITE_HEADER, 0x02000901},
+ { IDC_STATIC_OVERWRITE_QUESTION_BEGIN, 0x02000902 },
+ { IDC_STATIC_OVERWRITE_QUESTION_END, 0x02000903 },
+ { IDYES, 0x02000705 },
+ { IDC_BUTTON_OVERWRITE_YES_TO_ALL, 0x02000707 },
+ { IDNO, 0x02000709 },
+ { IDC_BUTTON_OVERWRITE_NO_TO_ALL,0x0200070B },
+ { IDC_BUTTON_OVERWRITE_AUTO_RENAME, 0x02000911 },
+ { IDCANCEL, 0x02000711 }
+};
+#endif
+
+void COverwriteDialog::SetFileInfoControl(int textID, int iconID,
+ const NOverwriteDialog::CFileInfo &fileInfo)
+{
+ UString sizeString;
+ if (fileInfo.SizeIsDefined)
+ sizeString = MyFormatNew(IDS_FILE_SIZE,
+ #ifdef LANG
+ 0x02000982,
+ #endif
+ NumberToString(fileInfo.Size));
+
+ UString reducedName;
+ const int kLineSize = 88;
+ for (int i = 0; i < fileInfo.Name.Length();)
+ {
+ reducedName += fileInfo.Name.Mid(i, kLineSize);
+ reducedName += L" ";
+ i += kLineSize;
+ }
+
+ UString fullString = reducedName;
+ fullString += L"\n";
+ fullString += sizeString;
+ fullString += L"\n";
+
+ if (fileInfo.TimeIsDefined)
+ {
+ UString timeString;
+ FILETIME localFileTime;
+ if (!FileTimeToLocalFileTime(&fileInfo.Time, &localFileTime))
+ throw 4190402;
+ timeString = ConvertFileTimeToString(localFileTime);
+
+ fullString +=
+ #ifdef LANG
+ LangString(IDS_FILE_MODIFIED, 0x02000983);
+ #else
+ MyLoadStringW(IDS_FILE_MODIFIED);
+ #endif
+
+ fullString += L" ";
+ fullString += timeString;
+ }
+
+ NWindows::NControl::CDialogChildControl control;
+ control.Init(*this, textID);
+ control.SetText(fullString);
+
+#ifdef _WIN32 // FIXME
+ SHFILEINFO shellFileInfo;
+ if (::SHGetFileInfo(
+ GetSystemString(fileInfo.Name), FILE_ATTRIBUTE_NORMAL, &shellFileInfo,
+ sizeof(shellFileInfo), SHGFI_ICON | SHGFI_USEFILEATTRIBUTES | SHGFI_LARGEICON))
+ {
+ NControl::CStatic staticContol;
+ staticContol.Attach(GetItem(iconID));
+ staticContol.SetIcon(shellFileInfo.hIcon);
+ }
+#endif
+}
+
+bool COverwriteDialog::OnInit()
+{
+ #ifdef LANG
+ LangSetWindowText(HWND(*this), 0x02000900);
+ LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
+ #endif
+ SetFileInfoControl(IDC_STATIC_OVERWRITE_OLD_FILE_SIZE_TIME,
+ IDC_STATIC_OVERWRITE_OLD_FILE_ICON, OldFileInfo);
+ SetFileInfoControl(IDC_STATIC_OVERWRITE_NEW_FILE_SIZE_TIME,
+ IDC_STATIC_OVERWRITE_NEW_FILE_ICON, NewFileInfo);
+ return CModalDialog::OnInit();
+}
+
+bool COverwriteDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ switch(buttonID)
+ {
+ case IDYES:
+ case IDC_BUTTON_OVERWRITE_YES_TO_ALL:
+ case IDNO:
+ case IDC_BUTTON_OVERWRITE_NO_TO_ALL:
+ case IDC_BUTTON_OVERWRITE_AUTO_RENAME:
+ End(buttonID);
+ return true;
+ }
+ return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog.h
new file mode 100644
index 000000000..d206fb015
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog.h
@@ -0,0 +1,34 @@
+// OverwriteDialog.h
+
+#ifndef __OVERWRITEDIALOG_H
+#define __OVERWRITEDIALOG_H
+
+#include "OverwriteDialogRes.h"
+#include "Windows/Control/Dialog.h"
+
+namespace NOverwriteDialog
+{
+ struct CFileInfo
+ {
+ bool SizeIsDefined;
+ UINT64 Size;
+ bool TimeIsDefined;
+ FILETIME Time;
+ UString Name;
+ };
+}
+
+class COverwriteDialog: public NWindows::NControl::CModalDialog
+{
+ void SetFileInfoControl(int textID, int iconID,
+ const NOverwriteDialog::CFileInfo &fileInfo);
+ virtual bool OnInit();
+ bool OnButtonClicked(int buttonID, HWND buttonHWND);
+public:
+ INT_PTR Create(HWND parent = 0) { return CModalDialog::Create(IDD_DIALOG_OVERWRITE, parent); }
+
+ NOverwriteDialog::CFileInfo OldFileInfo;
+ NOverwriteDialog::CFileInfo NewFileInfo;
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialogRes.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialogRes.h
new file mode 100644
index 000000000..66710f848
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialogRes.h
@@ -0,0 +1,19 @@
+#define IDS_FILE_MODIFIED 600
+#define IDS_FILE_SIZE 601
+
+#define IDD_DIALOG_OVERWRITE 502
+
+#define IDC_STATIC_OVERWRITE_HEADER 1000
+
+#define IDC_STATIC_OVERWRITE_QUESTION_BEGIN 1001
+#define IDC_STATIC_OVERWRITE_QUESTION_END 1002
+
+#define IDC_STATIC_OVERWRITE_OLD_FILE_ICON 1003
+#define IDC_STATIC_OVERWRITE_NEW_FILE_ICON 1004
+
+#define IDC_STATIC_OVERWRITE_OLD_FILE_SIZE_TIME 1005
+#define IDC_STATIC_OVERWRITE_NEW_FILE_SIZE_TIME 1006
+
+#define IDC_BUTTON_OVERWRITE_YES_TO_ALL 1010
+#define IDC_BUTTON_OVERWRITE_NO_TO_ALL 1011
+#define IDC_BUTTON_OVERWRITE_AUTO_RENAME 1012
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog_rc.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog_rc.cpp
new file mode 100644
index 000000000..08ddd36de
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/OverwriteDialog_rc.cpp
@@ -0,0 +1,96 @@
+// OverwriteDialog_rc.cpp
+
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+// for all others, include the necessary headers (this file is usually all you
+// need because it includes almost all "standard" wxWidgets headers)
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "OverwriteDialogRes.h"
+#include "Windows/Control/DialogImpl.h"
+
+/*
+IDD_DIALOG_OVERWRITE DIALOG 0, 0, xSize, ySize MY_MODAL_DIALOG_STYLE
+CAPTION "Confirm File Replace"
+MY_FONT
+BEGIN
+ LTEXT "Destination folder already contains processed file.", IDC_STATIC_OVERWRITE_HEADER, marg, 7, xSize2, 8
+ LTEXT "Would you like to replace the existing file", IDC_STATIC_OVERWRITE_QUESTION_BEGIN, marg, 28, xSize2, 8
+ ICON "", IDC_STATIC_OVERWRITE_OLD_FILE_ICON, marg, 44, iconSize, iconSize
+ LTEXT "", IDC_STATIC_OVERWRITE_OLD_FILE_SIZE_TIME, fiXPos, 44, fiXSize, fiYSize, SS_NOPREFIX
+ LTEXT "with this one?",IDC_STATIC_OVERWRITE_QUESTION_END, marg, 98, xSize2, 8
+ ICON "",IDC_STATIC_OVERWRITE_NEW_FILE_ICON, marg, 114, iconSize, iconSize
+ LTEXT "",IDC_STATIC_OVERWRITE_NEW_FILE_SIZE_TIME, fiXPos, 114, fiXSize, fiYSize, SS_NOPREFIX
+ PUSHBUTTON "&Yes", IDYES, 78, b2YPos, bXSize, bYSize
+ PUSHBUTTON "Yes to &All", IDC_BUTTON_OVERWRITE_YES_TO_ALL, 152, b2YPos, bXSize, bYSize
+ PUSHBUTTON "&No", IDNO, 226, b2YPos, bXSize, bYSize
+ PUSHBUTTON "No to A&ll", IDC_BUTTON_OVERWRITE_NO_TO_ALL, 300, b2YPos, bXSize, bYSize
+ PUSHBUTTON "A&uto Rename", IDC_BUTTON_OVERWRITE_AUTO_RENAME, 181, b1YPos, 109, bYSize
+ PUSHBUTTON "&Cancel", IDCANCEL, 300, b1YPos, bXSize, bYSize
+END
+*/
+
+class COverwriteDialogImpl : public NWindows::NControl::CModalDialogImpl
+{
+ public:
+ COverwriteDialogImpl(NWindows::NControl::CModalDialog *dialog,wxWindow * parent , int id) : CModalDialogImpl(dialog,parent, id, wxT("Confirm File Replace"))
+ {
+ ///Sizer for adding the controls created by users
+ wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
+
+ topsizer->Add(new wxStaticText(this, IDC_STATIC_OVERWRITE_HEADER, _T("Destination folder already contains processed file.")) , 0 ,wxALL | wxALIGN_LEFT, 5 );
+ topsizer->Add(new wxStaticText(this, IDC_STATIC_OVERWRITE_QUESTION_BEGIN, _T("Would you like to replace the existing file")) , 0 ,wxALL | wxALIGN_LEFT, 5 );
+
+ // FIXME ICON "", IDC_STATIC_OVERWRITE_OLD_FILE_ICON, marg, 44, iconSize, iconSize
+ topsizer->Add(new wxStaticText(this, IDC_STATIC_OVERWRITE_OLD_FILE_SIZE_TIME, _T(""),
+ wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT) , 0 ,wxALL | wxALIGN_LEFT, 15 );
+ topsizer->Add(new wxStaticText(this, IDC_STATIC_OVERWRITE_QUESTION_END, _T("with this one?")) , 0 ,wxALL | wxALIGN_LEFT, 5 );
+
+ // FIXME ICON "",IDC_STATIC_OVERWRITE_NEW_FILE_ICON, marg, 114, iconSize, iconSize
+ topsizer->Add(new wxStaticText(this, IDC_STATIC_OVERWRITE_NEW_FILE_SIZE_TIME, _T(""),
+ wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT) , 0 ,wxALL | wxALIGN_LEFT, 15 );
+
+ wxBoxSizer* Sizer1 = new wxBoxSizer(wxHORIZONTAL);
+ Sizer1->Add(new wxButton(this, wxID_YES, _T("&Yes")) , 0, wxALL | wxALIGN_RIGHT, 5);
+ Sizer1->Add(new wxButton(this, IDC_BUTTON_OVERWRITE_YES_TO_ALL, _T("Yes to &All")) , 0, wxALL | wxALIGN_RIGHT, 5);
+ Sizer1->Add(new wxButton(this, wxID_NO, _T("&No")) , 0, wxALL | wxALIGN_RIGHT, 5);
+ Sizer1->Add(new wxButton(this, IDC_BUTTON_OVERWRITE_NO_TO_ALL, _T("No to A&ll")) , 0, wxALL | wxALIGN_RIGHT, 5);
+ topsizer->Add(Sizer1 , 0, wxALL | wxALIGN_RIGHT, 5);
+
+ wxBoxSizer* Sizer2 = new wxBoxSizer(wxHORIZONTAL);
+ Sizer2->Add(new wxButton(this, IDC_BUTTON_OVERWRITE_AUTO_RENAME, _T("A&uto Rename")) , 0, wxALL | wxALIGN_RIGHT, 5);
+ Sizer2->Add(new wxButton(this, wxID_CANCEL, _T("&Cancel")) , 0, wxALL | wxALIGN_RIGHT, 5);
+ topsizer->Add(Sizer2 , 1, wxALL | wxALIGN_RIGHT, 5);
+
+ this->OnInit();
+
+ SetSizer(topsizer); // use the sizer for layout
+ topsizer->SetSizeHints(this); // set size hints to honour minimum size
+ }
+private:
+ // Any class wishing to process wxWindows events must use this macro
+ DECLARE_EVENT_TABLE()
+};
+
+static CStringTable g_stringTable[] =
+{
+ { IDS_FILE_MODIFIED, L"modified on" },
+ { IDS_FILE_SIZE, L"{0} bytes" },
+ { 0 , 0 }
+};
+
+REGISTER_DIALOG(IDD_DIALOG_OVERWRITE,COverwriteDialog,g_stringTable)
+
+BEGIN_EVENT_TABLE(COverwriteDialogImpl, wxDialog)
+ EVT_BUTTON(wxID_ANY, CModalDialogImpl::OnAnyButton)
+END_EVENT_TABLE()
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/Panel.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/Panel.cpp
new file mode 100644
index 000000000..a9123da80
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/Panel.cpp
@@ -0,0 +1,1100 @@
+// Panel.cpp
+
+#include "StdAfx.h"
+
+#ifdef _WIN32
+#include <Windowsx.h>
+#endif
+
+#include "Common/Defs.h"
+#include "Common/StringConvert.h"
+#include "Common/IntToString.h"
+#include "Windows/Error.h"
+#include "Windows/PropVariant.h"
+#include "Windows/Thread.h"
+
+#include "../../PropID.h"
+
+#include "Panel.h"
+#include "RootFolder.h"
+#include "FSFolder.h"
+#include "FormatUtils.h"
+#include "App.h"
+#include "ExtractCallback.h"
+
+#include "resource.h"
+#include "../GUI/ExtractRes.h"
+
+#include "../Agent/IFolderArchive.h"
+
+#include "../Common/CompressCall.h"
+#include "../Common/ArchiveName.h"
+
+using namespace NWindows;
+using namespace NControl;
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+static const UINT_PTR kTimerID = 1;
+static const UINT kTimerElapse = 1000;
+
+#ifdef _WIN32
+static DWORD kStyles[4] = { LVS_ICON, LVS_SMALLICON, LVS_LIST, LVS_REPORT };
+#endif
+
+// static const int kCreateFolderID = 101;
+// static const UINT kFileChangeNotifyMessage = WM_APP;
+
+extern HINSTANCE g_hInstance;
+extern DWORD g_ComCtl32Version;
+
+void CPanel::Release()
+{
+ // It's for unloading COM dll's: don't change it.
+ CloseOpenFolders();
+#ifdef _WIN32
+ _sevenZipContextMenu.Release();
+ _systemContextMenu.Release();
+#endif
+}
+
+CPanel::~CPanel()
+{
+ CloseOpenFolders();
+}
+
+#ifdef _WIN32 // FIXME
+HWND CPanel::GetParent()
+{
+ HWND h = CWindow2::GetParent();
+ return (h == 0) ? _mainWindow : h;
+}
+#endif
+
+static LPCWSTR kClassName = L"7-Zip::Panel";
+
+
+HRESULT CPanel::Create(HWND mainWindow, HWND parentWindow, UINT id,
+ const UString &currentFolderPrefix, CPanelCallback *panelCallback, CAppState *appState,
+ bool &archiveIsOpened, bool &encrypted)
+{
+ _mainWindow = mainWindow;
+ _processTimer = true;
+ _processNotify = true;
+
+ _panelCallback = panelCallback;
+ _appState = appState;
+ // _index = index;
+ _baseID = id;
+ _comboBoxID = _baseID + 3;
+ _statusBarID = _comboBoxID + 1;
+
+ UString cfp = currentFolderPrefix;
+
+ if (!currentFolderPrefix.IsEmpty())
+ if (currentFolderPrefix[0] == L'.')
+ if (!NFile::NDirectory::MyGetFullPathName(currentFolderPrefix, cfp))
+ cfp = currentFolderPrefix;
+ RINOK(BindToPath(cfp, archiveIsOpened, encrypted));
+
+#ifdef _WIN32
+ if (!CreateEx(0, kClassName, 0, WS_CHILD | WS_VISIBLE,
+ 0, 0, _xSize, 260,
+ parentWindow, (HMENU)(UINT_PTR)id, g_hInstance))
+ return E_FAIL;
+#else
+ {
+ // printf("WARNING CPanel::Create => CreateEx\n");
+ // this->OnCreate(0);
+ extern void registerWindow2(int baseID,NWindows::NControl::CWindow2 *w);
+ registerWindow2(_baseID,this);
+ }
+#endif
+
+ return S_OK;
+}
+
+LRESULT CPanel::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch(message)
+ {
+ case kShiftSelectMessage:
+ OnShiftSelectMessage();
+ return 0;
+ case kReLoadMessage:
+ RefreshListCtrl(_selectedState);
+ return 0;
+ case kSetFocusToListView:
+ _listView.SetFocus();
+ return 0;
+ case kOpenItemChanged:
+ return OnOpenItemChanged(lParam);
+ case kRefreshStatusBar:
+ OnRefreshStatusBar();
+ return 0;
+#ifdef _WIN32
+ case WM_TIMER:
+ OnTimer();
+ return 0;
+ case WM_CONTEXTMENU:
+ if (OnContextMenu(HANDLE(wParam), GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)))
+ return 0;
+ break;
+ /*
+ case WM_DROPFILES:
+ CompressDropFiles(HDROP(wParam));
+ return 0;
+ */
+#endif
+ }
+ return CWindow2::OnMessage(message, wParam, lParam);
+}
+
+#ifdef _WIN32
+static LRESULT APIENTRY ListViewSubclassProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ CWindow tempDialog(hwnd);
+ CMyListView *w = (CMyListView *)(tempDialog.GetUserDataLongPtr());
+ if (w == NULL)
+ return 0;
+ return w->OnMessage(message, wParam, lParam);
+}
+
+LRESULT CMyListView::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ if (message == WM_CHAR)
+ {
+ UINT scanCode = (UINT)((lParam >> 16) & 0xFF);
+ bool extended = ((lParam & 0x1000000) != 0);
+ UINT virtualKey = MapVirtualKey(scanCode, 1);
+ if (virtualKey == VK_MULTIPLY || virtualKey == VK_ADD ||
+ virtualKey == VK_SUBTRACT)
+ return 0;
+ if ((wParam == '/' && extended)
+ || wParam == CHAR_PATH_SEPARATOR || wParam == '/')
+ {
+ _panel->OpenDrivesFolder();
+ return 0;
+ }
+ }
+ else if (message == WM_SYSCHAR)
+ {
+ // For Alt+Enter Beep disabling
+ UINT scanCode = (UINT)(lParam >> 16) & 0xFF;
+ UINT virtualKey = MapVirtualKey(scanCode, 1);
+ if (virtualKey == VK_RETURN || virtualKey == VK_MULTIPLY ||
+ virtualKey == VK_ADD || virtualKey == VK_SUBTRACT)
+ return 0;
+ }
+ /*
+ else if (message == WM_SYSKEYDOWN)
+ {
+ // return 0;
+ }
+ */
+ else if (message == WM_KEYDOWN)
+ {
+ bool alt = (::GetKeyState(VK_MENU) & 0x8000) != 0;
+ bool ctrl = (::GetKeyState(VK_CONTROL) & 0x8000) != 0;
+ // bool leftCtrl = (::GetKeyState(VK_LCONTROL) & 0x8000) != 0;
+ // bool RightCtrl = (::GetKeyState(VK_RCONTROL) & 0x8000) != 0;
+ bool shift = (::GetKeyState(VK_SHIFT) & 0x8000) != 0;
+ switch(wParam)
+ {
+ case VK_RETURN:
+ {
+ if (shift && !alt && !ctrl)
+ {
+ _panel->OpenSelectedItems(false);
+ return 0;
+ }
+ break;
+ }
+ case VK_NEXT:
+ {
+ if (ctrl && !alt && !shift)
+ {
+ _panel->OpenFocusedItemAsInternal();
+ return 0;
+ }
+ break;
+ }
+ case VK_PRIOR:
+ if (ctrl && !alt && !shift)
+ {
+ _panel->OpenParentFolder();
+ return 0;
+ }
+ }
+ }
+ else if (message == WM_SETFOCUS)
+ {
+ _panel->_lastFocusedIsList = true;
+ _panel->_panelCallback->PanelWasFocused();
+ }
+ #ifndef _UNICODE
+ if (g_IsNT)
+ return CallWindowProcW(_origWindowProc, *this, message, wParam, lParam);
+ else
+ #endif
+ return CallWindowProc(_origWindowProc, *this, message, wParam, lParam);
+}
+
+/*
+static LRESULT APIENTRY ComboBoxSubclassProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ CWindow tempDialog(hwnd);
+ CMyComboBox *w = (CMyComboBox *)(tempDialog.GetUserDataLongPtr());
+ if (w == NULL)
+ return 0;
+ return w->OnMessage(message, wParam, lParam);
+}
+
+LRESULT CMyComboBox::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ return CallWindowProc(_origWindowProc, *this, message, wParam, lParam);
+}
+*/
+static LRESULT APIENTRY ComboBoxEditSubclassProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ CWindow tempDialog(hwnd);
+ CMyComboBoxEdit *w = (CMyComboBoxEdit *)(tempDialog.GetUserDataLongPtr());
+ if (w == NULL)
+ return 0;
+ return w->OnMessage(message, wParam, lParam);
+}
+
+LRESULT CMyComboBoxEdit::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ // See MSDN / Subclassing a Combo Box / Creating a Combo-box Toolbar
+ switch (message)
+ {
+ case WM_SYSKEYDOWN:
+ switch (wParam)
+ {
+ case VK_F1:
+ case VK_F2:
+ {
+ // check ALT
+ if ((lParam & (1<<29)) == 0)
+ break;
+ bool alt = (::GetKeyState(VK_MENU) & 0x8000) != 0;
+ bool ctrl = (::GetKeyState(VK_CONTROL) & 0x8000) != 0;
+ bool shift = (::GetKeyState(VK_SHIFT) & 0x8000) != 0;
+ if (alt && !ctrl && !shift)
+ {
+ _panel->_panelCallback->SetFocusToPath(wParam == VK_F1 ? 0 : 1);
+ return 0;
+ }
+ break;
+ }
+ }
+ break;
+ case WM_KEYDOWN:
+ switch (wParam)
+ {
+ case VK_TAB:
+ // SendMessage(hwndMain, WM_ENTER, 0, 0);
+ _panel->SetFocusToList();
+ return 0;
+ case VK_F9:
+ {
+ bool alt = (::GetKeyState(VK_MENU) & 0x8000) != 0;
+ bool ctrl = (::GetKeyState(VK_CONTROL) & 0x8000) != 0;
+ bool shift = (::GetKeyState(VK_SHIFT) & 0x8000) != 0;
+ if (!alt && !ctrl && !shift)
+ {
+ g_App.SwitchOnOffOnePanel();;
+ return 0;
+ }
+ break;
+ }
+ }
+ break;
+ case WM_CHAR:
+ switch (wParam)
+ {
+ case VK_TAB:
+ case VK_ESCAPE:
+ return 0;
+ }
+ }
+ #ifndef _UNICODE
+ if (g_IsNT)
+ return CallWindowProcW(_origWindowProc, *this, message, wParam, lParam);
+ else
+ #endif
+ return CallWindowProc(_origWindowProc, *this, message, wParam, lParam);
+}
+
+static HIMAGELIST GetSysImageList(bool smallIcons)
+{
+ SHFILEINFO shellInfo;
+ return (HIMAGELIST)SHGetFileInfo(TEXT(""),
+ FILE_ATTRIBUTE_NORMAL |FILE_ATTRIBUTE_DIRECTORY,
+ &shellInfo, sizeof(shellInfo),
+ SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX | (smallIcons ? SHGFI_SMALLICON : SHGFI_ICON));
+}
+
+bool CPanel::OnCreate(CREATESTRUCT * /* createStruct */)
+{
+ // _virtualMode = false;
+ // _sortIndex = 0;
+ _sortID = kpidName;
+ _ascending = true;
+ _lastFocusedIsList = true;
+
+ DWORD style = WS_CHILD | WS_VISIBLE; // | WS_BORDER ; // | LVS_SHAREIMAGELISTS; // | LVS_SHOWSELALWAYS;;
+
+ style |= LVS_SHAREIMAGELISTS;
+ // style |= LVS_AUTOARRANGE;
+ style |= WS_CLIPCHILDREN;
+ style |= WS_CLIPSIBLINGS;
+
+ const UInt32 kNumListModes = sizeof(kStyles) / sizeof(kStyles[0]);
+ if (_ListViewMode >= kNumListModes)
+ _ListViewMode = kNumListModes - 1;
+
+ style |= kStyles[_ListViewMode]
+ | WS_TABSTOP
+ | LVS_EDITLABELS;
+ if (_mySelectMode)
+ style |= LVS_SINGLESEL;
+
+ /*
+ if (_virtualMode)
+ style |= LVS_OWNERDATA;
+ */
+
+ DWORD exStyle;
+ exStyle = WS_EX_CLIENTEDGE;
+
+ if (!_listView.CreateEx(exStyle, style, 0, 0, 116, 260,
+ HWND(*this), (HMENU)(UINT_PTR)(_baseID + 1), g_hInstance, NULL))
+ return false;
+
+ _listView.SetUnicodeFormat(true);
+
+ _listView.SetUserDataLongPtr(LONG_PTR(&_listView));
+ _listView._panel = this;
+
+ #ifndef _UNICODE
+ if(g_IsNT)
+ _listView._origWindowProc =
+ (WNDPROC)_listView.SetLongPtrW(GWLP_WNDPROC, LONG_PTR(ListViewSubclassProc));
+ else
+ #endif
+ _listView._origWindowProc =
+ (WNDPROC)_listView.SetLongPtr(GWLP_WNDPROC, LONG_PTR(ListViewSubclassProc));
+
+ _listView.SetImageList(GetSysImageList(true), LVSIL_SMALL);
+ _listView.SetImageList(GetSysImageList(false), LVSIL_NORMAL);
+
+ // _exStyle |= LVS_EX_HEADERDRAGDROP;
+ // DWORD extendedStyle = _listView.GetExtendedListViewStyle();
+ // extendedStyle |= _exStyle;
+ // _listView.SetExtendedListViewStyle(extendedStyle);
+ SetExtendedStyle();
+
+ _listView.Show(SW_SHOW);
+ _listView.InvalidateRect(NULL, true);
+ _listView.Update();
+
+ // Ensure that the common control DLL is loaded.
+ INITCOMMONCONTROLSEX icex;
+
+ icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+ icex.dwICC = ICC_BAR_CLASSES;
+ InitCommonControlsEx(&icex);
+
+ TBBUTTON tbb [ ] =
+ {
+ // {0, 0, TBSTATE_ENABLED, BTNS_SEP, 0L, 0},
+ {VIEW_PARENTFOLDER, kParentFolderID, TBSTATE_ENABLED, BTNS_BUTTON, 0L, 0},
+ // {0, 0, TBSTATE_ENABLED, BTNS_SEP, 0L, 0},
+ // {VIEW_NEWFOLDER, kCreateFolderID, TBSTATE_ENABLED, BTNS_BUTTON, 0L, 0},
+ };
+
+ if (g_ComCtl32Version >= MAKELONG(71, 4))
+ {
+ icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+ icex.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES;
+ InitCommonControlsEx(&icex);
+
+ _headerReBar.Attach(::CreateWindowEx(WS_EX_TOOLWINDOW,
+ REBARCLASSNAME,
+ NULL, WS_VISIBLE | WS_BORDER | WS_CHILD |
+ WS_CLIPCHILDREN | WS_CLIPSIBLINGS
+ | CCS_NODIVIDER
+ | CCS_NOPARENTALIGN
+ | CCS_TOP
+ | RBS_VARHEIGHT
+ | RBS_BANDBORDERS
+ ,0,0,0,0, HWND(*this), NULL, g_hInstance, NULL));
+ }
+
+ DWORD toolbarStyle = WS_CHILD | WS_VISIBLE ;
+ if (_headerReBar)
+ {
+ toolbarStyle |= 0
+ // | WS_CLIPCHILDREN
+ // | WS_CLIPSIBLINGS
+
+ | TBSTYLE_TOOLTIPS
+ | CCS_NODIVIDER
+ | CCS_NORESIZE
+ | TBSTYLE_FLAT
+ ;
+ }
+
+ _headerToolBar.Attach(::CreateToolbarEx ((*this), toolbarStyle,
+ _baseID + 2, 11,
+ (HINSTANCE)HINST_COMMCTRL,
+ IDB_VIEW_SMALL_COLOR,
+ (LPCTBBUTTON)&tbb, sizeof(tbb) / sizeof(tbb[0]),
+ 0, 0, 0, 0, sizeof (TBBUTTON)));
+
+ icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+ icex.dwICC = ICC_USEREX_CLASSES;
+ InitCommonControlsEx(&icex);
+
+ _headerComboBox.CreateEx(0, WC_COMBOBOXEXW, NULL,
+ WS_BORDER | WS_VISIBLE |WS_CHILD | CBS_DROPDOWN | CBS_AUTOHSCROLL,
+ 0, 0, 100, 520,
+ ((_headerReBar == 0) ? HWND(*this) : _headerToolBar),
+ (HMENU)(UINT_PTR)(_comboBoxID),
+ g_hInstance, NULL);
+ _headerComboBox.SendMessage(CBEM_SETUNICODEFORMAT, (WPARAM)(BOOL)TRUE, 0);
+
+ _headerComboBox.SetImageList(GetSysImageList(true));
+
+ _headerComboBox.SetExtendedStyle(CBES_EX_PATHWORDBREAKPROC, CBES_EX_PATHWORDBREAKPROC);
+
+ /*
+ _headerComboBox.SetUserDataLongPtr(LONG_PTR(&_headerComboBox));
+ _headerComboBox._panel = this;
+ _headerComboBox._origWindowProc =
+ (WNDPROC)_headerComboBox.SetLongPtr(GWLP_WNDPROC,
+ LONG_PTR(ComboBoxSubclassProc));
+ */
+ _comboBoxEdit.Attach(_headerComboBox.GetEditControl());
+
+ // _comboBoxEdit.SendMessage(CCM_SETUNICODEFORMAT, (WPARAM)(BOOL)TRUE, 0);
+
+ _comboBoxEdit.SetUserDataLongPtr(LONG_PTR(&_comboBoxEdit));
+ _comboBoxEdit._panel = this;
+ #ifndef _UNICODE
+ if(g_IsNT)
+ _comboBoxEdit._origWindowProc =
+ (WNDPROC)_comboBoxEdit.SetLongPtrW(GWLP_WNDPROC, LONG_PTR(ComboBoxEditSubclassProc));
+ else
+ #endif
+ _comboBoxEdit._origWindowProc =
+ (WNDPROC)_comboBoxEdit.SetLongPtr(GWLP_WNDPROC, LONG_PTR(ComboBoxEditSubclassProc));
+
+ if (_headerReBar)
+ {
+ REBARINFO rbi;
+ rbi.cbSize = sizeof(REBARINFO); // Required when using this struct.
+ rbi.fMask = 0;
+ rbi.himl = (HIMAGELIST)NULL;
+ _headerReBar.SetBarInfo(&rbi);
+
+ // Send the TB_BUTTONSTRUCTSIZE message, which is required for
+ // backward compatibility.
+ // _headerToolBar.SendMessage(TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
+ SIZE size;
+ _headerToolBar.GetMaxSize(&size);
+
+ REBARBANDINFO rbBand;
+ rbBand.cbSize = sizeof(REBARBANDINFO); // Required
+ rbBand.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE;
+ rbBand.fStyle = RBBS_NOGRIPPER;
+ rbBand.cxMinChild = size.cx;
+ rbBand.cyMinChild = size.cy;
+ rbBand.cyChild = size.cy;
+ rbBand.cx = size.cx;
+ rbBand.hwndChild = _headerToolBar;
+ _headerReBar.InsertBand(-1, &rbBand);
+
+ RECT rc;
+ ::GetWindowRect(_headerComboBox, &rc);
+ rbBand.cxMinChild = 30;
+ rbBand.cyMinChild = rc.bottom - rc.top;
+ rbBand.cx = 1000;
+ rbBand.hwndChild = _headerComboBox;
+ _headerReBar.InsertBand(-1, &rbBand);
+ // _headerReBar.MaximizeBand(1, false);
+ }
+
+ _statusBar.Create(WS_CHILD | WS_VISIBLE, L"Status", (*this), _statusBarID);
+ // _statusBar2.Create(WS_CHILD | WS_VISIBLE, L"Status", (*this), _statusBarID + 1);
+
+ int sizes[] = {150, 250, 350, -1};
+ _statusBar.SetParts(4, sizes);
+ // _statusBar2.SetParts(5, sizes);
+
+ /*
+ RECT rect;
+ GetClientRect(&rect);
+ OnSize(0, rect.right - rect.left, rect.top - rect.bottom);
+ */
+
+ SetTimer(kTimerID, kTimerElapse);
+
+ // InitListCtrl();
+ RefreshListCtrl();
+ RefreshStatusBar();
+
+ return true;
+}
+#else
+bool CPanel::OnCreate(CREATESTRUCT * /* createStruct */)
+{
+ printf("WARNING CPanel::OnCreate\n");
+ _sortID = kpidName;
+ _ascending = true;
+ _lastFocusedIsList = true;
+
+ extern HWND g_HWND;
+ HWND w = GetDlgItem(g_HWND, _comboBoxID);
+ if (w == 0)
+ {
+ printf("Can't find id=%d\n",_comboBoxID);
+ return false;
+ }
+ printf("CPanel::OnCreate : _headerComboBox.Attach(%p)\n",w);
+ _headerComboBox.Attach(w);
+
+ w = GetDlgItem(g_HWND, _statusBarID);
+ if (w == 0)
+ {
+ printf("Can't find id=%d\n",_statusBarID);
+ return false;
+ }
+ printf("CPanel::OnCreate : _statusBar.Attach(%p)\n",w);
+ _statusBar.Attach(w);
+
+ w = GetDlgItem(g_HWND, _baseID + 1);
+ if (w == 0)
+ {
+ printf("Can't find id=%d\n",_baseID + 1);
+ return false;
+ }
+ printf("CPanel::OnCreate : _listView.Attach(%p)\n",w);
+ _listView.Attach(w);
+
+ _listView.SetUnicodeFormat(true);
+
+ // _listView.SetUserDataLongPtr(LONG_PTR(&_listView));
+ _listView._panel = this;
+
+ // FIXME _listView.SetImageList(GetSysImageList(true), LVSIL_SMALL);
+ // FIXME _listView.SetImageList(GetSysImageList(false), LVSIL_NORMAL);
+
+ // FIXME SetExtendedStyle();
+
+ // FIXME _listView.Show(SW_SHOW);
+ // FIXME _listView.InvalidateRect(NULL, true);
+ _listView.Update();
+
+ /* FIXME
+ _headerToolBar.Attach(::CreateToolbarEx ((*this), toolbarStyle,
+ _baseID + 2, 11,
+ (HINSTANCE)HINST_COMMCTRL,
+ IDB_VIEW_SMALL_COLOR,
+ (LPCTBBUTTON)&tbb, sizeof(tbb) / sizeof(tbb[0]),
+ 0, 0, 0, 0, sizeof (TBBUTTON)));
+ */
+
+ /* FIXME
+ _headerComboBox.CreateEx(0, WC_COMBOBOXEXW, NULL,
+ WS_BORDER | WS_VISIBLE |WS_CHILD | CBS_DROPDOWN | CBS_AUTOHSCROLL,
+ 0, 0, 100, 520,
+ ((_headerReBar == 0) ? HWND(*this) : _headerToolBar),
+ (HMENU)(UINT_PTR)(_comboBoxID),
+ g_hInstance, NULL);
+ _headerComboBox.SendMessage(CBEM_SETUNICODEFORMAT, (WPARAM)(BOOL)TRUE, 0);
+
+ _headerComboBox.SetImageList(GetSysImageList(true));
+
+ _headerComboBox.SetExtendedStyle(CBES_EX_PATHWORDBREAKPROC, CBES_EX_PATHWORDBREAKPROC);
+ */
+
+ // FIXME _comboBoxEdit.Attach(_headerComboBox.GetEditControl());
+
+ _comboBoxEdit._panel = this;
+
+ // FIXME if (_headerReBar) ...
+
+ // _statusBar.Create(WS_CHILD | WS_VISIBLE, L"Status", (*this), _statusBarID);
+
+ // int sizes[] = {150, 250, 350, -1};
+ // _statusBar.SetParts(4, sizes);
+
+ // SetTimer(kTimerID, kTimerElapse);
+
+ // InitListCtrl();
+ RefreshListCtrl();
+ RefreshStatusBar();
+
+ return true;
+}
+#endif
+
+
+void CPanel::OnDestroy()
+{
+ printf("CPanel::OnDestroy\n");
+
+ SaveListViewInfo();
+ CWindow2::OnDestroy();
+}
+
+#ifdef _WIN32
+void CPanel::ChangeWindowSize(int xSize, int ySize)
+{
+ int kHeaderSize;
+ int kStatusBarSize;
+ // int kStatusBar2Size;
+ RECT rect;
+ if (_headerReBar)
+ _headerReBar.GetWindowRect(&rect);
+ else
+ _headerToolBar.GetWindowRect(&rect);
+
+ kHeaderSize = rect.bottom - rect.top;
+
+ _statusBar.GetWindowRect(&rect);
+ kStatusBarSize = rect.bottom - rect.top;
+
+ // _statusBar2.GetWindowRect(&rect);
+ // kStatusBar2Size = rect.bottom - rect.top;
+
+ int yListViewSize = MyMax(ySize - kHeaderSize - kStatusBarSize, 0);
+ const int kStartXPos = 32;
+ if (_headerReBar)
+ {
+ }
+ else
+ {
+ _headerToolBar.Move(0, 0, xSize, 0);
+ _headerComboBox.Move(kStartXPos, 2,
+ MyMax(xSize - kStartXPos - 10, kStartXPos), 0);
+ }
+ _listView.Move(0, kHeaderSize, xSize, yListViewSize);
+ _statusBar.Move(0, kHeaderSize + yListViewSize, xSize, kStatusBarSize);
+ // _statusBar2.MoveWindow(0, kHeaderSize + yListViewSize + kStatusBarSize, xSize, kStatusBar2Size);
+ // _statusBar.MoveWindow(0, 100, xSize, kStatusBarSize);
+ // _statusBar2.MoveWindow(0, 200, xSize, kStatusBar2Size);
+}
+
+bool CPanel::OnSize(WPARAM /* wParam */, int xSize, int ySize)
+{
+ if (_headerReBar)
+ _headerReBar.Move(0, 0, xSize, 0);
+ ChangeWindowSize(xSize, ySize);
+ return true;
+}
+
+bool CPanel::OnNotifyReBar(LPNMHDR header, LRESULT & /* result */)
+{
+ switch(header->code)
+ {
+ case RBN_HEIGHTCHANGE:
+ {
+ RECT rect;
+ GetWindowRect(&rect);
+ ChangeWindowSize(rect.right - rect.left, rect.bottom - rect.top);
+ return false;
+ }
+ }
+ return false;
+}
+#endif
+
+bool CPanel::OnNotify(UINT /* controlID */, LPNMHDR header, LRESULT &result)
+{
+ if (!_processNotify)
+ return false;
+#ifdef _WIN32
+ if (header->hwndFrom == _headerComboBox)
+ return OnNotifyComboBox(header, result);
+ else if (header->hwndFrom == _headerReBar)
+ return OnNotifyReBar(header, result);
+ // if (header->hwndFrom == _listView)
+#endif
+ else if (header->hwndFrom == _listView)
+ return OnNotifyList(header, result);
+#ifdef _WIN32
+ else if (::GetParent(header->hwndFrom) == _listView &&
+ header->code == NM_RCLICK)
+ return OnRightClick((LPNMITEMACTIVATE)header, result);
+#endif
+ return false;
+}
+
+bool CPanel::OnCommand(int code, int itemID, LPARAM lParam, LRESULT &result)
+{
+ printf("CPanel::OnCommand(code=%d,itemID=%d)\n",code,itemID);
+ if (itemID == kParentFolderID)
+ {
+ OpenParentFolder();
+ result = 0;
+ return true;
+ }
+ /*
+ if (itemID == kCreateFolderID)
+ {
+ CreateFolder();
+ result = 0;
+ return true;
+ }
+ */
+ if (itemID == _comboBoxID)
+ {
+ // FIXME if (OnComboBoxCommand(code, lParam, result))
+ return true;
+ }
+ return CWindow2::OnCommand(code, itemID, lParam, result);
+}
+
+void CPanel::MessageBoxInfo(LPCWSTR message, LPCWSTR caption)
+ { ::MessageBoxW(HWND(*this), message, caption, MB_OK); }
+void CPanel::MessageBox(LPCWSTR message, LPCWSTR caption)
+ { ::MessageBoxW(HWND(*this), message, caption, MB_OK | MB_ICONSTOP); }
+void CPanel::MessageBox(LPCWSTR message)
+ { MessageBox(message, L"7-Zip"); }
+void CPanel::MessageBoxMyError(LPCWSTR message)
+ { MessageBox(message, L"Error"); }
+void CPanel::MessageBoxError(HRESULT errorCode, LPCWSTR caption)
+{
+ UString message;
+ if (errorCode == E_OUTOFMEMORY)
+ message = LangString(IDS_MEM_ERROR, 0x0200060B);
+ else
+ if (!NError::MyFormatMessage(errorCode, message))
+ message = L"Error";
+ MessageBox(message, caption);
+}
+
+void CPanel::MessageBoxError(HRESULT errorCode)
+ { MessageBoxError(errorCode, L"7-Zip"); }
+void CPanel::MessageBoxLastError(LPCWSTR caption)
+ { MessageBoxError(::GetLastError(), caption); }
+void CPanel::MessageBoxLastError()
+ { MessageBoxLastError(L"Error"); }
+
+void CPanel::MessageBoxErrorLang(UINT resourceID, UInt32 langID)
+ { MessageBox(LangString(resourceID, langID)); }
+
+
+void CPanel::SetFocusToList()
+{
+ _listView.SetFocus();
+ // SetCurrentPathText();
+}
+
+void CPanel::SetFocusToLastRememberedItem()
+{
+ if (_lastFocusedIsList)
+ SetFocusToList();
+#ifdef _WIN32 // FIXME
+ else
+ _headerComboBox.SetFocus();
+#endif
+}
+
+UString CPanel::GetFolderTypeID() const
+{
+ NCOM::CPropVariant prop;
+ if (_folder->GetFolderProperty(kpidType, &prop) == S_OK)
+ if (prop.vt == VT_BSTR)
+ return (const wchar_t *)prop.bstrVal;
+ return L"";
+}
+
+bool CPanel::IsRootFolder() const
+{
+ return (GetFolderTypeID() == L"RootFolder");
+}
+
+bool CPanel::IsFSFolder() const
+{
+ return (GetFolderTypeID() == L"FSFolder");
+}
+
+bool CPanel::IsFSDrivesFolder() const
+{
+ return (GetFolderTypeID() == L"FSDrives");
+}
+
+UString CPanel::GetFsPath() const
+{
+ if (IsFSDrivesFolder())
+ return UString();
+ return _currentFolderPrefix;
+}
+
+UString CPanel::GetDriveOrNetworkPrefix() const
+{
+ if (!IsFSFolder())
+ return UString();
+ UString drive = GetFsPath();
+ if (drive.Length() < 3)
+ return UString();
+ if (drive[0] == L'\\' && drive[1] == L'\\')
+ {
+ // if network
+ int pos = drive.Find(L'\\', 2);
+ if (pos < 0)
+ return UString();
+ pos = drive.Find(L'\\', pos + 1);
+ if (pos < 0)
+ return UString();
+ return drive.Left(pos + 1);
+ }
+ if (drive[1] != L':' || drive[2] != L'\\')
+ return UString();
+ return drive.Left(3);
+}
+
+bool CPanel::DoesItSupportOperations() const
+{
+ CMyComPtr<IFolderOperations> folderOperations;
+ return _folder.QueryInterface(IID_IFolderOperations, &folderOperations) == S_OK;
+}
+
+void CPanel::SetListViewMode(UInt32 index)
+{
+#ifdef _WIN32 // FIXME
+ if (index >= 4)
+ return;
+ _ListViewMode = index;
+ DWORD oldStyle = (DWORD)_listView.GetStyle();
+ DWORD newStyle = kStyles[index];
+ if ((oldStyle & LVS_TYPEMASK) != newStyle)
+ _listView.SetStyle((oldStyle & ~LVS_TYPEMASK) | newStyle);
+ // RefreshListCtrlSaveFocused();
+#endif
+}
+
+void CPanel::ChangeFlatMode()
+{
+ _flatMode = !_flatMode;
+ RefreshListCtrlSaveFocused();
+}
+
+
+void CPanel::RefreshStatusBar()
+{
+ // FIXME PostMessage(kRefreshStatusBar);
+}
+
+void CPanel::AddToArchive()
+{
+ CRecordVector<UInt32> indices;
+ GetOperatedItemIndices(indices);
+ if (!IsFSFolder())
+ {
+ MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return;
+ }
+ if (indices.Size() == 0)
+ {
+ MessageBoxErrorLang(IDS_SELECT_FILES, 0x03020A03);
+ return;
+ }
+ UStringVector names;
+ for (int i = 0; i < indices.Size(); i++)
+ {
+ int index = indices[i];
+ names.Add(_currentFolderPrefix + GetItemRelPath(index));
+ }
+ const UString archiveName = CreateArchiveName(
+ names.Front(), (names.Size() > 1), false);
+ HRESULT res = CompressFiles(_currentFolderPrefix, archiveName, L"", names, false, true, false);
+ if (res != S_OK)
+ {
+ if (_currentFolderPrefix.Length() >= MAX_PATH)
+ MessageBoxErrorLang(IDS_MESSAGE_UNSUPPORTED_OPERATION_FOR_LONG_PATH_FOLDER, 0x03020A01);
+ else
+ MessageBoxError(res);
+ }
+ // KillSelection();
+}
+
+static UString GetSubFolderNameForExtract(const UString &archiveName)
+{
+ int slashPos = archiveName.ReverseFind(WCHAR_PATH_SEPARATOR);
+ int dotPos = archiveName.ReverseFind(L'.');
+ if (dotPos < 0 || slashPos > dotPos)
+ return archiveName + UString(L"~");
+ UString res = archiveName.Left(dotPos);
+ res.TrimRight();
+ return res;
+}
+
+void CPanel::GetFilePaths(const CRecordVector<UInt32> &indices, UStringVector &paths)
+{
+ for (int i = 0; i < indices.Size(); i++)
+ {
+ int index = indices[i];
+ if (IsItemFolder(index))
+ {
+ paths.Clear();
+ break;
+ }
+ paths.Add(_currentFolderPrefix + GetItemRelPath(index));
+ }
+ if (paths.Size() == 0)
+ {
+ MessageBoxErrorLang(IDS_SELECT_FILES, 0x03020A03);
+ return;
+ }
+}
+
+void CPanel::ExtractArchives()
+{
+ if (_parentFolders.Size() > 0)
+ {
+ _panelCallback->OnCopy(false, false);
+ return;
+ }
+ CRecordVector<UInt32> indices;
+ GetOperatedItemIndices(indices);
+ UStringVector paths;
+ GetFilePaths(indices, paths);
+ if (paths.IsEmpty())
+ return;
+ UString folderName;
+ if (indices.Size() == 1)
+ folderName = GetSubFolderNameForExtract(GetItemRelPath(indices[0]));
+ else
+ folderName = L"*";
+ ::ExtractArchives(paths, _currentFolderPrefix + folderName + UString(WSTRING_PATH_SEPARATOR), true);
+}
+
+struct CThreadTest
+{
+ CRecordVector<UInt32> Indices;
+ CExtractCallbackImp *ExtractCallbackSpec;
+ CMyComPtr<IFolderArchiveExtractCallback> ExtractCallback;
+ CMyComPtr<IArchiveFolder> ArchiveFolder;
+ HRESULT Result;
+
+ void Test()
+ {
+ ExtractCallbackSpec->ProgressDialog.WaitCreating();
+ Result = ArchiveFolder->Extract(&Indices[0], Indices.Size(),
+ NExtract::NPathMode::kFullPathnames, NExtract::NOverwriteMode::kAskBefore,
+ NULL, BoolToInt(true), ExtractCallback);
+ ExtractCallbackSpec->ProgressDialog.MyClose();
+ }
+
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
+ {
+ ((CThreadTest*)param)->Test();
+ return 0;
+ }
+};
+
+static void AddValuePair(UINT resourceID, UInt32 langID, UInt64 value, UString &s)
+{
+ wchar_t sz[32];
+ s += LangString(resourceID, langID);
+ s += L" ";
+ ConvertUInt64ToString(value, sz);
+ s += sz;
+ s += L"\n";
+}
+
+/*
+static void AddSizePair(UINT resourceID, UInt32 langID, UInt64 value, UString &s)
+{
+ wchar_t sz[32];
+ s += LangString(resourceID, langID);
+ s += L" ";
+ ConvertUInt64ToString(value, sz);
+ s += sz;
+ ConvertUInt64ToString(value >> 20, sz);
+ s += L" (";
+ s += sz;
+ s += L" MB)";
+ s += L"\n";
+}
+*/
+
+void CPanel::TestArchives()
+{
+ CRecordVector<UInt32> indices;
+ GetOperatedIndicesSmart(indices);
+ CMyComPtr<IArchiveFolder> archiveFolder;
+ _folder.QueryInterface(IID_IArchiveFolder, &archiveFolder);
+ if (archiveFolder)
+ {
+ {
+ CThreadTest extracter;
+
+ extracter.ArchiveFolder = archiveFolder;
+ extracter.ExtractCallbackSpec = new CExtractCallbackImp;
+ extracter.ExtractCallback = extracter.ExtractCallbackSpec;
+ extracter.ExtractCallbackSpec->ParentWindow = GetParent();
+ extracter.ExtractCallbackSpec->ShowMessages = true;
+
+ if (indices.IsEmpty())
+ return;
+
+ extracter.Indices = indices;
+
+ UString title = LangString(IDS_PROGRESS_TESTING, 0x02000F90);
+ UString progressWindowTitle = LangString(IDS_APP_TITLE, 0x03000000);
+
+ extracter.ExtractCallbackSpec->ProgressDialog.CompressingMode = false;
+ extracter.ExtractCallbackSpec->ProgressDialog.MainWindow = GetParent();
+ extracter.ExtractCallbackSpec->ProgressDialog.MainTitle = progressWindowTitle;
+ extracter.ExtractCallbackSpec->ProgressDialog.MainAddTitle = title + L" ";
+
+ extracter.ExtractCallbackSpec->OverwriteMode = NExtract::NOverwriteMode::kAskBefore;
+ extracter.ExtractCallbackSpec->Init();
+
+ NWindows::CThread extractThread;
+ if (extractThread.Create(CThreadTest::MyThreadFunction, &extracter) != S_OK)
+ return;
+ extracter.ExtractCallbackSpec->StartProgressDialog(title);
+
+ if (extracter.ExtractCallbackSpec->Messages.IsEmpty() && extracter.Result == S_OK)
+ {
+ UString s;
+ AddValuePair(IDS_FOLDERS_COLON, 0x02000321, extracter.ExtractCallbackSpec->NumFolders, s);
+ AddValuePair(IDS_FILES_COLON, 0x02000320, extracter.ExtractCallbackSpec->NumFiles, s);
+ // AddSizePair(IDS_SIZE_COLON, 0x02000322, extracter.Stat.UnpackSize, s);
+ // AddSizePair(IDS_COMPRESSED_COLON, 0x02000323, extracter.Stat.PackSize, s);
+ s += L"\n";
+ s += LangString(IDS_MESSAGE_NO_ERRORS, 0x02000608);
+ MessageBoxInfo(s, LangString(IDS_PROGRESS_TESTING, 0x02000F90));
+ }
+ else
+ {
+ if (extracter.Result != S_OK && extracter.Result != E_ABORT)
+ MessageBoxError(extracter.Result, L"Testing Error");
+ }
+ }
+ RefreshTitleAlways();
+ return;
+ }
+
+ if (!IsFSFolder())
+ {
+ MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return;
+ }
+ UStringVector paths;
+ GetFilePaths(indices, paths);
+ if (paths.IsEmpty())
+ return;
+ ::TestArchives(paths);
+}
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/Panel.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/Panel.h
new file mode 100644
index 000000000..dff858f87
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/Panel.h
@@ -0,0 +1,577 @@
+// Panel.h
+
+#ifndef __PANEL_H
+#define __PANEL_H
+
+#include "Common/MyCom.h"
+
+#include "Windows/DLL.h"
+#include "Windows/FileFind.h"
+#include "Windows/FileDir.h"
+#include "Windows/Synchronization.h"
+// #include "Windows/Handle.h"
+
+// #include "Windows/Control/ToolBar.h"
+// #include "Windows/Control/ReBar.h"
+#include "Windows/Control/ListView.h"
+#include "Windows/Control/Static.h"
+#include "Windows/Control/Edit.h"
+#include "Windows/Control/ComboBox.h"
+#include "Windows/Control/Window2.h"
+#include "Windows/Control/StatusBar.h"
+
+#include "SysIconUtils.h"
+#include "IFolder.h"
+#include "ViewSettings.h"
+#include "AppState.h"
+// #include "MyCom2.h"
+
+const int kParentFolderID = 100;
+const int kPluginMenuStartID = 1000;
+const int kToolbarStartID = 2000;
+
+const int kParentIndex = -1;
+
+struct CPanelCallback
+{
+ virtual void OnTab() = 0;
+ virtual void SetFocusToPath(int index) = 0;
+ virtual void OnCopy(bool move, bool copyToSame) = 0;
+ virtual void OnSetSameFolder() = 0;
+ virtual void OnSetSubFolder() = 0;
+ virtual void PanelWasFocused() = 0;
+ virtual void DragBegin() = 0;
+ virtual void DragEnd() = 0;
+ virtual void RefreshTitle(bool always) = 0;
+};
+
+void PanelCopyItems();
+
+struct CItemProperty
+{
+ UString Name;
+ PROPID ID;
+ VARTYPE Type;
+ int Order;
+ bool IsVisible;
+ UInt32 Width;
+};
+
+inline bool operator<(const CItemProperty &a1, const CItemProperty &a2)
+ { return (a1.Order < a2.Order); }
+
+inline bool operator==(const CItemProperty &a1, const CItemProperty &a2)
+ { return (a1.Order == a2.Order); }
+
+class CItemProperties: public CObjectVector<CItemProperty>
+{
+public:
+ int FindItemWithID(PROPID id)
+ {
+ for (int i = 0; i < Size(); i++)
+ if ((*this)[i].ID == id)
+ return i;
+ return -1;
+ }
+};
+
+struct CTempFileInfo
+{
+ UString ItemName;
+ UString FolderPath;
+ UString FilePath;
+ NWindows::NFile::NFind::CFileInfoW FileInfo;
+ bool NeedDelete;
+
+ CTempFileInfo(): NeedDelete(false) {}
+ void DeleteDirAndFile() const
+ {
+ if (NeedDelete)
+ {
+ NWindows::NFile::NDirectory::DeleteFileAlways(FilePath);
+ NWindows::NFile::NDirectory::MyRemoveDirectory(FolderPath);
+ }
+ }
+ bool WasChanged(const NWindows::NFile::NFind::CFileInfoW &newFileInfo) const
+ {
+ return newFileInfo.Size != FileInfo.Size ||
+ CompareFileTime(&newFileInfo.MTime, &FileInfo.MTime) != 0;
+ }
+};
+
+struct CFolderLink: public CTempFileInfo
+{
+ NWindows::NDLL::CLibrary Library;
+ CMyComPtr<IFolderFolder> ParentFolder;
+ bool UsePassword;
+ UString Password;
+ bool IsVirtual;
+
+ UString VirtualPath;
+ CFolderLink(): UsePassword(false), IsVirtual(false) {}
+
+ bool WasChanged(const NWindows::NFile::NFind::CFileInfoW &newFileInfo) const
+ {
+ return IsVirtual || CTempFileInfo::WasChanged(newFileInfo);
+ }
+
+};
+
+enum MyMessages
+{
+ kShiftSelectMessage = 20000, // FIXME = WM_USER + 1,
+ kReLoadMessage,
+ kSetFocusToListView,
+ kOpenItemChanged,
+ kRefreshStatusBar
+};
+
+UString GetFolderPath(IFolderFolder * folder);
+
+class CPanel;
+
+class CMyListView: public NWindows::NControl::CListView
+{
+public:
+ WNDPROC _origWindowProc;
+ CPanel *_panel;
+ LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+};
+
+/*
+class CMyComboBox: public NWindows::NControl::CComboBoxEx
+{
+public:
+ WNDPROC _origWindowProc;
+ CPanel *_panel;
+ LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+};
+*/
+class CMyComboBoxEdit: public NWindows::NControl::CEdit
+{
+public:
+ WNDPROC _origWindowProc;
+ CPanel *_panel;
+ LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+};
+
+struct CSelectedState
+{
+ int FocusedItem;
+ UString FocusedName;
+ bool SelectFocused;
+ UStringVector SelectedNames;
+ CSelectedState(): FocusedItem(-1), SelectFocused(false) {}
+};
+
+class CPanel :public NWindows::NControl::CWindow2
+{
+ // FIXME CExtToIconMap _extToIconMap;
+ UINT _baseID;
+ int _comboBoxID;
+ UINT _statusBarID;
+
+ CAppState *_appState;
+
+ bool OnCommand(int code, int itemID, LPARAM lParam, LRESULT &result);
+ LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+ virtual bool OnCreate(CREATESTRUCT *createStruct);
+ // FIXME virtual bool OnSize(WPARAM wParam, int xSize, int ySize);
+ virtual void OnDestroy();
+ virtual bool OnNotify(UINT controlID, LPNMHDR lParam, LRESULT &result);
+ void OnComboBoxCommand(UINT code, LPARAM &aParam);
+ // FIXME bool OnNotifyComboBoxEndEdit(PNMCBEENDEDITW info, LRESULT &result);
+ #ifndef _UNICODE
+ bool OnNotifyComboBoxEndEdit(PNMCBEENDEDIT info, LRESULT &result);
+ #endif
+ // FIXME bool OnNotifyReBar(LPNMHDR lParam, LRESULT &result);
+ // FIXME bool OnNotifyComboBox(LPNMHDR lParam, LRESULT &result);
+ void OnItemChanged(NMLISTVIEW *item);
+ bool OnNotifyList(LPNMHDR lParam, LRESULT &result);
+ // FIXME void OnDrag(LPNMLISTVIEW nmListView);
+ // FIXME bool OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result);
+ // FIXME BOOL OnBeginLabelEdit(LV_DISPINFOW * lpnmh);
+ // FIXME BOOL OnEndLabelEdit(LV_DISPINFOW * lpnmh);
+ void OnColumnClick(LPNMLISTVIEW info);
+ // FIXME bool OnCustomDraw(LPNMLVCUSTOMDRAW lplvcd, LRESULT &result);
+
+public:
+ HWND _mainWindow;
+ CPanelCallback *_panelCallback;
+
+/* FIXME BEGIN */
+ HWND GetParent() { return 0; }
+ operator HWND() const { return 0; }
+/* FIXME END */
+
+ void DeleteItems(bool toRecycleBin);
+ void DeleteItemsInternal(CRecordVector<UInt32> &indices);
+ void CreateFolder();
+ void CreateFile();
+
+private:
+
+ void ChangeWindowSize(int xSize, int ySize);
+
+ void InitColumns();
+ // void InitColumns2(PROPID sortID);
+ void InsertColumn(int index);
+
+ void SetFocusedSelectedItem(int index, bool select);
+ void RefreshListCtrl(const UString &focusedName, int focusedPos, bool selectFocused,
+ const UStringVector &selectedNames);
+
+ void OnShiftSelectMessage();
+ void OnArrowWithShift();
+
+ void OnInsert();
+ // void OnUpWithShift();
+ // void OnDownWithShift();
+public:
+ void myTests();
+ void UpdateSelection();
+ void SelectSpec(bool selectMode);
+ void SelectByType(bool selectMode);
+ void SelectAll(bool selectMode);
+ void InvertSelection();
+private:
+
+ // UString GetFileType(UInt32 index);
+ LRESULT SetItemText(LVITEMW &item);
+
+ // CRecordVector<PROPID> m_ColumnsPropIDs;
+
+public:
+ // FIXME NWindows::NControl::CReBar _headerReBar;
+ // FIXME NWindows::NControl::CToolBar _headerToolBar;
+ NWindows::NControl::CComboBoxEx _headerComboBox;
+ // CMyComboBox _headerComboBox;
+ CMyComboBoxEdit _comboBoxEdit;
+ CMyListView _listView;
+ NWindows::NControl::CStatusBar _statusBar;
+ bool _lastFocusedIsList;
+ // NWindows::NControl::CStatusBar _statusBar2;
+
+ DWORD _exStyle;
+ bool _showDots;
+ bool _showRealFileIcons;
+ // bool _virtualMode;
+ // CUIntVector _realIndices;
+ bool _enableItemChangeNotify;
+ bool _mySelectMode;
+ CBoolVector _selectedStatusVector;
+
+ CSelectedState _selectedState;
+
+ UInt32 GetRealIndex(const LVITEMW &item) const
+ {
+ /*
+ if (_virtualMode)
+ return _realIndices[item.iItem];
+ */
+ return (UInt32)item.lParam;
+ }
+ int GetRealItemIndex(int indexInListView) const
+ {
+ /*
+ if (_virtualMode)
+ return indexInListView;
+ */
+ LPARAM param;
+ if (!_listView.GetItemParam(indexInListView, param))
+ throw 1;
+ return (int)param;
+ }
+
+ UInt32 _ListViewMode;
+ int _xSize;
+
+ bool _flatMode;
+ bool _flatModeForDisk;
+ bool _flatModeForArc;
+
+ bool _dontShowMode;
+
+
+ UString _currentFolderPrefix;
+
+ CObjectVector<CFolderLink> _parentFolders;
+ NWindows::NDLL::CLibrary _library;
+ CMyComPtr<IFolderFolder> _folder;
+ // CMyComPtr<IFolderGetSystemIconIndex> _folderGetSystemIconIndex;
+
+ UStringVector _fastFolders;
+
+ void GetSelectedNames(UStringVector &selectedNames);
+ void SaveSelectedState(CSelectedState &s);
+ void RefreshListCtrl(const CSelectedState &s);
+ void RefreshListCtrlSaveFocused();
+
+ UString GetItemName(int itemIndex) const;
+ UString GetItemPrefix(int itemIndex) const;
+ UString GetItemRelPath(int itemIndex) const;
+ bool IsItemFolder(int itemIndex) const;
+ UInt64 GetItemSize(int itemIndex) const;
+
+ ////////////////////////
+ // PanelFolderChange.cpp
+
+ void SetToRootFolder();
+ HRESULT BindToPath(const UString &fullPath, bool &archiveIsOpened, bool &encrypted); // can be prefix
+ HRESULT BindToPathAndRefresh(const UString &path);
+ void OpenDrivesFolder();
+
+ void SetBookmark(int index);
+ void OpenBookmark(int index);
+
+ void LoadFullPath();
+ void LoadFullPathAndShow();
+ void FoldersHistory();
+ void OpenParentFolder();
+ void CloseOpenFolders();
+ void OpenRootFolder();
+
+
+ HRESULT Create(HWND mainWindow, HWND parentWindow,
+ UINT id,
+ const UString &currentFolderPrefix,
+ CPanelCallback *panelCallback,
+ CAppState *appState, bool &archiveIsOpened, bool &encrypted);
+ void SetFocusToList();
+ void SetFocusToLastRememberedItem();
+
+
+ void ReadListViewInfo();
+ void SaveListViewInfo();
+
+ CPanel() :
+ // _virtualMode(flase),
+ _exStyle(0),
+ _showDots(false),
+ _showRealFileIcons(false),
+ _needSaveInfo(false),
+ _startGroupSelect(0),
+ _selectionIsDefined(false),
+ _ListViewMode(3),
+ _flatMode(false),
+ _flatModeForDisk(false),
+ _flatModeForArc(false),
+ _xSize(300),
+ _mySelectMode(false),
+ _enableItemChangeNotify(true),
+ _dontShowMode(false)
+ {}
+
+
+ void SetExtendedStyle()
+ {
+/* FIXME
+ if (_listView != 0)
+ _listView.SetExtendedListViewStyle(_exStyle);
+ */
+ }
+
+
+ bool _needSaveInfo;
+ UString _typeIDString;
+ CListViewInfo _listViewInfo;
+ CItemProperties _properties;
+ CItemProperties _visibleProperties;
+
+ PROPID _sortID;
+ // int _sortIndex;
+ bool _ascending;
+
+ void Release();
+ ~CPanel();
+ // FIXME void OnLeftClick(LPNMITEMACTIVATE itemActivate);
+ // FIXME bool OnRightClick(LPNMITEMACTIVATE itemActivate, LRESULT &result);
+
+ void OnTimer();
+ void OnReload();
+ bool OnContextMenu(HANDLE windowHandle, int xPos, int yPos);
+
+#ifdef _WIN32
+ CMyComPtr<IContextMenu> _sevenZipContextMenu;
+ CMyComPtr<IContextMenu> _systemContextMenu;
+ HRESULT CreateShellContextMenu(
+ const CRecordVector<UInt32> &operatedIndices,
+ CMyComPtr<IContextMenu> &systemContextMenu);
+ void CreateSystemMenu(HMENU menu,
+ const CRecordVector<UInt32> &operatedIndices,
+ CMyComPtr<IContextMenu> &systemContextMenu);
+ void CreateSevenZipMenu(HMENU menu,
+ const CRecordVector<UInt32> &operatedIndices,
+ CMyComPtr<IContextMenu> &sevenZipContextMenu);
+ void CreateFileMenu(HMENU menu,
+ CMyComPtr<IContextMenu> &sevenZipContextMenu,
+ CMyComPtr<IContextMenu> &systemContextMenu,
+ bool programMenu);
+ void CreateFileMenu(HMENU menu);
+ bool InvokePluginCommand(int id);
+ bool InvokePluginCommand(int id, IContextMenu *sevenZipContextMenu,
+ IContextMenu *systemContextMenu);
+#endif // ifdef _WIN32
+
+ void InvokeSystemCommand(const char *command);
+ void Properties();
+ void EditCut();
+ void EditCopy();
+ void EditPaste();
+
+ int _startGroupSelect;
+
+ bool _selectionIsDefined;
+ bool _selectMark;
+ int _prevFocusedItem;
+
+
+ // void SortItems(int index);
+ void SortItemsWithPropID(PROPID propID);
+
+ void GetSelectedItemsIndices(CRecordVector<UInt32> &indices) const;
+ void GetOperatedItemIndices(CRecordVector<UInt32> &indices) const;
+ void GetAllItemIndices(CRecordVector<UInt32> &indices) const;
+ void GetOperatedIndicesSmart(CRecordVector<UInt32> &indices) const;
+ // void GetOperatedListViewIndices(CRecordVector<UInt32> &indices) const;
+ void KillSelection();
+
+ UString GetFolderTypeID() const;
+ bool IsRootFolder() const;
+ bool IsFSFolder() const;
+ bool IsFSDrivesFolder() const;
+
+ UString GetFsPath() const;
+ UString GetDriveOrNetworkPrefix() const;
+
+ bool DoesItSupportOperations() const;
+
+ bool _processTimer;
+ bool _processNotify;
+
+ class CDisableTimerProcessing
+ {
+ bool _processTimerMem;
+ bool _processNotifyMem;
+
+ CPanel &_panel;
+ public:
+
+ CDisableTimerProcessing(CPanel &panel): _panel(panel)
+ {
+ Disable();
+ }
+ void Disable()
+ {
+ _processTimerMem = _panel._processTimer;
+ _processNotifyMem = _panel._processNotify;
+ _panel._processTimer = false;
+ _panel._processNotify = false;
+ }
+ void Restore()
+ {
+ _panel._processTimer = _processTimerMem;
+ _panel._processNotify = _processNotifyMem;
+ }
+ ~CDisableTimerProcessing()
+ {
+ Restore();
+ }
+ CDisableTimerProcessing& operator=(const CDisableTimerProcessing &) {; }
+ };
+
+ // bool _passwordIsDefined;
+ // UString _password;
+
+ void RefreshListCtrl();
+
+ void MessageBoxInfo(LPCWSTR message, LPCWSTR caption);
+ void MessageBox(LPCWSTR message);
+ void MessageBox(LPCWSTR message, LPCWSTR caption);
+ void MessageBoxMyError(LPCWSTR message);
+ void MessageBoxError(HRESULT errorCode, LPCWSTR caption);
+ void MessageBoxError(HRESULT errorCode);
+ void MessageBoxLastError(LPCWSTR caption);
+ void MessageBoxLastError();
+
+ void MessageBoxErrorLang(UINT resourceID, UInt32 langID);
+
+ void OpenFocusedItemAsInternal();
+ void OpenSelectedItems(bool internal);
+
+ void OpenFolderExternal(int index);
+
+ void OpenFolder(int index);
+ HRESULT OpenParentArchiveFolder();
+ HRESULT OpenItemAsArchive(IInStream *inStream,
+ const CTempFileInfo &tempFileInfo,
+ const UString &virtualFilePath,
+ bool &encrypted);
+ HRESULT OpenItemAsArchive(const UString &name, bool &encrypted);
+ HRESULT OpenItemAsArchive(int index);
+ void OpenItemInArchive(int index, bool tryInternal, bool tryExternal,
+ bool editMode);
+ HRESULT OnOpenItemChanged(const UString &folderPath, const UString &itemName, bool usePassword, const UString &password);
+ LRESULT OnOpenItemChanged(LPARAM lParam);
+
+ void OpenItem(int index, bool tryInternal, bool tryExternal);
+ void EditItem();
+ void EditItem(int index);
+
+ void RenameFile();
+ void ChangeComment();
+
+ void SetListViewMode(UInt32 index);
+ UInt32 GetListViewMode() const { return _ListViewMode; };
+
+ void ChangeFlatMode();
+ bool GetFlatMode() const { return _flatMode; };
+
+ void RefreshStatusBar();
+ void OnRefreshStatusBar();
+
+ void AddToArchive();
+
+ void GetFilePaths(const CRecordVector<UInt32> &indices, UStringVector &paths);
+ void ExtractArchives();
+ void TestArchives();
+
+ HRESULT CopyTo(const CRecordVector<UInt32> &indices, const UString &folder,
+ bool moveMode, bool showErrorMessages, UStringVector *messages,
+ bool &usePassword, UString &password);
+
+ HRESULT CopyTo(const CRecordVector<UInt32> &indices, const UString &folder,
+ bool moveMode, bool showErrorMessages, UStringVector *messages)
+ {
+ bool usePassword = false;
+ UString password;
+ if (_parentFolders.Size() > 0)
+ {
+ const CFolderLink &fl = _parentFolders.Back();
+ usePassword = fl.UsePassword;
+ password = fl.Password;
+ }
+ return CopyTo(indices, folder, moveMode, showErrorMessages, messages, usePassword, password);
+ }
+
+ HRESULT CopyFrom(const UString &folderPrefix, const UStringVector &filePaths,
+ bool showErrorMessages, UStringVector *messages);
+
+ void CopyFromNoAsk(const UStringVector &filePaths);
+ void CopyFromAsk(const UStringVector &filePaths);
+
+ // empty folderPath means create new Archive to path of first fileName.
+ #ifdef _WIN32
+ void DropObject(IDataObject * dataObject, const UString &folderPath);
+
+ // empty folderPath means create new Archive to path of first fileName.
+ void CompressDropFiles(const UStringVector &fileNames, const UString &folderPath);
+#endif
+
+ void RefreshTitle(bool always = false) { _panelCallback->RefreshTitle(always); }
+ void RefreshTitleAlways() { RefreshTitle(true); }
+
+ UString GetItemsInfoString(const CRecordVector<UInt32> &indices);
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelCopy.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelCopy.cpp
new file mode 100644
index 000000000..8ad3d4c91
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelCopy.cpp
@@ -0,0 +1,228 @@
+// PanelExtract.cpp
+
+#include "StdAfx.h"
+
+#include "Panel.h"
+#include "resource.h"
+#include "LangUtils.h"
+#include "ExtractCallback.h"
+#include "Windows/Thread.h"
+////////////////////////////////////////////////////////////////
+
+#include "UpdateCallback100.h"
+
+using namespace NWindows;
+
+struct CThreadExtractInArchive2
+{
+ CMyComPtr<IFolderOperations> FolderOperations;
+ CRecordVector<UInt32> Indices;
+ UString DestPath;
+ CExtractCallbackImp *ExtractCallbackSpec;
+ CMyComPtr<IFolderOperationsExtractCallback> ExtractCallback;
+ HRESULT Result;
+ bool MoveMode;
+
+ CThreadExtractInArchive2(): MoveMode(false) {}
+
+ DWORD Extract()
+ {
+ ExtractCallbackSpec->ProgressDialog.WaitCreating();
+ if (MoveMode)
+ Result = FolderOperations->MoveTo(&Indices.Front(), Indices.Size(),
+ DestPath, ExtractCallback);
+ else
+ Result = FolderOperations->CopyTo(&Indices.Front(), Indices.Size(),
+ DestPath, ExtractCallback);
+ ExtractCallbackSpec->ProgressDialog.MyClose();
+ return 0;
+ }
+
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
+ {
+ return ((CThreadExtractInArchive2 *)param)->Extract();
+ }
+};
+
+HRESULT CPanel::CopyTo(const CRecordVector<UInt32> &indices, const UString &folder,
+ bool moveMode, bool showErrorMessages, UStringVector *messages,
+ bool &usePassword, UString &password)
+{
+ CMyComPtr<IFolderOperations> folderOperations;
+ if (_folder.QueryInterface(IID_IFolderOperations, &folderOperations) != S_OK)
+ {
+ UString errorMessage = LangString(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ if (showErrorMessages)
+ MessageBox(errorMessage);
+ else if (messages != 0)
+ messages->Add(errorMessage);
+ return E_FAIL;
+ }
+
+ HRESULT res;
+ {
+ CThreadExtractInArchive2 extracter;
+
+ extracter.ExtractCallbackSpec = new CExtractCallbackImp;
+ extracter.ExtractCallback = extracter.ExtractCallbackSpec;
+ extracter.ExtractCallbackSpec->ParentWindow = GetParent();
+ extracter.ExtractCallbackSpec->ShowMessages = showErrorMessages;
+ extracter.ExtractCallbackSpec->ProgressDialog.CompressingMode = false;
+
+ UString title = moveMode ?
+ LangString(IDS_MOVING, 0x03020206):
+ LangString(IDS_COPYING, 0x03020205);
+ UString progressWindowTitle = LangString(IDS_APP_TITLE, 0x03000000);
+
+ extracter.ExtractCallbackSpec->ProgressDialog.MainWindow = GetParent();
+ extracter.ExtractCallbackSpec->ProgressDialog.MainTitle = progressWindowTitle;
+ extracter.ExtractCallbackSpec->ProgressDialog.MainAddTitle = title + L" ";
+
+ extracter.ExtractCallbackSpec->OverwriteMode = NExtract::NOverwriteMode::kAskBefore;
+ extracter.ExtractCallbackSpec->Init();
+ extracter.Indices = indices;
+ extracter.DestPath = folder;
+ extracter.FolderOperations = folderOperations;
+ extracter.MoveMode = moveMode;
+
+ extracter.ExtractCallbackSpec->PasswordIsDefined = usePassword;
+ extracter.ExtractCallbackSpec->Password = password;
+
+ NWindows::CThread extractThread;
+ RINOK(extractThread.Create(CThreadExtractInArchive2::MyThreadFunction, &extracter));
+ extracter.ExtractCallbackSpec->StartProgressDialog(title);
+
+ if (messages != 0)
+ *messages = extracter.ExtractCallbackSpec->Messages;
+ res = extracter.Result;
+
+ if (res == S_OK && extracter.ExtractCallbackSpec->Messages.IsEmpty())
+ {
+ usePassword = extracter.ExtractCallbackSpec->PasswordIsDefined;
+ password = extracter.ExtractCallbackSpec->Password;
+ }
+ }
+ RefreshTitleAlways();
+ return res;
+}
+
+
+struct CThreadUpdate
+{
+ CMyComPtr<IFolderOperations> FolderOperations;
+ UString FolderPrefix;
+ UStringVector FileNames;
+ CRecordVector<const wchar_t *> FileNamePointers;
+ CMyComPtr<IFolderArchiveUpdateCallback> UpdateCallback;
+ CUpdateCallback100Imp *UpdateCallbackSpec;
+ HRESULT Result;
+
+ DWORD Process()
+ {
+ UpdateCallbackSpec->ProgressDialog.WaitCreating();
+ Result = FolderOperations->CopyFrom(
+ FolderPrefix,
+ &FileNamePointers.Front(),
+ FileNamePointers.Size(),
+ UpdateCallback);
+ UpdateCallbackSpec->ProgressDialog.MyClose();
+ return 0;
+ }
+
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
+ {
+ return ((CThreadUpdate *)param)->Process();
+ }
+};
+
+
+HRESULT CPanel::CopyFrom(const UString &folderPrefix, const UStringVector &filePaths,
+ bool showErrorMessages, UStringVector *messages)
+{
+ CMyComPtr<IFolderOperations> folderOperations;
+ if (_folder.QueryInterface(IID_IFolderOperations, &folderOperations) != S_OK)
+ {
+ UString errorMessage = LangString(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ if (showErrorMessages)
+ MessageBox(errorMessage);
+ else if (messages != 0)
+ messages->Add(errorMessage);
+ return E_FAIL;
+ }
+
+ HRESULT res;
+ {
+ CThreadUpdate updater;
+ updater.UpdateCallbackSpec = new CUpdateCallback100Imp;
+ updater.UpdateCallback = updater.UpdateCallbackSpec;
+
+ UString title = LangString(IDS_COPYING, 0x03020205);
+ UString progressWindowTitle = LangString(IDS_APP_TITLE, 0x03000000);
+
+ updater.UpdateCallbackSpec->ProgressDialog.MainWindow = GetParent();
+ updater.UpdateCallbackSpec->ProgressDialog.MainTitle = progressWindowTitle;
+ updater.UpdateCallbackSpec->ProgressDialog.MainAddTitle = title + UString(L" ");
+
+ updater.UpdateCallbackSpec->Init((HWND)*this, false, L"");
+ updater.FolderOperations = folderOperations;
+ updater.FolderPrefix = folderPrefix;
+ updater.FileNames.Reserve(filePaths.Size());
+ int i;
+ for(i = 0; i < filePaths.Size(); i++)
+ updater.FileNames.Add(filePaths[i]);
+ updater.FileNamePointers.Reserve(updater.FileNames.Size());
+ for(i = 0; i < updater.FileNames.Size(); i++)
+ updater.FileNamePointers.Add(updater.FileNames[i]);
+
+ NWindows::CThread thread;
+ RINOK(thread.Create(CThreadUpdate::MyThreadFunction, &updater));
+ updater.UpdateCallbackSpec->StartProgressDialog(title);
+
+ if (messages != 0)
+ *messages = updater.UpdateCallbackSpec->Messages;
+
+ res = updater.Result;
+ }
+ RefreshTitleAlways();
+ return res;
+}
+
+void CPanel::CopyFromNoAsk(const UStringVector &filePaths)
+{
+ CDisableTimerProcessing disableTimerProcessing(*this);
+
+ CSelectedState srcSelState;
+ SaveSelectedState(srcSelState);
+
+ HRESULT result = CopyFrom(L"", filePaths, true, 0);
+
+ if (result != S_OK)
+ {
+ disableTimerProcessing.Restore();
+ // For Password:
+ SetFocusToList();
+ if (result != E_ABORT)
+ MessageBoxError(result);
+ return;
+ }
+
+ RefreshListCtrl(srcSelState);
+
+ disableTimerProcessing.Restore();
+ SetFocusToList();
+}
+
+void CPanel::CopyFromAsk(const UStringVector &filePaths)
+{
+ UString title = LangString(IDS_CONFIRM_FILE_COPY, 0x03020222);
+ UString message = LangString(IDS_WANT_TO_COPY_FILES, 0x03020223);
+ message += L"\n\'";
+ message += _currentFolderPrefix;
+ message += L"\' ?";
+ int res = ::MessageBoxW(*(this), message, title, MB_YESNOCANCEL | MB_ICONQUESTION | MB_SYSTEMMODAL);
+ if (res != IDYES)
+ return;
+
+ CopyFromNoAsk(filePaths);
+}
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelCrc.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelCrc.cpp
new file mode 100644
index 000000000..61490b578
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelCrc.cpp
@@ -0,0 +1,368 @@
+// PanelSplitFile.cpp
+
+#include "StdAfx.h"
+
+#include "resource.h"
+
+extern "C"
+{
+ #include "../../../../C/Alloc.h"
+ #include "../../../../C/7zCrc.h"
+}
+
+#include "Common/IntToString.h"
+#include "Common/StringConvert.h"
+
+#include "Windows/FileIO.h"
+#include "Windows/FileFind.h"
+#include "Windows/FileName.h"
+#include "Windows/Thread.h"
+#include "Windows/Error.h"
+
+#include "ProgressDialog2.h"
+#include "OverwriteDialogRes.h"
+
+#include "App.h"
+#include "FormatUtils.h"
+#include "LangUtils.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NName;
+
+static const UInt32 kBufSize = (1 << 15);
+
+struct CDirEnumerator
+{
+ bool FlatMode;
+ UString BasePrefix;
+ UStringVector FileNames;
+
+ CObjectVector<NFind::CEnumeratorW> Enumerators;
+ UStringVector Prefixes;
+ int Index;
+ bool GetNextFile(NFind::CFileInfoW &fileInfo, bool &filled, UString &fullPath, DWORD &errorCode);
+ void Init();
+
+ CDirEnumerator(): FlatMode(false) {};
+};
+
+void CDirEnumerator::Init()
+{
+ Enumerators.Clear();
+ Prefixes.Clear();
+ Index = 0;
+}
+
+bool CDirEnumerator::GetNextFile(NFind::CFileInfoW &fileInfo, bool &filled, UString &resPath, DWORD &errorCode)
+{
+ filled = false;
+ for (;;)
+ {
+ if (Enumerators.IsEmpty())
+ {
+ if (Index >= FileNames.Size())
+ return true;
+ const UString &path = FileNames[Index];
+ int pos = path.ReverseFind('\\');
+ resPath.Empty();
+ if (pos >= 0)
+ resPath = path.Left(pos + 1);
+ if (!NFind::FindFile(BasePrefix + path, fileInfo))
+ {
+ errorCode = ::GetLastError();
+ resPath = path;
+ return false;
+ }
+ Index++;
+ break;
+ }
+ bool found;
+ if (!Enumerators.Back().Next(fileInfo, found))
+ {
+ errorCode = ::GetLastError();
+ resPath = Prefixes.Back();
+ return false;
+ }
+ if (found)
+ {
+ resPath = Prefixes.Back();
+ break;
+ }
+ Enumerators.DeleteBack();
+ Prefixes.DeleteBack();
+ }
+ resPath += fileInfo.Name;
+ if (!FlatMode && fileInfo.IsDir())
+ {
+ UString prefix = resPath + (UString)(wchar_t)kDirDelimiter;
+ Enumerators.Add(NFind::CEnumeratorW(BasePrefix + prefix + (UString)(wchar_t)kAnyStringWildcard));
+ Prefixes.Add(prefix);
+ }
+ filled = true;
+ return true;
+}
+
+struct CThreadCrc
+{
+ class CMyBuffer
+ {
+ void *_data;
+ public:
+ CMyBuffer(): _data(0) {}
+ operator void *() { return _data; }
+ bool Allocate(size_t size)
+ {
+ if (_data != 0)
+ return false;
+ _data = ::MidAlloc(size);
+ return _data != 0;
+ }
+ ~CMyBuffer() { ::MidFree(_data); }
+ };
+
+ CProgressDialog *ProgressDialog;
+
+ CDirEnumerator DirEnumerator;
+
+ UInt64 NumFiles;
+ UInt64 NumFolders;
+ UInt64 DataSize;
+ UInt32 DataCrcSum;
+ UInt32 DataNameCrcSum;
+
+ HRESULT Result;
+ DWORD ErrorCode;
+ UString ErrorPath;
+ UString Error;
+ bool ThereIsError;
+
+ void Process2()
+ {
+ DataSize = NumFolders = NumFiles = DataCrcSum = DataNameCrcSum = 0;
+ ProgressDialog->WaitCreating();
+
+ CMyBuffer bufferObject;
+ if (!bufferObject.Allocate(kBufSize))
+ {
+ Error = L"Can not allocate memory";
+ ThereIsError = true;
+ return;
+ }
+ Byte *buffer = (Byte *)(void *)bufferObject;
+
+ UInt64 totalSize = 0;
+
+ DirEnumerator.Init();
+
+ UString scanningStr = LangString(IDS_SCANNING, 0x03020800);
+ scanningStr += L" ";
+
+ for (;;)
+ {
+ NFile::NFind::CFileInfoW fileInfo;
+ bool filled;
+ UString resPath;
+ if (!DirEnumerator.GetNextFile(fileInfo, filled, resPath, ErrorCode))
+ {
+ ThereIsError = true;
+ ErrorPath = resPath;
+ return;
+ }
+ if (!filled)
+ break;
+ if (!fileInfo.IsDir())
+ totalSize += fileInfo.Size;
+ ProgressDialog->ProgressSynch.SetCurrentFileName(scanningStr + resPath);
+ ProgressDialog->ProgressSynch.SetProgress(totalSize, 0);
+ Result = ProgressDialog->ProgressSynch.SetPosAndCheckPaused(0);
+ if (Result != S_OK)
+ return;
+ }
+
+ ProgressDialog->ProgressSynch.SetProgress(totalSize, 0);
+
+ DirEnumerator.Init();
+
+ for (;;)
+ {
+ NFile::NFind::CFileInfoW fileInfo;
+ bool filled;
+ UString resPath;
+ if (!DirEnumerator.GetNextFile(fileInfo, filled, resPath, ErrorCode))
+ {
+ ThereIsError = true;
+ ErrorPath = resPath;
+ return;
+ }
+ if (!filled)
+ break;
+
+ UInt32 crc = CRC_INIT_VAL;
+ if (fileInfo.IsDir())
+ NumFolders++;
+ else
+ {
+ NFile::NIO::CInFile inFile;
+ if (!inFile.Open(DirEnumerator.BasePrefix + resPath))
+ {
+ ErrorCode = ::GetLastError();
+ ThereIsError = true;
+ ErrorPath = resPath;
+ return;
+ }
+ NumFiles++;
+ ProgressDialog->ProgressSynch.SetCurrentFileName(resPath);
+ for (;;)
+ {
+ UInt32 processedSize;
+ if (!inFile.Read(buffer, kBufSize, processedSize))
+ {
+ ErrorCode = ::GetLastError();
+ ThereIsError = true;
+ ErrorPath = resPath;
+ return;
+ }
+ if (processedSize == 0)
+ break;
+ crc = CrcUpdate(crc, buffer, processedSize);
+ DataSize += processedSize;
+ Result = ProgressDialog->ProgressSynch.SetPosAndCheckPaused(DataSize);
+ if (Result != S_OK)
+ return;
+ }
+ DataCrcSum += CRC_GET_DIGEST(crc);
+ }
+ for (int i = 0; i < resPath.Length(); i++)
+ {
+ wchar_t c = resPath[i];
+ crc = CRC_UPDATE_BYTE(crc, ((Byte)(c & 0xFF)));
+ crc = CRC_UPDATE_BYTE(crc, ((Byte)((c >> 8) & 0xFF)));
+ }
+ DataNameCrcSum += CRC_GET_DIGEST(crc);
+ Result = ProgressDialog->ProgressSynch.SetPosAndCheckPaused(DataSize);
+ if (Result != S_OK)
+ return;
+ }
+ }
+ DWORD Process()
+ {
+ try { Process2(); }
+ catch(...) { Error = L"Error"; ThereIsError = true;}
+ ProgressDialog->MyClose();
+ return 0;
+ }
+
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
+ {
+ return ((CThreadCrc *)param)->Process();
+ }
+};
+
+static void ConvertUInt32ToHex(UInt32 value, wchar_t *s)
+{
+ for (int i = 0; i < 8; i++)
+ {
+ int t = value & 0xF;
+ value >>= 4;
+ s[7 - i] = (wchar_t)((t < 10) ? (L'0' + t) : (L'A' + (t - 10)));
+ }
+ s[8] = L'\0';
+}
+
+void CApp::CalculateCrc()
+{
+ int srcPanelIndex = GetFocusedPanelIndex();
+ CPanel &srcPanel = Panels[srcPanelIndex];
+ if (!srcPanel.IsFSFolder())
+ {
+ srcPanel.MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return;
+ }
+ CRecordVector<UInt32> indices;
+ srcPanel.GetOperatedItemIndices(indices);
+ if (indices.IsEmpty())
+ return;
+
+ CThreadCrc combiner;
+ for (int i = 0; i < indices.Size(); i++)
+ combiner.DirEnumerator.FileNames.Add(srcPanel.GetItemRelPath(indices[i]));
+ combiner.DirEnumerator.BasePrefix = srcPanel._currentFolderPrefix;
+ combiner.DirEnumerator.FlatMode = GetFlatMode();
+
+ {
+ CProgressDialog progressDialog;
+ combiner.ProgressDialog = &progressDialog;
+ combiner.ErrorCode = 0;
+ combiner.Result = S_OK;
+ combiner.ThereIsError = false;
+
+ UString progressWindowTitle = LangString(IDS_APP_TITLE, 0x03000000);
+ UString title = LangString(IDS_CHECKSUM_CALCULATING, 0x03020710);
+
+ progressDialog.MainWindow = _window;
+ progressDialog.MainTitle = progressWindowTitle;
+ progressDialog.MainAddTitle = title + UString(L" ");
+
+ NWindows::CThread thread;
+ if (thread.Create(CThreadCrc::MyThreadFunction, &combiner) != S_OK)
+ return;
+ progressDialog.Create(title, _window);
+
+ if (combiner.Result != S_OK)
+ {
+ if (combiner.Result != E_ABORT)
+ srcPanel.MessageBoxError(combiner.Result);
+ }
+ else if (combiner.ThereIsError)
+ {
+ if (combiner.Error.IsEmpty())
+ {
+ UString message = combiner.DirEnumerator.BasePrefix + combiner.ErrorPath;
+ message += L"\n";
+ message += NError::MyFormatMessageW(combiner.ErrorCode);
+ srcPanel.MessageBoxMyError(message);
+ }
+ else
+ srcPanel.MessageBoxMyError(combiner.Error);
+ }
+ else
+ {
+ UString s;
+ {
+ wchar_t sz[32];
+
+ s += LangString(IDS_FILES_COLON, 0x02000320);
+ s += L" ";
+ ConvertUInt64ToString(combiner.NumFiles, sz);
+ s += sz;
+ s += L"\n";
+
+ s += LangString(IDS_FOLDERS_COLON, 0x02000321);
+ s += L" ";
+ ConvertUInt64ToString(combiner.NumFolders, sz);
+ s += sz;
+ s += L"\n";
+
+ s += LangString(IDS_SIZE_COLON, 0x02000322);
+ s += L" ";
+ ConvertUInt64ToString(combiner.DataSize, sz);
+ s += MyFormatNew(IDS_FILE_SIZE, 0x02000982, sz);;
+ s += L"\n";
+
+ s += LangString(IDS_CHECKSUM_CRC_DATA, 0x03020721);
+ s += L" ";
+ ConvertUInt32ToHex(combiner.DataCrcSum, sz);
+ s += sz;
+ s += L"\n";
+
+ s += LangString(IDS_CHECKSUM_CRC_DATA_NAMES, 0x03020722);
+ s += L" ";
+ ConvertUInt32ToHex(combiner.DataNameCrcSum, sz);
+ s += sz;
+ }
+ srcPanel.MessageBoxInfo(s, LangString(IDS_CHECKSUM_INFORMATION, 0x03020720));
+ }
+ }
+ RefreshTitleAlways();
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelFolderChange.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelFolderChange.cpp
new file mode 100644
index 000000000..3364dc9c7
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelFolderChange.cpp
@@ -0,0 +1,597 @@
+// PanelFolderChange.cpp
+
+#include "StdAfx.h"
+
+#include "Common/StringConvert.h"
+#include "Common/Wildcard.h"
+
+#include "Windows/PropVariant.h"
+
+#include "../../PropID.h"
+
+#ifdef _WIN32
+#include "FSDrives.h"
+#endif
+#include "LangUtils.h"
+#include "ListViewDialog.h"
+#include "Panel.h"
+#include "RootFolder.h"
+#include "ViewSettings.h"
+
+#include "resource.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NFind;
+
+void CPanel::SetToRootFolder()
+{
+ _folder.Release();
+ _library.Free();
+ CRootFolder *rootFolderSpec = new CRootFolder;
+ _folder = rootFolderSpec;
+ rootFolderSpec->Init();
+}
+
+HRESULT CPanel::BindToPath(const UString &fullPath, bool &archiveIsOpened, bool &encrypted)
+{
+ archiveIsOpened = false;
+ encrypted = false;
+ CDisableTimerProcessing disableTimerProcessing1(*this);
+
+ printf("CPanel::BindToPath(%ls)\n",(const wchar_t *)fullPath);
+
+ if (_parentFolders.Size() > 0)
+ {
+ const UString &virtPath = _parentFolders.Back().VirtualPath;
+ if (fullPath.Left(virtPath.Length()) == virtPath)
+ {
+ for (;;)
+ {
+ CMyComPtr<IFolderFolder> newFolder;
+ HRESULT res = _folder->BindToParentFolder(&newFolder);
+ if (!newFolder || res != S_OK)
+ break;
+ _folder = newFolder;
+ }
+ UStringVector parts;
+ SplitPathToParts(fullPath.Mid(virtPath.Length()), parts);
+ for (int i = 0; i < parts.Size(); i++)
+ {
+ const UString &s = parts[i];
+ if ((i == 0 || i == parts.Size() - 1) && s.IsEmpty())
+ continue;
+ CMyComPtr<IFolderFolder> newFolder;
+ HRESULT res = _folder->BindToFolder(s, &newFolder);
+ if (!newFolder || res != S_OK)
+ break;
+ _folder = newFolder;
+ }
+ return S_OK;
+ }
+ }
+
+ CloseOpenFolders();
+ UString sysPath = fullPath;
+ CFileInfoW fileInfo;
+ UStringVector reducedParts;
+ while (!sysPath.IsEmpty())
+ {
+ if (fileInfo.Find(sysPath))
+ break;
+ int pos = sysPath.ReverseFind(WCHAR_PATH_SEPARATOR);
+ if (pos < 0)
+ sysPath.Empty();
+ else
+ {
+ if (reducedParts.Size() > 0 || pos < sysPath.Length() - 1)
+ reducedParts.Add(sysPath.Mid(pos + 1));
+ sysPath = sysPath.Left(pos);
+ }
+ }
+ SetToRootFolder();
+ CMyComPtr<IFolderFolder> newFolder;
+ if (sysPath.IsEmpty())
+ {
+ if (_folder->BindToFolder(fullPath, &newFolder) == S_OK)
+ _folder = newFolder;
+ }
+ else if (fileInfo.IsDir())
+ {
+ NName::NormalizeDirPathPrefix(sysPath);
+ if (_folder->BindToFolder(sysPath, &newFolder) == S_OK)
+ _folder = newFolder;
+ }
+ else
+ {
+ UString dirPrefix;
+ if (!NDirectory::GetOnlyDirPrefix(sysPath, dirPrefix))
+ dirPrefix.Empty();
+ if (_folder->BindToFolder(dirPrefix, &newFolder) == S_OK)
+ {
+ _folder = newFolder;
+ LoadFullPath();
+ UString fileName;
+ if (NDirectory::GetOnlyName(sysPath, fileName))
+ {
+ HRESULT res = OpenItemAsArchive(fileName, encrypted);
+ if (res != S_FALSE)
+ {
+ RINOK(res);
+ }
+ /*
+ if (res == E_ABORT)
+ return res;
+ */
+ if (res == S_OK)
+ {
+ archiveIsOpened = true;
+ for (int i = reducedParts.Size() - 1; i >= 0; i--)
+ {
+ CMyComPtr<IFolderFolder> newFolder;
+ _folder->BindToFolder(reducedParts[i], &newFolder);
+ if (!newFolder)
+ break;
+ _folder = newFolder;
+ }
+ }
+ }
+ }
+ }
+ return S_OK;
+}
+
+HRESULT CPanel::BindToPathAndRefresh(const UString &path)
+{
+ CDisableTimerProcessing disableTimerProcessing1(*this);
+ bool archiveIsOpened, encrypted;
+ RINOK(BindToPath(path, archiveIsOpened, encrypted));
+ RefreshListCtrl(UString(), -1, true, UStringVector());
+ return S_OK;
+}
+
+void CPanel::SetBookmark(int index)
+{
+ _appState->FastFolders.SetString(index, _currentFolderPrefix);
+}
+
+void CPanel::OpenBookmark(int index)
+{
+ BindToPathAndRefresh(_appState->FastFolders.GetString(index));
+}
+
+UString GetFolderPath(IFolderFolder *folder)
+{
+ NCOM::CPropVariant prop;
+ if (folder->GetFolderProperty(kpidPath, &prop) == S_OK)
+ if (prop.vt == VT_BSTR)
+ return (wchar_t *)prop.bstrVal;
+ return UString();
+}
+
+void CPanel::LoadFullPath()
+{
+ _currentFolderPrefix.Empty();
+ for (int i = 0; i < _parentFolders.Size(); i++)
+ {
+ const CFolderLink &folderLink = _parentFolders[i];
+ _currentFolderPrefix += GetFolderPath(folderLink.ParentFolder);
+ _currentFolderPrefix += folderLink.ItemName;
+ _currentFolderPrefix += WCHAR_PATH_SEPARATOR;
+ }
+ if (_folder)
+ _currentFolderPrefix += GetFolderPath(_folder);
+}
+
+static int GetRealIconIndex(LPCWSTR path, DWORD attributes)
+{
+ int index = -1;
+ if (GetRealIconIndex(path, attributes, index) != 0)
+ return index;
+ return -1;
+}
+
+void CPanel::LoadFullPathAndShow()
+{
+ LoadFullPath();
+ _appState->FolderHistory.AddString(_currentFolderPrefix);
+
+ _headerComboBox.SetText(_currentFolderPrefix);
+#ifdef _WIN32 // FIXME
+ COMBOBOXEXITEM item;
+ item.mask = 0;
+
+ UString path = _currentFolderPrefix;
+ if (path.Length() >
+ #ifdef _WIN32
+ 3
+ #else
+ 1
+ #endif
+ && path[path.Length() - 1] == WCHAR_PATH_SEPARATOR)
+ path.Delete(path.Length() - 1);
+
+ CFileInfoW info;
+ DWORD attrib = FILE_ATTRIBUTE_DIRECTORY;
+ if (info.Find(path))
+ attrib = info.Attrib;
+
+ item.iImage = GetRealIconIndex(path, attrib);
+
+ if (item.iImage >= 0)
+ {
+ item.iSelectedImage = item.iImage;
+ item.mask |= (CBEIF_IMAGE | CBEIF_SELECTEDIMAGE);
+ }
+ item.iItem = -1;
+ _headerComboBox.SetItem(&item);
+#endif
+
+ RefreshTitle();
+}
+
+#ifdef _WIN32
+LRESULT CPanel::OnNotifyComboBoxEnter(const UString &s)
+{
+ if (BindToPathAndRefresh(GetUnicodeString(s)) == S_OK)
+ {
+ PostMessage(kSetFocusToListView);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool CPanel::OnNotifyComboBoxEndEdit(PNMCBEENDEDITW info, LRESULT &result)
+{
+ if (info->iWhy == CBENF_ESCAPE)
+ {
+ _headerComboBox.SetText(_currentFolderPrefix);
+ PostMessage(kSetFocusToListView);
+ result = FALSE;
+ return true;
+ }
+
+ /*
+ if (info->iWhy == CBENF_DROPDOWN)
+ {
+ result = FALSE;
+ return true;
+ }
+ */
+
+ if (info->iWhy == CBENF_RETURN)
+ {
+ // When we use Edit control and press Enter.
+ UString s;
+ _headerComboBox.GetText(s);
+ result = OnNotifyComboBoxEnter(s);
+ return true;
+ }
+ return false;
+}
+
+#ifndef _UNICODE
+bool CPanel::OnNotifyComboBoxEndEdit(PNMCBEENDEDIT info, LRESULT &result)
+{
+ if (info->iWhy == CBENF_ESCAPE)
+ {
+ _headerComboBox.SetText(_currentFolderPrefix);
+ PostMessage(kSetFocusToListView);
+ result = FALSE;
+ return true;
+ }
+ /*
+ if (info->iWhy == CBENF_DROPDOWN)
+ {
+ result = FALSE;
+ return true;
+ }
+ */
+
+ if (info->iWhy == CBENF_RETURN)
+ {
+ UString s;
+ _headerComboBox.GetText(s);
+ // GetUnicodeString(info->szText)
+ result = OnNotifyComboBoxEnter(s);
+ return true;
+ }
+ return false;
+}
+#endif
+
+void CPanel::AddComboBoxItem(const UString &name, int iconIndex, int indent, bool addToList)
+{
+ COMBOBOXEXITEMW item;
+ item.mask = CBEIF_TEXT | CBEIF_INDENT;
+ item.iSelectedImage = item.iImage = iconIndex;
+ if (iconIndex >= 0)
+ item.mask |= (CBEIF_IMAGE | CBEIF_SELECTEDIMAGE);
+ item.iItem = -1;
+ item.iIndent = indent;
+ item.pszText = (LPWSTR)(LPCWSTR)name;
+ _headerComboBox.InsertItem(&item);
+ if (addToList)
+ ComboBoxPaths.Add(name);
+}
+
+extern UString RootFolder_GetName_Computer(int &iconIndex);
+extern UString RootFolder_GetName_Network(int &iconIndex);
+extern UString RootFolder_GetName_Documents(int &iconIndex);
+
+bool CPanel::OnComboBoxCommand(UINT code, LPARAM /* param */, LRESULT &result)
+{
+ result = FALSE;
+ switch(code)
+ {
+ case CBN_DROPDOWN:
+ {
+ ComboBoxPaths.Clear();
+ _headerComboBox.ResetContent();
+
+ int iconIndex;
+ UString name;
+
+ int i;
+ UStringVector pathParts;
+
+ SplitPathToParts(_currentFolderPrefix, pathParts);
+ UString sumPass;
+ for (i = 0; i < pathParts.Size(); i++)
+ {
+ UString name = pathParts[i];
+ if (name.IsEmpty())
+ continue;
+ sumPass += name;
+ UString curName = sumPass;
+ if (i == 0)
+ curName += WCHAR_PATH_SEPARATOR;
+ CFileInfoW info;
+ DWORD attrib = FILE_ATTRIBUTE_DIRECTORY;
+ if (info.Find(sumPass))
+ attrib = info.Attrib;
+ sumPass += WCHAR_PATH_SEPARATOR;
+ AddComboBoxItem(name, GetRealIconIndex(curName, attrib), i, false);
+ ComboBoxPaths.Add(sumPass);
+ }
+
+ name = RootFolder_GetName_Documents(iconIndex);
+ AddComboBoxItem(name, iconIndex, 0, true);
+
+ name = RootFolder_GetName_Computer(iconIndex);
+ AddComboBoxItem(name, iconIndex, 0, true);
+
+ UStringVector driveStrings;
+ MyGetLogicalDriveStrings(driveStrings);
+ for (i = 0; i < driveStrings.Size(); i++)
+ {
+ UString s = driveStrings[i];
+ ComboBoxPaths.Add(s);
+ int iconIndex = GetRealIconIndex(s, 0);
+ if (s.Length() > 0 && s[s.Length() - 1] == WCHAR_PATH_SEPARATOR)
+ s.Delete(s.Length() - 1);
+ AddComboBoxItem(s, iconIndex, 1, false);
+ }
+
+ name = RootFolder_GetName_Network(iconIndex);
+ AddComboBoxItem(name, iconIndex, 0, true);
+
+ // UStringVector strings; _appState->FolderHistory.GetList(strings);
+
+ return false;
+ }
+
+ case CBN_SELENDOK:
+ {
+ code = code;
+ int index = _headerComboBox.GetCurSel();
+ if (index >= 0)
+ {
+ UString pass = ComboBoxPaths[index];
+ _headerComboBox.SetCurSel(-1);
+ _headerComboBox.SetText(pass); // it's fix for seclecting by mouse.
+ if (BindToPathAndRefresh(pass) == S_OK)
+ {
+ PostMessage(kSetFocusToListView);
+ return true;
+ }
+ }
+ return false;
+ }
+ /*
+ case CBN_CLOSEUP:
+ {
+ LoadFullPathAndShow();
+ true;
+
+ }
+ case CBN_SELCHANGE:
+ {
+ // LoadFullPathAndShow();
+ return true;
+ }
+ */
+ }
+ return false;
+}
+
+bool CPanel::OnNotifyComboBox(LPNMHDR header, LRESULT &result)
+{
+ switch(header->code)
+ {
+ case CBEN_BEGINEDIT:
+ {
+ _lastFocusedIsList = false;
+ _panelCallback->PanelWasFocused();
+ break;
+ }
+ #ifndef _UNICODE
+ case CBEN_ENDEDIT:
+ {
+ return OnNotifyComboBoxEndEdit((PNMCBEENDEDIT)header, result);
+ }
+ #endif
+ case CBEN_ENDEDITW:
+ {
+ return OnNotifyComboBoxEndEdit((PNMCBEENDEDITW)header, result);
+ }
+ }
+ return false;
+}
+#endif
+
+
+void CPanel::FoldersHistory()
+{
+ CListViewDialog listViewDialog;
+ listViewDialog.DeleteIsAllowed = true;
+ listViewDialog.Title = LangString(IDS_FOLDERS_HISTORY, 0x03020260);
+ _appState->FolderHistory.GetList(listViewDialog.Strings);
+ if (listViewDialog.Create(GetParent()) == IDCANCEL)
+ return;
+ UString selectString;
+ if (listViewDialog.StringsWereChanged)
+ {
+ _appState->FolderHistory.RemoveAll();
+ for (int i = listViewDialog.Strings.Size() - 1; i >= 0; i--)
+ _appState->FolderHistory.AddString(listViewDialog.Strings[i]);
+ if (listViewDialog.FocusedItemIndex >= 0)
+ selectString = listViewDialog.Strings[listViewDialog.FocusedItemIndex];
+ }
+ else
+ {
+ if (listViewDialog.FocusedItemIndex >= 0)
+ selectString = listViewDialog.Strings[listViewDialog.FocusedItemIndex];
+ }
+ if (listViewDialog.FocusedItemIndex >= 0)
+ BindToPathAndRefresh(selectString);
+}
+
+void CPanel::OpenParentFolder()
+{
+printf("CPanel::OpenParentFolder\n");
+ LoadFullPath(); // Maybe we don't need it ??
+ UString focucedName;
+ if (!_currentFolderPrefix.IsEmpty())
+ {
+ UString string = _currentFolderPrefix;
+ string.Delete(string.Length() - 1);
+ int pos = string.ReverseFind(WCHAR_PATH_SEPARATOR);
+ if (pos < 0)
+ pos = 0;
+ else
+ pos++;
+ focucedName = string.Mid(pos);
+ }
+
+ printf("CPanel::OpenParentFolder focucedName=%ls\n",(const wchar_t *)focucedName);
+
+ CDisableTimerProcessing disableTimerProcessing1(*this);
+ CMyComPtr<IFolderFolder> newFolder;
+ _folder->BindToParentFolder(&newFolder);
+ if (newFolder)
+ _folder = newFolder;
+ else
+ {
+ if (_parentFolders.IsEmpty())
+ {
+ SetToRootFolder();
+ if (focucedName.IsEmpty())
+ focucedName = GetItemName(0);
+ }
+ else
+ {
+ _folder.Release();
+ _library.Free();
+ CFolderLink &link = _parentFolders.Back();
+ _folder = link.ParentFolder;
+ _library.Attach(link.Library.Detach());
+ focucedName = link.ItemName;
+ if (_parentFolders.Size() > 1)
+ OpenParentArchiveFolder();
+ _parentFolders.DeleteBack();
+ if (_parentFolders.IsEmpty())
+ _flatMode = _flatModeForDisk;
+ }
+ }
+
+ UStringVector selectedItems;
+ /*
+ if (!focucedName.IsEmpty())
+ selectedItems.Add(focucedName);
+ */
+ LoadFullPath();
+ // ::SetCurrentDirectory(::_currentFolderPrefix);
+ RefreshListCtrl(focucedName, -1, true, selectedItems);
+ _listView.EnsureVisible(_listView.GetFocusedItem(), false);
+ RefreshStatusBar();
+
+ printf("CPanel::OpenParentFolder-end\n");
+}
+
+void CPanel::CloseOpenFolders()
+{
+ while (_parentFolders.Size() > 0)
+ {
+ _folder.Release();
+ _library.Free();
+ _folder = _parentFolders.Back().ParentFolder;
+ _library.Attach(_parentFolders.Back().Library.Detach());
+ if (_parentFolders.Size() > 1)
+ OpenParentArchiveFolder();
+ _parentFolders.DeleteBack();
+ }
+ _flatMode = _flatModeForDisk;
+ _folder.Release();
+ _library.Free();
+}
+
+void CPanel::OpenRootFolder()
+{
+ CDisableTimerProcessing disableTimerProcessing1(*this);
+ _parentFolders.Clear();
+ SetToRootFolder();
+ RefreshListCtrl(UString(), -1, true, UStringVector());
+ // ::SetCurrentDirectory(::_currentFolderPrefix);
+ /*
+ BeforeChangeFolder();
+ _currentFolderPrefix.Empty();
+ AfterChangeFolder();
+ SetCurrentPathText();
+ RefreshListCtrl(UString(), 0, UStringVector());
+ _listView.EnsureVisible(_listView.GetFocusedItem(), false);
+ */
+}
+
+void CPanel::OpenDrivesFolder()
+{
+#ifdef _WIN32
+ CloseOpenFolders();
+ CFSDrives *fsFolderSpec = new CFSDrives;
+ _folder = fsFolderSpec;
+ fsFolderSpec->Init();
+ RefreshListCtrl();
+#else
+ printf("CPanel::OpenDrivesFolder : FIXME\n");
+#endif
+}
+
+void CPanel::OpenFolder(int index)
+{
+ if (index == kParentIndex)
+ {
+ OpenParentFolder();
+ return;
+ }
+ CMyComPtr<IFolderFolder> newFolder;
+ _folder->BindToFolder(index, &newFolder);
+ if (!newFolder)
+ return;
+ _folder = newFolder;
+ LoadFullPath();
+ // ::SetCurrentDirectory(::_currentFolderPrefix);
+ RefreshListCtrl();
+ UINT state = LVIS_SELECTED;
+ _listView.SetItemState(_listView.GetFocusedItem(), state, state);
+ _listView.EnsureVisible(_listView.GetFocusedItem(), false);
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelItemOpen.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
new file mode 100644
index 000000000..814507925
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
@@ -0,0 +1,621 @@
+// PanelItemOpen.cpp
+
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+#include "wx/mimetype.h"
+
+#include "resource.h"
+
+#include "Common/StringConvert.h"
+// FIXME #include "Common/Random.h"
+#include "Common/StringConvert.h"
+#include "Common/AutoPtr.h"
+
+#include "Windows/FileDir.h"
+#include "Windows/FileFind.h"
+#include "Windows/Thread.h"
+#include "Windows/Synchronization.h"
+#include "Windows/Error.h"
+
+#include "ExtractCallback.h"
+#include "UpdateCallback100.h"
+#include "IFolder.h"
+#include "FileFolderPluginOpen.h"
+#include "FormatUtils.h"
+#include "Panel.h"
+#include "RegistryUtils.h"
+#include "LangUtils.h"
+
+using namespace NWindows;
+using namespace NSynchronization;
+using namespace NFile;
+using namespace NDirectory;
+
+extern HWND g_HWND;
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+static const wchar_t *kTempDirPrefix = L"7zO";
+
+
+static bool IsNameVirus(const UString &name)
+{
+ return (name.Find(L" ") >= 0);
+}
+
+struct CTmpProcessInfo: public CTempFileInfo
+{
+ HANDLE ProcessHandle;
+ HWND Window;
+ UString FullPathFolderPrefix;
+ bool UsePassword;
+ UString Password;
+ CTmpProcessInfo(): UsePassword(false) {}
+};
+
+class CTmpProcessInfoRelease
+{
+ CTmpProcessInfo *_tmpProcessInfo;
+public:
+ bool _needDelete;
+ CTmpProcessInfoRelease(CTmpProcessInfo &tmpProcessInfo):
+ _tmpProcessInfo(&tmpProcessInfo), _needDelete(true) {}
+ ~CTmpProcessInfoRelease()
+ {
+ if (_needDelete)
+ _tmpProcessInfo->DeleteDirAndFile();
+ }
+};
+
+HRESULT CPanel::OpenItemAsArchive(IInStream *inStream,
+ const CTempFileInfo &tempFileInfo,
+ const UString &virtualFilePath,
+ bool &encrypted)
+{
+ encrypted = false;
+ CFolderLink folderLink;
+ (CTempFileInfo &)folderLink = tempFileInfo;
+ if (inStream)
+ folderLink.IsVirtual = true;
+ else
+ {
+ if (!folderLink.FileInfo.Find(folderLink.FilePath))
+ return ::GetLastError();
+ if (folderLink.FileInfo.IsDir())
+ return S_FALSE;
+ folderLink.IsVirtual = false;
+ }
+
+ folderLink.VirtualPath = virtualFilePath;
+
+ CMyComPtr<IFolderFolder> newFolder;
+
+ // _passwordIsDefined = false;
+ // _password.Empty();
+
+ NDLL::CLibrary library;
+
+ UString password;
+ RINOK(OpenFileFolderPlugin(inStream,
+ folderLink.FilePath.IsEmpty() ? virtualFilePath : folderLink.FilePath,
+ &library, &newFolder, GetParent(), encrypted, password));
+
+ folderLink.Password = password;
+ folderLink.UsePassword = encrypted;
+
+ folderLink.ParentFolder = _folder;
+ _parentFolders.Add(folderLink);
+ _parentFolders.Back().Library.Attach(_library.Detach());
+
+ _folder.Release();
+ _library.Free();
+ _folder = newFolder;
+ _library.Attach(library.Detach());
+
+ _flatMode = _flatModeForArc;
+
+ return S_OK;
+}
+
+HRESULT CPanel::OpenItemAsArchive(const UString &name, bool &encrypted)
+{
+ CTempFileInfo tfi;
+ tfi.ItemName = name;
+ tfi.FolderPath = _currentFolderPrefix;
+ tfi.FilePath = _currentFolderPrefix + name;
+ return OpenItemAsArchive(NULL, tfi, _currentFolderPrefix + name, encrypted);
+}
+
+HRESULT CPanel::OpenItemAsArchive(int index)
+{
+ CDisableTimerProcessing disableTimerProcessing1(*this);
+ bool encrypted;
+ RINOK(OpenItemAsArchive(GetItemRelPath(index), encrypted));
+ RefreshListCtrl();
+ return S_OK;
+}
+
+HRESULT CPanel::OpenParentArchiveFolder()
+{
+ CDisableTimerProcessing disableTimerProcessing1(*this);
+ if (_parentFolders.Size() < 2)
+ return S_OK;
+ CFolderLink &folderLink = _parentFolders.Back();
+ NFind::CFileInfoW newFileInfo;
+ if (NFind::FindFile(folderLink.FilePath, newFileInfo))
+ {
+ if (newFileInfo.Size != folderLink.FileInfo.Size ||
+ CompareFileTime(&newFileInfo.MTime, &folderLink.FileInfo.MTime) != 0)
+ {
+ UString message = MyFormatNew(IDS_WANT_UPDATE_MODIFIED_FILE,
+ 0x03020280, folderLink.ItemName);
+ if (::MessageBoxW(HWND(*this), message, L"7-Zip", MB_OKCANCEL | MB_ICONQUESTION) == IDOK)
+ {
+ if (OnOpenItemChanged(folderLink.FolderPath, folderLink.ItemName,
+ folderLink.UsePassword, folderLink.Password) != S_OK)
+ {
+ ::MessageBoxW(HWND(*this), MyFormatNew(IDS_CANNOT_UPDATE_FILE,
+ 0x03020281, folderLink.FilePath), L"7-Zip", MB_OK | MB_ICONSTOP);
+ return S_OK;
+ }
+ }
+ }
+ }
+ folderLink.DeleteDirAndFile();
+ return S_OK;
+}
+
+static const wchar_t *kStartExtensions[] =
+{
+ L"exe", L"bat", L"com",
+ L"chm",
+ L"msi", L"doc", L"xls", L"ppt", L"pps", L"wps", L"wpt", L"wks", L"xlr", L"wdb",
+
+ L"docx", L"docm", L"dotx", L"dotm", L"xlsx", L"xlsm", L"xltx", L"xltm", L"xlsb",
+ L"xlam", L"pptx", L"pptm", L"potx", L"potm", L"ppam", L"ppsx", L"ppsm", L"xsn",
+
+ L"dwf",
+
+ L"odt", L"ods",
+ L"wb3",
+ L"pdf"
+};
+
+static bool DoItemAlwaysStart(const UString &name)
+{
+ int extPos = name.ReverseFind('.');
+ if (extPos < 0)
+ return false;
+ UString ext = name.Mid(extPos + 1);
+ ext.MakeLower();
+ for (int i = 0; i < sizeof(kStartExtensions) / sizeof(kStartExtensions[0]); i++)
+ if (ext.Compare(kStartExtensions[i]) == 0)
+ return true;
+ return false;
+}
+
+#ifdef _WIN32
+static HANDLE StartEditApplication(const UString &path, HWND window)
+{
+ UString command;
+ ReadRegEditor(command);
+ if (command.IsEmpty())
+ {
+ if (!MyGetWindowsDirectory(command))
+ return 0;
+ NFile::NName::NormalizeDirPathPrefix(command);
+ command += L"notepad.exe";
+ }
+ command = UString(L"\"") + command + UString(L"\"");
+ command += L" \"";
+ command += UString(path);
+ command += L"\"";
+
+ PROCESS_INFORMATION processInformation;
+ BOOL result;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ STARTUPINFOA startupInfo;
+ startupInfo.cb = sizeof(startupInfo);
+ startupInfo.lpReserved = 0;
+ startupInfo.lpDesktop = 0;
+ startupInfo.lpTitle = 0;
+ startupInfo.dwFlags = 0;
+ startupInfo.cbReserved2 = 0;
+ startupInfo.lpReserved2 = 0;
+
+ result = ::CreateProcessA(NULL, (CHAR *)(const CHAR *)GetSystemString(command),
+ NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &processInformation);
+ }
+ else
+ #endif
+ {
+ STARTUPINFOW startupInfo;
+ startupInfo.cb = sizeof(startupInfo);
+ startupInfo.lpReserved = 0;
+ startupInfo.lpDesktop = 0;
+ startupInfo.lpTitle = 0;
+ startupInfo.dwFlags = 0;
+ startupInfo.cbReserved2 = 0;
+ startupInfo.lpReserved2 = 0;
+
+ result = ::CreateProcessW(NULL, (WCHAR *)(const WCHAR *)command,
+ NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &processInformation);
+ }
+
+ if (result != FALSE)
+ {
+ ::CloseHandle(processInformation.hThread);
+ return processInformation.hProcess;
+ }
+ ::MessageBoxW(window, LangString(IDS_CANNOT_START_EDITOR, 0x03020282),
+ L"7-Zip", MB_OK | MB_ICONSTOP);
+ return 0;
+}
+
+#ifndef _UNICODE
+typedef BOOL (WINAPI * ShellExecuteExWP)(LPSHELLEXECUTEINFOW lpExecInfo);
+#endif
+
+#endif // _WIN32
+
+static void StartApplication(const UString &path, HWND window)
+{
+ // FIXME
+ extern const TCHAR * nameWindowToUnix(const TCHAR * lpFileName);
+ UString tmpPath = path;
+
+ wxString filename(nameWindowToUnix(tmpPath));
+
+
+ wxString ext = filename.AfterLast(_T('.'));
+
+ printf("StartApplication(%ls) ext='%ls'\n",(const wchar_t *)filename,(const wchar_t *)ext);
+
+ if ( ! ext.empty() )
+ {
+ wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext);
+ // printf("StartApplication(%ls) ft=%p\n",(const wchar_t *)filename,ft);
+ if (ft)
+ {
+ wxString cmd;
+ // wxString type; ft->GetMimeType(&type);
+ wxFileType::MessageParameters params(filename); // , type);
+ bool ok = ft->GetOpenCommand(&cmd, params);
+ // printf("StartApplication(%ls) ok=%d\n",(const wchar_t *)filename,(int)ok);
+ delete ft;
+ if ( ok )
+ {
+ printf("StartApplication(%ls) cmd='%ls'\n",(const wchar_t *)filename,(const wchar_t *)cmd);
+ long pid = wxExecute(cmd, wxEXEC_ASYNC);
+ if (pid) return ;
+ }
+ }
+ }
+ ::MessageBoxW(window,
+ // NError::MyFormatMessageW(::GetLastError()),
+ L"There is no application associated with the given file name extension",
+ L"7-Zip", MB_OK | MB_ICONSTOP);
+}
+
+void CPanel::EditItem(int index)
+{
+ if (!_parentFolders.IsEmpty())
+ {
+ OpenItemInArchive(index, false, true, true);
+ return;
+ }
+#ifdef _WIN32
+ HANDLE hProcess = StartEditApplication(_currentFolderPrefix + GetItemRelPath(index), (HWND)*this);
+ if (hProcess != 0)
+ ::CloseHandle(hProcess);
+#endif
+}
+
+void CPanel::OpenFolderExternal(int index)
+{
+#ifdef _WIN32
+ HANDLE hProcess = StartApplication(GetFsPath() + GetItemRelPath(index), (HWND)*this);
+ if (hProcess != 0)
+ ::CloseHandle(hProcess);
+#else
+ printf(" CPanel::OpenFolderExternal : FIXME\n");
+#endif
+}
+
+void CPanel::OpenItem(int index, bool tryInternal, bool tryExternal)
+{
+ CDisableTimerProcessing disableTimerProcessing1(*this);
+ if (!_parentFolders.IsEmpty())
+ {
+ OpenItemInArchive(index, tryInternal, tryExternal, false);
+ return;
+ }
+ UString name = GetItemRelPath(index);
+ if (IsNameVirus(name))
+ {
+ MessageBoxErrorLang(IDS_VIRUS, 0x03020284);
+ return;
+ }
+ UString fullPath = _currentFolderPrefix + name;
+ if (tryInternal)
+ if (!tryExternal || !DoItemAlwaysStart(name))
+ {
+ HRESULT res = OpenItemAsArchive(index);
+ if (res == S_OK || res == E_ABORT)
+ return;
+ if (res != S_FALSE)
+ {
+ MessageBoxError(res);
+ return;
+ }
+ }
+ if (tryExternal)
+ {
+ // SetCurrentDirectory opens HANDLE to folder!!!
+ // NDirectory::MySetCurrentDirectory(_currentFolderPrefix);
+#ifdef _WIN32
+ HANDLE hProcess = StartApplication(fullPath, (HWND)*this);
+ if (hProcess != 0)
+ ::CloseHandle(hProcess);
+#else
+ StartApplication(fullPath, (HWND)*this);
+#endif
+ }
+}
+
+HRESULT CPanel::OnOpenItemChanged(const UString &folderPath, const UString &itemName,
+ bool usePassword, const UString &password)
+{
+ CMyComPtr<IFolderOperations> folderOperations;
+ if (_folder.QueryInterface(IID_IFolderOperations, &folderOperations) != S_OK)
+ {
+ MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return E_FAIL;
+ }
+ UStringVector fileNames;
+ CRecordVector<const wchar_t *> fileNamePointers;
+ fileNames.Add(itemName);
+ fileNamePointers.Add(fileNames[0]);
+
+ UString pathPrefix = folderPath;
+ NName::NormalizeDirPathPrefix(pathPrefix);
+
+ CUpdateCallback100Imp *callbackSpec = new CUpdateCallback100Imp;
+ CMyComPtr<IProgress> callback = callbackSpec;
+ callbackSpec->Init((HWND)*this, usePassword, password);
+
+ return folderOperations->CopyFrom(pathPrefix, &fileNamePointers.Front(), fileNamePointers.Size(), callback);
+}
+
+LRESULT CPanel::OnOpenItemChanged(LPARAM lParam)
+{
+ CTmpProcessInfo &tmpProcessInfo = *(CTmpProcessInfo *)lParam;
+ // LoadCurrentPath()
+ if (tmpProcessInfo.FullPathFolderPrefix != _currentFolderPrefix)
+ return 0;
+
+ CSelectedState state;
+ SaveSelectedState(state);
+
+ HRESULT result = OnOpenItemChanged(tmpProcessInfo.FolderPath, tmpProcessInfo.ItemName,
+ tmpProcessInfo.UsePassword, tmpProcessInfo.Password);
+ if (result != S_OK)
+ return 0;
+ RefreshListCtrl(state);
+ return 1;
+}
+
+/*
+class CTmpProcessInfoList
+{
+public:
+ CObjectVector<CTmpProcessInfo> _items;
+} g_TmpProcessInfoList;
+*/
+
+class CExitEventLauncher
+{
+public:
+ NWindows::NSynchronization::CManualResetEvent _exitEvent;
+ CExitEventLauncher()
+ {
+ if (_exitEvent.Create(false) != S_OK)
+ throw 9387173;
+ };
+ ~CExitEventLauncher() { _exitEvent.Set(); }
+} g_ExitEventLauncher;
+
+#ifdef _WIN32
+static THREAD_FUNC_DECL MyThreadFunction(void *param)
+{
+ CMyAutoPtr<CTmpProcessInfo> tmpProcessInfoPtr((CTmpProcessInfo *)param);
+ CTmpProcessInfo *tmpProcessInfo = tmpProcessInfoPtr.get();
+
+ HANDLE hProcess = tmpProcessInfo->ProcessHandle;
+ HANDLE events[2] = { g_ExitEventLauncher._exitEvent, hProcess};
+ DWORD waitResult = ::WaitForMultipleObjects(2, events, FALSE, INFINITE);
+ ::CloseHandle(hProcess);
+ if (waitResult == WAIT_OBJECT_0 + 0)
+ return 0;
+ if (waitResult != WAIT_OBJECT_0 + 1)
+ return 1;
+ Sleep(200);
+ NFind::CFileInfoW newFileInfo;
+ if (NFind::FindFile(tmpProcessInfo->FilePath, newFileInfo))
+ {
+ if (newFileInfo.Size != tmpProcessInfo->FileInfo.Size ||
+ CompareFileTime(&newFileInfo.MTime, &tmpProcessInfo->FileInfo.MTime) != 0)
+ {
+ UString message = MyFormatNew(IDS_WANT_UPDATE_MODIFIED_FILE,
+ 0x03020280, tmpProcessInfo->ItemName);
+ if (::MessageBoxW(g_HWND, message, L"7-Zip", MB_OKCANCEL | MB_ICONQUESTION) == IDOK)
+ {
+ if (SendMessage(tmpProcessInfo->Window, kOpenItemChanged, 0, (LONG_PTR)tmpProcessInfo) != 1)
+ {
+ ::MessageBoxW(g_HWND, MyFormatNew(IDS_CANNOT_UPDATE_FILE,
+ 0x03020281, tmpProcessInfo->FilePath), L"7-Zip", MB_OK | MB_ICONSTOP);
+ return 0;
+ }
+ }
+ }
+ }
+ tmpProcessInfo->DeleteDirAndFile();
+ return 0;
+}
+#endif
+
+void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal, bool editMode)
+{
+ const UString name = GetItemName(index);
+ if (IsNameVirus(name))
+ {
+ MessageBoxErrorLang(IDS_VIRUS, 0x03020284);
+ return;
+ }
+
+ CMyComPtr<IFolderOperations> folderOperations;
+ if (_folder.QueryInterface(IID_IFolderOperations, &folderOperations) != S_OK)
+ {
+ MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return;
+ }
+
+#ifdef _WIN32
+ NFile::NDirectory::CTempDirectoryW tempDirectory;
+ tempDirectory.Create(kTempDirPrefix);
+ UString tempDir = tempDirectory.GetPath();
+ UString tempDirNorm = tempDir;
+ NFile::NName::NormalizeDirPathPrefix(tempDirNorm);
+
+ CRecordVector<UInt32> indices;
+ indices.Add(index);
+
+ UStringVector messages;
+
+ bool usePassword = false;
+ UString password;
+ if (_parentFolders.Size() > 0)
+ {
+ const CFolderLink &fl = _parentFolders.Back();
+ usePassword = fl.UsePassword;
+ password = fl.Password;
+ }
+
+ HRESULT result = CopyTo(indices, tempDirNorm, false, true, &messages, usePassword, password);
+
+ if (_parentFolders.Size() > 0)
+ {
+ CFolderLink &fl = _parentFolders.Back();
+ fl.UsePassword = usePassword;
+ fl.Password = password;
+ }
+
+ if (!messages.IsEmpty())
+ return;
+ if (result != S_OK)
+ {
+ if (result != E_ABORT)
+ MessageBoxError(result);
+ return;
+ }
+
+ UString tempFilePath = tempDirNorm + name;
+
+ CMyAutoPtr<CTmpProcessInfo> tmpProcessInfoPtr(new CTmpProcessInfo());
+ CTmpProcessInfo *tmpProcessInfo = tmpProcessInfoPtr.get();
+ tmpProcessInfo->FolderPath = tempDir;
+ tmpProcessInfo->FilePath = tempFilePath;
+ tmpProcessInfo->UsePassword = usePassword;
+ tmpProcessInfo->Password = password;
+
+ if (!NFind::FindFile(tempFilePath, tmpProcessInfo->FileInfo))
+ return;
+
+ if (tryInternal)
+ {
+ if (!tryExternal || !DoItemAlwaysStart(name))
+ {
+ bool encrypted;
+ if (OpenItemAsArchive(name, tempDir, tempFilePath,
+ _currentFolderPrefix + name, encrypted) == S_OK)
+ {
+ RefreshListCtrl();
+ return;
+ }
+ }
+ }
+
+ CTmpProcessInfoRelease tmpProcessInfoRelease(*tmpProcessInfo);
+
+ if (!tryExternal)
+ return;
+
+ HANDLE hProcess;
+ if (editMode)
+ hProcess = StartEditApplication(tempFilePath, (HWND)*this);
+ else
+ hProcess = StartApplication(tempFilePath, (HWND)*this);
+
+ if (hProcess == 0)
+ return;
+
+ tmpProcessInfo->Window = (HWND)(*this);
+ tmpProcessInfo->FullPathFolderPrefix = _currentFolderPrefix;
+ tmpProcessInfo->ItemName = name;
+ tmpProcessInfo->ProcessHandle = hProcess;
+
+ NWindows::CThread thread;
+ if (thread.Create(MyThreadFunction, tmpProcessInfo) != S_OK)
+ throw 271824;
+ tempDirectory.DisableDeleting();
+ tmpProcessInfoPtr.release();
+ tmpProcessInfoRelease._needDelete = false;
+#else
+ printf(" CPanel::OpenItemInArchive : FIXME\n");
+#endif
+}
+
+/*
+static const UINT64 kTimeLimit = UINT64(10000000) * 3600 * 24;
+
+static bool CheckDeleteItem(UINT64 currentFileTime, UINT64 folderFileTime)
+{
+ return (currentFileTime - folderFileTime > kTimeLimit &&
+ folderFileTime - currentFileTime > kTimeLimit);
+}
+
+void DeleteOldTempFiles()
+{
+ UString tempPath;
+ if(!NFile::NDirectory::MyGetTempPath(tempPath))
+ throw 1;
+
+ UINT64 currentFileTime;
+ NTime::GetCurUtcFileTime(currentFileTime);
+ UString searchWildCard = tempPath + kTempDirPrefix + L"*.tmp";
+ searchWildCard += WCHAR(NName::kAnyStringWildcard);
+ NFind::CEnumeratorW enumerator(searchWildCard);
+ NFind::CFileInfoW fileInfo;
+ while(enumerator.Next(fileInfo))
+ {
+ if (!fileInfo.IsDir())
+ continue;
+ const UINT64 &cTime = *(const UINT64 *)(&fileInfo.CTime);
+ if(CheckDeleteItem(cTime, currentFileTime))
+ RemoveDirectoryWithSubItems(tempPath + fileInfo.Name);
+ }
+}
+*/
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelItems.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelItems.cpp
new file mode 100644
index 000000000..38d925355
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelItems.cpp
@@ -0,0 +1,828 @@
+// PanelItems.cpp
+
+#include "StdAfx.h"
+
+#include "Common/StringConvert.h"
+
+#include "Windows/PropVariant.h"
+#include "Windows/PropVariantConversions.h"
+// FIXME #include "Windows/Menu.h"
+
+#include "../../PropID.h"
+
+#include "resource.h"
+
+#include "LangUtils.h"
+#include "Panel.h"
+#include "PropertyName.h"
+#include "RootFolder.h"
+
+extern "C"
+{
+ #include "../../../../C/Sort.h"
+}
+
+using namespace NWindows;
+
+static int GetColumnAlign(PROPID propID, VARTYPE varType)
+{
+ switch(propID)
+ {
+ case kpidCTime:
+ case kpidATime:
+ case kpidMTime:
+ return LVCFMT_LEFT;
+ }
+ switch(varType)
+ {
+ case VT_UI1:
+ case VT_I2:
+ case VT_UI2:
+ case VT_I4:
+ case VT_INT:
+ case VT_UI4:
+ case VT_UINT:
+ case VT_I8:
+ case VT_UI8:
+ case VT_BOOL:
+ return LVCFMT_RIGHT;
+
+ case VT_EMPTY:
+ case VT_I1:
+ case VT_FILETIME:
+ case VT_BSTR:
+ return LVCFMT_LEFT;
+
+ default:
+ return LVCFMT_CENTER;
+ }
+}
+
+void CPanel::InitColumns()
+{
+ printf("CPanel::InitColumns\n");
+ if (_needSaveInfo)
+ SaveListViewInfo();
+
+ _listView.DeleteAllItems();
+ _selectedStatusVector.Clear();
+
+ ReadListViewInfo();
+
+
+ PROPID sortID;
+ /*
+ if (_listViewInfo.SortIndex >= 0)
+ sortID = _listViewInfo.Columns[_listViewInfo.SortIndex].PropID;
+ */
+ sortID = _listViewInfo.SortID;
+
+ _ascending = _listViewInfo.Ascending;
+
+ _properties.Clear();
+
+ _needSaveInfo = true;
+
+ UInt32 numProperties;
+ _folder->GetNumberOfProperties(&numProperties);
+ int i;
+ for (i = 0; i < (int)numProperties; i++)
+ {
+ CMyComBSTR name;
+ PROPID propID;
+ VARTYPE varType;
+
+ if (_folder->GetPropertyInfo(i, &name, &propID, &varType) != S_OK)
+ throw 1;
+
+ if (propID == kpidIsDir)
+ continue;
+
+ CItemProperty prop;
+ prop.Type = varType;
+ prop.ID = propID;
+ prop.Name = GetNameOfProperty(propID, name);
+ prop.Order = -1;
+ prop.IsVisible = true;
+ prop.Width = 100;
+ _properties.Add(prop);
+ }
+ // InitColumns2(sortID);
+
+ for (;;)
+ if (!_listView.DeleteColumn(0))
+ break;
+
+ int order = 0;
+ for(i = 0; i < _listViewInfo.Columns.Size(); i++)
+ {
+ const CColumnInfo &columnInfo = _listViewInfo.Columns[i];
+ int index = _properties.FindItemWithID(columnInfo.PropID);
+ if (index >= 0)
+ {
+ CItemProperty &item = _properties[index];
+ item.IsVisible = columnInfo.IsVisible;
+ item.Width = columnInfo.Width;
+ if (columnInfo.IsVisible)
+ item.Order = order++;
+ continue;
+ }
+ }
+ for(i = 0; i < _properties.Size(); i++)
+ {
+ CItemProperty &item = _properties[i];
+ if (item.Order < 0)
+ item.Order = order++;
+ }
+
+ _visibleProperties.Clear();
+ for (i = 0; i < _properties.Size(); i++)
+ {
+ const CItemProperty &property = _properties[i];
+ if (property.IsVisible)
+ _visibleProperties.Add(property);
+ }
+
+ // _sortIndex = 0;
+ _sortID = kpidName;
+ /*
+ if (_listViewInfo.SortIndex >= 0)
+ {
+ int sortIndex = _properties.FindItemWithID(sortID);
+ if (sortIndex >= 0)
+ _sortIndex = sortIndex;
+ }
+ */
+ _sortID = _listViewInfo.SortID;
+
+ for (i = 0; i < _visibleProperties.Size(); i++)
+ {
+ InsertColumn(i);
+ }
+}
+
+void CPanel::InsertColumn(int index)
+{
+ //printf("CPanel::InsertColumn\n");
+ const CItemProperty &property = _visibleProperties[index];
+ LV_COLUMNW column;
+ column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM | LVCF_ORDER;
+ column.cx = property.Width;
+ column.fmt = GetColumnAlign(property.ID, property.Type);
+ column.iOrder = property.Order;
+ column.iSubItem = index;
+ column.pszText = (wchar_t *)(const wchar_t *)property.Name;
+ _listView.InsertColumn(index, &column);
+}
+
+void CPanel::RefreshListCtrl()
+{
+ RefreshListCtrl(UString(), -1, true, UStringVector());
+}
+
+int CALLBACK CompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData);
+
+
+void CPanel::GetSelectedNames(UStringVector &selectedNames)
+{
+ selectedNames.Clear();
+
+ CRecordVector<UInt32> indices;
+ GetSelectedItemsIndices(indices);
+ selectedNames.Reserve(indices.Size());
+ for (int i = 0; i < indices.Size(); i++)
+ selectedNames.Add(GetItemRelPath(indices[i]));
+
+ /*
+ for (int i = 0; i < _listView.GetItemCount(); i++)
+ {
+ const int kSize = 1024;
+ WCHAR name[kSize + 1];
+ LVITEMW item;
+ item.iItem = i;
+ item.pszText = name;
+ item.cchTextMax = kSize;
+ item.iSubItem = 0;
+ item.mask = LVIF_TEXT | LVIF_PARAM;
+ if (!_listView.GetItem(&item))
+ continue;
+ int realIndex = GetRealIndex(item);
+ if (realIndex == kParentIndex)
+ continue;
+ if (_selectedStatusVector[realIndex])
+ selectedNames.Add(item.pszText);
+ }
+ */
+ selectedNames.Sort();
+}
+
+void CPanel::SaveSelectedState(CSelectedState &s)
+{
+ s.FocusedName.Empty();
+ s.SelectedNames.Clear();
+ s.FocusedItem = _listView.GetFocusedItem();
+ {
+ if (s.FocusedItem >= 0)
+ {
+ int realIndex = GetRealItemIndex(s.FocusedItem);
+ if (realIndex != kParentIndex)
+ s.FocusedName = GetItemRelPath(realIndex);
+ /*
+ const int kSize = 1024;
+ WCHAR name[kSize + 1];
+ LVITEMW item;
+ item.iItem = focusedItem;
+ item.pszText = name;
+ item.cchTextMax = kSize;
+ item.iSubItem = 0;
+ item.mask = LVIF_TEXT;
+ if (_listView.GetItem(&item))
+ focusedName = item.pszText;
+ */
+ }
+ }
+ GetSelectedNames(s.SelectedNames);
+}
+
+void CPanel::RefreshListCtrl(const CSelectedState &s)
+{
+ bool selectFocused = s.SelectFocused;
+ if (_mySelectMode)
+ selectFocused = true;
+ RefreshListCtrl(s.FocusedName, s.FocusedItem, selectFocused, s.SelectedNames);
+}
+
+void CPanel::RefreshListCtrlSaveFocused()
+{
+ CSelectedState state;
+ SaveSelectedState(state);
+ RefreshListCtrl(state);
+}
+
+void CPanel::SetFocusedSelectedItem(int index, bool select)
+{
+ UINT state = LVIS_FOCUSED;
+ if (select)
+ state |= LVIS_SELECTED;
+ _listView.SetItemState(index, state, state);
+ if (!_mySelectMode && select)
+ {
+ int realIndex = GetRealItemIndex(index);
+ if (realIndex != kParentIndex)
+ _selectedStatusVector[realIndex] = true;
+ }
+}
+
+void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool selectFocused,
+ const UStringVector &selectedNames)
+{
+printf("CPanel::RefreshListCtrl\n");
+ _dontShowMode = false;
+ LoadFullPathAndShow();
+ // OutputDebugStringA("=======\n");
+ // OutputDebugStringA("s1 \n");
+ CDisableTimerProcessing timerProcessing(*this);
+
+ if (focusedPos < 0)
+ focusedPos = 0;
+
+ _listView.SetRedraw(false);
+ // m_RedrawEnabled = false;
+
+#ifdef _WIN32
+ LVITEMW item;
+ ZeroMemory(&item, sizeof(item));
+#else
+ LVITEMW item = { 0 };
+#endif
+
+ _listView.DeleteAllItems();
+ _selectedStatusVector.Clear();
+ // _realIndices.Clear();
+ _startGroupSelect = 0;
+
+ _selectionIsDefined = false;
+
+ // m_Files.Clear();
+ // _folder.Release();
+
+ if (!_folder)
+ {
+ // throw 1;
+ SetToRootFolder();
+ }
+
+ // FIXME _headerToolBar.EnableButton(kParentFolderID, !IsRootFolder());
+
+ CMyComPtr<IFolderSetFlatMode> folderSetFlatMode;
+ _folder.QueryInterface(IID_IFolderSetFlatMode, &folderSetFlatMode);
+ if (folderSetFlatMode)
+ folderSetFlatMode->SetFlatMode(BoolToInt(_flatMode));
+
+ if (_folder->LoadItems() != S_OK)
+ return;
+
+ InitColumns();
+
+
+ // OutputDebugString(TEXT("Start Dir\n"));
+ UInt32 numItems;
+ _folder->GetNumberOfItems(&numItems);
+
+ bool showDots = _showDots && !IsRootFolder();
+
+ _listView.SetItemCount(numItems + (showDots ? 1 : 0));
+
+ _selectedStatusVector.Reserve(numItems);
+ int cursorIndex = -1;
+
+ CMyComPtr<IFolderGetSystemIconIndex> folderGetSystemIconIndex;
+ if (!IsFSFolder() || _showRealFileIcons)
+ _folder.QueryInterface(IID_IFolderGetSystemIconIndex, &folderGetSystemIconIndex);
+
+ if (showDots)
+ {
+ UString itemName = L"..";
+ item.iItem = _listView.GetItemCount();
+ if (itemName.CompareNoCase(focusedName) == 0)
+ cursorIndex = item.iItem;
+ item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
+ int subItem = 0;
+ item.iSubItem = subItem++;
+ item.lParam = kParentIndex;
+ item.pszText = (wchar_t *)(const wchar_t *)itemName;
+ UInt32 attributes = FILE_ATTRIBUTE_DIRECTORY;
+ /* FIXME
+ item.iImage = _extToIconMap.GetIconIndex(attributes, itemName);
+ if (item.iImage < 0)
+ item.iImage = 0;
+ */
+ item.iImage = -1; // FIXME
+ if(_listView.InsertItem(&item) == -1)
+ return;
+ }
+
+ // OutputDebugStringA("S1\n");
+
+ for(UInt32 i = 0; i < numItems; i++)
+ {
+ UString itemName = GetItemName(i);
+ const UString relPath = GetItemRelPath(i);
+ if (relPath.CompareNoCase(focusedName) == 0)
+ cursorIndex = _listView.GetItemCount();
+ bool selected = false;
+ if (selectedNames.FindInSorted(relPath) >= 0)
+ selected = true;
+ _selectedStatusVector.Add(selected);
+
+ item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
+
+ if (!_mySelectMode)
+ if (selected)
+ {
+ item.mask |= LVIF_STATE;
+ item.state = LVIS_SELECTED;
+ }
+
+ int subItem = 0;
+ item.iItem = _listView.GetItemCount();
+
+ item.iSubItem = subItem++;
+ item.lParam = i;
+
+ UString correctedName;
+ if (itemName.Find(L" ") >= 0)
+ {
+ int pos = 0;
+ for (;;)
+ {
+ int posNew = itemName.Find(L" ", pos);
+ if (posNew < 0)
+ {
+ correctedName += itemName.Mid(pos);
+ break;
+ }
+ correctedName += itemName.Mid(pos, posNew - pos);
+ correctedName += L" ... ";
+ pos = posNew;
+ while (itemName[++pos] == ' ');
+ }
+ item.pszText = (wchar_t *)(const wchar_t *)correctedName;
+ }
+ else
+ item.pszText = (wchar_t *)(const wchar_t *)itemName;
+
+ NCOM::CPropVariant propVariant;
+ _folder->GetProperty(i, kpidAttrib, &propVariant);
+ UInt32 attributes = 0;
+ if (propVariant.vt == VT_UI4)
+ attributes = propVariant.ulVal;
+ else
+ {
+ if (IsItemFolder(i))
+ attributes |= FILE_ATTRIBUTE_DIRECTORY;
+ }
+
+ bool defined = false;
+
+ if (folderGetSystemIconIndex)
+ {
+ folderGetSystemIconIndex->GetSystemIconIndex(i, &item.iImage);
+ defined = (item.iImage > 0);
+ }
+ if (!defined)
+ {
+ if (_currentFolderPrefix.IsEmpty())
+ {
+ int iconIndexTemp = -1;
+ GetRealIconIndex(itemName + WSTRING_PATH_SEPARATOR, attributes, iconIndexTemp);
+ item.iImage = iconIndexTemp;
+ }
+ else
+ {
+ item.iImage = -1; // FIXME _extToIconMap.GetIconIndex(attributes, itemName);
+ }
+ }
+ if (item.iImage < 0)
+ item.iImage = 0;
+
+ if(_listView.InsertItem(&item) == -1)
+ return; // error
+
+ // FIXME Added
+ item.pszText = (LPWSTR)malloc(4096); // FIXME
+ for(int col=1;col < _listView.GetColumnCount(); col++)
+ {
+ item.iSubItem = col;
+ item.cchTextMax = 4096 / sizeof(item.pszText[0]);
+ this->SetItemText(item);
+ _listView.SetItem(&item);
+ }
+ free(item.pszText); item.pszText = 0;
+
+ }
+ // OutputDebugStringA("End2\n");
+
+ if(_listView.GetItemCount() > 0 && cursorIndex >= 0)
+ SetFocusedSelectedItem(cursorIndex, selectFocused);
+ _listView.SortItems(CompareItems, (LPARAM)this);
+ if (cursorIndex < 0 && _listView.GetItemCount() > 0)
+ {
+ if (focusedPos >= _listView.GetItemCount())
+ focusedPos = _listView.GetItemCount() - 1;
+ SetFocusedSelectedItem(focusedPos, showDots);
+ }
+ // m_RedrawEnabled = true;
+ _listView.EnsureVisible(_listView.GetFocusedItem(), false);
+ _listView.SetRedraw(true);
+ _listView.InvalidateRect(NULL, true);
+ // OutputDebugStringA("End1\n");
+ /*
+ _listView.UpdateWindow();
+ */
+}
+
+void CPanel::GetSelectedItemsIndices(CRecordVector<UInt32> &indices) const
+{
+ indices.Clear();
+#if 0 // FIXME - not needed anymore ? (UNIX_ENV)
+ int itemIndex = -1;
+ while ((itemIndex = _listView.GetNextItem(itemIndex, LVNI_SELECTED)) != -1)
+ {
+ LPARAM param;
+ if (_listView.GetItemParam(itemIndex, param))
+ indices.Add(param);
+ }
+#else
+ for (int i = 0; i < _selectedStatusVector.Size(); i++)
+ if (_selectedStatusVector[i])
+ indices.Add(i);
+#endif
+ HeapSort(&indices.Front(), indices.Size());
+}
+
+void CPanel::GetOperatedItemIndices(CRecordVector<UInt32> &indices) const
+{
+ GetSelectedItemsIndices(indices);
+ if (!indices.IsEmpty())
+ return;
+ if (_listView.GetSelectedCount() == 0)
+ return;
+ int focusedItem = _listView.GetFocusedItem();
+ if (focusedItem >= 0)
+ {
+ if(_listView.GetItemState(focusedItem, LVIS_SELECTED) == LVIS_SELECTED)
+ {
+ int realIndex = GetRealItemIndex(focusedItem);
+ if (realIndex != kParentIndex)
+ indices.Add(realIndex);
+ }
+ }
+}
+
+void CPanel::GetAllItemIndices(CRecordVector<UInt32> &indices) const
+{
+ indices.Clear();
+ UInt32 numItems;
+ if (_folder->GetNumberOfItems(&numItems) == S_OK)
+ for (UInt32 i = 0; i < numItems; i++)
+ indices.Add(i);
+}
+
+void CPanel::GetOperatedIndicesSmart(CRecordVector<UInt32> &indices) const
+{
+ GetOperatedItemIndices(indices);
+ if (indices.IsEmpty() || (indices.Size() == 1 && indices[0] == (UInt32)(Int32)-1))
+ GetAllItemIndices(indices);
+}
+
+/*
+void CPanel::GetOperatedListViewIndices(CRecordVector<UInt32> &indices) const
+{
+ indices.Clear();
+ int numItems = _listView.GetItemCount();
+ for (int i = 0; i < numItems; i++)
+ {
+ int realIndex = GetRealItemIndex(i);
+ if (realIndex >= 0)
+ if (_selectedStatusVector[realIndex])
+ indices.Add(i);
+ }
+ if (indices.IsEmpty())
+ {
+ int focusedItem = _listView.GetFocusedItem();
+ if (focusedItem >= 0)
+ indices.Add(focusedItem);
+ }
+}
+*/
+
+void CPanel::EditItem()
+{
+ int focusedItem = _listView.GetFocusedItem();
+ if (focusedItem < 0)
+ return;
+ int realIndex = GetRealItemIndex(focusedItem);
+ if (realIndex == kParentIndex)
+ return;
+ if (!IsItemFolder(realIndex))
+ EditItem(realIndex);
+}
+
+void CPanel::OpenFocusedItemAsInternal()
+{
+ int focusedItem = _listView.GetFocusedItem();
+ if (focusedItem < 0)
+ return;
+ int realIndex = GetRealItemIndex(focusedItem);
+ if (IsItemFolder(realIndex))
+ OpenFolder(realIndex);
+ else
+ OpenItem(realIndex, true, false);
+}
+
+void CPanel::OpenSelectedItems(bool tryInternal)
+{
+ CRecordVector<UInt32> indices;
+ GetOperatedItemIndices(indices);
+ if (indices.Size() > 20)
+ {
+ MessageBoxErrorLang(IDS_TOO_MANY_ITEMS, 0x02000606);
+ return;
+ }
+
+ int focusedItem = _listView.GetFocusedItem();
+ if (focusedItem >= 0)
+ {
+ int realIndex = GetRealItemIndex(focusedItem);
+ if (realIndex == kParentIndex && (tryInternal || indices.Size() == 0))
+ indices.Insert(0, realIndex);
+ }
+
+ bool dirIsStarted = false;
+ for(int i = 0; i < indices.Size(); i++)
+ {
+ UInt32 index = indices[i];
+ // CFileInfo &aFile = m_Files[index];
+ if (IsItemFolder(index))
+ {
+ if (!dirIsStarted)
+ {
+ if (tryInternal)
+ {
+ OpenFolder(index);
+ dirIsStarted = true;
+ break;
+ }
+ else
+ OpenFolderExternal(index);
+ }
+ }
+ else
+ OpenItem(index, (tryInternal && indices.Size() == 1), true);
+ }
+}
+
+UString CPanel::GetItemName(int itemIndex) const
+{
+ if (itemIndex == kParentIndex)
+ return L"..";
+ NCOM::CPropVariant propVariant;
+ if (_folder->GetProperty(itemIndex, kpidName, &propVariant) != S_OK)
+ throw 2723400;
+ if (propVariant.vt != VT_BSTR)
+ throw 2723401;
+ return (propVariant.bstrVal);
+}
+
+UString CPanel::GetItemPrefix(int itemIndex) const
+{
+ if (itemIndex == kParentIndex)
+ return UString();
+ NCOM::CPropVariant propVariant;
+ if (_folder->GetProperty(itemIndex, kpidPrefix, &propVariant) != S_OK)
+ throw 2723400;
+ UString prefix;
+ if (propVariant.vt == VT_BSTR)
+ prefix = propVariant.bstrVal;
+ return prefix;
+}
+
+UString CPanel::GetItemRelPath(int itemIndex) const
+{
+ return GetItemPrefix(itemIndex) + GetItemName(itemIndex);
+}
+
+
+bool CPanel::IsItemFolder(int itemIndex) const
+{
+ if (itemIndex == kParentIndex)
+ return true;
+ NCOM::CPropVariant propVariant;
+ if (_folder->GetProperty(itemIndex, kpidIsDir, &propVariant) != S_OK)
+ throw 2723400;
+ if (propVariant.vt == VT_BOOL)
+ return VARIANT_BOOLToBool(propVariant.boolVal);
+ if (propVariant.vt == VT_EMPTY)
+ return false;
+ return false;
+}
+
+UINT64 CPanel::GetItemSize(int itemIndex) const
+{
+ if (itemIndex == kParentIndex)
+ return 0;
+ NCOM::CPropVariant propVariant;
+ if (_folder->GetProperty(itemIndex, kpidSize, &propVariant) != S_OK)
+ throw 2723400;
+ if (propVariant.vt == VT_EMPTY)
+ return 0;
+ return ConvertPropVariantToUInt64(propVariant);
+}
+
+void CPanel::ReadListViewInfo()
+{
+ _typeIDString = GetFolderTypeID();
+ if (!_typeIDString.IsEmpty())
+ ::ReadListViewInfo(_typeIDString, _listViewInfo);
+}
+
+void CPanel::SaveListViewInfo()
+{
+ int i;
+ for(i = 0; i < _visibleProperties.Size(); i++)
+ {
+ CItemProperty &property = _visibleProperties[i];
+ LVCOLUMN winColumnInfo;
+ winColumnInfo.mask = LVCF_ORDER | LVCF_WIDTH;
+ if (!_listView.GetColumn(i, &winColumnInfo))
+ throw 1;
+ property.Order = winColumnInfo.iOrder;
+ property.Width = winColumnInfo.cx;
+ }
+
+ CListViewInfo viewInfo;
+
+ // PROPID sortPropID = _properties[_sortIndex].ID;
+ PROPID sortPropID = _sortID;
+
+ _visibleProperties.Sort();
+ for(i = 0; i < _visibleProperties.Size(); i++)
+ {
+ const CItemProperty &property = _visibleProperties[i];
+ CColumnInfo columnInfo;
+ columnInfo.IsVisible = property.IsVisible;
+ columnInfo.PropID = property.ID;
+ columnInfo.Width = property.Width;
+ viewInfo.Columns.Add(columnInfo);
+ }
+ for(i = 0; i < _properties.Size(); i++)
+ {
+ const CItemProperty &property = _properties[i];
+ if (!property.IsVisible)
+ {
+ CColumnInfo columnInfo;
+ columnInfo.IsVisible = property.IsVisible;
+ columnInfo.PropID = property.ID;
+ columnInfo.Width = property.Width;
+ viewInfo.Columns.Add(columnInfo);
+ }
+ }
+
+ // viewInfo.SortIndex = viewInfo.FindColumnWithID(sortPropID);
+ viewInfo.SortID = sortPropID;
+
+ viewInfo.Ascending = _ascending;
+ if (!_listViewInfo.IsEqual(viewInfo))
+ {
+ ::SaveListViewInfo(_typeIDString, viewInfo);
+ _listViewInfo = viewInfo;
+ }
+}
+
+#ifdef _WIN32
+bool CPanel::OnRightClick(LPNMITEMACTIVATE itemActiveate, LRESULT &result)
+{
+ if(itemActiveate->hdr.hwndFrom == HWND(_listView))
+ return false;
+
+ POINT point;
+ ::GetCursorPos(&point);
+
+ CMenu menu;
+ CMenuDestroyer menuDestroyer(menu);
+
+ menu.CreatePopup();
+
+ const int kCommandStart = 100;
+ for(int i = 0; i < _properties.Size(); i++)
+ {
+ const CItemProperty &property = _properties[i];
+ UINT flags = MF_STRING;
+ if (property.IsVisible)
+ flags |= MF_CHECKED;
+ if (i == 0)
+ flags |= MF_GRAYED;
+ menu.AppendItem(flags, kCommandStart + i, GetSystemString(property.Name));
+ }
+ int menuResult = menu.Track(TPM_LEFTALIGN | TPM_RETURNCMD | TPM_NONOTIFY,
+ point.x, point.y, _listView);
+ if (menuResult >= kCommandStart && menuResult <= kCommandStart + _properties.Size())
+ {
+ int index = menuResult - kCommandStart;
+ CItemProperty &property = _properties[index];
+ property.IsVisible = !property.IsVisible;
+
+ if (property.IsVisible)
+ {
+ int prevVisibleSize = _visibleProperties.Size();
+ property.Order = prevVisibleSize;
+ _visibleProperties.Add(property);
+ InsertColumn(prevVisibleSize);
+ }
+ else
+ {
+ int visibleIndex = _visibleProperties.FindItemWithID(property.ID);
+ _visibleProperties.Delete(visibleIndex);
+ /*
+ if (_sortIndex == index)
+ {
+ _sortIndex = 0;
+ _ascending = true;
+ }
+ */
+ if (_sortID == property.ID)
+ {
+ _sortID = kpidName;
+ _ascending = true;
+ }
+
+ _listView.DeleteColumn(visibleIndex);
+ }
+ }
+ result = TRUE;
+ return true;
+}
+#endif // _WIN32
+
+void CPanel::OnReload()
+{
+ RefreshListCtrlSaveFocused();
+ OnRefreshStatusBar();
+}
+
+void CPanel::OnTimer()
+{
+ if (!_processTimer)
+ return;
+ CMyComPtr<IFolderWasChanged> folderWasChanged;
+ if (_folder.QueryInterface(IID_IFolderWasChanged, &folderWasChanged) != S_OK)
+ return;
+ INT32 wasChanged;
+ if (folderWasChanged->WasChanged(&wasChanged) != S_OK)
+ return;
+ if (wasChanged == 0)
+ return;
+ OnReload();
+}
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelListNotify.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelListNotify.cpp
new file mode 100644
index 000000000..4e956324c
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelListNotify.cpp
@@ -0,0 +1,429 @@
+// PanelListNotify.cpp
+
+#include "StdAfx.h"
+
+#include "resource.h"
+
+#include "Common/IntToString.h"
+#include "Common/StringConvert.h"
+
+#include "Windows/PropVariant.h"
+#include "Windows/PropVariantConversions.h"
+
+#include "../Common/PropIDUtils.h"
+#include "../../PropID.h"
+
+#include "Panel.h"
+#include "FormatUtils.h"
+
+using namespace NWindows;
+
+static UString ConvertSizeToStringShort(UInt64 value)
+{
+ wchar_t s[32];
+ wchar_t c, c2 = L'B';
+ if (value < (UInt64)10000)
+ {
+ c = L'B';
+ c2 = L'\0';
+ }
+ else if (value < ((UInt64)10000 << 10))
+ {
+ value >>= 10;
+ c = L'K';
+ }
+ else if (value < ((UInt64)10000 << 20))
+ {
+ value >>= 20;
+ c = L'M';
+ }
+ else
+ {
+ value >>= 30;
+ c = L'G';
+ }
+ ConvertUInt64ToString(value, s);
+ int p = MyStringLen(s);
+ s[p++] = L' ';
+ s[p++] = c;
+ s[p++] = c2;
+ s[p++] = L'\0';
+ return s;
+}
+
+UString ConvertSizeToString(UInt64 value)
+{
+ wchar_t s[32];
+ ConvertUInt64ToString(value, s);
+ int i = MyStringLen(s);
+ int pos = sizeof(s) / sizeof(s[0]);
+ s[--pos] = L'\0';
+ while (i > 3)
+ {
+ s[--pos] = s[--i];
+ s[--pos] = s[--i];
+ s[--pos] = s[--i];
+ s[--pos] = L' ';
+ }
+ while (i > 0)
+ s[--pos] = s[--i];
+ return s + pos;
+}
+
+LRESULT CPanel::SetItemText(LVITEMW &item)
+{
+ if (_dontShowMode)
+ return 0;
+
+ UINT32 realIndex = GetRealIndex(item);
+ // printf(" CPanel::SetItemText : realIndex=%d\n",realIndex);
+
+ /*
+ if ((item.mask & LVIF_IMAGE) != 0)
+ {
+ bool defined = false;
+ CComPtr<IFolderGetSystemIconIndex> folderGetSystemIconIndex;
+ _folder.QueryInterface(&folderGetSystemIconIndex);
+ if (folderGetSystemIconIndex)
+ {
+ folderGetSystemIconIndex->GetSystemIconIndex(index, &item.iImage);
+ defined = (item.iImage > 0);
+ }
+ if (!defined)
+ {
+ NCOM::CPropVariant prop;
+ _folder->GetProperty(index, kpidAttrib, &prop);
+ UINT32 attrib = 0;
+ if (prop.vt == VT_UI4)
+ attrib = prop.ulVal;
+ else if (IsItemFolder(index))
+ attrib |= FILE_ATTRIBUTE_DIRECTORY;
+ if (_currentFolderPrefix.IsEmpty())
+ throw 1;
+ else
+ item.iImage = _extToIconMap.GetIconIndex(attrib, GetSystemString(GetItemName(index)));
+ }
+ // item.iImage = 1;
+ }
+ */
+
+ if ((item.mask & LVIF_TEXT) == 0)
+ return 0;
+
+ if (realIndex == kParentIndex)
+ return 0;
+ UString s;
+ UINT32 subItemIndex = item.iSubItem;
+ PROPID propID = _visibleProperties[subItemIndex].ID;
+ /*
+ {
+ NCOM::CPropVariant property;
+ if(propID == kpidType)
+ string = GetFileType(index);
+ else
+ {
+ HRESULT result = m_ArchiveFolder->GetProperty(index, propID, &property);
+ if (result != S_OK)
+ {
+ // PrintMessage("GetPropertyValue error");
+ return 0;
+ }
+ string = ConvertPropertyToString(property, propID, false);
+ }
+ }
+ */
+ // const NFind::CFileInfo &aFileInfo = m_Files[index];
+
+ NCOM::CPropVariant prop;
+ /*
+ bool needRead = true;
+ if (propID == kpidSize)
+ {
+ CComPtr<IFolderGetItemFullSize> getItemFullSize;
+ if (_folder.QueryInterface(&getItemFullSize) == S_OK)
+ {
+ if (getItemFullSize->GetItemFullSize(index, &prop) == S_OK)
+ needRead = false;
+ }
+ }
+ if (needRead)
+ */
+
+ if (_folder->GetProperty(realIndex, propID, &prop) != S_OK)
+ throw 2723407;
+
+ if ((propID == kpidSize || propID == kpidPackSize || propID == kpidClusterSize ||
+ propID == kpidNumSubDirs || propID == kpidNumSubFiles) &&
+ (prop.vt == VT_UI8 || prop.vt == VT_UI4))
+ s = ConvertSizeToString(ConvertPropVariantToUInt64(prop));
+ else if ((propID == kpidTotalSize || propID == kpidFreeSpace) &&
+ (prop.vt == VT_UI8 || prop.vt == VT_UI4))
+ s = ConvertSizeToStringShort(ConvertPropVariantToUInt64(prop));
+ else
+ {
+ s = ConvertPropertyToString(prop, propID, false);
+ s.Replace(wchar_t(0xA), L' ');
+ s.Replace(wchar_t(0xD), L' ');
+ }
+ int size = item.cchTextMax;
+ if(size > 0)
+ {
+ if(s.Length() + 1 > size)
+ s = s.Left(size - 1);
+ MyStringCopy(item.pszText, (const wchar_t *)s);
+ }
+ return 0;
+}
+
+#ifdef _WIN32
+extern DWORD g_ComCtl32Version;
+#endif
+
+void CPanel::OnItemChanged(NMLISTVIEW *item)
+{
+ int index = (int)item->lParam;
+ if (index == kParentIndex)
+ return;
+ bool oldSelected = (item->uOldState & LVIS_SELECTED) != 0;
+ bool newSelected = (item->uNewState & LVIS_SELECTED) != 0;
+ // Don't change this code. It works only with such check
+ printf("CPanel::OnItemChanged : index=%d oldSel=%d newSel=%d\n",index,(int)oldSelected,(int)newSelected);
+ if(oldSelected != newSelected) {
+ printf("CPanel::OnItemChanged : _selectedStatusVector[%d] = %d\n",index,(int)newSelected);
+ _selectedStatusVector[index] = newSelected;
+ }
+}
+
+bool CPanel::OnNotifyList(LPNMHDR header, LRESULT &result)
+{
+ printf("CPanel::OnNotifyList : FIXME\n");
+ // bool alt = (::GetKeyState(VK_MENU) & 0x8000) != 0;
+ // bool ctrl = (::GetKeyState(VK_CONTROL) & 0x8000) != 0;
+ // bool shift = (::GetKeyState(VK_SHIFT) & 0x8000) != 0;
+ switch(header->code)
+ {
+ case LVN_ITEMCHANGED:
+ {
+ if (_enableItemChangeNotify)
+ {
+ if (!_mySelectMode)
+ OnItemChanged((LPNMLISTVIEW)header);
+ RefreshStatusBar();
+ }
+ return false;
+ }
+ /*
+
+ case LVN_ODSTATECHANGED:
+ {
+ break;
+ }
+ */
+
+#ifdef _WIN32
+ case LVN_GETDISPINFOW:
+ {
+ LV_DISPINFOW *dispInfo = (LV_DISPINFOW *)header;
+
+ //is the sub-item information being requested?
+
+ if((dispInfo->item.mask & LVIF_TEXT) != 0 ||
+ (dispInfo->item.mask & LVIF_IMAGE) != 0)
+ SetItemText(dispInfo->item);
+ return false;
+ }
+ case LVN_KEYDOWN:
+ {
+ bool boolResult = OnKeyDown(LPNMLVKEYDOWN(header), result);
+ RefreshStatusBar();
+ return boolResult;
+ }
+#endif
+
+ case LVN_COLUMNCLICK:
+ OnColumnClick(LPNMLISTVIEW(header));
+ return false;
+ /*
+ case LVN_ITEMACTIVATE:
+ RefreshStatusBar();
+ if (!alt && !ctrl && !shift)
+ OpenSelectedItems(true);
+ return false;
+ */
+
+ case NM_DBLCLK:
+ RefreshStatusBar();
+ OpenSelectedItems(true);
+ return false;
+#ifdef _WIN32
+ case NM_RETURN:
+ {
+ bool alt = (::GetKeyState(VK_MENU) & 0x8000) != 0;
+ bool ctrl = (::GetKeyState(VK_CONTROL) & 0x8000) != 0;
+ // bool leftCtrl = (::GetKeyState(VK_LCONTROL) & 0x8000) != 0;
+ // bool RightCtrl = (::GetKeyState(VK_RCONTROL) & 0x8000) != 0;
+ bool shift = (::GetKeyState(VK_SHIFT) & 0x8000) != 0;
+ if (!shift && alt && !ctrl)
+ {
+ Properties();
+ return false;
+ }
+ OpenSelectedItems(true);
+ return false;
+ }
+ case NM_RCLICK:
+ RefreshStatusBar();
+ break;
+
+ /*
+ return OnRightClick((LPNMITEMACTIVATE)header, result);
+ */
+ /*
+ case NM_CLICK:
+ SendRefreshStatusBarMessage();
+ return 0;
+
+ // TODO : Handler default action...
+ return 0;
+ case LVN_ITEMCHANGED:
+ {
+ NMLISTVIEW *pNMLV = (NMLISTVIEW *) lpnmh;
+ SelChange(pNMLV);
+ return TRUE;
+ }
+ case NM_SETFOCUS:
+ return onSetFocus(NULL);
+ case NM_KILLFOCUS:
+ return onKillFocus(NULL);
+ */
+ case NM_CLICK:
+ {
+ // we need SetFocusToList, if we drag-select items from other panel.
+ SetFocusToList();
+ RefreshStatusBar();
+ if(_mySelectMode)
+ if(g_ComCtl32Version >= MAKELONG(71, 4))
+ OnLeftClick((LPNMITEMACTIVATE)header);
+ return false;
+ }
+ case LVN_BEGINLABELEDITW:
+ result = OnBeginLabelEdit((LV_DISPINFOW *)header);
+ return true;
+ case LVN_ENDLABELEDITW:
+ result = OnEndLabelEdit((LV_DISPINFOW *)header);
+ return true;
+
+ case NM_CUSTOMDRAW:
+ {
+ if (_mySelectMode)
+ return OnCustomDraw((LPNMLVCUSTOMDRAW)header, result);
+ break;
+ }
+ case LVN_BEGINDRAG:
+ {
+ OnDrag((LPNMLISTVIEW)header);
+ RefreshStatusBar();
+ break;
+ }
+#endif
+ // case LVN_BEGINRDRAG:
+ }
+ return false;
+}
+
+#ifdef _WIN32
+bool CPanel::OnCustomDraw(LPNMLVCUSTOMDRAW lplvcd, LRESULT &result)
+{
+ switch(lplvcd->nmcd.dwDrawStage)
+ {
+ case CDDS_PREPAINT :
+ result = CDRF_NOTIFYITEMDRAW;
+ return true;
+
+ case CDDS_ITEMPREPAINT:
+ /*
+ SelectObject(lplvcd->nmcd.hdc,
+ GetFontForItem(lplvcd->nmcd.dwItemSpec,
+ lplvcd->nmcd.lItemlParam) );
+ lplvcd->clrText = GetColorForItem(lplvcd->nmcd.dwItemSpec,
+ lplvcd->nmcd.lItemlParam);
+ lplvcd->clrTextBk = GetBkColorForItem(lplvcd->nmcd.dwItemSpec,
+ lplvcd->nmcd.lItemlParam);
+ */
+ int realIndex = (int)lplvcd->nmcd.lItemlParam;
+ bool selected = false;
+ if (realIndex != kParentIndex)
+ selected = _selectedStatusVector[realIndex];
+ if (selected)
+ lplvcd->clrTextBk = RGB(255, 192, 192);
+ // lplvcd->clrText = RGB(255, 0, 128);
+ else
+ lplvcd->clrTextBk = _listView.GetBkColor();
+ // lplvcd->clrText = RGB(0, 0, 0);
+ // result = CDRF_NEWFONT;
+ result = CDRF_NOTIFYITEMDRAW;
+ return true;
+
+ // return false;
+ // return true;
+ /*
+ case CDDS_SUBITEM | CDDS_ITEMPREPAINT:
+ if (lplvcd->iSubItem == 0)
+ {
+ // lplvcd->clrText = RGB(255, 0, 0);
+ lplvcd->clrTextBk = RGB(192, 192, 192);
+ }
+ else
+ {
+ lplvcd->clrText = RGB(0, 0, 0);
+ lplvcd->clrTextBk = RGB(255, 255, 255);
+ }
+ return true;
+ */
+
+ /* At this point, you can change the background colors for the item
+ and any subitems and return CDRF_NEWFONT. If the list-view control
+ is in report mode, you can simply return CDRF_NOTIFYSUBITEMREDRAW
+ to customize the item's subitems individually */
+ }
+ return false;
+}
+#endif //#ifdef _WIN32
+
+void CPanel::OnRefreshStatusBar()
+{
+ CRecordVector<UINT32> indices;
+ GetOperatedItemIndices(indices);
+
+ _statusBar.SetText(0, MyFormatNew(IDS_N_SELECTED_ITEMS, 0x02000301, NumberToString(indices.Size())));
+
+ UString selectSizeString;
+
+ if (indices.Size() > 0)
+ {
+ UInt64 totalSize = 0;
+ for (int i = 0; i < indices.Size(); i++)
+ totalSize += GetItemSize(indices[i]);
+ selectSizeString = ConvertSizeToString(totalSize);
+ }
+ _statusBar.SetText(1, selectSizeString);
+
+ int focusedItem = _listView.GetFocusedItem();
+ UString sizeString;
+ UString dateString;
+ if (focusedItem >= 0 && _listView.GetSelectedCount() > 0)
+ {
+ int realIndex = GetRealItemIndex(focusedItem);
+ if (realIndex != kParentIndex)
+ {
+ sizeString = ConvertSizeToString(GetItemSize(realIndex));
+ NCOM::CPropVariant prop;
+ if (_folder->GetProperty(realIndex, kpidMTime, &prop) == S_OK)
+ dateString = ConvertPropertyToString(prop, kpidMTime, false);
+ }
+ }
+ _statusBar.SetText(2, sizeString);
+ _statusBar.SetText(3, dateString);
+ // _statusBar.SetText(4, nameString);
+ // _statusBar2.SetText(1, MyFormatNew(L"{0} bytes", NumberToStringW(totalSize)));
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelMenu.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelMenu.cpp
new file mode 100644
index 000000000..55ac88b96
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelMenu.cpp
@@ -0,0 +1,621 @@
+#include "StdAfx.h"
+
+#include "Common/StringConvert.h"
+
+#include "Windows/COM.h"
+#include "Windows/Clipboard.h"
+// FIXME #include "Windows/Menu.h"
+#include "Windows/PropVariant.h"
+#include "Windows/PropVariantConversions.h"
+
+#include "../Common/PropIDUtils.h"
+#include "../../PropID.h"
+
+#include "App.h"
+#include "LangUtils.h"
+#include "MyLoadMenu.h"
+#include "PluginInterface.h"
+#include "PropertyName.h"
+
+#include "resource.h"
+#include "PropertyNameRes.h"
+
+using namespace NWindows;
+
+// {23170F69-40C1-278A-1000-000100020000}
+DEFINE_GUID(CLSID_CZipContextMenu,
+0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00);
+
+static const UINT kSevenZipStartMenuID = kPluginMenuStartID ;
+static const UINT kSystemStartMenuID = kPluginMenuStartID + 100;
+
+void CPanel::InvokeSystemCommand(const char *command)
+{
+#ifdef _WIN32
+ NCOM::CComInitializer comInitializer;
+ if (!IsFsOrPureDrivesFolder())
+ return;
+ CRecordVector<UInt32> operatedIndices;
+ GetOperatedItemIndices(operatedIndices);
+ if (operatedIndices.IsEmpty())
+ return;
+ CMyComPtr<IContextMenu> contextMenu;
+ if (CreateShellContextMenu(operatedIndices, contextMenu) != S_OK)
+ return;
+
+ CMINVOKECOMMANDINFO ci;
+ ZeroMemory(&ci, sizeof(ci));
+ ci.cbSize = sizeof(CMINVOKECOMMANDINFO);
+ ci.hwnd = GetParent();
+ ci.lpVerb = command;
+ contextMenu->InvokeCommand(&ci);
+#endif
+}
+
+static const wchar_t *kSeparator = L"--------------------------------------\n";
+static const wchar_t *kPropValueSeparator = L": ";
+
+extern UString ConvertSizeToString(UInt64 value);
+
+static void AddPropertyString(PROPID propID, const wchar_t *nameBSTR,
+ const NCOM::CPropVariant &prop, UString &s)
+{
+ if (prop.vt != VT_EMPTY)
+ {
+ UString val;
+
+ if ((prop.vt == VT_UI8 || prop.vt == VT_UI4) && (
+ propID == kpidSize ||
+ propID == kpidPackSize ||
+ propID == kpidNumSubDirs ||
+ propID == kpidNumSubFiles ||
+ propID == kpidNumBlocks ||
+ propID == kpidClusterSize ||
+ propID == kpidTotalSize ||
+ propID == kpidFreeSpace ||
+ propID == kpidPhySize ||
+ propID == kpidHeadersSize ||
+ propID == kpidFreeSpace
+ ))
+ val = ConvertSizeToString(ConvertPropVariantToUInt64(prop));
+ else
+ val = ConvertPropertyToString(prop, propID);
+
+ if (!val.IsEmpty())
+ {
+ s += GetNameOfProperty(propID, nameBSTR);
+ s += kPropValueSeparator;
+ /*
+ if (propID == kpidComment)
+ s += L'\n';
+ */
+ s += val;
+ s += L'\n';
+ }
+ }
+}
+
+void CPanel::Properties()
+{
+ CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties;
+ _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties);
+ if (!getFolderArchiveProperties)
+ {
+ InvokeSystemCommand("properties");
+ return;
+ }
+
+ {
+ UString message;
+
+ CRecordVector<UInt32> operatedIndices;
+ GetOperatedItemIndices(operatedIndices);
+ if (operatedIndices.Size() == 1)
+ {
+ UInt32 index = operatedIndices[0];
+ // message += L"Item:\n";
+ UInt32 numProps;
+ if (_folder->GetNumberOfProperties(&numProps) == S_OK)
+ {
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ CMyComBSTR name;
+ PROPID propID;
+ VARTYPE varType;
+
+ if (_folder->GetPropertyInfo(i, &name, &propID, &varType) != S_OK)
+ continue;
+
+ NCOM::CPropVariant prop;
+ if (_folder->GetProperty(index, propID, &prop) != S_OK)
+ continue;
+ AddPropertyString(propID, name, prop, message);
+ }
+ }
+ message += kSeparator;
+ }
+
+ message += LangString(IDS_PROP_FILE_TYPE, 0x02000214);
+ message += kPropValueSeparator;
+ message += GetFolderTypeID();
+ message += L"\n";
+
+ {
+ NCOM::CPropVariant prop;
+ if (_folder->GetFolderProperty(kpidPath, &prop) == S_OK)
+ {
+ AddPropertyString(kpidName, L"Path", prop, message);
+ }
+ }
+
+ CMyComPtr<IFolderProperties> folderProperties;
+ _folder.QueryInterface(IID_IFolderProperties, &folderProperties);
+ if (folderProperties)
+ {
+ UInt32 numProps;
+ if (folderProperties->GetNumberOfFolderProperties(&numProps) == S_OK)
+ {
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ CMyComBSTR name;
+ PROPID propID;
+ VARTYPE vt;
+ if (folderProperties->GetFolderPropertyInfo(i, &name, &propID, &vt) != S_OK)
+ continue;
+ NCOM::CPropVariant prop;
+ if (_folder->GetFolderProperty(propID, &prop) != S_OK)
+ continue;
+ AddPropertyString(propID, name, prop, message);
+ }
+ }
+ }
+
+ CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties;
+ _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties);
+ if (getFolderArchiveProperties)
+ {
+ CMyComPtr<IFolderArchiveProperties> getProps;
+ getFolderArchiveProperties->GetFolderArchiveProperties(&getProps);
+ if (getProps)
+ {
+ UInt32 numProps;
+ if (getProps->GetNumberOfArchiveProperties(&numProps) == S_OK)
+ {
+ if (numProps > 0)
+ message += kSeparator;
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ CMyComBSTR name;
+ PROPID propID;
+ VARTYPE vt;
+ if (getProps->GetArchivePropertyInfo(i, &name, &propID, &vt) != S_OK)
+ continue;
+ NCOM::CPropVariant prop;
+ if (getProps->GetArchiveProperty(propID, &prop) != S_OK)
+ continue;
+ AddPropertyString(propID, name, prop, message);
+ }
+ }
+ }
+ }
+ ::MessageBoxW(*(this), message, LangString(IDS_PROPERTIES, 0x03020900), MB_OK);
+ }
+}
+
+void CPanel::EditCut()
+{
+ // InvokeSystemCommand("cut");
+}
+
+void CPanel::EditCopy()
+{
+ /*
+ CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties;
+ _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties);
+ if (!getFolderArchiveProperties)
+ {
+ InvokeSystemCommand("copy");
+ return;
+ }
+ */
+ UString s;
+ CRecordVector<UInt32> indices;
+ GetSelectedItemsIndices(indices);
+ for (int i = 0; i < indices.Size(); i++)
+ {
+ if (i > 0)
+ s += L"\xD\n";
+ s += GetItemName(indices[i]);
+ }
+ ClipboardSetText(_mainWindow, s);
+}
+
+void CPanel::EditPaste()
+{
+ /*
+ UStringVector names;
+ ClipboardGetFileNames(names);
+ CopyFromNoAsk(names);
+ UString s;
+ for (int i = 0; i < names.Size(); i++)
+ {
+ s += L" ";
+ s += names[i];
+ }
+
+ MessageBoxW(0, s, L"", 0);
+ */
+
+ // InvokeSystemCommand("paste");
+}
+
+#ifdef _WIN32
+HRESULT CPanel::CreateShellContextMenu(
+ const CRecordVector<UInt32> &operatedIndices,
+ CMyComPtr<IContextMenu> &systemContextMenu)
+{
+ systemContextMenu.Release();
+ UString folderPath = GetFsPath();
+
+ CMyComPtr<IShellFolder> desktopFolder;
+ RINOK(::SHGetDesktopFolder(&desktopFolder));
+ if (!desktopFolder)
+ {
+ // ShowMessage("Failed to get Desktop folder.");
+ return E_FAIL;
+ }
+
+ // Separate the file from the folder.
+
+
+ // Get a pidl for the folder the file
+ // is located in.
+ LPITEMIDLIST parentPidl;
+ DWORD eaten;
+ RINOK(desktopFolder->ParseDisplayName(
+ GetParent(), 0, (wchar_t *)(const wchar_t *)folderPath,
+ &eaten, &parentPidl, 0));
+
+ // Get an IShellFolder for the folder
+ // the file is located in.
+ CMyComPtr<IShellFolder> parentFolder;
+ RINOK(desktopFolder->BindToObject(parentPidl,
+ 0, IID_IShellFolder, (void**)&parentFolder));
+ if (!parentFolder)
+ {
+ // ShowMessage("Invalid file name.");
+ return E_FAIL;
+ }
+
+ // Get a pidl for the file itself.
+ CRecordVector<LPITEMIDLIST> pidls;
+ pidls.Reserve(operatedIndices.Size());
+ for (int i = 0; i < operatedIndices.Size(); i++)
+ {
+ LPITEMIDLIST pidl;
+ UString fileName = GetItemRelPath(operatedIndices[i]);
+ if (IsFSDrivesFolder())
+ fileName += WCHAR_PATH_SEPARATOR;
+ RINOK(parentFolder->ParseDisplayName(GetParent(), 0,
+ (wchar_t *)(const wchar_t *)fileName, &eaten, &pidl, 0));
+ pidls.Add(pidl);
+ }
+
+ ITEMIDLIST temp;
+ if (pidls.Size() == 0)
+ {
+ temp.mkid.cb = 0;
+ /*
+ LPITEMIDLIST pidl;
+ HRESULT result = parentFolder->ParseDisplayName(GetParent(), 0,
+ L"." WSTRING_PATH_SEPARATOR, &eaten, &pidl, 0);
+ if (result != NOERROR)
+ return;
+ */
+ pidls.Add(&temp);
+ }
+
+ // Get the IContextMenu for the file.
+ CMyComPtr<IContextMenu> cm;
+ RINOK( parentFolder->GetUIObjectOf(GetParent(), pidls.Size(),
+ (LPCITEMIDLIST *)&pidls.Front(), IID_IContextMenu, 0, (void**)&cm));
+ if (!cm)
+ {
+ // ShowMessage("Unable to get context menu interface.");
+ return E_FAIL;
+ }
+ systemContextMenu = cm;
+ return S_OK;
+}
+
+void CPanel::CreateSystemMenu(HMENU menuSpec,
+ const CRecordVector<UInt32> &operatedIndices,
+ CMyComPtr<IContextMenu> &systemContextMenu)
+{
+ systemContextMenu.Release();
+
+ CreateShellContextMenu(operatedIndices, systemContextMenu);
+
+ if (systemContextMenu == 0)
+ return;
+
+ // Set up a CMINVOKECOMMANDINFO structure.
+ CMINVOKECOMMANDINFO ci;
+ ZeroMemory(&ci, sizeof(ci));
+ ci.cbSize = sizeof(CMINVOKECOMMANDINFO);
+ ci.hwnd = GetParent();
+
+ /*
+ if (Sender == GoBtn)
+ {
+ // Verbs that can be used are cut, paste,
+ // properties, delete, and so on.
+ String action;
+ if (CutRb->Checked)
+ action = "cut";
+ else if (CopyRb->Checked)
+ action = "copy";
+ else if (DeleteRb->Checked)
+ action = "delete";
+ else if (PropertiesRb->Checked)
+ action = "properties";
+
+ ci.lpVerb = action.c_str();
+ result = cm->InvokeCommand(&ci);
+ if (result)
+ ShowMessage(
+ "Error copying file to clipboard.");
+
+ }
+ else
+ */
+ {
+ // HMENU hMenu = CreatePopupMenu();
+ CMenu popupMenu;
+ // CMenuDestroyer menuDestroyer(popupMenu);
+ if(!popupMenu.CreatePopup())
+ throw 210503;
+
+ HMENU hMenu = popupMenu;
+
+ DWORD Flags = CMF_EXPLORE;
+ // Optionally the shell will show the extended
+ // context menu on some operating systems when
+ // the shift key is held down at the time the
+ // context menu is invoked. The following is
+ // commented out but you can uncommnent this
+ // line to show the extended context menu.
+ // Flags |= 0x00000080;
+ systemContextMenu->QueryContextMenu(hMenu, 0, kSystemStartMenuID, 0x7FFF, Flags);
+
+
+ {
+ CMenu menu;
+ menu.Attach(menuSpec);
+ CMenuItem menuItem;
+ menuItem.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_ID;
+ menuItem.fType = MFT_STRING;
+ menuItem.hSubMenu = popupMenu.Detach();
+ // menuDestroyer.Disable();
+ menuItem.StringValue = LangString(IDS_SYSTEM, 0x030202A0);
+ menu.InsertItem(0, true, menuItem);
+ }
+ /*
+ if (Cmd < 100 && Cmd != 0)
+ {
+ ci.lpVerb = MAKEINTRESOURCE(Cmd - 1);
+ ci.lpParameters = "";
+ ci.lpDirectory = "";
+ ci.nShow = SW_SHOWNORMAL;
+ cm->InvokeCommand(&ci);
+ }
+ // If Cmd is > 100 then it's one of our
+ // inserted menu items.
+ else
+ // Find the menu item.
+ for (int i = 0; i < popupMenu1->Items->Count; i++)
+ {
+ TMenuItem* menu = popupMenu1->Items->Items[i];
+ // Call its OnClick handler.
+ if (menu->Command == Cmd - 100)
+ menu->OnClick(this);
+ }
+ // Release the memory allocated for the menu.
+ DestroyMenu(hMenu);
+ */
+ }
+}
+
+void CPanel::CreateFileMenu(HMENU menuSpec)
+{
+ CreateFileMenu(menuSpec, _sevenZipContextMenu, _systemContextMenu, true);
+}
+
+void CPanel::CreateSevenZipMenu(HMENU menuSpec,
+ const CRecordVector<UInt32> &operatedIndices,
+ CMyComPtr<IContextMenu> &sevenZipContextMenu)
+{
+ sevenZipContextMenu.Release();
+
+ CMenu menu;
+ menu.Attach(menuSpec);
+ // CMenuDestroyer menuDestroyer(menu);
+ // menu.CreatePopup();
+
+ bool sevenZipMenuCreated = false;
+
+ CMyComPtr<IContextMenu> contextMenu;
+ if (contextMenu.CoCreateInstance(CLSID_CZipContextMenu, IID_IContextMenu) == S_OK)
+ {
+ CMyComPtr<IInitContextMenu> initContextMenu;
+ if (contextMenu.QueryInterface(IID_IInitContextMenu, &initContextMenu) != S_OK)
+ return;
+ UString currentFolderUnicode = _currentFolderPrefix;
+ UStringVector names;
+ int i;
+ for(i = 0; i < operatedIndices.Size(); i++)
+ names.Add(currentFolderUnicode + GetItemRelPath(operatedIndices[i]));
+ CRecordVector<const wchar_t *> namePointers;
+ for(i = 0; i < operatedIndices.Size(); i++)
+ namePointers.Add(names[i]);
+
+ // NFile::NDirectory::MySetCurrentDirectory(currentFolderUnicode);
+ if (initContextMenu->InitContextMenu(currentFolderUnicode, &namePointers.Front(),
+ operatedIndices.Size()) == S_OK)
+ {
+ HRESULT res = contextMenu->QueryContextMenu(menu, 0, kSevenZipStartMenuID,
+ kSystemStartMenuID - 1, 0);
+ sevenZipMenuCreated = (HRESULT_SEVERITY(res) == SEVERITY_SUCCESS);
+ if (sevenZipMenuCreated)
+ sevenZipContextMenu = contextMenu;
+ // int code = HRESULT_CODE(res);
+ // int nextItemID = code;
+ }
+ }
+}
+
+void CPanel::CreateFileMenu(HMENU menuSpec,
+ CMyComPtr<IContextMenu> &sevenZipContextMenu,
+ CMyComPtr<IContextMenu> &systemContextMenu,
+ bool programMenu)
+{
+ sevenZipContextMenu.Release();
+ systemContextMenu.Release();
+
+ CRecordVector<UInt32> operatedIndices;
+ GetOperatedItemIndices(operatedIndices);
+
+ CMenu menu;
+ menu.Attach(menuSpec);
+
+ CreateSevenZipMenu(menu, operatedIndices, sevenZipContextMenu);
+ if (g_App.ShowSystemMenu)
+ CreateSystemMenu(menu, operatedIndices, systemContextMenu);
+
+ if (menu.GetItemCount() > 0)
+ menu.AppendItem(MF_SEPARATOR, 0, (LPCTSTR)0);
+
+ int i;
+ for (i = 0; i < operatedIndices.Size(); i++)
+ if (IsItemFolder(operatedIndices[i]))
+ break;
+ bool allAreFiles = (i == operatedIndices.Size());
+ LoadFileMenu(menu, menu.GetItemCount(), programMenu,
+ IsFSFolder(), operatedIndices.Size(), allAreFiles);
+}
+
+bool CPanel::InvokePluginCommand(int id)
+{
+ return InvokePluginCommand(id, _sevenZipContextMenu, _systemContextMenu);
+}
+
+bool CPanel::InvokePluginCommand(int id,
+ IContextMenu *sevenZipContextMenu, IContextMenu *systemContextMenu)
+{
+ UInt32 offset;
+ bool isSystemMenu = (id >= kSystemStartMenuID);
+ if (isSystemMenu)
+ offset = id - kSystemStartMenuID;
+ else
+ offset = id - kSevenZipStartMenuID;
+
+ CMINVOKECOMMANDINFOEX commandInfo;
+ commandInfo.cbSize = sizeof(commandInfo);
+ commandInfo.fMask = CMIC_MASK_UNICODE;
+ commandInfo.hwnd = GetParent();
+ commandInfo.lpVerb = (LPCSTR)(MAKEINTRESOURCE(offset));
+ commandInfo.lpParameters = NULL;
+ CSysString currentFolderSys = GetSystemString(_currentFolderPrefix);
+ commandInfo.lpDirectory = (LPCSTR)(LPCTSTR)(currentFolderSys);
+ commandInfo.nShow = SW_SHOW;
+ commandInfo.lpTitle = "";
+ commandInfo.lpVerbW = (LPCWSTR)(MAKEINTRESOURCEW(offset));
+ commandInfo.lpParameters = NULL;
+ UString currentFolderUnicode = _currentFolderPrefix;
+ commandInfo.lpDirectoryW = currentFolderUnicode;
+ commandInfo.lpTitleW = L"";
+ // commandInfo.ptInvoke.x = xPos;
+ // commandInfo.ptInvoke.y = yPos;
+ commandInfo.ptInvoke.x = 0;
+ commandInfo.ptInvoke.y = 0;
+ HRESULT result;
+ if (isSystemMenu)
+ result = systemContextMenu->InvokeCommand(LPCMINVOKECOMMANDINFO(&commandInfo));
+ else
+ result = sevenZipContextMenu->InvokeCommand(LPCMINVOKECOMMANDINFO(&commandInfo));
+ if (result == NOERROR)
+ {
+ KillSelection();
+ return true;
+ }
+ return false;
+}
+
+bool CPanel::OnContextMenu(HANDLE windowHandle, int xPos, int yPos)
+{
+ if (windowHandle != _listView)
+ return false;
+ /*
+ POINT point;
+ point.x = xPos;
+ point.y = yPos;
+ if (!_listView.ScreenToClient(&point))
+ return false;
+
+ LVHITTESTINFO info;
+ info.pt = point;
+ int index = _listView.HitTest(&info);
+ */
+
+ CRecordVector<UInt32> operatedIndices;
+ GetOperatedItemIndices(operatedIndices);
+
+ if (xPos < 0 || yPos < 0)
+ {
+ if (operatedIndices.Size() == 0)
+ {
+ xPos = 0;
+ yPos = 0;
+ }
+ else
+ {
+ int itemIndex = _listView.GetNextItem(-1, LVNI_FOCUSED);
+ if (itemIndex == -1)
+ return false;
+ RECT rect;
+ if (!_listView.GetItemRect(itemIndex, &rect, LVIR_ICON))
+ return false;
+ xPos = (rect.left + rect.right) / 2;
+ yPos = (rect.top + rect.bottom) / 2;
+ }
+ POINT point = {xPos, yPos};
+ _listView.ClientToScreen(&point);
+ xPos = point.x;
+ yPos = point.y;
+ }
+
+ CMenu menu;
+ CMenuDestroyer menuDestroyer(menu);
+ menu.CreatePopup();
+
+ CMyComPtr<IContextMenu> sevenZipContextMenu;
+ CMyComPtr<IContextMenu> systemContextMenu;
+ CreateFileMenu(menu, sevenZipContextMenu, systemContextMenu, false);
+
+ int result = menu.Track(TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD | TPM_NONOTIFY,
+ xPos, yPos, _listView);
+
+ if (result == 0)
+ return true;
+
+ if (result >= kPluginMenuStartID)
+ {
+ InvokePluginCommand(result, sevenZipContextMenu, systemContextMenu);
+ return true;
+ }
+ if (ExecuteFileCommand(result))
+ return true;
+ return true;
+}
+#endif
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelOperations.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelOperations.cpp
new file mode 100644
index 000000000..5a0d052c4
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelOperations.cpp
@@ -0,0 +1,470 @@
+// PanelOperations.cpp
+
+#include "StdAfx.h"
+
+#include "resource.h"
+
+#include "Panel.h"
+
+#include "Common/StringConvert.h"
+#include "Common/DynamicBuffer.h"
+#include "Windows/FileDir.h"
+#include "Windows/ResourceString.h"
+#include "Windows/Thread.h"
+#include "Windows/COM.h"
+
+#include "ComboDialog.h"
+
+#include "FSFolder.h"
+#include "LangUtils.h"
+#include "FormatUtils.h"
+
+#include "UpdateCallback100.h"
+
+using namespace NWindows;
+using namespace NFile;
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+enum EFolderOpType
+{
+ FOLDER_TYPE_CREATE_FOLDER = 0,
+ FOLDER_TYPE_DELETE = 1,
+ FOLDER_TYPE_RENAME = 2
+};
+
+struct CThreadFolderOperations
+{
+ EFolderOpType OpType;
+ UString Name;
+ UInt32 Index;
+ CRecordVector<UInt32> Indices;
+
+ CMyComPtr<IFolderOperations> FolderOperations;
+ CMyComPtr<IProgress> UpdateCallback;
+ CUpdateCallback100Imp *UpdateCallbackSpec;
+ HRESULT Result;
+
+ CThreadFolderOperations(EFolderOpType opType);
+
+ void Process()
+ {
+#ifdef _WIN32
+ NCOM::CComInitializer comInitializer;
+#endif
+ UpdateCallbackSpec->ProgressDialog.WaitCreating();
+
+ switch(OpType)
+ {
+ case FOLDER_TYPE_CREATE_FOLDER:
+ Result = FolderOperations->CreateFolder(Name, UpdateCallback);
+ break;
+ case FOLDER_TYPE_DELETE:
+ Result = FolderOperations->Delete(&Indices.Front(), Indices.Size(), UpdateCallback);
+ break;
+ case FOLDER_TYPE_RENAME:
+ Result = FolderOperations->Rename(Index, Name, UpdateCallback);
+ break;
+ default:
+ Result = E_FAIL;
+ }
+ UpdateCallbackSpec->ProgressDialog.MyClose();
+ }
+
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
+ {
+ ((CThreadFolderOperations *)param)->Process();
+ return 0;
+ }
+};
+
+CThreadFolderOperations::CThreadFolderOperations(EFolderOpType opType): OpType(opType) {};
+
+static void DoOperation(CThreadFolderOperations &op, CPanel &panel, const UString &progressTitle)
+{
+ op.UpdateCallbackSpec = new CUpdateCallback100Imp;
+ op.UpdateCallback = op.UpdateCallbackSpec;
+
+ bool usePassword = false;
+ UString password;
+ if (panel._parentFolders.Size() > 0)
+ {
+ const CFolderLink &fl = panel._parentFolders.Back();
+ usePassword = fl.UsePassword;
+ password = fl.Password;
+ }
+
+ op.UpdateCallbackSpec->Init(panel.GetParent(), usePassword, password);
+
+ op.UpdateCallbackSpec->ProgressDialog.MainWindow = panel._mainWindow;
+ op.UpdateCallbackSpec->ProgressDialog.MainTitle = LangString(IDS_APP_TITLE, 0x03000000);
+ op.UpdateCallbackSpec->ProgressDialog.MainAddTitle = progressTitle + UString(L" ");
+
+ // op.FolderOperations = folderOperations;
+ // op.Index = realIndex;
+ // op.Name = newName;
+ // HRESULT result = folderOperations->Rename(realIndex, newName, 0);
+
+ NWindows::CThread thread;
+ if (thread.Create(CThreadFolderOperations::MyThreadFunction, &op) != S_OK)
+ throw 271824;
+ op.UpdateCallbackSpec->StartProgressDialog(progressTitle);
+}
+
+#ifndef _UNICODE
+typedef int (WINAPI * SHFileOperationWP)(LPSHFILEOPSTRUCTW lpFileOp);
+#endif
+
+void CPanel::DeleteItems(bool toRecycleBin)
+{
+ CPanel::CDisableTimerProcessing disableTimerProcessing2(*this);
+ CRecordVector<UInt32> indices;
+ GetOperatedItemIndices(indices);
+ if (indices.IsEmpty())
+ return;
+ CSelectedState state;
+ SaveSelectedState(state);
+ bool useInternalDelete = false;
+ if (IsFSFolder() && toRecycleBin)
+ {
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ CDynamicBuffer<CHAR> buffer;
+ size_t size = 0;
+ for (int i = 0; i < indices.Size(); i++)
+ {
+ const AString path = GetSystemString(GetFsPath() + GetItemRelPath(indices[i]));
+ buffer.EnsureCapacity(size + path.Length() + 1);
+ memmove(((CHAR *)buffer) + size, (const CHAR *)path, (path.Length() + 1) * sizeof(CHAR));
+ size += path.Length() + 1;
+ }
+ buffer.EnsureCapacity(size + 1);
+ ((CHAR *)buffer)[size] = 0;
+ SHFILEOPSTRUCTA fo;
+ fo.hwnd = GetParent();
+ fo.wFunc = FO_DELETE;
+ fo.pFrom = (const CHAR *)buffer;
+ fo.pTo = 0;
+ fo.fFlags = 0;
+ if (toRecycleBin)
+ fo.fFlags |= FOF_ALLOWUNDO;
+ // fo.fFlags |= FOF_NOCONFIRMATION;
+ // fo.fFlags |= FOF_NOERRORUI;
+ // fo.fFlags |= FOF_SILENT;
+ // fo.fFlags |= FOF_WANTNUKEWARNING;
+ fo.fAnyOperationsAborted = FALSE;
+ fo.hNameMappings = 0;
+ fo.lpszProgressTitle = 0;
+ /* int res = */ ::SHFileOperationA(&fo);
+ }
+ else
+ #endif
+ {
+ CDynamicBuffer<WCHAR> buffer;
+ size_t size = 0;
+ int maxLen = 0;
+ for (int i = 0; i < indices.Size(); i++)
+ {
+ // L"\\\\?\\") doesn't work here.
+ const UString path = GetFsPath() + GetItemRelPath(indices[i]);
+ if (path.Length() > maxLen)
+ maxLen = path.Length();
+ buffer.EnsureCapacity(size + path.Length() + 1);
+ memmove(((WCHAR *)buffer) + size, (const WCHAR *)path, (path.Length() + 1) * sizeof(WCHAR));
+ size += path.Length() + 1;
+ }
+ buffer.EnsureCapacity(size + 1);
+ ((WCHAR *)buffer)[size] = 0;
+#ifdef _WIN32
+ if (maxLen >= MAX_PATH)
+ {
+ if (toRecycleBin)
+ {
+ MessageBoxErrorLang(IDS_ERROR_LONG_PATH_TO_RECYCLE, 0x03020218);
+ return;
+ }
+ useInternalDelete = true;
+ }
+ else
+ {
+ SHFILEOPSTRUCTW fo;
+ fo.hwnd = GetParent();
+ fo.wFunc = FO_DELETE;
+ fo.pFrom = (const WCHAR *)buffer;
+ fo.pTo = 0;
+ fo.fFlags = 0;
+ if (toRecycleBin)
+ fo.fFlags |= FOF_ALLOWUNDO;
+ fo.fAnyOperationsAborted = FALSE;
+ fo.hNameMappings = 0;
+ fo.lpszProgressTitle = 0;
+ int res;
+ #ifdef _UNICODE
+ res = ::SHFileOperationW(&fo);
+ #else
+ SHFileOperationWP shFileOperationW = (SHFileOperationWP)
+ ::GetProcAddress(::GetModuleHandleW(L"shell32.dll"), "SHFileOperationW");
+ if (shFileOperationW == 0)
+ return;
+ res = shFileOperationW(&fo);
+ #endif
+ }
+#else
+ // FIXME - how to use the recycle bin undex Gnome or KDE ?
+ useInternalDelete = true;
+#endif
+ }
+ /*
+ if (fo.fAnyOperationsAborted)
+ MessageBoxError(result, LangString(IDS_ERROR_DELETING, 0x03020217));
+ */
+ }
+ else
+ useInternalDelete = true;
+ if (useInternalDelete)
+ DeleteItemsInternal(indices);
+ RefreshListCtrl(state);
+}
+
+void CPanel::DeleteItemsInternal(CRecordVector<UInt32> &indices)
+{
+ CMyComPtr<IFolderOperations> folderOperations;
+ if (_folder.QueryInterface(IID_IFolderOperations, &folderOperations) != S_OK)
+ {
+ MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return;
+ }
+
+ UString title;
+ UString message;
+ if (indices.Size() == 1)
+ {
+ int index = indices[0];
+ const UString itemName = GetItemRelPath(index);
+ if (IsItemFolder(index))
+ {
+ title = LangString(IDS_CONFIRM_FOLDER_DELETE, 0x03020211);
+ message = MyFormatNew(IDS_WANT_TO_DELETE_FOLDER, 0x03020214, itemName);
+ }
+ else
+ {
+ title = LangString(IDS_CONFIRM_FILE_DELETE, 0x03020210);
+ message = MyFormatNew(IDS_WANT_TO_DELETE_FILE, 0x03020213, itemName);
+ }
+ }
+ else
+ {
+ title = LangString(IDS_CONFIRM_ITEMS_DELETE, 0x03020212);
+ message = MyFormatNew(IDS_WANT_TO_DELETE_ITEMS, 0x03020215,
+ NumberToString(indices.Size()));
+ }
+ if (::MessageBoxW(GetParent(), message, title, MB_OKCANCEL | MB_ICONQUESTION) != IDOK)
+ return;
+
+ {
+ CThreadFolderOperations op(FOLDER_TYPE_DELETE);
+ op.FolderOperations = folderOperations;
+ op.Indices = indices;
+ DoOperation(op, *this, LangString(IDS_DELETING, 0x03020216));
+ if (op.Result != S_OK)
+ MessageBoxError(op.Result, LangString(IDS_ERROR_DELETING, 0x03020217));
+ }
+ RefreshTitleAlways();
+}
+
+#ifdef _WIN32
+BOOL CPanel::OnBeginLabelEdit(LV_DISPINFOW * lpnmh)
+{
+ int realIndex = GetRealIndex(lpnmh->item);
+ if (realIndex == kParentIndex)
+ return TRUE;
+ CMyComPtr<IFolderOperations> folderOperations;
+ if (_folder.QueryInterface(IID_IFolderOperations, &folderOperations) != S_OK)
+ return TRUE;
+ return FALSE;
+}
+
+BOOL CPanel::OnEndLabelEdit(LV_DISPINFOW * lpnmh)
+{
+ if (lpnmh->item.pszText == NULL)
+ return FALSE;
+ CMyComPtr<IFolderOperations> folderOperations;
+ if (_folder.QueryInterface(IID_IFolderOperations, &folderOperations) != S_OK)
+ {
+ MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return FALSE;
+ }
+ const UString newName = lpnmh->item.pszText;
+ CPanel::CDisableTimerProcessing disableTimerProcessing2(*this);
+
+ SaveSelectedState(_selectedState);
+
+ int realIndex = GetRealIndex(lpnmh->item);
+ if (realIndex == kParentIndex)
+ return FALSE;
+ const UString prefix = GetItemPrefix(realIndex);
+
+
+ {
+ CThreadFolderOperations op(FOLDER_TYPE_RENAME);
+ op.FolderOperations = folderOperations;
+ op.Index = realIndex;
+ op.Name = newName;
+ DoOperation(op, *this, LangString(IDS_RENAMING, 0x03020220));
+ if (op.Result != S_OK)
+ {
+ MessageBoxError(op.Result, LangString(IDS_ERROR_RENAMING, 0x03020221));
+ return FALSE;
+ }
+ }
+
+ // Can't use RefreshListCtrl here.
+ // RefreshListCtrlSaveFocused();
+ _selectedState.FocusedName = prefix + newName;
+ _selectedState.SelectFocused = true;
+
+ // We need clear all items to disable GetText before Reload:
+ // number of items can change.
+ // _listView.DeleteAllItems();
+ // But seems it can still call GetText (maybe for current item)
+ // so we can't delete items.
+
+ _dontShowMode = true;
+
+ PostMessage(kReLoadMessage);
+ return TRUE;
+}
+#endif
+
+void CPanel::CreateFolder()
+{
+ CMyComPtr<IFolderOperations> folderOperations;
+ if (_folder.QueryInterface(IID_IFolderOperations, &folderOperations) != S_OK)
+ {
+ MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return;
+ }
+ CPanel::CDisableTimerProcessing disableTimerProcessing2(*this);
+ CSelectedState state;
+ SaveSelectedState(state);
+ CComboDialog comboDialog;
+ comboDialog.Title = LangString(IDS_CREATE_FOLDER, 0x03020230);
+ comboDialog.Static = LangString(IDS_CREATE_FOLDER_NAME, 0x03020231);
+ comboDialog.Value = LangString(IDS_CREATE_FOLDER_DEFAULT_NAME, /*0x03020232*/ (UInt32)-1);
+ if (comboDialog.Create(GetParent()) == IDCANCEL)
+ return;
+
+ UString newName = comboDialog.Value;
+
+ {
+ CThreadFolderOperations op(FOLDER_TYPE_CREATE_FOLDER);
+ op.FolderOperations = folderOperations;
+ op.Name = newName;
+ DoOperation(op, *this, LangString(IDS_CREATE_FOLDER, 0x03020230));
+
+ if (op.Result != S_OK)
+ {
+ MessageBoxError(op.Result, LangString(IDS_CREATE_FOLDER_ERROR, 0x03020233));
+ return;
+ }
+ }
+ int pos = newName.Find(L'\\');
+ if (pos >= 0)
+ newName = newName.Left(pos);
+ if (!_mySelectMode)
+ state.SelectedNames.Clear();
+ state.FocusedName = newName;
+ state.SelectFocused = true;
+ RefreshTitleAlways();
+ RefreshListCtrl(state);
+}
+
+void CPanel::CreateFile()
+{
+ CMyComPtr<IFolderOperations> folderOperations;
+ if (_folder.QueryInterface(IID_IFolderOperations, &folderOperations) != S_OK)
+ {
+ MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return;
+ }
+ CPanel::CDisableTimerProcessing disableTimerProcessing2(*this);
+ CSelectedState state;
+ SaveSelectedState(state);
+ CComboDialog comboDialog;
+ comboDialog.Title = LangString(IDS_CREATE_FILE, 0x03020240);
+ comboDialog.Static = LangString(IDS_CREATE_FILE_NAME, 0x03020241);
+ comboDialog.Value = LangString(IDS_CREATE_FILE_DEFAULT_NAME, /*0x03020242*/ (UInt32)-1);
+ if (comboDialog.Create(GetParent()) == IDCANCEL)
+ return;
+ UString newName = comboDialog.Value;
+ HRESULT result = folderOperations->CreateFile(newName, 0);
+ if (result != S_OK)
+ {
+ MessageBoxError(result, LangString(IDS_CREATE_FILE_ERROR, 0x03020243));
+ return;
+ }
+ int pos = newName.Find(L'\\');
+ if (pos >= 0)
+ newName = newName.Left(pos);
+ if (!_mySelectMode)
+ state.SelectedNames.Clear();
+ state.FocusedName = newName;
+ state.SelectFocused = true;
+ RefreshListCtrl(state);
+}
+
+void CPanel::RenameFile()
+{
+ int index = _listView.GetFocusedItem();
+ if (index >= 0)
+ _listView.EditLabel(index);
+}
+
+void CPanel::ChangeComment()
+{
+ CPanel::CDisableTimerProcessing disableTimerProcessing2(*this);
+ int index = _listView.GetFocusedItem();
+ if (index < 0)
+ return;
+ int realIndex = GetRealItemIndex(index);
+ if (realIndex == kParentIndex)
+ return;
+ CSelectedState state;
+ SaveSelectedState(state);
+ CMyComPtr<IFolderOperations> folderOperations;
+ if (_folder.QueryInterface(IID_IFolderOperations, &folderOperations) != S_OK)
+ {
+ MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return;
+ }
+
+ UString comment;
+ {
+ NCOM::CPropVariant propVariant;
+ if (_folder->GetProperty(realIndex, kpidComment, &propVariant) != S_OK)
+ return;
+ if (propVariant.vt == VT_BSTR)
+ comment = propVariant.bstrVal;
+ else if (propVariant.vt != VT_EMPTY)
+ return;
+ }
+ UString name = GetItemRelPath(realIndex);
+ CComboDialog comboDialog;
+ comboDialog.Title = name + L" " + LangString(IDS_COMMENT, 0x03020290);
+ comboDialog.Value = comment;
+ comboDialog.Static = LangString(IDS_COMMENT2, 0x03020291);
+ if (comboDialog.Create(GetParent()) == IDCANCEL)
+ return;
+ NCOM::CPropVariant propVariant(comboDialog.Value);
+
+ HRESULT result = folderOperations->SetProperty(realIndex, kpidComment, &propVariant, NULL);
+ if (result != S_OK)
+ {
+ MessageBoxError(result, L"Set Comment Error");
+ }
+ RefreshListCtrl(state);
+}
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSelect.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSelect.cpp
new file mode 100644
index 000000000..0e2423003
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSelect.cpp
@@ -0,0 +1,305 @@
+// PanelSelect.cpp
+
+#include "StdAfx.h"
+
+#include "resource.h"
+
+#include "Common/StringConvert.h"
+#include "Common/Wildcard.h"
+
+#include "Panel.h"
+
+#include "ComboDialog.h"
+
+#include "LangUtils.h"
+
+void CPanel::OnShiftSelectMessage()
+{
+ if (!_mySelectMode)
+ return;
+ int focusedItem = _listView.GetFocusedItem();
+ if (focusedItem < 0)
+ return;
+ if (!_selectionIsDefined)
+ return;
+ int startItem = MyMin(focusedItem, _prevFocusedItem);
+ int finishItem = MyMax(focusedItem, _prevFocusedItem);
+ for (int i = 0; i < _listView.GetItemCount(); i++)
+ {
+ int realIndex = GetRealItemIndex(i);
+ if (realIndex == kParentIndex)
+ continue;
+ if (i >= startItem && i <= finishItem)
+ if (_selectedStatusVector[realIndex] != _selectMark)
+ {
+ _selectedStatusVector[realIndex] = _selectMark;
+ _listView.RedrawItem(i);
+ }
+ }
+ _prevFocusedItem = focusedItem;
+}
+
+#ifdef _WIN32
+void CPanel::OnArrowWithShift()
+{
+ if (!_mySelectMode)
+ return;
+ int focusedItem = _listView.GetFocusedItem();
+ if (focusedItem < 0)
+ return;
+ int realIndex = GetRealItemIndex(focusedItem);
+ if (_selectionIsDefined)
+ {
+ if (realIndex != kParentIndex)
+ _selectedStatusVector[realIndex] = _selectMark;
+ }
+ else
+ {
+ if (realIndex == kParentIndex)
+ {
+ _selectionIsDefined = true;
+ _selectMark = true;
+ }
+ else
+ {
+ _selectionIsDefined = true;
+ _selectMark = !_selectedStatusVector[realIndex];
+ _selectedStatusVector[realIndex] = _selectMark;
+ }
+ }
+ _prevFocusedItem = focusedItem;
+ PostMessage(kShiftSelectMessage);
+ _listView.RedrawItem(focusedItem);
+}
+
+void CPanel::OnInsert()
+{
+ /*
+ const int kState = CDIS_MARKED; // LVIS_DROPHILITED;
+ UINT state = (_listView.GetItemState(focusedItem, LVIS_CUT) == 0) ?
+ LVIS_CUT : 0;
+ _listView.SetItemState(focusedItem, state, LVIS_CUT);
+ // _listView.SetItemState(focusedItem, LVIS_SELECTED, LVIS_SELECTED);
+
+ */
+ int focusedItem = _listView.GetFocusedItem();
+ if (focusedItem < 0)
+ return;
+ int realIndex = GetRealItemIndex(focusedItem);
+ bool isSelected = !_selectedStatusVector[realIndex];
+ if (realIndex != kParentIndex)
+ _selectedStatusVector[realIndex] = isSelected;
+
+ if (!_mySelectMode)
+ _listView.SetItemState(focusedItem, isSelected ? LVIS_SELECTED: 0, LVIS_SELECTED);
+
+ _listView.RedrawItem(focusedItem);
+
+ int nextIndex = focusedItem + 1;
+ if (nextIndex < _listView.GetItemCount())
+ {
+ _listView.SetItemState(nextIndex, LVIS_FOCUSED | LVIS_SELECTED,
+ LVIS_FOCUSED | LVIS_SELECTED);
+ _listView.EnsureVisible(nextIndex, false);
+ }
+}
+#endif // _WIN32
+
+/*
+void CPanel::OnUpWithShift()
+{
+ int focusedItem = _listView.GetFocusedItem();
+ if (focusedItem < 0)
+ return;
+ int index = GetRealItemIndex(focusedItem);
+ _selectedStatusVector[index] = !_selectedStatusVector[index];
+ _listView.RedrawItem(index);
+}
+
+void CPanel::OnDownWithShift()
+{
+ int focusedItem = _listView.GetFocusedItem();
+ if (focusedItem < 0)
+ return;
+ int index = GetRealItemIndex(focusedItem);
+ _selectedStatusVector[index] = !_selectedStatusVector[index];
+ _listView.RedrawItem(index);
+}
+*/
+
+void CPanel::UpdateSelection()
+{
+printf("CPanel::UpdateSelection : _mySelectMode=%d\n",(int)_mySelectMode);
+ if (!_mySelectMode)
+ {
+ bool enableTemp = _enableItemChangeNotify;
+ _enableItemChangeNotify = false;
+ int numItems = _listView.GetItemCount();
+printf("CPanel::UpdateSelection : numItems=%d\n",(int)numItems);
+ for (int i = 0; i < numItems; i++)
+ {
+ int realIndex = GetRealItemIndex(i);
+ if (realIndex != kParentIndex)
+ {
+ UINT value = 0;
+ value = _selectedStatusVector[realIndex] ? LVIS_SELECTED: 0;
+printf("CPanel::UpdateSelection : SetItemState(%d,%d,LVIS_SELECTED)\n",(int)i,(unsigned)value);
+ _listView.SetItemState(i, value, LVIS_SELECTED);
+ }
+ }
+ _enableItemChangeNotify = enableTemp;
+ }
+ _listView.RedrawAllItems();
+}
+
+
+void CPanel::SelectSpec(bool selectMode)
+{
+ CComboDialog comboDialog;
+ comboDialog.Title = selectMode ?
+ LangString(IDS_SELECT, 0x03020250):
+ LangString(IDS_DESELECT, 0x03020251);
+ comboDialog.Static = LangString(IDS_SELECT_MASK, 0x03020252);
+ comboDialog.Value = L"*";
+ if (comboDialog.Create(GetParent()) == IDCANCEL)
+ return;
+ const UString &mask = comboDialog.Value;
+ for (int i = 0; i < _selectedStatusVector.Size(); i++)
+ if (CompareWildCardWithName(mask, GetItemName(i)))
+ _selectedStatusVector[i] = selectMode;
+ UpdateSelection();
+}
+
+void CPanel::SelectByType(bool selectMode)
+{
+ int focusedItem = _listView.GetFocusedItem();
+ if (focusedItem < 0)
+ return;
+ int realIndex = GetRealItemIndex(focusedItem);
+ UString name = GetItemName(realIndex);
+ bool isItemFolder = IsItemFolder(realIndex);
+
+ /*
+ UINT32 numItems;
+ _folder->GetNumberOfItems(&numItems);
+ if ((UInt32)_selectedStatusVector.Size() != numItems)
+ throw 11111;
+ */
+
+ if (isItemFolder)
+ {
+ for (int i = 0; i < _selectedStatusVector.Size(); i++)
+ if (IsItemFolder(i) == isItemFolder)
+ _selectedStatusVector[i] = selectMode;
+ }
+ else
+ {
+ int pos = name.ReverseFind(L'.');
+ if (pos < 0)
+ {
+ for (int i = 0; i < _selectedStatusVector.Size(); i++)
+ if (IsItemFolder(i) == isItemFolder && GetItemName(i).ReverseFind(L'.') < 0)
+ _selectedStatusVector[i] = selectMode;
+ }
+ else
+ {
+ UString mask = UString(L'*') + name.Mid(pos);
+ for (int i = 0; i < _selectedStatusVector.Size(); i++)
+ if (IsItemFolder(i) == isItemFolder && CompareWildCardWithName(mask, GetItemName(i)))
+ _selectedStatusVector[i] = selectMode;
+ }
+ }
+ UpdateSelection();
+}
+
+void CPanel::SelectAll(bool selectMode)
+{
+ for (int i = 0; i < _selectedStatusVector.Size(); i++)
+ _selectedStatusVector[i] = selectMode;
+ UpdateSelection();
+}
+
+void CPanel::InvertSelection()
+{
+ if (!_mySelectMode)
+ {
+ int numSelected = 0;
+ for (int i = 0; i < _selectedStatusVector.Size(); i++)
+ if (_selectedStatusVector[i])
+ numSelected++;
+ if (numSelected == 1)
+ {
+ int focused = _listView.GetFocusedItem();
+ if (focused >= 0)
+ {
+ int realIndex = GetRealItemIndex(focused);
+ if (realIndex >= 0)
+ if (_selectedStatusVector[realIndex])
+ _selectedStatusVector[realIndex] = false;
+ }
+ }
+ }
+ for (int i = 0; i < _selectedStatusVector.Size(); i++)
+ _selectedStatusVector[i] = !_selectedStatusVector[i];
+ UpdateSelection();
+}
+
+void CPanel::KillSelection()
+{
+ SelectAll(false);
+ if (!_mySelectMode)
+ {
+ int focused = _listView.GetFocusedItem();
+ if (focused >= 0)
+ _listView.SetItemState(focused, LVIS_SELECTED, LVIS_SELECTED);
+ }
+}
+
+#ifdef _WIN32
+void CPanel::OnLeftClick(LPNMITEMACTIVATE itemActivate)
+{
+ if(itemActivate->hdr.hwndFrom != HWND(_listView))
+ return;
+ // It will be work only for Version 4.71 (IE 4);
+ int indexInList = itemActivate->iItem;
+ if (indexInList < 0)
+ return;
+ if ((itemActivate->uKeyFlags & LVKF_SHIFT) != 0)
+ {
+ // int focusedIndex = _listView.GetFocusedItem();
+ int focusedIndex = _startGroupSelect;
+ if (focusedIndex < 0)
+ return;
+ int startItem = MyMin(focusedIndex, indexInList);
+ int finishItem = MyMax(focusedIndex, indexInList);
+ for (int i = 0; i < _selectedStatusVector.Size(); i++)
+ {
+ int realIndex = GetRealItemIndex(i);
+ if (realIndex == kParentIndex)
+ continue;
+ bool selected = (i >= startItem && i <= finishItem);
+ if (_selectedStatusVector[realIndex] != selected)
+ {
+ _selectedStatusVector[realIndex] = selected;
+ _listView.RedrawItem(i);
+ }
+ }
+ }
+ else
+ {
+ _startGroupSelect = indexInList;
+ if ((itemActivate->uKeyFlags & LVKF_CONTROL) != 0)
+ {
+ int realIndex = GetRealItemIndex(indexInList);
+ if (realIndex != kParentIndex)
+ {
+ _selectedStatusVector[realIndex] = !_selectedStatusVector[realIndex];
+ _listView.RedrawItem(indexInList);
+ }
+ }
+ }
+ return;
+}
+#endif
+
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSort.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSort.cpp
new file mode 100644
index 000000000..5a8f87556
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSort.cpp
@@ -0,0 +1,163 @@
+// PanelSort.cpp
+
+#include "StdAfx.h"
+
+#include "Windows/PropVariant.h"
+
+#include "../../PropID.h"
+
+#include "Panel.h"
+
+using namespace NWindows;
+
+static UString GetExtension(const UString &name)
+{
+ int dotPos = name.ReverseFind(L'.');
+ if (dotPos < 0)
+ return UString();
+ return name.Mid(dotPos);
+}
+
+int CALLBACK CompareItems2(LPARAM lParam1, LPARAM lParam2, LPARAM lpData)
+{
+ if (lpData == 0) // FIXME NULL)
+ return 0;
+ CPanel *panel = (CPanel*)lpData;
+
+ switch(panel->_sortID)
+ {
+ // if (panel->_sortIndex == 0)
+ case kpidName:
+ {
+ const UString name1 = panel->GetItemName((int)lParam1);
+ const UString name2 = panel->GetItemName((int)lParam2);
+ int res = name1.CompareNoCase(name2);
+ /*
+ if (res != 0 || !panel->_flatMode)
+ return res;
+ const UString prefix1 = panel->GetItemPrefix(lParam1);
+ const UString prefix2 = panel->GetItemPrefix(lParam2);
+ return res = prefix1.CompareNoCase(prefix2);
+ */
+ return res;
+ }
+ case kpidNoProperty:
+ {
+ return MyCompare(lParam1, lParam2);
+ }
+ case kpidExtension:
+ {
+ const UString ext1 = GetExtension(panel->GetItemName((int)lParam1));
+ const UString ext2 = GetExtension(panel->GetItemName((int)lParam2));
+ return ext1.CompareNoCase(ext2);
+ }
+ }
+ /*
+ if (panel->_sortIndex == 1)
+ return MyCompare(file1.Size, file2.Size);
+ return ::CompareFileTime(&file1.MTime, &file2.MTime);
+ */
+
+ // PROPID propID = panel->_properties[panel->_sortIndex].ID;
+ PROPID propID = panel->_sortID;
+
+ NCOM::CPropVariant propVariant1, propVariant2;
+ // Name must be first property
+ panel->_folder->GetProperty((UINT32)lParam1, propID, &propVariant1);
+ panel->_folder->GetProperty((UINT32)lParam2, propID, &propVariant2);
+ if (propVariant1.vt != propVariant2.vt)
+ return 0; // It means some BUG
+ if (propVariant1.vt == VT_BSTR)
+ {
+#ifdef _WIN32
+ return _wcsicmp(propVariant1.bstrVal, propVariant2.bstrVal);
+#else
+ return wcscmp(propVariant1.bstrVal, propVariant2.bstrVal); // FIXME _wcsicmp ?
+#endif
+ }
+ return propVariant1.Compare(propVariant2);
+ // return 0;
+}
+
+int CALLBACK CompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData)
+{
+ if (lpData == 0) // FIXME NULL)
+ return 0;
+ if (lParam1 == kParentIndex) return -1;
+ if (lParam2 == kParentIndex) return 1;
+
+ CPanel *panel = (CPanel*)lpData;
+
+ bool isDir1 = panel->IsItemFolder((int)lParam1);
+ bool isDir2 = panel->IsItemFolder((int)lParam2);
+
+ if (isDir1 && !isDir2) return -1;
+ if (isDir2 && !isDir1) return 1;
+
+ int result = CompareItems2(lParam1, lParam2, lpData);
+ return panel->_ascending ? result: (-result);
+}
+
+
+/*
+void CPanel::SortItems(int index)
+{
+ if (index == _sortIndex)
+ _ascending = !_ascending;
+ else
+ {
+ _sortIndex = index;
+ _ascending = true;
+ switch (_properties[_sortIndex].ID)
+ {
+ case kpidSize:
+ case kpidPackedSize:
+ case kpidCTime:
+ case kpidATime:
+ case kpidMTime:
+ _ascending = false;
+ break;
+ }
+ }
+ _listView.SortItems(CompareItems, (LPARAM)this);
+ _listView.EnsureVisible(_listView.GetFocusedItem(), false);
+}
+void CPanel::SortItemsWithPropID(PROPID propID)
+{
+ int index = _properties.FindItemWithID(propID);
+ if (index >= 0)
+ SortItems(index);
+}
+*/
+void CPanel::SortItemsWithPropID(PROPID propID)
+{
+ if (propID == _sortID)
+ _ascending = !_ascending;
+ else
+ {
+ _sortID = propID;
+ _ascending = true;
+ switch (propID)
+ {
+ case kpidSize:
+ case kpidPackSize:
+ case kpidCTime:
+ case kpidATime:
+ case kpidMTime:
+ _ascending = false;
+ break;
+ }
+ }
+ _listView.SortItems(CompareItems, (LPARAM)this);
+ _listView.EnsureVisible(_listView.GetFocusedItem(), false);
+}
+
+
+void CPanel::OnColumnClick(LPNMLISTVIEW info)
+{
+ /*
+ int index = _properties.FindItemWithID(_visibleProperties[info->iSubItem].ID);
+ SortItems(index);
+ */
+ SortItemsWithPropID(_visibleProperties[info->iSubItem].ID);
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSplitFile.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSplitFile.cpp
new file mode 100644
index 000000000..36146d7a4
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PanelSplitFile.cpp
@@ -0,0 +1,528 @@
+// PanelSplitFile.cpp
+
+#include "StdAfx.h"
+
+#include "resource.h"
+
+extern "C"
+{
+ #include "../../../../C/Alloc.h"
+}
+
+#include "Common/Types.h"
+#include "Common/IntToString.h"
+
+// #include "Windows/COM.h"
+#include "Windows/FileIO.h"
+#include "Windows/FileFind.h"
+#include "Windows/Thread.h"
+#include "ProgressDialog2.h"
+#include "SplitDialog.h"
+#include "CopyDialog.h"
+
+#include "../GUI/ExtractRes.h"
+
+#include "SplitUtils.h"
+#include "App.h"
+#include "FormatUtils.h"
+#include "LangUtils.h"
+
+using namespace NWindows;
+
+class CMyBuffer
+{
+ void *_data;
+public:
+ CMyBuffer(): _data(0) {}
+ operator void *() { return _data; }
+ bool Allocate(size_t size)
+ {
+ if (_data != 0)
+ return false;
+ _data = ::MidAlloc(size);
+ return _data != 0;
+ }
+ ~CMyBuffer() { ::MidFree(_data); }
+};
+
+struct CVolSeqName
+{
+ UString UnchangedPart;
+ UString ChangedPart;
+ CVolSeqName(): ChangedPart(L"000") {};
+
+ bool ParseName(const UString &name)
+ {
+ if (name.Right(2) != L"01")
+ return false;
+ int numLetters = 2;
+ while (numLetters < name.Length())
+ {
+ if (name[name.Length() - numLetters - 1] != '0')
+ break;
+ numLetters++;
+ }
+ UnchangedPart = name.Left(name.Length() - numLetters);
+ ChangedPart = name.Right(numLetters);
+ return true;
+ }
+
+ UString GetNextName()
+ {
+ UString newName;
+ int i;
+ int numLetters = ChangedPart.Length();
+ for (i = numLetters - 1; i >= 0; i--)
+ {
+ wchar_t c = ChangedPart[i];
+ if (c == L'9')
+ {
+ c = L'0';
+ newName = c + newName;
+ if (i == 0)
+ newName = UString(L'1') + newName;
+ continue;
+ }
+ c++;
+ newName = c + newName;
+ i--;
+ for (; i >= 0; i--)
+ newName = ChangedPart[i] + newName;
+ break;
+ }
+ ChangedPart = newName;
+ return UnchangedPart + ChangedPart;
+ }
+};
+
+static const UInt32 kBufSize = (1 << 20);
+
+struct CThreadSplit
+{
+ // HRESULT Result;
+ // CPanel *Panel;
+ CProgressDialog *ProgressDialog;
+ UString FilePath;
+ UString VolBasePath;
+ CRecordVector<UInt64> VolumeSizes;
+ UString Error;
+
+ void Process2()
+ {
+ // NCOM::CComInitializer comInitializer;
+ ProgressDialog->WaitCreating();
+ NFile::NIO::CInFile inFile;
+ if (!inFile.Open(FilePath))
+ throw L"Can not open file";
+ NFile::NIO::COutFile outFile;
+ CMyBuffer bufferObject;
+ if (!bufferObject.Allocate(kBufSize))
+ throw L"Can not allocate buffer";
+ Byte *buffer = (Byte *)(void *)bufferObject;
+ UInt64 curVolSize = 0;
+ CVolSeqName seqName;
+ UInt64 length;
+ if (!inFile.GetLength(length))
+ throw "error";
+
+ ProgressDialog->ProgressSynch.SetProgress(length, 0);
+ UInt64 pos = 0;
+
+ int volIndex = 0;
+
+ for (;;)
+ {
+ UInt64 volSize;
+ if (volIndex < VolumeSizes.Size())
+ volSize = VolumeSizes[volIndex];
+ else
+ volSize = VolumeSizes.Back();
+
+ UInt32 needSize = (UInt32)(MyMin((UInt64)kBufSize, volSize - curVolSize));
+ UInt32 processedSize;
+ if (!inFile.Read(buffer, needSize, processedSize))
+ throw L"Can not read input file";
+ if (processedSize == 0)
+ break;
+ needSize = processedSize;
+ if (curVolSize == 0)
+ {
+ UString name = VolBasePath;
+ name += L".";
+ name += seqName.GetNextName();
+ if (!outFile.Create(name, false))
+ throw L"Can not create output file";
+ ProgressDialog->ProgressSynch.SetCurrentFileName(name);
+ }
+ if (!outFile.Write(buffer, needSize, processedSize))
+ throw L"Can not write output file";
+ if (needSize != processedSize)
+ throw L"Can not write output file";
+ curVolSize += processedSize;
+ if (curVolSize == volSize)
+ {
+ outFile.Close();
+ if (volIndex < VolumeSizes.Size())
+ volIndex++;
+ curVolSize = 0;
+ }
+ pos += processedSize;
+ HRESULT res = ProgressDialog->ProgressSynch.SetPosAndCheckPaused(pos);
+ if (res != S_OK)
+ return;
+ }
+ }
+ void Process()
+ {
+ try { Process2(); }
+ catch(const wchar_t *s) { Error = s; }
+ catch(...) { Error = L"Error"; }
+ ProgressDialog->MyClose();
+ }
+
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
+ {
+ ((CThreadSplit *)param)->Process();
+ return 0;
+ }
+};
+
+void CApp::Split()
+{
+ int srcPanelIndex = GetFocusedPanelIndex();
+ CPanel &srcPanel = Panels[srcPanelIndex];
+ if (!srcPanel.IsFSFolder())
+ {
+ srcPanel.MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return;
+ }
+ CRecordVector<UInt32> indices;
+ srcPanel.GetOperatedItemIndices(indices);
+ if (indices.IsEmpty())
+ return;
+ if (indices.Size() != 1)
+ {
+ srcPanel.MessageBoxErrorLang(IDS_SELECT_ONE_FILE, 0x03020A02);
+ return;
+ }
+ int index = indices[0];
+ if (srcPanel.IsItemFolder(index))
+ {
+ srcPanel.MessageBoxErrorLang(IDS_SELECT_ONE_FILE, 0x03020A02);
+ return;
+ }
+ const UString itemName = srcPanel.GetItemName(index);
+
+ UString srcPath = srcPanel._currentFolderPrefix + srcPanel.GetItemPrefix(index);
+ UString path = srcPath;
+ int destPanelIndex = (NumPanels <= 1) ? srcPanelIndex : (1 - srcPanelIndex);
+ CPanel &destPanel = Panels[destPanelIndex];
+ if (NumPanels > 1)
+ if (destPanel.IsFSFolder())
+ path = destPanel._currentFolderPrefix;
+ CSplitDialog splitDialog;
+ splitDialog.FilePath = srcPanel.GetItemRelPath(index);
+ splitDialog.Path = path;
+ if (splitDialog.Create(srcPanel.GetParent()) == IDCANCEL)
+ return;
+
+ NFile::NFind::CFileInfoW fileInfo;
+ if (!NFile::NFind::FindFile(srcPath + itemName, fileInfo))
+ {
+ srcPanel.MessageBoxMyError(L"Can not find file");
+ return;
+ }
+ if (fileInfo.Size <= splitDialog.VolumeSizes.Front())
+ {
+ srcPanel.MessageBoxErrorLang(IDS_SPLIT_VOL_MUST_BE_SMALLER, 0x03020522);
+ return;
+ }
+ const UInt64 numVolumes = GetNumberOfVolumes(fileInfo.Size, splitDialog.VolumeSizes);
+ if (numVolumes >= 100)
+ {
+ wchar_t s[32];
+ ConvertUInt64ToString(numVolumes, s);
+ if (::MessageBoxW(srcPanel, MyFormatNew(IDS_SPLIT_CONFIRM_MESSAGE, 0x03020521, s),
+ LangString(IDS_SPLIT_CONFIRM_TITLE, 0x03020520),
+ MB_YESNOCANCEL | MB_ICONQUESTION | MB_TASKMODAL) != IDYES)
+ return;
+ }
+
+ path = splitDialog.Path;
+ NFile::NName::NormalizeDirPathPrefix(path);
+ if (!NFile::NDirectory::CreateComplexDirectory(path))
+ {
+ srcPanel.MessageBoxMyError(MyFormatNew(IDS_CANNOT_CREATE_FOLDER, 0x02000603, path));
+ return;
+ }
+
+ CThreadSplit spliter;
+ // spliter.Panel = this;
+
+ {
+ CProgressDialog progressDialog;
+ spliter.ProgressDialog = &progressDialog;
+
+ UString progressWindowTitle = LangString(IDS_APP_TITLE, 0x03000000);
+ UString title = LangString(IDS_SPLITTING, 0x03020510);
+
+ progressDialog.MainWindow = _window;
+ progressDialog.MainTitle = progressWindowTitle;
+ progressDialog.MainAddTitle = title + UString(L" ");
+ progressDialog.ProgressSynch.SetTitleFileName(itemName);
+
+
+ spliter.FilePath = srcPath + itemName;
+ spliter.VolBasePath = path + itemName;
+ spliter.VolumeSizes = splitDialog.VolumeSizes;
+
+ // if (splitDialog.VolumeSizes.Size() == 0) return;
+
+ // CPanel::CDisableTimerProcessing disableTimerProcessing1(srcPanel);
+ // CPanel::CDisableTimerProcessing disableTimerProcessing2(destPanel);
+
+ NWindows::CThread thread;
+ if (thread.Create(CThreadSplit::MyThreadFunction, &spliter) != S_OK)
+ throw 271824;
+ progressDialog.Create(title, _window);
+ }
+ RefreshTitleAlways();
+
+
+ if (!spliter.Error.IsEmpty())
+ srcPanel.MessageBoxMyError(spliter.Error);
+ // disableTimerProcessing1.Restore();
+ // disableTimerProcessing2.Restore();
+ // srcPanel.SetFocusToList();
+ // srcPanel.RefreshListCtrlSaveFocused();
+}
+
+
+struct CThreadCombine
+{
+ CProgressDialog *ProgressDialog;
+
+ UString InputDirPrefix;
+ UStringVector Names;
+ UString OutputPath;
+ UInt64 TotalSize;
+
+ UString Error;
+ HRESULT Res;
+
+ void Process2()
+ {
+ NFile::NIO::COutFile outFile;
+ if (!outFile.Create(OutputPath, false))
+ {
+ Error = L"Can create open output file:\n" + OutputPath;
+ return;
+ }
+
+ ProgressDialog->ProgressSynch.SetProgress(TotalSize, 0);
+
+ CMyBuffer bufferObject;
+ if (!bufferObject.Allocate(kBufSize))
+ throw L"Can not allocate buffer";
+ Byte *buffer = (Byte *)(void *)bufferObject;
+ UInt64 pos = 0;
+ for (int i = 0; i < Names.Size(); i++)
+ {
+ NFile::NIO::CInFile inFile;
+ const UString nextName = InputDirPrefix + Names[i];
+ if (!inFile.Open(nextName))
+ {
+ Error = L"Can not open input file:\n" + nextName;
+ return;
+ }
+ ProgressDialog->ProgressSynch.SetCurrentFileName(nextName);
+ for (;;)
+ {
+ UInt32 processedSize;
+ if (!inFile.Read(buffer, kBufSize, processedSize))
+ throw L"Can not read input file";
+ if (processedSize == 0)
+ break;
+ UInt32 needSize = processedSize;
+ if (!outFile.Write(buffer, needSize, processedSize) || needSize != processedSize)
+ throw L"Can not write output file";
+ pos += processedSize;
+ Res = ProgressDialog->ProgressSynch.SetPosAndCheckPaused(pos);
+ if (Res != S_OK)
+ return;
+ }
+ }
+ }
+
+ void Process()
+ {
+ Res = S_OK;
+ ProgressDialog->WaitCreating();
+ try { Process2(); }
+ catch(const wchar_t *s) { Error = s; }
+ catch(...) { Error = L"Error";}
+ ProgressDialog->MyClose();
+ }
+
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
+ {
+ ((CThreadCombine *)param)->Process();
+ return 0;
+ }
+};
+
+extern void AddValuePair2(UINT resourceID, UInt32 langID, UInt64 num, UInt64 size, UString &s);
+
+static void AddInfoFileName(const UString &name, UString &dest)
+{
+ dest += L"\n ";
+ dest += name;
+}
+
+void CApp::Combine()
+{
+ int srcPanelIndex = GetFocusedPanelIndex();
+ CPanel &srcPanel = Panels[srcPanelIndex];
+ if (!srcPanel.IsFSFolder())
+ {
+ srcPanel.MessageBoxErrorLang(IDS_OPERATION_IS_NOT_SUPPORTED, 0x03020208);
+ return;
+ }
+ CRecordVector<UInt32> indices;
+ srcPanel.GetOperatedItemIndices(indices);
+ if (indices.IsEmpty())
+ return;
+ int index = indices[0];
+ if (indices.Size() != 1 || srcPanel.IsItemFolder(index))
+ {
+ srcPanel.MessageBoxErrorLang(IDS_COMBINE_SELECT_ONE_FILE, 0x03020620);
+ return;
+ }
+ const UString itemName = srcPanel.GetItemName(index);
+
+ UString srcPath = srcPanel._currentFolderPrefix + srcPanel.GetItemPrefix(index);
+ UString path = srcPath;
+ int destPanelIndex = (NumPanels <= 1) ? srcPanelIndex : (1 - srcPanelIndex);
+ CPanel &destPanel = Panels[destPanelIndex];
+ if (NumPanels > 1)
+ if (destPanel.IsFSFolder())
+ path = destPanel._currentFolderPrefix;
+
+ CVolSeqName volSeqName;
+ if (!volSeqName.ParseName(itemName))
+ {
+ srcPanel.MessageBoxErrorLang(IDS_COMBINE_CANT_DETECT_SPLIT_FILE, 0x03020621);
+ return;
+ }
+
+ CThreadCombine combiner;
+
+ UString nextName = itemName;
+ combiner.TotalSize = 0;
+ for (;;)
+ {
+ NFile::NFind::CFileInfoW fileInfo;
+ if (!NFile::NFind::FindFile(srcPath + nextName, fileInfo) || fileInfo.IsDir())
+ break;
+ combiner.Names.Add(nextName);
+ combiner.TotalSize += fileInfo.Size;
+ nextName = volSeqName.GetNextName();
+ }
+ if (combiner.Names.Size() == 1)
+ {
+ srcPanel.MessageBoxErrorLang(IDS_COMBINE_CANT_FIND_MORE_THAN_ONE_PART, 0x03020622);
+ return;
+ }
+
+ if (combiner.TotalSize == 0)
+ {
+ srcPanel.MessageBoxMyError(L"No data");
+ return;
+ }
+
+ UString info;
+ AddValuePair2(IDS_FILES_COLON, 0x02000320, combiner.Names.Size(), combiner.TotalSize, info);
+
+ info += L"\n";
+ info += srcPath;
+
+ int i;
+ for (i = 0; i < combiner.Names.Size() && i < 2; i++)
+ AddInfoFileName(combiner.Names[i], info);
+ if (i != combiner.Names.Size())
+ {
+ if (i + 1 != combiner.Names.Size())
+ AddInfoFileName(L"...", info);
+ AddInfoFileName(combiner.Names.Back(), info);
+ }
+
+ {
+ CCopyDialog copyDialog;
+ copyDialog.Value = path;
+ copyDialog.Title = LangString(IDS_COMBINE, 0x03020600);
+ copyDialog.Title += ' ';
+ copyDialog.Title += srcPanel.GetItemRelPath(index);
+ copyDialog.Static = LangString(IDS_COMBINE_TO, 0x03020601);
+ copyDialog.Info = info;
+ if (copyDialog.Create(srcPanel.GetParent()) == IDCANCEL)
+ return;
+ path = copyDialog.Value;
+ }
+
+ NFile::NName::NormalizeDirPathPrefix(path);
+ if (!NFile::NDirectory::CreateComplexDirectory(path))
+ {
+ srcPanel.MessageBoxMyError(MyFormatNew(IDS_CANNOT_CREATE_FOLDER, 0x02000603, path));
+ return;
+ }
+
+ UString outName = volSeqName.UnchangedPart;
+ while (!outName.IsEmpty())
+ {
+ int lastIndex = outName.Length() - 1;
+ if (outName[lastIndex] != L'.')
+ break;
+ outName.Delete(lastIndex);
+ }
+ if (outName.IsEmpty())
+ outName = L"file";
+
+ NFile::NFind::CFileInfoW fileInfo;
+ UString destFilePath = path + outName;
+ combiner.OutputPath = destFilePath;
+ if (NFile::NFind::FindFile(destFilePath, fileInfo))
+ {
+ srcPanel.MessageBoxMyError(MyFormatNew(IDS_FILE_EXIST, 0x03020A04, destFilePath));
+ return;
+ }
+
+ {
+ CProgressDialog progressDialog;
+ combiner.ProgressDialog = &progressDialog;
+
+ UString progressWindowTitle = LangString(IDS_APP_TITLE, 0x03000000);
+ UString title = LangString(IDS_COMBINING, 0x03020610);
+
+ progressDialog.MainWindow = _window;
+ progressDialog.MainTitle = progressWindowTitle;
+ progressDialog.MainAddTitle = title + UString(L" ");
+
+ combiner.InputDirPrefix = srcPath;
+
+ // CPanel::CDisableTimerProcessing disableTimerProcessing1(srcPanel);
+ // CPanel::CDisableTimerProcessing disableTimerProcessing2(destPanel);
+
+ NWindows::CThread thread;
+ if (thread.Create(CThreadCombine::MyThreadFunction, &combiner) != S_OK)
+ throw 271824;
+ progressDialog.Create(title, _window);
+ }
+ RefreshTitleAlways();
+
+ if (!combiner.Error.IsEmpty())
+ srcPanel.MessageBoxMyError(combiner.Error);
+ // disableTimerProcessing1.Restore();
+ // disableTimerProcessing2.Restore();
+ // srcPanel.SetFocusToList();
+ // srcPanel.RefreshListCtrlSaveFocused();
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog.cpp
new file mode 100644
index 000000000..94e8219d4
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog.cpp
@@ -0,0 +1,50 @@
+// PasswordDialog.cpp
+
+#include "StdAfx.h"
+#include "PasswordDialog.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+#ifdef LANG
+static CIDLangPair kIDLangPairs[] =
+{
+ { IDC_STATIC_PASSWORD_HEADER, 0x02000B01 },
+ { IDC_CHECK_PASSWORD_SHOW, 0x02000B02 },
+
+};
+#endif
+
+
+bool CPasswordDialog::OnInit()
+{
+ #ifdef LANG
+ LangSetWindowText(HWND(*this), 0x02000B00);
+ LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
+ #endif
+ _passwordControl.Attach(GetItem(IDC_EDIT_PASSWORD));
+ _passwordControl.SetText(Password);
+ _passwordControl.SetPasswordChar(TEXT('*'));
+ return CModalDialog::OnInit();
+}
+
+bool CPasswordDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ if (buttonID == IDC_CHECK_PASSWORD_SHOW)
+ {
+ _passwordControl.SetPasswordChar((IsButtonChecked(
+ IDC_CHECK_PASSWORD_SHOW) == BST_CHECKED) ? 0: TEXT('*'));
+ UString password;
+ _passwordControl.GetText(password);
+ _passwordControl.SetText(password);
+ return true;
+ }
+ return CDialog::OnButtonClicked(buttonID, buttonHWND);
+}
+
+void CPasswordDialog::OnOK()
+{
+ _passwordControl.GetText(Password);
+ CModalDialog::OnOK();
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog.h
new file mode 100644
index 000000000..e5a960731
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog.h
@@ -0,0 +1,21 @@
+// PasswordDialog.h
+
+#ifndef __PASSWORDDIALOG_H
+#define __PASSWORDDIALOG_H
+
+#include "Windows/Control/Dialog.h"
+#include "Windows/Control/Edit.h"
+#include "PasswordDialogRes.h"
+
+class CPasswordDialog: public NWindows::NControl::CModalDialog
+{
+ NWindows::NControl::CEdit _passwordControl;
+ virtual void OnOK();
+ virtual bool OnInit();
+ virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
+public:
+ UString Password;
+ INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_DIALOG_PASSWORD, parentWindow); }
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialogRes.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialogRes.h
new file mode 100644
index 000000000..e0b426614
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialogRes.h
@@ -0,0 +1,4 @@
+#define IDD_DIALOG_PASSWORD 501
+#define IDC_STATIC_PASSWORD_HEADER 1000
+#define IDC_EDIT_PASSWORD 1001
+#define IDC_CHECK_PASSWORD_SHOW 1002
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog_rc.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog_rc.cpp
new file mode 100644
index 000000000..533919868
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PasswordDialog_rc.cpp
@@ -0,0 +1,63 @@
+// PasswordDialog.cpp
+
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+// for all others, include the necessary headers (this file is usually all you
+// need because it includes almost all "standard" wxWidgets headers)
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "Windows/Control/DialogImpl.h"
+
+#include "PasswordDialogRes.h"
+
+class CPasswordDialogImpl : public NWindows::NControl::CModalDialogImpl
+{
+ public:
+ CPasswordDialogImpl(NWindows::NControl::CModalDialog *dialog,wxWindow * parent,int id) : CModalDialogImpl(dialog, parent, id, wxT("Enter password"))
+ {
+ bool bShowPassword = false;
+
+ wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
+
+ {
+ wxStaticBoxSizer *passwdSizer = new wxStaticBoxSizer(new wxStaticBox(this,IDC_STATIC_PASSWORD_HEADER,_T("&Enter password:")),wxVERTICAL);
+
+ wxTextCtrl *TxtPasswd = new wxTextCtrl(this, IDC_EDIT_PASSWORD, L"",
+ wxDefaultPosition, wxSize(260,-1), bShowPassword?wxTE_LEFT:wxTE_PASSWORD );
+
+ wxCheckBox *ChkShowPasswd = new wxCheckBox(this, IDC_CHECK_PASSWORD_SHOW, wxT("&Show password"));
+
+ ChkShowPasswd->SetValue(bShowPassword);
+ passwdSizer->Add(TxtPasswd, 0, wxALL, 5);
+ passwdSizer->Add(ChkShowPasswd, 0, wxALL, 5);
+
+ topsizer->Add(passwdSizer, 0, wxALL, 5);
+ }
+ topsizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxALL|wxEXPAND, 5);
+
+ this->OnInit();
+
+ SetSizer(topsizer); // use the sizer for layout
+ topsizer->SetSizeHints(this); // set size hints to honour minimum size
+ }
+private:
+ // Any class wishing to process wxWindows events must use this macro
+ DECLARE_EVENT_TABLE()
+};
+
+REGISTER_DIALOG(IDD_DIALOG_PASSWORD,CPasswordDialog,0)
+
+BEGIN_EVENT_TABLE(CPasswordDialogImpl, wxDialog)
+ EVT_BUTTON(wxID_ANY, CModalDialogImpl::OnAnyButton)
+ EVT_CHECKBOX(wxID_ANY, CModalDialogImpl::OnAnyButton)
+END_EVENT_TABLE()
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PluginInterface.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PluginInterface.h
new file mode 100644
index 000000000..905aff9a4
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PluginInterface.h
@@ -0,0 +1,42 @@
+// PluginInterface.h
+
+#ifndef __PLUGININTERFACE_H
+#define __PLUGININTERFACE_H
+
+#include "Common/MyString.h"
+
+// {23170F69-40C1-278D-0000-000100010000}
+DEFINE_GUID(IID_IInitContextMenu,
+0x23170F69, 0x40C1, 0x278D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00);
+MIDL_INTERFACE("23170F69-40C1-278D-0000-000100010000")
+IInitContextMenu: public IUnknown
+{
+public:
+ STDMETHOD(InitContextMenu)(const wchar_t *aFolder, const wchar_t **aNames, UINT32 aNumFiles) PURE;
+
+};
+
+// {23170F69-40C1-278D-0000-000100020100}
+DEFINE_GUID(IID_IPluginOptionsCallback,
+0x23170F69, 0x40C1, 0x278D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00);
+MIDL_INTERFACE("23170F69-40C1-278D-0000-000100020000")
+IPluginOptionsCallback: public IUnknown
+{
+public:
+ STDMETHOD(GetProgramFolderPath)(BSTR *value) PURE;
+ STDMETHOD(GetProgramPath)(BSTR *value) PURE;
+ STDMETHOD(GetRegistryCUPath)(BSTR *value) PURE;
+};
+
+// {23170F69-40C1-278D-0000-000100020000}
+DEFINE_GUID(IID_IPluginOptions,
+0x23170F69, 0x40C1, 0x278D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00);
+MIDL_INTERFACE("23170F69-40C1-278D-0000-000100020000")
+IPluginOptions: public IUnknown
+{
+public:
+ STDMETHOD(PluginOptions)(HWND hWnd, IPluginOptionsCallback *callback) PURE;
+ // STDMETHOD(GetFileExtensions)(BSTR *extensions) PURE;
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PluginLoader.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PluginLoader.h
new file mode 100644
index 000000000..f48c9e97a
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PluginLoader.h
@@ -0,0 +1,32 @@
+// PluginLoader.h
+
+#ifndef __PLUGINLOADER_H
+#define __PLUGINLOADER_H
+
+#include "Windows/DLL.h"
+
+typedef UINT32 (WINAPI * CreateObjectPointer)(
+ const GUID *clsID,
+ const GUID *interfaceID,
+ void **outObject);
+
+class CPluginLibrary: public NWindows::NDLL::CLibrary
+{
+public:
+ HRESULT CreateManager(REFGUID clsID, IFolderManager **manager)
+ {
+ CreateObjectPointer createObject = (CreateObjectPointer)
+ GetProcAddress("CreateObject");
+ if (createObject == NULL)
+ return GetLastError();
+ return createObject(&clsID, &IID_IFolderManager, (void **)manager);
+ }
+ HRESULT LoadAndCreateManager(LPCWSTR filePath, REFGUID clsID, IFolderManager **manager)
+ {
+ if (!Load(filePath))
+ return GetLastError();
+ return CreateManager(clsID, manager);
+ }
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgramLocation.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgramLocation.cpp
new file mode 100644
index 000000000..ea8afd558
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgramLocation.cpp
@@ -0,0 +1,20 @@
+// ProgramLocation.h
+
+#include "StdAfx.h"
+
+#include "ProgramLocation.h"
+
+// #include "Windows/FileName.h"
+#include "Common/StringConvert.h"
+
+
+bool GetProgramFolderPath(UString &folder)
+{
+ const char *p7zip_home_dir = getenv("P7ZIP_HOME_DIR");
+ if (p7zip_home_dir == 0) p7zip_home_dir="./";
+
+ folder = MultiByteToUnicodeString(p7zip_home_dir);
+
+ return true;
+}
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgramLocation.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgramLocation.h
new file mode 100644
index 000000000..38317b45f
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgramLocation.h
@@ -0,0 +1,10 @@
+// ProgramLocation.h
+
+#ifndef __PROGRAMLOCATION_H
+#define __PROGRAMLOCATION_H
+
+#include "Common/MyString.h"
+
+bool GetProgramFolderPath(UString &folder); // normalized
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2.cpp
new file mode 100644
index 000000000..87a1521d0
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2.cpp
@@ -0,0 +1,507 @@
+// ProgressDialog2.cpp
+
+#include "StdAfx.h"
+
+#include "Common/IntToString.h"
+
+#include "ProgressDialog2.h"
+
+using namespace NWindows;
+
+static const UINT_PTR kTimerID = 3;
+static const UINT kTimerElapse = 100;
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+#ifdef LANG
+static CIDLangPair kIDLangPairs[] =
+{
+ { IDCANCEL, 0x02000C00 },
+ { IDC_PROGRESS_ELAPSED, 0x02000C01 },
+ { IDC_PROGRESS_REMAINING, 0x02000C02 },
+ { IDC_PROGRESS_TOTAL, 0x02000C03 },
+ { IDC_PROGRESS_SPEED, 0x02000C04 },
+ { IDC_PROGRESS_UNPACKED, 0x02000C05 },
+ { IDC_PROGRESS_PACKED, 0x02000323 },
+ { IDC_PROGRESS_RATIO, 0x02000C06 },
+ { IDC_PROGRESS_SPEED, 0x02000C04 },
+ { IDC_PROGRESS_FILES, 0x02000320 },
+ { IDC_BUTTON_PROGRESS_PRIORITY, 0x02000C10 },
+ { IDC_BUTTON_PAUSE, 0x02000C12 },
+ { IDCANCEL, 0x02000711 },
+};
+#endif
+
+HRESULT CProgressSynch::ProcessStopAndPause()
+{
+ for (;;)
+ {
+ if (GetStopped())
+ return E_ABORT;
+ if (!GetPaused())
+ break;
+ ::Sleep(100);
+ }
+ return S_OK;
+}
+
+HRESULT CProgressSynch::SetPosAndCheckPaused(UInt64 completed)
+{
+ RINOK(ProcessStopAndPause());
+ SetPos(completed);
+ return S_OK;
+}
+
+#ifndef _SFX
+CProgressDialog::~CProgressDialog()
+{
+ AddToTitle(L"");
+}
+void CProgressDialog::AddToTitle(LPCWSTR s)
+{
+ if (MainWindow != 0)
+ {
+ CWindow window(MainWindow);
+ window.SetText(s + UString(MainTitle));
+ }
+}
+
+static const int kTitleFileNameSizeLimit = 40;
+static const int kCurrentFileNameSizeLimit = 82;
+
+static void ReduceString(UString &s, int size)
+{
+ if (s.Length() > size)
+ s = s.Left(size / 2) + UString(L" ... ") + s.Right(size / 2);
+}
+#endif
+
+bool CProgressDialog::OnInit()
+{
+ _range = (UInt64)(Int64)(-1);
+ _prevPercentValue = UInt32(-1);
+ _prevElapsedSec = UInt32(-1);
+ _prevRemainingSec = UInt32(-1);
+ _prevSpeed = UInt32(-1);
+ _prevMode = kSpeedBytes;
+ _prevTime = ::GetTickCount();
+ _elapsedTime = 0;
+ _foreground = true;
+
+ #ifdef LANG
+ // LangSetWindowText(HWND(*this), 0x02000C00);
+ LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
+ #endif
+
+
+ CWindow window(GetItem(IDC_BUTTON_PROGRESS_PRIORITY));
+ window.GetText(backgroundString);
+ backgroundedString = backgroundString;
+ backgroundedString.Replace(L"&", L"");
+
+ window = GetItem(IDC_BUTTON_PAUSE);
+ window.GetText(pauseString);
+
+ foregroundString = LangString(IDS_PROGRESS_FOREGROUND, 0x02000C11);
+ continueString = LangString(IDS_PROGRESS_CONTINUE, 0x02000C13);
+ pausedString = LangString(IDS_PROGRESS_PAUSED, 0x02000C20);
+
+ m_ProgressBar.Attach(GetItem(IDC_PROGRESS1));
+ _timer = SetTimer(kTimerID, kTimerElapse);
+ _dialogCreatedEvent.Set();
+ SetText(_title);
+ SetPauseText();
+ SetPriorityText();
+ return CModalDialog::OnInit();
+}
+
+void CProgressDialog::OnCancel()
+{
+ ProgressSynch.SetStopped(true);
+}
+
+static void ConvertSizeToString(UInt64 value, wchar_t *s)
+{
+ const wchar_t *kModif = L" KM";
+ for (int i = 0; ; i++)
+ if (i == 2 || value < (UInt64(10000) << (i * 10)))
+ {
+ ConvertUInt64ToString(value >> (i * 10), s);
+ s += wcslen(s);
+ *s++ = ' ';
+ if (i != 0)
+ *s++ = kModif[i];
+ *s++ = L'B';
+ *s++ = L'\0';
+ return;
+ }
+}
+
+void CProgressDialog::SetRange(UInt64 range)
+{
+ _range = range;
+ _previousPos = (UInt64)(Int64)-1;
+ _converter.Init(range);
+ m_ProgressBar.SetRange32(0, _converter.Count(range)); // Test it for 100%
+}
+
+void CProgressDialog::SetPos(UInt64 pos)
+{
+ bool redraw = true;
+ if (pos < _range && pos > _previousPos)
+ {
+ if (pos - _previousPos < (_range >> 10))
+ redraw = false;
+ }
+ if(redraw)
+ {
+ m_ProgressBar.SetPos(_converter.Count(pos)); // Test it for 100%
+ _previousPos = pos;
+ }
+}
+
+static void GetTimeString(UInt64 timeValue, TCHAR *s)
+{
+ wsprintf(s, TEXT("%02d:%02d:%02d"),
+ UInt32(timeValue / 3600),
+ UInt32((timeValue / 60) % 60),
+ UInt32(timeValue % 60));
+}
+
+void CProgressDialog::ShowSize(int id, UInt64 value)
+{
+ wchar_t s[40];
+ s[0] = 0;
+ if (value != (UInt64)(Int64)-1)
+ ConvertSizeToString(value, s);
+ SetItemText(id, s);
+}
+
+bool CProgressDialog::OnTimer(WPARAM /* timerID */, LPARAM /* callback */)
+{
+ if (ProgressSynch.GetPaused())
+ return true;
+ UInt64 total, completed, totalFiles, completedFiles, inSize, outSize;
+ bool bytesProgressMode;
+ ProgressSynch.GetProgress(total, completed, totalFiles, completedFiles, inSize, outSize, bytesProgressMode);
+
+ UInt32 curTime = ::GetTickCount();
+
+ UInt64 progressTotal = bytesProgressMode ? total : totalFiles;
+ UInt64 progressCompleted = bytesProgressMode ? completed : completedFiles;
+
+ if (progressTotal != _range)
+ SetRange(progressTotal);
+ if (progressTotal == (UInt64)(Int64)-1)
+ {
+ SetPos(0);
+ SetRange(progressCompleted);
+ }
+ else
+ SetPos(progressCompleted);
+
+ wchar_t s[32] = { 0 };
+ if (total != (UInt64)(Int64)-1)
+ ConvertSizeToString(total, s);
+ SetItemText(IDC_PROGRESS_TOTAL_VALUE, s);
+
+ _elapsedTime += (curTime - _prevTime);
+ _prevTime = curTime;
+
+ UInt32 elapsedSec = _elapsedTime / 1000;
+
+ bool elapsedChanged = false;
+ if (elapsedSec != _prevElapsedSec)
+ {
+ TCHAR s[40];
+ GetTimeString(elapsedSec, s);
+ SetItemText(IDC_PROGRESS_ELAPSED_VALUE, s);
+ _prevElapsedSec = elapsedSec;
+ elapsedChanged = true;
+ }
+
+ if (elapsedChanged)
+ {
+ if (completed != 0)
+ {
+
+ if (total == (UInt64)(Int64)-1)
+ {
+ SetItemText(IDC_PROGRESS_REMAINING_VALUE, L"");
+ }
+ else
+ {
+ UInt64 remainingTime = 0;
+ if (completed < total)
+ remainingTime = _elapsedTime * (total - completed) / completed;
+ UInt64 remainingSec = remainingTime / 1000;
+ if (remainingSec != _prevRemainingSec)
+ {
+ TCHAR s[40];
+ GetTimeString(remainingSec, s);
+ SetItemText(IDC_PROGRESS_REMAINING_VALUE, s);
+ _prevRemainingSec = remainingSec;
+ }
+ }
+ // if (elapsedChanged)
+ {
+ UInt32 elapsedTime = (_elapsedTime == 0) ? 1 : _elapsedTime;
+ UInt64 speedB = (completed * 1000) / elapsedTime;
+ UInt64 speedKB = speedB / 1024;
+ UInt64 speedMB = speedKB / 1024;
+ const UInt32 kLimit1 = 10;
+ TCHAR s[40];
+ bool needRedraw = false;
+ if (speedMB >= kLimit1)
+ {
+ if (_prevMode != kSpeedMBytes || speedMB != _prevSpeed)
+ {
+ ConvertUInt64ToString(speedMB, s);
+ lstrcat(s, TEXT(" MB/s"));
+ _prevMode = kSpeedMBytes;
+ _prevSpeed = speedMB;
+ needRedraw = true;
+ }
+ }
+ else if (speedKB >= kLimit1)
+ {
+ if (_prevMode != kSpeedKBytes || speedKB != _prevSpeed)
+ {
+ ConvertUInt64ToString(speedKB, s);
+ lstrcat(s, TEXT(" KB/s"));
+ _prevMode = kSpeedKBytes;
+ _prevSpeed = speedKB;
+ needRedraw = true;
+ }
+ }
+ else
+ {
+ if (_prevMode != kSpeedBytes || speedB != _prevSpeed)
+ {
+ ConvertUInt64ToString(speedB, s);
+ lstrcat(s, TEXT(" B/s"));
+ _prevMode = kSpeedBytes;
+ _prevSpeed = speedB;
+ needRedraw = true;
+ }
+ }
+ if (needRedraw)
+ SetItemText(IDC_PROGRESS_SPEED_VALUE, s);
+ }
+ }
+
+ if (total == 0)
+ total = 1;
+ UInt32 percentValue = (UInt32)(completed * 100 / total);
+ UString titleName;
+ ProgressSynch.GetTitleFileName(titleName);
+ if (percentValue != _prevPercentValue || _prevTitleName != titleName)
+ {
+ _prevPercentValue = percentValue;
+ SetTitleText();
+ _prevTitleName = titleName;
+ }
+
+ TCHAR s[64];
+ ConvertUInt64ToString(completedFiles, s);
+ if (totalFiles != (UInt64)(Int64)-1)
+ {
+ lstrcat(s, TEXT(" / "));
+ ConvertUInt64ToString(totalFiles, s + lstrlen(s));
+ }
+
+ SetItemText(IDC_PROGRESS_FILES_VALUE, s);
+
+ const UInt64 packSize = CompressingMode ? outSize : inSize;
+ const UInt64 unpackSize = CompressingMode ? inSize : outSize;
+
+ if (unpackSize == (UInt64)(Int64)-1 && packSize == (UInt64)(Int64)-1)
+ {
+ ShowSize(IDC_PROGRESS_UNPACKED_VALUE, completed);
+ SetItemText(IDC_PROGRESS_PACKED_VALUE, L"");
+ }
+ else
+ {
+ ShowSize(IDC_PROGRESS_UNPACKED_VALUE, unpackSize);
+ ShowSize(IDC_PROGRESS_PACKED_VALUE, packSize);
+
+ if (packSize != (UInt64)(Int64)-1 && unpackSize != (UInt64)(Int64)-1 && unpackSize != 0)
+ {
+ UInt64 ratio = packSize * 100 / unpackSize;
+ ConvertUInt64ToString(ratio, s);
+ lstrcat(s, TEXT("%"));
+ SetItemText(IDC_PROGRESS_RATIO_VALUE, s);
+ }
+ }
+ }
+
+
+ UString fileName;
+ ProgressSynch.GetCurrentFileName(fileName);
+ if (_prevFileName != fileName)
+ {
+ int slashPos = fileName.ReverseFind(WCHAR_PATH_SEPARATOR);
+ UString s1, s2;
+ if (slashPos >= 0)
+ {
+ s1 = fileName.Left(slashPos + 1);
+ s2 = fileName.Mid(slashPos + 1);
+ }
+ else
+ s2 = fileName;
+ ReduceString(s1, kCurrentFileNameSizeLimit);
+ ReduceString(s2, kCurrentFileNameSizeLimit);
+ UString s = s1 + L"\n" + s2;
+ SetItemText(IDC_PROGRESS_FILE_NAME, s);
+ _prevFileName == fileName;
+ }
+
+ return true;
+}
+
+
+////////////////////
+// CU64ToI32Converter
+
+static const UInt64 kMaxIntValue = 0x7FFFFFFF;
+
+void CU64ToI32Converter::Init(UInt64 range)
+{
+ _numShiftBits = 0;
+ while(range > kMaxIntValue)
+ {
+ range >>= 1;
+ _numShiftBits++;
+ }
+}
+
+int CU64ToI32Converter::Count(UInt64 aValue)
+{
+ return int(aValue >> _numShiftBits);
+}
+
+const UINT CProgressDialog::kCloseMessage = WM_USER + 1;
+
+bool CProgressDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch(message)
+ {
+ case kCloseMessage:
+ {
+ KillTimer(_timer);
+ _timer = 0;
+ End(0);
+ return true;
+ }
+ case WM_SETTEXT:
+ {
+ if (_timer == 0)
+ return true;
+ }
+ }
+ return CModalDialog::OnMessage(message, wParam, lParam);
+}
+
+void CProgressDialog::SetTitleText()
+{
+ UString title;
+ if (ProgressSynch.GetPaused())
+ {
+ title = pausedString;
+ title += L" ";
+ }
+ if (_prevPercentValue != UInt32(-1))
+ {
+ wchar_t s[64];
+ ConvertUInt64ToString(_prevPercentValue, s);
+ title += s;
+ title += L"%";
+ }
+ if (!_foreground)
+ {
+ title += L" ";
+ title += backgroundedString;
+ }
+ title += L" ";
+ UString totalTitle = title + _title;
+ UString fileName;
+ ProgressSynch.GetTitleFileName(fileName);
+ if (!fileName.IsEmpty())
+ {
+ ReduceString(fileName, kTitleFileNameSizeLimit);
+ totalTitle += L" ";
+ totalTitle += fileName;
+ }
+ SetText(totalTitle);
+ #ifndef _SFX
+ AddToTitle(title + MainAddTitle);
+ #endif
+}
+
+void CProgressDialog::SetPauseText()
+{
+ SetItemText(IDC_BUTTON_PAUSE, ProgressSynch.GetPaused() ?
+ continueString : pauseString);
+ SetTitleText();
+}
+
+void CProgressDialog::OnPauseButton()
+{
+ bool paused = !ProgressSynch.GetPaused();
+ ProgressSynch.SetPaused(paused);
+ UInt32 curTime = ::GetTickCount();
+ if (paused)
+ _elapsedTime += (curTime - _prevTime);
+ _prevTime = curTime;
+ SetPauseText();
+}
+
+void CProgressDialog::SetPriorityText()
+{
+ SetItemText(IDC_BUTTON_PROGRESS_PRIORITY, _foreground ?
+ backgroundString :
+ foregroundString);
+ SetTitleText();
+}
+
+void CProgressDialog::OnPriorityButton()
+{
+ _foreground = !_foreground;
+ SetPriorityClass(GetCurrentProcess(), _foreground ?
+ NORMAL_PRIORITY_CLASS: IDLE_PRIORITY_CLASS);
+ SetPriorityText();
+}
+
+bool CProgressDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ switch(buttonID)
+ {
+ case IDCANCEL:
+ {
+ bool paused = ProgressSynch.GetPaused();;
+ // ProgressSynch.SetPaused(true);
+ if (!paused)
+ OnPauseButton();
+ int res = ::MessageBoxW(HWND(*this),
+ LangString(IDS_PROGRESS_ASK_CANCEL, 0x02000C30),
+ _title, MB_YESNOCANCEL);
+ // ProgressSynch.SetPaused(paused);
+ if (!paused)
+ OnPauseButton();
+ if (res == IDCANCEL || res == IDNO)
+ return true;
+ break;
+ }
+ case IDC_BUTTON_PAUSE:
+ OnPauseButton();
+ return true;
+ case IDC_BUTTON_PROGRESS_PRIORITY:
+ {
+ OnPriorityButton();
+ return true;
+ }
+ }
+ return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2.h
new file mode 100644
index 000000000..3ab9f4c05
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2.h
@@ -0,0 +1,242 @@
+// ProgressDialog2.h
+
+#ifndef __PROGRESS_DIALOG2_H
+#define __PROGRESS_DIALOG2_H
+
+#include "Common/Types.h"
+
+#include "Windows/Control/Dialog.h"
+#include "Windows/Control/ProgressBar.h"
+#include "Windows/Synchronization.h"
+
+#include "ProgressDialog2Res.h"
+
+class CProgressSynch
+{
+ NWindows::NSynchronization::CCriticalSection _cs;
+ bool _stopped;
+ bool _paused;
+ bool _bytesProgressMode;
+
+ UInt64 _totalBytes;
+ UInt64 _curBytes;
+ UInt64 _totalFiles;
+ UInt64 _curFiles;
+ UInt64 _inSize;
+ UInt64 _outSize;
+
+ UString TitleFileName;
+ UString CurrentFileName;
+
+public:
+ CProgressSynch():
+ _stopped(false), _paused(false),
+ _totalBytes((UInt64)(Int64)-1), _curBytes(0),
+ _totalFiles((UInt64)(Int64)-1), _curFiles(0),
+ _inSize((UInt64)(Int64)-1),
+ _outSize((UInt64)(Int64)-1),
+ _bytesProgressMode(true)
+ {}
+
+ bool GetStopped()
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ return _stopped;
+ }
+ void SetStopped(bool value)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _stopped = value;
+ }
+ bool GetPaused()
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ return _paused;
+ }
+ void SetPaused(bool value)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _paused = value;
+ }
+ void SetBytesProgressMode(bool bytesProgressMode)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _bytesProgressMode = bytesProgressMode;
+ }
+ void SetProgress(UInt64 total, UInt64 completed)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _totalBytes = total;
+ _curBytes = completed;
+ }
+ void SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ if (inSize)
+ _inSize = *inSize;
+ if (outSize)
+ _outSize = *outSize;
+ }
+ void SetPos(UInt64 completed)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _curBytes = completed;
+ }
+ void SetNumBytesTotal(UInt64 value)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _totalBytes = value;
+ }
+ void SetNumFilesTotal(UInt64 value)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _totalFiles = value;
+ }
+ void SetNumFilesCur(UInt64 value)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _curFiles = value;
+ }
+ HRESULT ProcessStopAndPause();
+ HRESULT SetPosAndCheckPaused(UInt64 completed);
+ void GetProgress(UInt64 &total, UInt64 &completed,
+ UInt64 &totalFiles, UInt64 &curFiles,
+ UInt64 &inSize, UInt64 &outSize,
+ bool &bytesProgressMode)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ total = _totalBytes;
+ completed = _curBytes;
+ totalFiles = _totalFiles;
+ curFiles = _curFiles;
+ inSize = _inSize;
+ outSize = _outSize;
+ bytesProgressMode = _bytesProgressMode;
+ }
+ void SetTitleFileName(const UString &fileName)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ TitleFileName = fileName;
+ }
+ void GetTitleFileName(UString &fileName)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ fileName = TitleFileName;
+ }
+ void SetCurrentFileName(const UString &fileName)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ CurrentFileName = fileName;
+ }
+ void GetCurrentFileName(UString &fileName)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ fileName = CurrentFileName;
+ }
+};
+
+class CU64ToI32Converter
+{
+ UInt64 _numShiftBits;
+public:
+ void Init(UInt64 _range);
+ int Count(UInt64 aValue);
+};
+
+// class CProgressDialog: public NWindows::NControl::CModelessDialog
+
+enum ESpeedMode
+{
+ kSpeedBytes,
+ kSpeedKBytes,
+ kSpeedMBytes
+};
+
+class CProgressDialog: public NWindows::NControl::CModalDialog
+{
+ UString _prevFileName;
+ UString _prevTitleName;
+private:
+ UString backgroundString;
+ UString backgroundedString;
+ UString foregroundString;
+ UString pauseString;
+ UString continueString;
+ UString pausedString;
+
+
+
+ UINT_PTR _timer;
+
+ UString _title;
+ CU64ToI32Converter _converter;
+ UInt64 _previousPos;
+ UInt64 _range;
+ NWindows::NControl::CProgressBar m_ProgressBar;
+
+ UInt32 _prevPercentValue;
+ UInt32 _prevTime;
+ UInt32 _elapsedTime;
+ UInt32 _prevElapsedSec;
+ UInt64 _prevRemainingSec;
+ ESpeedMode _prevMode;
+ UInt64 _prevSpeed;
+
+ bool _foreground;
+
+ bool OnTimer(WPARAM timerID, LPARAM callback);
+ void SetRange(UInt64 range);
+ void SetPos(UInt64 pos);
+ virtual bool OnInit();
+ virtual void OnCancel();
+ NWindows::NSynchronization::CManualResetEvent _dialogCreatedEvent;
+ #ifndef _SFX
+ void AddToTitle(LPCWSTR string);
+ #endif
+
+ void SetPauseText();
+ void SetPriorityText();
+ void OnPauseButton();
+ void OnPriorityButton();
+ bool OnButtonClicked(int buttonID, HWND buttonHWND);
+
+ void SetTitleText();
+ void ShowSize(int id, UInt64 value);
+
+public:
+ CProgressSynch ProgressSynch;
+ bool CompressingMode;
+
+ #ifndef _SFX
+ HWND MainWindow;
+ UString MainTitle;
+ UString MainAddTitle;
+ ~CProgressDialog();
+ #endif
+
+ CProgressDialog(): _timer(0), CompressingMode(true)
+ #ifndef _SFX
+ ,MainWindow(0)
+ #endif
+ {
+ if (_dialogCreatedEvent.Create() != S_OK)
+ throw 1334987;
+ }
+
+ void WaitCreating() { _dialogCreatedEvent.Lock(); }
+
+
+ INT_PTR Create(const UString &title, HWND wndParent = 0)
+ {
+ _title = title;
+ return CModalDialog::Create(IDD_DIALOG_PROGRESS, wndParent);
+ }
+
+ static const UINT kCloseMessage;
+
+ virtual bool OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+
+ void MyClose() { PostMessage(kCloseMessage); };
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2Res.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2Res.h
new file mode 100644
index 000000000..16bf26342
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2Res.h
@@ -0,0 +1,26 @@
+#define IDC_BUTTON_PAUSE 3
+#define IDC_BUTTON_PROGRESS_PRIORITY 4
+#define IDD_DIALOG_PROGRESS 500
+#define IDS_PROGRESS_PAUSED 700
+#define IDS_PROGRESS_FOREGROUND 701
+#define IDS_PROGRESS_CONTINUE 702
+#define IDS_PROGRESS_ASK_CANCEL 703
+#define IDC_PROGRESS1 1000
+#define IDC_PROGRESS_ELAPSED 1002
+#define IDC_PROGRESS_ELAPSED_VALUE 1003
+#define IDC_PROGRESS_REMAINING 1004
+#define IDC_PROGRESS_REMAINING_VALUE 1005
+#define IDC_PROGRESS_SPEED 1006
+#define IDC_PROGRESS_SPEED_VALUE 1007
+#define IDC_PROGRESS_TOTAL 1008
+#define IDC_PROGRESS_TOTAL_VALUE 1009
+#define IDC_PROGRESS_FILE_NAME 1010
+
+#define IDC_PROGRESS_FILES 1012
+#define IDC_PROGRESS_FILES_VALUE 1013
+#define IDC_PROGRESS_RATIO 1014
+#define IDC_PROGRESS_RATIO_VALUE 1015
+#define IDC_PROGRESS_PACKED 1016
+#define IDC_PROGRESS_PACKED_VALUE 1017
+#define IDC_PROGRESS_UNPACKED 1018
+#define IDC_PROGRESS_UNPACKED_VALUE 1019
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2_rc.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2_rc.cpp
new file mode 100644
index 000000000..016c9c85a
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialog2_rc.cpp
@@ -0,0 +1,171 @@
+// ProgressDialog2_rc.cpp
+
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+// for all others, include the necessary headers (this file is usually all you
+// need because it includes almost all "standard" wxWidgets headers)
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "ProgressDialog2Res.h"
+
+#include "Windows/Control/DialogImpl.h"
+
+/*
+IDD_DIALOG_PROGRESS DIALOG 0, 0, xSize, ySize MY_MODAL_DIALOG_STYLE | WS_MINIMIZEBOX
+CAPTION "Progress"
+MY_FONT
+BEGIN
+ PUSHBUTTON "&Background", IDC_BUTTON_PROGRESS_PRIORITY, bXPos3, bYPos, bXSize, bYSize
+ PUSHBUTTON "&Pause", IDC_BUTTON_PAUSE, bXPos2, bYPos, bXSize, bYSize
+ PUSHBUTTON "Cancel", IDCANCEL, bXPos1, bYPos, bXSize, bYSize
+ LTEXT "Elapsed time:", IDC_PROGRESS_ELAPSED, marg, y0, x0Size, 8
+ LTEXT "Remaining time:", IDC_PROGRESS_REMAINING, marg, y1, x0Size, 8
+ LTEXT "Files:", IDC_PROGRESS_FILES, marg, y2, x0Size, 8
+ LTEXT "Compression ratio:",IDC_PROGRESS_RATIO, marg, y3, x0Size, 8
+
+ LTEXT "Total size:", IDC_PROGRESS_TOTAL, x2, y0, x2Size, 8
+ LTEXT "Speed:", IDC_PROGRESS_SPEED, x2, y1, x2Size, 8
+ LTEXT "Processed:", IDC_PROGRESS_UNPACKED, x2, y2, x2Size, 8
+ LTEXT "Compressed size:", IDC_PROGRESS_PACKED, x2, y3, x2Size, 8
+
+ RTEXT "00:00:00", IDC_PROGRESS_ELAPSED_VALUE, x1, y0, x1Size, 8
+ RTEXT "", IDC_PROGRESS_REMAINING_VALUE, x1, y1, x1Size, 8
+ RTEXT "", IDC_PROGRESS_FILES_VALUE, x1, y2, x1Size, 8
+ RTEXT "", IDC_PROGRESS_RATIO_VALUE, x1, y3, x1Size, 8
+
+ RTEXT "", IDC_PROGRESS_TOTAL_VALUE, x3, y0, x3Size, 8
+ RTEXT "", IDC_PROGRESS_SPEED_VALUE, x3, y1, x3Size, 8
+ RTEXT "", IDC_PROGRESS_UNPACKED_VALUE, x3, y2, x3Size, 8
+ RTEXT "", IDC_PROGRESS_PACKED_VALUE, x3, y3, x3Size, 8
+
+ LTEXT "", IDC_PROGRESS_FILE_NAME, marg, bYPos - 30, xSize2, 8, SS_NOPREFIX
+ CONTROL "Progress1", IDC_PROGRESS1, "msctls_progress32", PBS_SMOOTH | WS_BORDER, marg, bYPos - 20, xSize2, 13
+END
+
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_PROGRESS_PAUSED "Paused"
+ IDS_PROGRESS_FOREGROUND "&Foreground"
+ IDS_PROGRESS_CONTINUE "&Continue"
+ IDS_PROGRESS_ASK_CANCEL "Are you sure you want to cancel?"
+END
+
+*/
+class CProgressDialogImpl : public NWindows::NControl::CModalDialogImpl
+{
+ public:
+ CProgressDialogImpl(NWindows::NControl::CModalDialog *dialog,wxWindow * parent , int id) : CModalDialogImpl(dialog,parent, id, wxT("Progress"))
+ {
+// FIXME : ProgressDialog2 but ProgressDialog ...
+
+ ///Sizer for adding the controls created by users
+ wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
+
+ wxStaticText *pStaticTextElapsedTime = new wxStaticText(this, IDC_PROGRESS_ELAPSED, wxT("Elapsed time:"));
+ wxStaticText *m_pStaticTextElapsedTime = new wxStaticText(this, IDC_PROGRESS_ELAPSED_VALUE, wxT("00:00:00"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+ wxStaticText *pStaticTextRemainingTime = new wxStaticText(this, IDC_PROGRESS_REMAINING, wxT("Remaining time"));
+ wxStaticText *m_pStaticTextRemainingTime = new wxStaticText(this, IDC_PROGRESS_REMAINING_VALUE, wxT("00:00:00"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+
+ wxStaticText *pStaticTextFiles = new wxStaticText(this, IDC_PROGRESS_FILES, wxT("Files:"));
+ wxStaticText *m_pStaticTextFiles = new wxStaticText(this, IDC_PROGRESS_FILES_VALUE, wxT(" "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+
+ wxStaticText *pStaticTextRatio = new wxStaticText(this, IDC_PROGRESS_RATIO, wxT("Compression ratio:"));
+ wxStaticText *m_pStaticTextRatio = new wxStaticText(this, IDC_PROGRESS_RATIO_VALUE, wxT(" "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+
+
+ wxStaticText *pStaticTextSize = new wxStaticText(this, IDC_PROGRESS_TOTAL, wxT("Total Size:"));
+ wxStaticText *m_pStaticTextSize = new wxStaticText(this, IDC_PROGRESS_TOTAL_VALUE, wxT(" "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+ wxStaticText *pStaticTextSpeed = new wxStaticText(this, IDC_PROGRESS_SPEED, wxT("Speed:"));
+ wxStaticText *m_pStaticTextSpeed = new wxStaticText(this, IDC_PROGRESS_SPEED_VALUE, wxT(" "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+
+ wxStaticText *pStaticTextUnpacked = new wxStaticText(this, IDC_PROGRESS_UNPACKED, wxT("Processed:"));
+ wxStaticText *m_pStaticTextUnpacked = new wxStaticText(this, IDC_PROGRESS_UNPACKED, wxT(" "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+
+ wxStaticText *pStaticTextPacked = new wxStaticText(this, IDC_PROGRESS_PACKED, wxT("Compressed size:"));
+ wxStaticText *m_pStaticTextPacked = new wxStaticText(this, IDC_PROGRESS_PACKED_VALUE, wxT(" "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
+
+ wxBoxSizer *pInfoSizer = new wxBoxSizer(wxHORIZONTAL);
+ wxBoxSizer *pTimeSizer = new wxBoxSizer(wxHORIZONTAL);
+ wxBoxSizer *pTimeLabelSizer = new wxBoxSizer(wxVERTICAL);
+ pTimeLabelSizer->Add(pStaticTextElapsedTime , 0, wxALL|wxEXPAND, 5);
+ pTimeLabelSizer->Add(pStaticTextRemainingTime, 0, wxALL|wxEXPAND, 5);
+ pTimeLabelSizer->Add(pStaticTextFiles , 0, wxALL|wxEXPAND, 5);
+ pTimeLabelSizer->Add(pStaticTextRatio , 0, wxALL|wxEXPAND, 5);
+ wxBoxSizer *pTimeInfoSizer = new wxBoxSizer(wxVERTICAL);
+ pTimeInfoSizer->Add(m_pStaticTextElapsedTime , 0, wxALL|wxEXPAND, 5);
+ pTimeInfoSizer->Add(m_pStaticTextRemainingTime, 0, wxALL|wxEXPAND, 5);
+ pTimeInfoSizer->Add(m_pStaticTextFiles , 0, wxALL|wxEXPAND, 5);
+ pTimeInfoSizer->Add(m_pStaticTextRatio , 0, wxALL|wxEXPAND, 5);
+ pTimeSizer->Add(pTimeLabelSizer , 0, wxALL|wxEXPAND, 5);
+ pTimeSizer->Add(pTimeInfoSizer , 0, wxALL|wxEXPAND, 5);
+ wxBoxSizer *pSizeSpeedSizer = new wxBoxSizer(wxHORIZONTAL);
+ wxBoxSizer *pSizeSpeedLabelSizer = new wxBoxSizer(wxVERTICAL);
+ pSizeSpeedLabelSizer->Add(pStaticTextSize , 0, wxALL|wxEXPAND, 5);
+ pSizeSpeedLabelSizer->Add(pStaticTextSpeed , 0, wxALL|wxEXPAND, 5);
+ pSizeSpeedLabelSizer->Add(pStaticTextUnpacked , 0, wxALL|wxEXPAND, 5);
+ pSizeSpeedLabelSizer->Add(pStaticTextPacked , 0, wxALL|wxEXPAND, 5);
+
+ wxBoxSizer *pSizeSpeedInfoSizer = new wxBoxSizer(wxVERTICAL);
+ pSizeSpeedInfoSizer->Add(m_pStaticTextSize , 0, wxALL|wxEXPAND, 5);
+ pSizeSpeedInfoSizer->Add(m_pStaticTextSpeed , 0, wxALL|wxEXPAND, 5);
+ pSizeSpeedInfoSizer->Add(m_pStaticTextUnpacked, 0, wxALL|wxEXPAND, 5);
+ pSizeSpeedInfoSizer->Add(m_pStaticTextPacked , 0, wxALL|wxEXPAND, 5);
+
+ pSizeSpeedSizer->Add(pSizeSpeedLabelSizer, 1, wxALL|wxEXPAND, 5);
+ pSizeSpeedSizer->Add(pSizeSpeedInfoSizer, 1, wxALL|wxEXPAND, 5);
+ pInfoSizer->Add(pTimeSizer, 0, wxALL|wxEXPAND, 5);
+ pInfoSizer->Add(pSizeSpeedSizer, 0, wxALL|wxEXPAND, 5);
+
+ wxStaticText *m_pStaticArchiveName = new wxStaticText(this, IDC_PROGRESS_FILE_NAME, wxT(" \n "));
+ wxGauge *m_pGaugeProgress = new wxGauge(this, IDC_PROGRESS1, 100);
+
+ wxBoxSizer *pButtonSizer = new wxBoxSizer(wxHORIZONTAL);
+ wxButton *m_pButtonBackground = new wxButton(this, IDC_BUTTON_PROGRESS_PRIORITY, wxT("&Background"));
+ wxButton *m_pButtonPause = new wxButton(this, IDC_BUTTON_PAUSE, wxT("&Pause"));
+ wxButton *m_pButtonCancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel"));
+ // FIXME pButtonSizer->AddStretchSpacer(1);
+ pButtonSizer->Add(m_pButtonBackground, 0, wxALL|wxEXPAND, 5);
+ pButtonSizer->Add(m_pButtonPause, 0, wxALL|wxEXPAND, 5);
+ pButtonSizer->Add(m_pButtonCancel, 0, wxALL|wxEXPAND, 5);
+
+ topsizer->Add(pInfoSizer, 0, wxBOTTOM|wxEXPAND, 5);
+ topsizer->Add(m_pStaticArchiveName, 0, wxLEFT|wxRIGHT|wxEXPAND, 10);
+ topsizer->Add(m_pGaugeProgress, 0, wxALL|wxEXPAND, 10);
+ topsizer->Add(pButtonSizer, 0, wxALL|wxEXPAND, 5);
+
+ this->OnInit();
+
+ SetSizer(topsizer); // use the sizer for layout
+ topsizer->SetSizeHints(this); // set size hints to honour minimum size
+ }
+private:
+ // Any class wishing to process wxWindows events must use this macro
+ DECLARE_EVENT_TABLE()
+};
+
+static CStringTable g_stringTable[] =
+{
+ { IDS_PROGRESS_PAUSED , L"Paused" },
+ { IDS_PROGRESS_FOREGROUND , L"&Foreground" },
+ { IDS_PROGRESS_CONTINUE , L"&Continue" },
+ { IDS_PROGRESS_ASK_CANCEL , L"Are you sure you want to cancel?" },
+ { 0 , 0 }
+};
+
+REGISTER_DIALOG(IDD_DIALOG_PROGRESS,CProgressDialog,g_stringTable)
+
+BEGIN_EVENT_TABLE(CProgressDialogImpl, wxDialog)
+ EVT_TIMER(wxID_ANY, CModalDialogImpl::OnAnyTimer)
+ EVT_BUTTON(wxID_ANY, CModalDialogImpl::OnAnyButton)
+END_EVENT_TABLE()
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialogRes.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialogRes.h
new file mode 100644
index 000000000..97e47228d
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ProgressDialogRes.h
@@ -0,0 +1,3 @@
+#define IDD_DIALOG_PROGRESS 500
+
+#define IDC_PROGRESS1 1000
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyName.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyName.cpp
new file mode 100644
index 000000000..48090d38b
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyName.cpp
@@ -0,0 +1,109 @@
+// PropertyName.cpp
+
+#include "StdAfx.h"
+
+#include "Common/IntToString.h"
+
+#include "Windows/ResourceString.h"
+
+#include "../../PropID.h"
+
+#include "LangUtils.h"
+#include "PropertyName.h"
+
+#include "resource.h"
+#include "PropertyNameRes.h"
+
+struct CPropertyIDNamePair
+{
+ PROPID PropID;
+ UINT ResourceID;
+ UInt32 LangID;
+};
+
+static CPropertyIDNamePair kPropertyIDNamePairs[] =
+{
+ { kpidPath, IDS_PROP_PATH, 0x02000203 },
+ { kpidName, IDS_PROP_NAME, 0x02000204 },
+ { kpidExtension, IDS_PROP_EXTENSION, 0x02000205 },
+ { kpidIsDir, IDS_PROP_IS_FOLDER, 0x02000206},
+ { kpidSize, IDS_PROP_SIZE, 0x02000207},
+ { kpidPackSize, IDS_PROP_PACKED_SIZE, 0x02000208 },
+ { kpidAttrib, IDS_PROP_ATTRIBUTES, 0x02000209 },
+ { kpidCTime, IDS_PROP_CTIME, 0x0200020A },
+ { kpidATime, IDS_PROP_ATIME, 0x0200020B },
+ { kpidMTime, IDS_PROP_MTIME, 0x0200020C },
+ { kpidSolid, IDS_PROP_SOLID, 0x0200020D },
+ { kpidCommented, IDS_PROP_C0MMENTED, 0x0200020E },
+ { kpidEncrypted, IDS_PROP_ENCRYPTED, 0x0200020F },
+ { kpidSplitBefore, IDS_PROP_SPLIT_BEFORE, 0x02000210 },
+ { kpidSplitAfter, IDS_PROP_SPLIT_AFTER, 0x02000211 },
+ { kpidDictionarySize, IDS_PROP_DICTIONARY_SIZE, 0x02000212 },
+ { kpidCRC, IDS_PROP_CRC, 0x02000213 },
+ { kpidType, IDS_PROP_FILE_TYPE, 0x02000214},
+ { kpidIsAnti, IDS_PROP_ANTI, 0x02000215 },
+ { kpidMethod, IDS_PROP_METHOD, 0x02000216 },
+ { kpidHostOS, IDS_PROP_HOST_OS, 0x02000217 },
+ { kpidFileSystem, IDS_PROP_FILE_SYSTEM, 0x02000218},
+ { kpidUser, IDS_PROP_USER, 0x02000219},
+ { kpidGroup, IDS_PROP_GROUP, 0x0200021A},
+ { kpidBlock, IDS_PROP_BLOCK, 0x0200021B },
+ { kpidComment, IDS_PROP_COMMENT, 0x0200021C },
+ { kpidPosition, IDS_PROP_POSITION, 0x0200021D },
+ { kpidPrefix, IDS_PROP_PREFIX, 0x0200021E },
+ { kpidNumSubDirs, IDS_PROP_FOLDERS, 0x0200021F },
+ { kpidNumSubFiles, IDS_PROP_FILES, 0x02000220 },
+ { kpidUnpackVer, IDS_PROP_VERSION, 0x02000221},
+ { kpidVolume, IDS_PROP_VOLUME, 0x02000222},
+ { kpidIsVolume, IDS_PROP_IS_VOLUME, 0x02000223},
+ { kpidOffset, IDS_PROP_OFFSET, 0x02000224},
+ { kpidLinks, IDS_PROP_LINKS, 0x02000225},
+ { kpidNumBlocks, IDS_PROP_NUM_BLOCKS, 0x02000226},
+ { kpidNumVolumes, IDS_PROP_NUM_VOLUMES, 0x02000227},
+
+ { kpidBit64, IDS_PROP_BIT64, 0x02000229},
+ { kpidBigEndian, IDS_PROP_BIG_ENDIAN, 0x0200022A},
+ { kpidCpu, IDS_PROP_CPU, 0x0200022B},
+ { kpidPhySize, IDS_PROP_PHY_SIZE, 0x0200022C},
+ { kpidHeadersSize, IDS_PROP_HEADERS_SIZE, 0x0200022D},
+ { kpidChecksum, IDS_PROP_CHECKSUM, 0x0200022E},
+ { kpidCharacts, IDS_PROP_CHARACTS, 0x0200022F},
+ { kpidVa, IDS_PROP_VA, 0x02000230},
+ { kpidId, IDS_PROP_ID, 0x02000231 },
+ { kpidShortName, IDS_PROP_SHORT_NAME, 0x02000232 },
+ { kpidCreatorApp, IDS_PROP_CREATOR_APP, 0x02000233 },
+ { kpidSectorSize, IDS_PROP_SECTOR_SIZE, 0x02000234 },
+ { kpidPosixAttrib, IDS_PROP_POSIX_ATTRIB, 0x02000235 },
+ { kpidLink, IDS_PROP_LINK, 0x02000236 },
+
+ { kpidTotalSize, IDS_PROP_TOTAL_SIZE, 0x03031100 },
+ { kpidFreeSpace, IDS_PROP_FREE_SPACE, 0x03031101 },
+ { kpidClusterSize, IDS_PROP_CLUSTER_SIZE, 0x03031102},
+ { kpidVolumeName, IDS_PROP_VOLUME_NAME, 0x03031103 },
+
+ { kpidLocalName, IDS_PROP_LOCAL_NAME, 0x03031200 },
+ { kpidProvider, IDS_PROP_PROVIDER, 0x03031201 }
+};
+
+int FindProperty(PROPID propID)
+{
+ for (int i = 0; i < sizeof(kPropertyIDNamePairs) / sizeof(kPropertyIDNamePairs[0]); i++)
+ if (kPropertyIDNamePairs[i].PropID == propID)
+ return i;
+ return -1;
+}
+
+UString GetNameOfProperty(PROPID propID, const wchar_t *name)
+{
+ int index = FindProperty(propID);
+ if (index < 0)
+ {
+ if (name)
+ return name;
+ wchar_t s[16];
+ ConvertUInt32ToString(propID, s);
+ return s;
+ }
+ const CPropertyIDNamePair &pair = kPropertyIDNamePairs[index];
+ return LangString(pair.ResourceID, pair.LangID);
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyName.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyName.h
new file mode 100644
index 000000000..95e9dc9b3
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyName.h
@@ -0,0 +1,10 @@
+// PropertyName.h
+
+#ifndef __PROPERTYNAME_H
+#define __PROPERTYNAME_H
+
+#include "Common/MyString.h"
+
+UString GetNameOfProperty(PROPID propID, const wchar_t *name);
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyNameRes.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyNameRes.h
new file mode 100644
index 000000000..00458a24f
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/PropertyNameRes.h
@@ -0,0 +1,52 @@
+#define IDS_PROP_PATH 3
+#define IDS_PROP_NAME 4
+#define IDS_PROP_EXTENSION 5
+#define IDS_PROP_IS_FOLDER 6
+#define IDS_PROP_SIZE 7
+#define IDS_PROP_PACKED_SIZE 8
+#define IDS_PROP_ATTRIBUTES 9
+#define IDS_PROP_CTIME 10
+#define IDS_PROP_ATIME 11
+#define IDS_PROP_MTIME 12
+#define IDS_PROP_SOLID 13
+#define IDS_PROP_C0MMENTED 14
+#define IDS_PROP_ENCRYPTED 15
+#define IDS_PROP_DICTIONARY_SIZE 16
+#define IDS_PROP_SPLIT_BEFORE 17
+#define IDS_PROP_SPLIT_AFTER 18
+#define IDS_PROP_CRC 19
+#define IDS_PROP_FILE_TYPE 20
+#define IDS_PROP_ANTI 21
+#define IDS_PROP_METHOD 22
+#define IDS_PROP_HOST_OS 23
+#define IDS_PROP_FILE_SYSTEM 24
+#define IDS_PROP_USER 25
+#define IDS_PROP_GROUP 26
+#define IDS_PROP_BLOCK 27
+#define IDS_PROP_COMMENT 28
+#define IDS_PROP_POSITION 29
+#define IDS_PROP_PREFIX 30
+#define IDS_PROP_FOLDERS 31
+#define IDS_PROP_FILES 32
+#define IDS_PROP_VERSION 33
+#define IDS_PROP_VOLUME 34
+#define IDS_PROP_IS_VOLUME 35
+#define IDS_PROP_OFFSET 36
+#define IDS_PROP_LINKS 37
+#define IDS_PROP_NUM_BLOCKS 38
+#define IDS_PROP_NUM_VOLUMES 39
+
+#define IDS_PROP_BIT64 41
+#define IDS_PROP_BIG_ENDIAN 42
+#define IDS_PROP_CPU 43
+#define IDS_PROP_PHY_SIZE 44
+#define IDS_PROP_HEADERS_SIZE 45
+#define IDS_PROP_CHECKSUM 46
+#define IDS_PROP_CHARACTS 47
+#define IDS_PROP_VA 48
+#define IDS_PROP_ID 49
+#define IDS_PROP_SHORT_NAME 50
+#define IDS_PROP_CREATOR_APP 51
+#define IDS_PROP_SECTOR_SIZE 52
+#define IDS_PROP_POSIX_ATTRIB 53
+#define IDS_PROP_LINK 54
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryAssociations.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryAssociations.cpp
new file mode 100644
index 000000000..d4fbfe139
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryAssociations.cpp
@@ -0,0 +1,301 @@
+// RegistryAssociations.cpp
+
+#include "StdAfx.h"
+
+#include "RegistryAssociations.h"
+
+#include "Common/IntToString.h"
+#include "Common/StringConvert.h"
+#include "Common/StringToInt.h"
+
+#include "Windows/Registry.h"
+#include "Windows/Synchronization.h"
+
+#include "StringUtils.h"
+
+using namespace NWindows;
+using namespace NRegistry;
+
+namespace NRegistryAssociations {
+
+static NSynchronization::CCriticalSection g_CriticalSection;
+
+#define REG_PATH_FM TEXT("Software") TEXT(STRING_PATH_SEPARATOR) TEXT("7-ZIP") TEXT(STRING_PATH_SEPARATOR) TEXT("FM")
+
+static const TCHAR *kCUKeyPath = REG_PATH_FM;
+static const WCHAR *kExtPlugins = L"Plugins";
+static const TCHAR *kExtEnabled = TEXT("Enabled");
+
+#define kAssociations TEXT("Associations")
+#define kAssociationsPath REG_PATH_FM TEXT(STRING_PATH_SEPARATOR) kAssociations
+
+bool ReadInternalAssociation(const wchar_t *ext, CExtInfo &extInfo)
+{
+ NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+ CKey key;
+ if (key.Open(HKEY_CURRENT_USER,
+ CSysString(kAssociationsPath TEXT(STRING_PATH_SEPARATOR)) +
+ GetSystemString(ext), KEY_READ) != ERROR_SUCCESS)
+ return false;
+ UString pluginsString;
+ key.QueryValue(kExtPlugins, pluginsString);
+ SplitString(pluginsString, extInfo.Plugins);
+ return true;
+}
+
+void ReadInternalAssociations(CObjectVector<CExtInfo> &items)
+{
+ items.Clear();
+ NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+ CKey associationsKey;
+ if (associationsKey.Open(HKEY_CURRENT_USER, kAssociationsPath, KEY_READ) != ERROR_SUCCESS)
+ return;
+ CSysStringVector extNames;
+ associationsKey.EnumKeys(extNames);
+ for(int i = 0; i < extNames.Size(); i++)
+ {
+ const CSysString extName = extNames[i];
+ CExtInfo extInfo;
+ // extInfo.Enabled = false;
+ extInfo.Ext = GetUnicodeString(extName);
+ CKey key;
+ if (key.Open(associationsKey, extName, KEY_READ) != ERROR_SUCCESS)
+ return;
+ UString pluginsString;
+ key.QueryValue(kExtPlugins, pluginsString);
+ SplitString(pluginsString, extInfo.Plugins);
+ /*
+ if (key.QueryValue(kExtEnabled, extInfo.Enabled) != ERROR_SUCCESS)
+ extInfo.Enabled = false;
+ */
+ items.Add(extInfo);
+ }
+}
+
+void WriteInternalAssociations(const CObjectVector<CExtInfo> &items)
+{
+ NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+ CKey mainKey;
+ mainKey.Create(HKEY_CURRENT_USER, kCUKeyPath);
+ mainKey.RecurseDeleteKey(kAssociations);
+ CKey associationsKey;
+ associationsKey.Create(mainKey, kAssociations);
+ for(int i = 0; i < items.Size(); i++)
+ {
+ const CExtInfo &extInfo = items[i];
+ CKey key;
+ key.Create(associationsKey, GetSystemString(extInfo.Ext));
+ key.SetValue(kExtPlugins, JoinStrings(extInfo.Plugins));
+ // key.SetValue(kExtEnabled, extInfo.Enabled);
+ }
+}
+
+///////////////////////////////////
+// External
+
+static const TCHAR *kShellNewKeyName = TEXT("ShellNew");
+static const TCHAR *kShellNewDataValueName = TEXT("Data");
+
+static const TCHAR *kDefaultIconKeyName = TEXT("DefaultIcon");
+static const TCHAR *kShellKeyName = TEXT("shell");
+static const TCHAR *kOpenKeyName = TEXT("open");
+static const TCHAR *kCommandKeyName = TEXT("command");
+
+static CSysString GetExtensionKeyName(const CSysString &extension)
+{
+ return CSysString(TEXT(".")) + extension;
+}
+
+static CSysString GetExtProgramKeyName(const CSysString &extension)
+{
+ return CSysString(TEXT("7-Zip.")) + extension;
+}
+
+static bool CheckShellExtensionInfo2(const CSysString &extension, UString &iconPath, int &iconIndex)
+{
+ iconIndex = -1;
+ iconPath.Empty();
+ NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+ CKey extKey;
+ if (extKey.Open(HKEY_CLASSES_ROOT, GetExtensionKeyName(extension), KEY_READ) != ERROR_SUCCESS)
+ return false;
+ CSysString programNameValue;
+ if (extKey.QueryValue(NULL, programNameValue) != ERROR_SUCCESS)
+ return false;
+ CSysString extProgramKeyName = GetExtProgramKeyName(extension);
+ UString programNameValueU = GetUnicodeString(programNameValue);
+ if (programNameValueU.CompareNoCase(GetUnicodeString(extProgramKeyName)) != 0)
+ return false;
+ CKey iconKey;
+ if (extKey.Open(HKEY_CLASSES_ROOT, extProgramKeyName + CSysString(TEXT(CHAR_PATH_SEPARATOR)) + kDefaultIconKeyName, KEY_READ) != ERROR_SUCCESS)
+ return false;
+ UString value;
+ if (extKey.QueryValue(NULL, value) == ERROR_SUCCESS)
+ {
+ int pos = value.ReverseFind(L',');
+ iconPath = value;
+ if (pos >= 0)
+ {
+ const wchar_t *end;
+ UInt64 index = ConvertStringToUInt64((const wchar_t *)value + pos + 1, &end);
+ if (*end == 0)
+ {
+ iconIndex = (int)index;
+ iconPath = value.Left(pos);
+ }
+ }
+ }
+ return true;
+}
+
+bool CheckShellExtensionInfo(const CSysString &extension, UString &iconPath, int &iconIndex)
+{
+ NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+ if (!CheckShellExtensionInfo2(extension, iconPath, iconIndex))
+ return false;
+ CKey extProgKey;
+ return (extProgKey.Open(HKEY_CLASSES_ROOT, GetExtProgramKeyName(extension), KEY_READ) == ERROR_SUCCESS);
+}
+
+static void DeleteShellExtensionKey(const CSysString &extension)
+{
+ NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+ CKey rootKey;
+ rootKey.Attach(HKEY_CLASSES_ROOT);
+ rootKey.RecurseDeleteKey(GetExtensionKeyName(extension));
+ rootKey.Detach();
+}
+
+static void DeleteShellExtensionProgramKey(const CSysString &extension)
+{
+ NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+ CKey rootKey;
+ rootKey.Attach(HKEY_CLASSES_ROOT);
+ rootKey.RecurseDeleteKey(GetExtProgramKeyName(extension));
+ rootKey.Detach();
+}
+
+void DeleteShellExtensionInfo(const CSysString &extension)
+{
+ UString iconPath;
+ int iconIndex;
+ if (CheckShellExtensionInfo2(extension, iconPath, iconIndex))
+ DeleteShellExtensionKey(extension);
+ DeleteShellExtensionProgramKey(extension);
+}
+
+void AddShellExtensionInfo(const CSysString &extension,
+ const UString &programTitle,
+ const UString &programOpenCommand,
+ const UString &iconPath, int iconIndex,
+ const void *shellNewData, int shellNewDataSize)
+{
+ DeleteShellExtensionKey(extension);
+ DeleteShellExtensionProgramKey(extension);
+ NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+ CSysString programKeyName = GetExtProgramKeyName(extension);
+ {
+ CKey extKey;
+ extKey.Create(HKEY_CLASSES_ROOT, GetExtensionKeyName(extension));
+ extKey.SetValue(NULL, programKeyName);
+ if (shellNewData != NULL)
+ {
+ CKey shellNewKey;
+ shellNewKey.Create(extKey, kShellNewKeyName);
+ shellNewKey.SetValue(kShellNewDataValueName, shellNewData, shellNewDataSize);
+ }
+ }
+ CKey programKey;
+ programKey.Create(HKEY_CLASSES_ROOT, programKeyName);
+ programKey.SetValue(NULL, programTitle);
+ {
+ CKey iconKey;
+ iconKey.Create(programKey, kDefaultIconKeyName);
+ UString iconPathFull = iconPath;
+ if (iconIndex >= 0)
+ {
+ iconPathFull += L",";
+ wchar_t s[16];
+ ConvertUInt32ToString(iconIndex, s);
+ iconPathFull += s;
+ }
+ iconKey.SetValue(NULL, iconPathFull);
+ }
+
+ CKey shellKey;
+ shellKey.Create(programKey, kShellKeyName);
+ shellKey.SetValue(NULL, TEXT(""));
+
+ CKey openKey;
+ openKey.Create(shellKey, kOpenKeyName);
+ openKey.SetValue(NULL, TEXT(""));
+
+ CKey commandKey;
+ commandKey.Create(openKey, kCommandKeyName);
+
+ commandKey.SetValue(NULL, programOpenCommand);
+}
+
+///////////////////////////
+// ContextMenu
+/*
+
+static const TCHAR *kContextMenuKeyName = TEXT("\\shellex\\ContextMenuHandlers\\7-ZIP");
+static const TCHAR *kContextMenuHandlerCLASSIDValue =
+ TEXT("{23170F69-40C1-278A-1000-000100020000}");
+static const TCHAR *kRootKeyNameForFile = TEXT("*");
+static const TCHAR *kRootKeyNameForFolder = TEXT("Folder");
+
+static CSysString GetFullContextMenuKeyName(const CSysString &aKeyName)
+ { return (aKeyName + kContextMenuKeyName); }
+
+static bool CheckContextMenuHandlerCommon(const CSysString &aKeyName)
+{
+ NSynchronization::CCriticalSectionLock lock(&g_CriticalSection, true);
+ CKey aKey;
+ if (aKey.Open(HKEY_CLASSES_ROOT, GetFullContextMenuKeyName(aKeyName), KEY_READ)
+ != ERROR_SUCCESS)
+ return false;
+ CSysString aValue;
+ if (aKey.QueryValue(NULL, aValue) != ERROR_SUCCESS)
+ return false;
+ return (aValue.CompareNoCase(kContextMenuHandlerCLASSIDValue) == 0);
+}
+
+bool CheckContextMenuHandler()
+{
+ return CheckContextMenuHandlerCommon(kRootKeyNameForFile) &&
+ CheckContextMenuHandlerCommon(kRootKeyNameForFolder);
+}
+
+static void DeleteContextMenuHandlerCommon(const CSysString &aKeyName)
+{
+ CKey rootKey;
+ rootKey.Attach(HKEY_CLASSES_ROOT);
+ rootKey.RecurseDeleteKey(GetFullContextMenuKeyName(aKeyName));
+ rootKey.Detach();
+}
+
+void DeleteContextMenuHandler()
+{
+ DeleteContextMenuHandlerCommon(kRootKeyNameForFile);
+ DeleteContextMenuHandlerCommon(kRootKeyNameForFolder);
+}
+
+static void AddContextMenuHandlerCommon(const CSysString &aKeyName)
+{
+ DeleteContextMenuHandlerCommon(aKeyName);
+ NSynchronization::CCriticalSectionLock lock(&g_CriticalSection, true);
+ CKey aKey;
+ aKey.Create(HKEY_CLASSES_ROOT, GetFullContextMenuKeyName(aKeyName));
+ aKey.SetValue(NULL, kContextMenuHandlerCLASSIDValue);
+}
+
+void AddContextMenuHandler()
+{
+ AddContextMenuHandlerCommon(kRootKeyNameForFile);
+ AddContextMenuHandlerCommon(kRootKeyNameForFolder);
+}
+*/
+
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryAssociations.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryAssociations.h
new file mode 100644
index 000000000..2516fd2b6
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryAssociations.h
@@ -0,0 +1,44 @@
+// RegistryAssociations.h
+
+#ifndef __REGISTRYASSOCIATIONS_H
+#define __REGISTRYASSOCIATIONS_H
+
+#include "Common/MyString.h"
+
+namespace NRegistryAssociations {
+
+ struct CExtInfo
+ {
+ UString Ext;
+ UStringVector Plugins;
+ // bool Enabled;
+ };
+ bool ReadInternalAssociation(const wchar_t *ext, CExtInfo &extInfo);
+ void ReadInternalAssociations(CObjectVector<CExtInfo> &items);
+ void WriteInternalAssociations(const CObjectVector<CExtInfo> &items);
+
+ bool CheckShellExtensionInfo(const CSysString &extension, UString &iconPath, int &iconIndex);
+
+ // void ReadCompressionInfo(NZipSettings::NCompression::CInfo &anInfo,
+ void DeleteShellExtensionInfo(const CSysString &extension);
+
+ void AddShellExtensionInfo(const CSysString &extension,
+ const UString &programTitle,
+ const UString &programOpenCommand,
+ const UString &iconPath, int iconIndex,
+ const void *shellNewData, int shellNewDataSize);
+
+
+ ///////////////////////////
+ // ContextMenu
+ /*
+ bool CheckContextMenuHandler();
+ void AddContextMenuHandler();
+ void DeleteContextMenuHandler();
+ */
+
+}
+
+// bool GetProgramDirPrefix(CSysString &aFolder);
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryPlugins.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryPlugins.h
new file mode 100644
index 000000000..77055ac77
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryPlugins.h
@@ -0,0 +1,32 @@
+// RegistryPlugins.h
+
+#ifndef __REGISTRYPLUGINS_H
+#define __REGISTRYPLUGINS_H
+
+#include "Common/MyString.h"
+
+enum EPluginType
+{
+ kPluginTypeFF = 0
+};
+
+struct CPluginInfo
+{
+ UString FilePath;
+ EPluginType Type;
+ UString Name;
+ CLSID ClassID;
+ CLSID OptionsClassID;
+ bool ClassIDDefined;
+ bool OptionsClassIDDefined;
+
+ // CSysString Extension;
+ // CSysString AddExtension;
+ // bool UpdateEnabled;
+ // bool KeepName;
+};
+
+void ReadPluginInfoList(CObjectVector<CPluginInfo> &plugins);
+void ReadFileFolderPluginInfoList(CObjectVector<CPluginInfo> &plugins);
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryUtils.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryUtils.cpp
new file mode 100644
index 000000000..f071a9c95
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryUtils.cpp
@@ -0,0 +1,152 @@
+// RegistryUtils.cpp
+
+#include "StdAfx.h"
+
+#include "RegistryUtils.h"
+#include "Windows/Registry.h"
+
+using namespace NWindows;
+using namespace NRegistry;
+
+#define REG_PATH_7Z TEXT("Software") TEXT(STRING_PATH_SEPARATOR) TEXT("7-ZIP")
+
+static const TCHAR *kCUBasePath = REG_PATH_7Z;
+static const TCHAR *kCU_FMPath = REG_PATH_7Z TEXT(STRING_PATH_SEPARATOR) TEXT("FM");
+// static const TCHAR *kLM_Path = REG_PATH_7Z TEXT(STRING_PATH_SEPARATOR) TEXT("FM");
+
+static const WCHAR *kLangValueName = L"Lang";
+static const WCHAR *kEditor = L"Editor";
+static const TCHAR *kShowDots = TEXT("ShowDots");
+static const TCHAR *kShowRealFileIcons = TEXT("ShowRealFileIcons");
+static const TCHAR *kShowSystemMenu = TEXT("ShowSystemMenu");
+
+static const TCHAR *kFullRow = TEXT("FullRow");
+static const TCHAR *kShowGrid = TEXT("ShowGrid");
+static const TCHAR *kAlternativeSelection = TEXT("AlternativeSelection");
+// static const TCHAR *kLockMemoryAdd = TEXT("LockMemoryAdd");
+static const TCHAR *kLargePagesEnable = TEXT("LargePages");
+// static const TCHAR *kSingleClick = TEXT("SingleClick");
+// static const TCHAR *kUnderline = TEXT("Underline");
+
+void SaveRegLang(const UString &langFile)
+{
+ CKey key;
+ key.Create(HKEY_CURRENT_USER, kCUBasePath);
+ key.SetValue(kLangValueName, langFile);
+}
+
+void ReadRegLang(UString &langFile)
+{
+ langFile.Empty();
+ CKey key;
+ if (key.Open(HKEY_CURRENT_USER, kCUBasePath, KEY_READ) == ERROR_SUCCESS)
+ key.QueryValue(kLangValueName, langFile);
+}
+
+void SaveRegEditor(const UString &editorPath)
+{
+ CKey key;
+ key.Create(HKEY_CURRENT_USER, kCU_FMPath);
+ key.SetValue(kEditor, editorPath);
+}
+
+void ReadRegEditor(UString &editorPath)
+{
+ editorPath.Empty();
+ CKey key;
+ if (key.Open(HKEY_CURRENT_USER, kCU_FMPath, KEY_READ) == ERROR_SUCCESS)
+ key.QueryValue(kEditor, editorPath);
+}
+
+static void Save7ZipOption(const TCHAR *value, bool enabled)
+{
+ CKey key;
+ key.Create(HKEY_CURRENT_USER, kCUBasePath);
+ key.SetValue(value, enabled);
+}
+
+static void SaveOption(const TCHAR *value, bool enabled)
+{
+ CKey key;
+ key.Create(HKEY_CURRENT_USER, kCU_FMPath);
+ key.SetValue(value, enabled);
+}
+
+static bool Read7ZipOption(const TCHAR *value, bool defaultValue)
+{
+ CKey key;
+ if (key.Open(HKEY_CURRENT_USER, kCUBasePath, KEY_READ) == ERROR_SUCCESS)
+ {
+ bool enabled;
+ if (key.QueryValue(value, enabled) == ERROR_SUCCESS)
+ return enabled;
+ }
+ return defaultValue;
+}
+
+static bool ReadOption(const TCHAR *value, bool defaultValue)
+{
+ CKey key;
+ if (key.Open(HKEY_CURRENT_USER, kCU_FMPath, KEY_READ) == ERROR_SUCCESS)
+ {
+ bool enabled;
+ if (key.QueryValue(value, enabled) == ERROR_SUCCESS)
+ return enabled;
+ }
+ return defaultValue;
+}
+
+/*
+static void SaveLmOption(const TCHAR *value, bool enabled)
+{
+ CKey key;
+ key.Create(HKEY_LOCAL_MACHINE, kLM_Path);
+ key.SetValue(value, enabled);
+}
+
+static bool ReadLmOption(const TCHAR *value, bool defaultValue)
+{
+ CKey key;
+ if (key.Open(HKEY_LOCAL_MACHINE, kLM_Path, KEY_READ) == ERROR_SUCCESS)
+ {
+ bool enabled;
+ if (key.QueryValue(value, enabled) == ERROR_SUCCESS)
+ return enabled;
+ }
+ return defaultValue;
+}
+*/
+
+void SaveShowDots(bool showDots) { SaveOption(kShowDots, showDots); }
+bool ReadShowDots() { return ReadOption(kShowDots, false); }
+
+void SaveShowRealFileIcons(bool show) { SaveOption(kShowRealFileIcons, show); }
+bool ReadShowRealFileIcons() { return ReadOption(kShowRealFileIcons, false); }
+
+void SaveShowSystemMenu(bool show) { SaveOption(kShowSystemMenu, show); }
+bool ReadShowSystemMenu(){ return ReadOption(kShowSystemMenu, false); }
+
+void SaveFullRow(bool enable) { SaveOption(kFullRow, enable); }
+bool ReadFullRow() { return ReadOption(kFullRow, false); }
+
+void SaveShowGrid(bool enable) { SaveOption(kShowGrid, enable); }
+bool ReadShowGrid(){ return ReadOption(kShowGrid, false); }
+
+void SaveAlternativeSelection(bool enable) { SaveOption(kAlternativeSelection, enable); }
+bool ReadAlternativeSelection(){ return ReadOption(kAlternativeSelection, false); }
+
+/*
+void SaveSingleClick(bool enable) { SaveOption(kSingleClick, enable); }
+bool ReadSingleClick(){ return ReadOption(kSingleClick, false); }
+
+void SaveUnderline(bool enable) { SaveOption(kUnderline, enable); }
+bool ReadUnderline(){ return ReadOption(kUnderline, false); }
+*/
+
+// void SaveLockMemoryAdd(bool enable) { SaveLmOption(kLockMemoryAdd, enable); }
+// bool ReadLockMemoryAdd() { return ReadLmOption(kLockMemoryAdd, true); }
+
+void SaveLockMemoryEnable(bool enable) { Save7ZipOption(kLargePagesEnable, enable); }
+bool ReadLockMemoryEnable() { return Read7ZipOption(kLargePagesEnable, false); }
+
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryUtils.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryUtils.h
new file mode 100644
index 000000000..0fec6f80c
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RegistryUtils.h
@@ -0,0 +1,46 @@
+// RegistryUtils.h
+
+#include "Common/StringConvert.h"
+
+#ifndef __REGISTRYUTILS_H
+#define __REGISTRYUTILS_H
+
+void SaveRegLang(const UString &langFile);
+void ReadRegLang(UString &langFile);
+
+void SaveRegEditor(const UString &editorPath);
+void ReadRegEditor(UString &editorPath);
+
+void SaveShowDots(bool showDots);
+bool ReadShowDots();
+
+void SaveShowRealFileIcons(bool show);
+bool ReadShowRealFileIcons();
+
+void SaveShowSystemMenu(bool showSystemMenu);
+bool ReadShowSystemMenu();
+
+void SaveFullRow(bool enable);
+bool ReadFullRow();
+
+void SaveShowGrid(bool enable);
+bool ReadShowGrid();
+
+void SaveAlternativeSelection(bool enable);
+bool ReadAlternativeSelection();
+
+// void SaveLockMemoryAdd(bool enable);
+// bool ReadLockMemoryAdd();
+
+bool ReadLockMemoryEnable();
+void SaveLockMemoryEnable(bool enable);
+
+/*
+void SaveSingleClick(bool enable);
+bool ReadSingleClick();
+
+void SaveUnderline(bool enable);
+bool ReadUnderline();
+*/
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RootFolder.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RootFolder.cpp
new file mode 100644
index 000000000..bf9083bc4
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RootFolder.cpp
@@ -0,0 +1,278 @@
+// RootFolder.cpp
+
+#include "StdAfx.h"
+
+#include "resource.h"
+
+#include "RootFolder.h"
+
+#include "Common/StringConvert.h"
+#include "../../PropID.h"
+#include "Windows/Defs.h"
+#include "Windows/PropVariant.h"
+
+#ifdef _WIN32
+#include "FSDrives.h"
+#include "PhysDriveFolder.h"
+#include "NetFolder.h"
+#endif
+#include "SysIconUtils.h"
+#include "LangUtils.h"
+
+using namespace NWindows;
+
+
+static const STATPROPSTG kProperties[] =
+{
+ { NULL, kpidName, VT_BSTR}
+};
+
+// static const wchar_t *kMyComputerTitle = L"Computer";
+// static const wchar_t *kMyNetworkTitle = L"Network";
+
+#ifdef _WIN32
+UString RootFolder_GetName_Computer(int &iconIndex)
+{
+ iconIndex = GetIconIndexForCSIDL(CSIDL_DRIVES);
+ return LangString(IDS_COMPUTER, 0x03020300);
+}
+
+UString RootFolder_GetName_Network(int &iconIndex)
+{
+ iconIndex = GetIconIndexForCSIDL(CSIDL_NETWORK);
+ return LangString(IDS_NETWORK, 0x03020301);
+}
+
+UString RootFolder_GetName_Documents(int &iconIndex)
+{
+ iconIndex = GetIconIndexForCSIDL(CSIDL_PERSONAL);
+ return LangString(IDS_DOCUMENTS, 0x03020302); ;
+}
+
+const int ROOT_INDEX_COMPUTER = 0;
+const int ROOT_INDEX_DOCUMENTS = 1;
+const int ROOT_INDEX_NETWORK = 2;
+
+void CRootFolder::Init()
+{
+ _names[ROOT_INDEX_COMPUTER] = RootFolder_GetName_Computer(_iconIndices[ROOT_INDEX_COMPUTER]);
+ _names[ROOT_INDEX_DOCUMENTS] = RootFolder_GetName_Documents(_iconIndices[ROOT_INDEX_DOCUMENTS]);
+ _names[ROOT_INDEX_NETWORK] = RootFolder_GetName_Network(_iconIndices[ROOT_INDEX_NETWORK]);
+};
+#else
+void CRootFolder::Init()
+{
+}
+#endif
+
+STDMETHODIMP CRootFolder::LoadItems()
+{
+ Init();
+ return S_OK;
+}
+
+STDMETHODIMP CRootFolder::GetNumberOfItems(UInt32 *numItems)
+{
+#ifdef _WIN32
+ *numItems = kNumRootFolderItems;
+#else
+ *numItems = 1; // only "/" !
+#endif
+ return S_OK;
+}
+
+STDMETHODIMP CRootFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIANT *value)
+{
+ NCOM::CPropVariant prop;
+ switch(propID)
+ {
+ case kpidIsDir: prop = true; break;
+#ifdef _WIN32
+ case kpidName: prop = _names[itemIndex]; break;
+#else
+ case kpidName: prop = L"/"; break;
+#endif
+ }
+ prop.Detach(value);
+ return S_OK;
+}
+
+#ifdef _WIN32
+UString GetMyDocsPath()
+{
+ UString us;
+ WCHAR s[MAX_PATH + 1];
+ if (SHGetSpecialFolderPathW(0, s, CSIDL_PERSONAL, FALSE))
+ us = s;
+ #ifndef _UNICODE
+ else
+ {
+ CHAR s2[MAX_PATH + 1];
+ if (SHGetSpecialFolderPathA(0, s2, CSIDL_PERSONAL, FALSE))
+ us = GetUnicodeString(s2);
+ }
+ #endif
+ if (us.Length() > 0 && us[us.Length() - 1] != L'\\')
+ us += L'\\';
+ return us;
+}
+#endif
+
+STDMETHODIMP CRootFolder::BindToFolder(UInt32 index, IFolderFolder **resultFolder)
+{
+#ifdef _WIN32
+ if (index == ROOT_INDEX_COMPUTER)
+ {
+ CFSDrives *fsDrivesSpec = new CFSDrives;
+ CMyComPtr<IFolderFolder> subFolder = fsDrivesSpec;
+ fsDrivesSpec->Init();
+ *resultFolder = subFolder.Detach();
+ }
+ else if (index == ROOT_INDEX_NETWORK)
+ {
+ CNetFolder *netFolderSpec = new CNetFolder;
+ CMyComPtr<IFolderFolder> subFolder = netFolderSpec;
+ netFolderSpec->Init(0, 0, _names[ROOT_INDEX_NETWORK] + L'\\');
+ *resultFolder = subFolder.Detach();
+ }
+ else if (index == ROOT_INDEX_DOCUMENTS)
+ {
+ UString s = GetMyDocsPath();
+ if (!s.IsEmpty())
+ {
+ NFsFolder::CFSFolder *fsFolderSpec = new NFsFolder::CFSFolder;
+ CMyComPtr<IFolderFolder> subFolder = fsFolderSpec;
+ RINOK(fsFolderSpec->Init(s, NULL));
+ *resultFolder = subFolder.Detach();
+ }
+ }
+ else
+ return E_INVALIDARG;
+ return S_OK;
+#else
+ return E_INVALIDARG;
+#endif
+}
+
+static bool AreEqualNames(const UString &name1, const UString &name2)
+{
+ return (name1 == name2 || name1 == (name2 + UString(WCHAR_PATH_SEPARATOR)));
+}
+
+STDMETHODIMP CRootFolder::BindToFolder(const wchar_t *name, IFolderFolder **resultFolder)
+{
+ *resultFolder = 0;
+ UString name2 = name;
+ name2.Trim();
+ if (name2.IsEmpty())
+ {
+ CRootFolder *rootFolderSpec = new CRootFolder;
+ CMyComPtr<IFolderFolder> rootFolder = rootFolderSpec;
+ rootFolderSpec->Init();
+ *resultFolder = rootFolder.Detach();
+ return S_OK;
+ }
+#ifdef _WIN32
+ for (int i = 0; i < kNumRootFolderItems; i++)
+ if (AreEqualNames(name2, _names[i]))
+ return BindToFolder((UInt32)i, resultFolder);
+ if (AreEqualNames(name2, L"My Documents") ||
+ AreEqualNames(name2, L"Documents"))
+ return BindToFolder((UInt32)ROOT_INDEX_DOCUMENTS, resultFolder);
+ if (AreEqualNames(name2, L"My Computer") ||
+ AreEqualNames(name2, L"Computer"))
+ return BindToFolder((UInt32)ROOT_INDEX_COMPUTER, resultFolder);
+#endif
+ if (name2 == UString(WCHAR_PATH_SEPARATOR))
+ {
+ CMyComPtr<IFolderFolder> subFolder = this;
+ *resultFolder = subFolder.Detach();
+ return S_OK;
+ }
+
+ if (name2.Length () < 2)
+ return E_INVALIDARG;
+
+ CMyComPtr<IFolderFolder> subFolder;
+
+#ifdef _WIN32
+ if (name2.Left(4) == L"\\\\.\\")
+ {
+ CPhysDriveFolder *folderSpec = new CPhysDriveFolder;
+ subFolder = folderSpec;
+ RINOK(folderSpec->Init(name2.Mid(4, 2)));
+ }
+ else
+#endif
+ {
+ if (name2[name2.Length () - 1] != WCHAR_PATH_SEPARATOR)
+ name2 += WCHAR_PATH_SEPARATOR;
+ NFsFolder::CFSFolder *fsFolderSpec = new NFsFolder::CFSFolder;
+ subFolder = fsFolderSpec;
+ if (fsFolderSpec->Init(name2, 0) != S_OK)
+ {
+#ifdef _WIN32
+ if (name2[0] == WCHAR_PATH_SEPARATOR)
+ {
+ CNetFolder *netFolderSpec = new CNetFolder;
+ subFolder = netFolderSpec;
+ netFolderSpec->Init(name2);
+ }
+ else
+#endif
+ return E_INVALIDARG;
+ }
+ }
+ *resultFolder = subFolder.Detach();
+ return S_OK;
+}
+
+STDMETHODIMP CRootFolder::BindToParentFolder(IFolderFolder **resultFolder)
+{
+ *resultFolder = 0;
+ return S_OK;
+}
+
+STDMETHODIMP CRootFolder::GetNumberOfProperties(UInt32 *numProperties)
+{
+ *numProperties = sizeof(kProperties) / sizeof(kProperties[0]);
+ return S_OK;
+}
+
+STDMETHODIMP CRootFolder::GetPropertyInfo(UInt32 index,
+ BSTR *name, PROPID *propID, VARTYPE *varType)
+{
+ if (index >= sizeof(kProperties) / sizeof(kProperties[0]))
+ return E_INVALIDARG;
+ const STATPROPSTG &prop = kProperties[index];
+ *propID = prop.propid;
+ *varType = prop.vt;
+ *name = 0;
+ return S_OK;
+}
+
+STDMETHODIMP CRootFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value)
+{
+ NWindows::NCOM::CPropVariant prop;
+ switch(propID)
+ {
+ case kpidType: prop = L"RootFolder"; break;
+ case kpidPath: prop = L""; break;
+ }
+ prop.Detach(value);
+ return S_OK;
+}
+
+STDMETHODIMP CRootFolder::GetSystemIconIndex(UInt32 index, INT32 *iconIndex)
+{
+#ifdef _WIN32
+ *iconIndex = _iconIndices[index];
+#else
+ *iconIndex = -1; // FIXME - folder icon ?
+#endif
+ return S_OK;
+}
+
+
+
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RootFolder.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RootFolder.h
new file mode 100644
index 000000000..a65bb7601
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/RootFolder.h
@@ -0,0 +1,38 @@
+// RootFolder.h
+
+#ifndef __ROOTFOLDER_H
+#define __ROOTFOLDER_H
+
+#include "Common/MyString.h"
+
+#include "Windows/PropVariant.h"
+
+#include "FSFolder.h"
+
+#ifdef _WIN32
+const int kNumRootFolderItems = 3;
+#endif
+
+class CRootFolder:
+ public IFolderFolder,
+ public IFolderGetSystemIconIndex,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP1(
+ IFolderGetSystemIconIndex
+ )
+
+ INTERFACE_FolderFolder(;)
+
+ STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex);
+
+ void Init();
+private:
+#ifdef _WIN32
+ UString _names[kNumRootFolderItems];
+ int _iconIndices[kNumRootFolderItems];
+#endif
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog.cpp
new file mode 100644
index 000000000..bab319d19
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog.cpp
@@ -0,0 +1,89 @@
+// SplitDialog.cpp
+
+#include "StdAfx.h"
+#include "SplitDialog.h"
+
+#include "Common/StringToInt.h"
+#include "Windows/Shell.h"
+#include "Windows/FileName.h"
+
+#include "SplitUtils.h"
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+#include "CopyDialogRes.h"
+
+using namespace NWindows;
+
+#ifdef LANG
+static CIDLangPair kIDLangPairs[] =
+{
+ { IDC_STATIC_SPLIT_PATH, 0x03020501 },
+ { IDC_STATIC_SPLIT_VOLUME, 0x02000D40 },
+};
+#endif
+
+
+bool CSplitDialog::OnInit()
+{
+ #ifdef LANG
+ LangSetWindowText(HWND(*this), 0x03020500);
+ LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
+ #endif
+ _pathCombo.Attach(GetItem(IDC_COMBO_SPLIT_PATH));
+ _volumeCombo.Attach(GetItem(IDC_COMBO_SPLIT_VOLUME));
+
+ if (!FilePath.IsEmpty())
+ {
+ UString title;
+ GetText(title);
+ title += L' ';
+ title += FilePath;
+ SetText(title);
+ }
+ _pathCombo.SetText(Path);
+ AddVolumeItems(_volumeCombo);
+ _volumeCombo.SetCurSel(0);
+ return CModalDialog::OnInit();
+}
+
+bool CSplitDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ switch(buttonID)
+ {
+ case IDC_BUTTON_SPLIT_PATH:
+ OnButtonSetPath();
+ return true;
+ }
+ return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
+}
+
+void CSplitDialog::OnButtonSetPath()
+{
+ UString currentPath;
+ _pathCombo.GetText(currentPath);
+ // UString title = L"Specify a location for output folder";
+ UString title = LangStringSpec(IDS_SET_FOLDER, 0x03020209);
+
+ UString resultPath;
+ if (!NShell::BrowseForFolder(HWND(*this), title, currentPath, resultPath))
+ return;
+ NFile::NName::NormalizeDirPathPrefix(resultPath);
+ _pathCombo.SetCurSel(-1);
+ _pathCombo.SetText(resultPath);
+}
+
+void CSplitDialog::OnOK()
+{
+ _pathCombo.GetText(Path);
+ UString volumeString;
+ _volumeCombo.GetText(volumeString);
+ volumeString.Trim();
+ if (!ParseVolumeSizes(volumeString, VolumeSizes) || VolumeSizes.Size() == 0)
+ {
+ ::MessageBoxW(*this, LangString(IDS_COMPRESS_INCORRECT_VOLUME_SIZE, 0x02000D41), L"7-Zip", 0);
+ return;
+ }
+ CModalDialog::OnOK();
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog.h
new file mode 100644
index 000000000..607a3daf5
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog.h
@@ -0,0 +1,27 @@
+// SplitDialog.h
+
+#ifndef __SPLITDIALOG_H
+#define __SPLITDIALOG_H
+
+#include "Common/Types.h"
+#include "Windows/Control/Dialog.h"
+#include "Windows/Control/ComboBox.h"
+#include "SplitDialogRes.h"
+
+class CSplitDialog: public NWindows::NControl::CModalDialog
+{
+ NWindows::NControl::CComboBox _pathCombo;
+ NWindows::NControl::CComboBox _volumeCombo;
+ virtual void OnOK();
+ virtual bool OnInit();
+ virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
+ void OnButtonSetPath();
+public:
+ UString FilePath;
+ UString Path;
+ CRecordVector<UInt64> VolumeSizes;
+ INT_PTR Create(HWND parentWindow = 0)
+ { return CModalDialog::Create(IDD_DIALOG_SPLIT, parentWindow); }
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialogRes.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialogRes.h
new file mode 100644
index 000000000..019b70292
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialogRes.h
@@ -0,0 +1,8 @@
+#define IDD_DIALOG_SPLIT 504
+#define IDC_STATIC_SPLIT_PATH 1000
+#define IDC_COMBO_SPLIT_PATH 1001
+#define IDC_BUTTON_SPLIT_PATH 1002
+#define IDC_STATIC_SPLIT_VOLUME 1010
+#define IDC_COMBO_SPLIT_VOLUME 1011
+
+#define IDS_COMPRESS_INCORRECT_VOLUME_SIZE 95
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog_rc.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog_rc.cpp
new file mode 100644
index 000000000..848b84ad7
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitDialog_rc.cpp
@@ -0,0 +1,79 @@
+// PasswordDialog.cpp
+
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+// for all others, include the necessary headers (this file is usually all you
+// need because it includes almost all "standard" wxWidgets headers)
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+#include "Windows/Control/DialogImpl.h"
+
+#include "SplitDialogRes.h"
+
+class CSplitDialogImpl : public NWindows::NControl::CModalDialogImpl
+{
+ public:
+ CSplitDialogImpl(NWindows::NControl::CModalDialog *dialog,wxWindow * parent,int id) : CModalDialogImpl(dialog, parent, id, wxT("Split File"))
+ {
+
+ wxArrayString pathArray;
+
+ wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
+
+
+ topsizer->Add(new wxStaticText(this, IDC_STATIC_SPLIT_PATH, _T("&Split to:")) , 0 ,wxALL | wxALIGN_LEFT, 5 );
+
+
+ {
+ wxBoxSizer *pathSizer = new wxBoxSizer(wxHORIZONTAL);
+
+ wxComboBox *combo = new wxComboBox(this, IDC_COMBO_SPLIT_PATH, wxEmptyString, wxDefaultPosition, wxSize(600,-1), pathArray, wxCB_DROPDOWN|wxCB_SORT);
+ wxButton *button = new wxButton(this, IDC_BUTTON_SPLIT_PATH, wxT("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
+ pathSizer->Add(combo, 1, wxLEFT|wxRIGHT|wxEXPAND, 5);
+ pathSizer->Add(button, 0, wxLEFT|wxRIGHT|wxEXPAND, 5);
+
+ topsizer->Add(pathSizer, 0 ,wxALL | wxALIGN_LEFT, 5 );
+ }
+
+ topsizer->Add(new wxStaticText(this, IDC_STATIC_SPLIT_VOLUME, _T("Split to &volumes, bytes:")) , 0 ,wxALL | wxALIGN_LEFT, 5 );
+
+ wxComboBox *combo = new wxComboBox(this, IDC_COMBO_SPLIT_VOLUME, wxEmptyString, wxDefaultPosition, wxSize(600,-1), pathArray, wxCB_DROPDOWN|wxCB_SORT);
+
+ topsizer->Add(combo, 0 ,wxALL | wxALIGN_LEFT, 5 );
+
+
+ topsizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxALL|wxEXPAND, 5);
+
+ this->OnInit();
+
+ SetSizer(topsizer); // use the sizer for layout
+ topsizer->SetSizeHints(this); // set size hints to honour minimum size
+ }
+private:
+ // Any class wishing to process wxWindows events must use this macro
+ DECLARE_EVENT_TABLE()
+};
+
+static CStringTable g_stringTable[] =
+{
+ { IDS_COMPRESS_INCORRECT_VOLUME_SIZE, L"Incorrect volume size" },
+ { 0 , 0 }
+};
+
+
+REGISTER_DIALOG(IDD_DIALOG_SPLIT,CSplitDialog,g_stringTable)
+
+BEGIN_EVENT_TABLE(CSplitDialogImpl, wxDialog)
+ EVT_BUTTON(wxID_ANY, CModalDialogImpl::OnAnyButton)
+ EVT_CHECKBOX(wxID_ANY, CModalDialogImpl::OnAnyButton)
+END_EVENT_TABLE()
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitUtils.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitUtils.cpp
new file mode 100644
index 000000000..3a7635fa1
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitUtils.cpp
@@ -0,0 +1,85 @@
+// SplitUtils.cpp
+
+#include "StdAfx.h"
+
+#include "Common/StringToInt.h"
+
+#include "SplitUtils.h"
+#include "StringUtils.h"
+
+bool ParseVolumeSizes(const UString &s, CRecordVector<UInt64> &values)
+{
+ values.Clear();
+ UStringVector destStrings;
+ SplitString(s, destStrings);
+ bool prevIsNumber = false;
+ for (int i = 0; i < destStrings.Size(); i++)
+ {
+ UString subString = destStrings[i];
+ subString.MakeUpper();
+ if (subString.IsEmpty())
+ return false;
+ if (subString == L"-")
+ return true;
+ if (prevIsNumber)
+ {
+ wchar_t c = subString[0];
+ UInt64 &value = values.Back();
+ prevIsNumber = false;
+ switch(c)
+ {
+ case L'B':
+ continue;
+ case L'K':
+ value <<= 10;
+ continue;
+ case L'M':
+ value <<= 20;
+ continue;
+ case L'G':
+ value <<= 30;
+ continue;
+ }
+ }
+ const wchar_t *start = subString;
+ const wchar_t *end;
+ UInt64 value = ConvertStringToUInt64(start, &end);
+ if (start == end)
+ return false;
+ if (value == 0)
+ return false;
+ values.Add(value);
+ prevIsNumber = true;
+ UString rem = subString.Mid((int)(end - start));
+ if (!rem.IsEmpty())
+ destStrings.Insert(i + 1, rem);
+ }
+ return true;
+}
+
+void AddVolumeItems(NWindows::NControl::CComboBox &volumeCombo)
+{
+ volumeCombo.AddString(TEXT("1457664 - 3.5\" floppy"));
+ volumeCombo.AddString(TEXT("650M - CD"));
+ volumeCombo.AddString(TEXT("700M - CD"));
+ volumeCombo.AddString(TEXT("4480M - DVD"));
+}
+
+UInt64 GetNumberOfVolumes(UInt64 size, CRecordVector<UInt64> &volSizes)
+{
+ if (size == 0 || volSizes.Size() == 0)
+ return 1;
+ UInt64 numVolumes = 0;
+ for (int i = 0; i < volSizes.Size(); i++)
+ {
+ UInt64 volSize = volSizes[i];
+ numVolumes++;
+ if (volSize >= size)
+ return numVolumes;
+ size -= volSize;
+ }
+ UInt64 volSize = volSizes.Back();
+ if (volSize == 0)
+ return (UInt64)(Int64)-1;
+ return numVolumes + (size - 1) / volSize + 1;
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitUtils.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitUtils.h
new file mode 100644
index 000000000..755c707c3
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SplitUtils.h
@@ -0,0 +1,15 @@
+// SplitUtils.h
+
+#ifndef __SPLITUTILS_H
+#define __SPLITUTILS_H
+
+#include "Common/MyString.h"
+#include "Common/Types.h"
+#include "Windows/Control/ComboBox.h"
+
+bool ParseVolumeSizes(const UString &s, CRecordVector<UInt64> &values);
+void AddVolumeItems(NWindows::NControl::CComboBox &volumeCombo);
+
+UInt64 GetNumberOfVolumes(UInt64 size, CRecordVector<UInt64> &volSizes);
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/StringUtils.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/StringUtils.cpp
new file mode 100644
index 000000000..bddaa971e
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/StringUtils.cpp
@@ -0,0 +1,68 @@
+// StringUtils.cpp
+
+#include "StdAfx.h"
+
+#include "StringUtils.h"
+
+void SplitStringToTwoStrings(const UString &src, UString &dest1, UString &dest2)
+{
+ dest1.Empty();
+ dest2.Empty();
+ bool quoteMode = false;
+ int i;
+ for (i = 0; i < src.Length(); i++)
+ {
+ wchar_t c = src[i];
+ if (c == L'\"')
+ quoteMode = !quoteMode;
+ else if (c == L' ' && !quoteMode)
+ {
+ if (!quoteMode)
+ {
+ i++;
+ break;
+ }
+ }
+ else
+ dest1 += c;
+ }
+ dest2 = src.Mid(i);
+}
+
+void SplitString(const UString &srcString, UStringVector &destStrings)
+{
+ destStrings.Clear();
+ UString string;
+ int len = srcString.Length();
+ if (len == 0)
+ return;
+ for (int i = 0; i < len; i++)
+ {
+ wchar_t c = srcString[i];
+ if (c == L' ')
+ {
+ if (!string.IsEmpty())
+ {
+ destStrings.Add(string);
+ string.Empty();
+ }
+ }
+ else
+ string += c;
+ }
+ if (!string.IsEmpty())
+ destStrings.Add(string);
+}
+
+UString JoinStrings(const UStringVector &srcStrings)
+{
+ UString destString;
+ for (int i = 0; i < srcStrings.Size(); i++)
+ {
+ if (i != 0)
+ destString += L' ';
+ destString += srcStrings[i];
+ }
+ return destString;
+}
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/StringUtils.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/StringUtils.h
new file mode 100644
index 000000000..7f72b7641
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/StringUtils.h
@@ -0,0 +1,13 @@
+// StringUtils.h
+
+#ifndef __STRINGUTILS_H
+#define __STRINGUTILS_H
+
+#include "Common/MyString.h"
+
+void SplitStringToTwoStrings(const UString &src, UString &dest1, UString &dest2);
+
+void SplitString(const UString &srcString, UStringVector &destStrings);
+UString JoinStrings(const UStringVector &srcStrings);
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SysIconUtils.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SysIconUtils.cpp
new file mode 100644
index 000000000..d177b66e1
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SysIconUtils.cpp
@@ -0,0 +1,167 @@
+// SysIconUtils.h
+
+#include "StdAfx.h"
+
+#include "SysIconUtils.h"
+#ifndef _UNICODE
+#include "Common/StringConvert.h"
+#endif
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+int GetIconIndexForCSIDL(int csidl)
+{
+#ifdef _WIN32
+ LPITEMIDLIST pidl = 0;
+ SHGetSpecialFolderLocation(NULL, csidl, &pidl);
+ if (pidl)
+ {
+ SHFILEINFO shellInfo;
+ SHGetFileInfo(LPCTSTR(pidl), FILE_ATTRIBUTE_NORMAL,
+ &shellInfo, sizeof(shellInfo),
+ SHGFI_PIDL | SHGFI_SYSICONINDEX);
+ IMalloc *pMalloc;
+ SHGetMalloc(&pMalloc);
+ if(pMalloc)
+ {
+ pMalloc->Free(pidl);
+ pMalloc->Release();
+ }
+ return shellInfo.iIcon;
+ }
+#endif // FIXME -1 ?
+ return 0;
+}
+
+DWORD_PTR GetRealIconIndex(LPCTSTR path, DWORD attributes, int &iconIndex)
+{
+#ifdef _WIN32
+ SHFILEINFO shellInfo;
+ DWORD_PTR res = ::SHGetFileInfo(path, FILE_ATTRIBUTE_NORMAL | attributes, &shellInfo,
+ sizeof(shellInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX);
+ iconIndex = shellInfo.iIcon;
+ return res;
+#else
+ return -1;
+#endif
+}
+
+
+#ifdef _WIN32
+
+#ifndef _UNICODE
+typedef int (WINAPI * SHGetFileInfoWP)(LPCWSTR pszPath, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags);
+
+struct CSHGetFileInfoInit
+{
+ SHGetFileInfoWP shGetFileInfoW;
+ CSHGetFileInfoInit()
+ {
+ shGetFileInfoW = (SHGetFileInfoWP)
+ ::GetProcAddress(::GetModuleHandleW(L"shell32.dll"), "SHGetFileInfoW");
+ }
+} g_SHGetFileInfoInit;
+#endif
+
+DWORD_PTR MySHGetFileInfoW(LPCWSTR pszPath, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags)
+{
+ #ifdef _UNICODE
+ return SHGetFileInfoW(
+ #else
+ if (g_SHGetFileInfoInit.shGetFileInfoW == 0)
+ return 0;
+ return g_SHGetFileInfoInit.shGetFileInfoW(
+ #endif
+ pszPath, dwFileAttributes, psfi, cbFileInfo, uFlags);
+}
+
+#ifndef _UNICODE
+// static inline UINT GetCurrentCodePage() { return ::AreFileApisANSI() ? CP_ACP : CP_OEMCP; }
+DWORD_PTR GetRealIconIndex(LPCWSTR path, DWORD attributes, int &iconIndex)
+{
+ if(g_IsNT)
+ {
+ SHFILEINFOW shellInfo;
+ DWORD_PTR res = ::MySHGetFileInfoW(path, FILE_ATTRIBUTE_NORMAL | attributes, &shellInfo,
+ sizeof(shellInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX);
+ iconIndex = shellInfo.iIcon;
+ return res;
+ }
+ else
+ return GetRealIconIndex(UnicodeStringToMultiByte(path), attributes, iconIndex);
+}
+#endif
+
+DWORD_PTR GetRealIconIndex(const UString &fileName, DWORD attributes,
+ int &iconIndex, UString &typeName)
+{
+ #ifndef _UNICODE
+ if(!g_IsNT)
+ {
+ SHFILEINFO shellInfo;
+ shellInfo.szTypeName[0] = 0;
+ DWORD_PTR res = ::SHGetFileInfoA(GetSystemString(fileName), FILE_ATTRIBUTE_NORMAL | attributes, &shellInfo,
+ sizeof(shellInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX
+ | SHGFI_TYPENAME);
+ typeName = GetUnicodeString(shellInfo.szTypeName);
+ iconIndex = shellInfo.iIcon;
+ return res;
+ }
+ else
+ #endif
+ {
+ SHFILEINFOW shellInfo;
+ shellInfo.szTypeName[0] = 0;
+ DWORD_PTR res = ::MySHGetFileInfoW(fileName, FILE_ATTRIBUTE_NORMAL | attributes, &shellInfo,
+ sizeof(shellInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX
+ | SHGFI_TYPENAME);
+ typeName = shellInfo.szTypeName;
+ iconIndex = shellInfo.iIcon;
+ return res;
+ }
+}
+
+int CExtToIconMap::GetIconIndex(UINT32 attributes, const UString &fileNameSpec, UString &typeName)
+{
+ UString fileName = fileNameSpec;
+ if ((attributes & FILE_ATTRIBUTE_DIRECTORY) != 0)
+ {
+ fileName = L"__Fldr__";
+ if (_dirIconIndex < 0)
+ GetRealIconIndex(fileName, attributes, _dirIconIndex, _dirTypeName);
+ typeName = _dirTypeName;
+ return _dirIconIndex;
+ }
+ int dotPos = fileName.ReverseFind('.');
+ if (dotPos < 0)
+ {
+ fileName = L"__File__";
+ if (_noExtIconIndex < 0)
+ {
+ int iconIndexTemp;
+ GetRealIconIndex(fileName, attributes, iconIndexTemp, _noExtTypeName);
+ }
+ typeName = _noExtTypeName;
+ return _noExtIconIndex;
+ }
+ CExtIconPair extIconPair;
+ extIconPair.Ext = fileName.Mid(dotPos + 1);
+ int anIndex = _map.FindInSorted(extIconPair);
+ if (anIndex >= 0)
+ return _map[anIndex].IconIndex;
+ fileName = fileName.Mid(dotPos);
+ GetRealIconIndex(fileName, attributes, extIconPair.IconIndex, extIconPair.TypeName);
+ _map.AddToSorted(extIconPair);
+ typeName = extIconPair.TypeName;
+ return extIconPair.IconIndex;
+}
+
+int CExtToIconMap::GetIconIndex(UINT32 attributes, const UString &fileName)
+{
+ UString typeName;
+ return GetIconIndex(attributes, fileName, typeName);
+}
+#endif
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SysIconUtils.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SysIconUtils.h
new file mode 100644
index 000000000..a90d28bc2
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/SysIconUtils.h
@@ -0,0 +1,51 @@
+// SysIconUtils.h
+
+#ifndef __SYSICONUTILS_H
+#define __SYSICONUTILS_H
+
+#include "Common/MyString.h"
+
+struct CExtIconPair
+{
+ UString Ext;
+ int IconIndex;
+ UString TypeName;
+
+};
+
+inline bool operator==(const CExtIconPair &a1, const CExtIconPair &a2)
+{
+ return (a1.Ext == a2.Ext);
+}
+
+inline bool operator<(const CExtIconPair &a1, const CExtIconPair &a2)
+{
+ return (a1.Ext < a2.Ext);
+}
+
+class CExtToIconMap
+{
+ int _dirIconIndex;
+ UString _dirTypeName;
+ int _noExtIconIndex;
+ UString _noExtTypeName;
+ CObjectVector<CExtIconPair> _map;
+public:
+ CExtToIconMap(): _dirIconIndex(-1), _noExtIconIndex(-1) {}
+ void Clear()
+ {
+ _dirIconIndex = -1;
+ _noExtIconIndex = -1;
+ _map.Clear();
+ }
+ int GetIconIndex(UINT32 attributes, const UString &fileName, UString &typeName);
+ int GetIconIndex(UINT32 attributes, const UString &fileName);
+};
+
+DWORD_PTR GetRealIconIndex(LPCTSTR path, DWORD attributes, int &iconIndex);
+#ifndef _UNICODE
+DWORD_PTR GetRealIconIndex(LPCWSTR path, DWORD attributes, int &iconIndex);
+#endif
+int GetIconIndexForCSIDL(int csidl);
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/TextPairs.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/TextPairs.cpp
new file mode 100644
index 000000000..cc57c0d56
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/TextPairs.cpp
@@ -0,0 +1,189 @@
+// TextPairs.cpp
+
+#include "StdAfx.h"
+
+#include "TextPairs.h"
+
+static const wchar_t kNewLineChar = '\n';
+static const wchar_t kQuoteChar = '\"';
+
+static const wchar_t kBOM = (wchar_t)0xFEFF;
+
+static bool IsSeparatorChar(wchar_t c)
+{
+ return (c == ' ' || c == '\t');
+}
+
+static void RemoveCr(UString &s)
+{
+ s.Replace(L"\x0D", L"");
+}
+
+static UString GetIDString(const wchar_t *srcString, int &finishPos)
+{
+ UString result;
+ bool quotes = false;
+ for (finishPos = 0;;)
+ {
+ wchar_t c = srcString[finishPos];
+ if (c == 0)
+ break;
+ finishPos++;
+ bool isSeparatorChar = IsSeparatorChar(c);
+ if (c == kNewLineChar || (isSeparatorChar && !quotes)
+ || (c == kQuoteChar && quotes))
+ break;
+ else if (c == kQuoteChar)
+ quotes = true;
+ else
+ result += c;
+ }
+ result.Trim();
+ RemoveCr(result);
+ return result;
+}
+
+static UString GetValueString(const wchar_t *srcString, int &finishPos)
+{
+ UString result;
+ for (finishPos = 0;;)
+ {
+ wchar_t c = srcString[finishPos];
+ if (c == 0)
+ break;
+ finishPos++;
+ if (c == kNewLineChar)
+ break;
+ result += c;
+ }
+ result.Trim();
+ RemoveCr(result);
+ return result;
+}
+
+static bool GetTextPairs(const UString &srcString, CObjectVector<CTextPair> &pairs)
+{
+ pairs.Clear();
+ int pos = 0;
+
+ if (srcString.Length() > 0)
+ {
+ if (srcString[0] == kBOM)
+ pos++;
+ }
+ while (pos < srcString.Length())
+ {
+ int finishPos;
+ UString id = GetIDString((const wchar_t *)srcString + pos, finishPos);
+ pos += finishPos;
+ if (id.IsEmpty())
+ continue;
+ UString value = GetValueString((const wchar_t *)srcString + pos, finishPos);
+ pos += finishPos;
+ if (!id.IsEmpty())
+ {
+ CTextPair pair;
+ pair.ID = id;
+ pair.Value = value;
+ pairs.Add(pair);
+ }
+ }
+ return true;
+}
+
+static int ComparePairIDs(const UString &s1, const UString &s2)
+ { return s1.CompareNoCase(s2); }
+static int ComparePairItems(const CTextPair &p1, const CTextPair &p2)
+ { return ComparePairIDs(p1.ID, p2.ID); }
+
+static int ComparePairItems(void *const *a1, void *const *a2, void * /* param */)
+ { return ComparePairItems(**(const CTextPair **)a1, **(const CTextPair **)a2); }
+
+void CPairsStorage::Sort() { Pairs.Sort(ComparePairItems, 0); }
+
+int CPairsStorage::FindID(const UString &id, int &insertPos)
+{
+ int left = 0, right = Pairs.Size();
+ while (left != right)
+ {
+ int mid = (left + right) / 2;
+ int compResult = ComparePairIDs(id, Pairs[mid].ID);
+ if (compResult == 0)
+ return mid;
+ if (compResult < 0)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ insertPos = left;
+ return -1;
+}
+
+int CPairsStorage::FindID(const UString &id)
+{
+ int pos;
+ return FindID(id, pos);
+}
+
+void CPairsStorage::AddPair(const CTextPair &pair)
+{
+ int insertPos;
+ int pos = FindID(pair.ID, insertPos);
+ if (pos >= 0)
+ Pairs[pos] = pair;
+ else
+ Pairs.Insert(insertPos, pair);
+}
+
+void CPairsStorage::DeletePair(const UString &id)
+{
+ int pos = FindID(id);
+ if (pos >= 0)
+ Pairs.Delete(pos);
+}
+
+bool CPairsStorage::GetValue(const UString &id, UString &value)
+{
+ value.Empty();
+ int pos = FindID(id);
+ if (pos < 0)
+ return false;
+ value = Pairs[pos].Value;
+ return true;
+}
+
+UString CPairsStorage::GetValue(const UString &id)
+{
+ int pos = FindID(id);
+ if (pos < 0)
+ return UString();
+ return Pairs[pos].Value;
+}
+
+bool CPairsStorage::ReadFromString(const UString &text)
+{
+ bool result = ::GetTextPairs(text, Pairs);
+ if (result)
+ Sort();
+ else
+ Pairs.Clear();
+ return result;
+}
+
+void CPairsStorage::SaveToString(UString &text)
+{
+ for (int i = 0; i < Pairs.Size(); i++)
+ {
+ const CTextPair &pair = Pairs[i];
+ bool multiWord = (pair.ID.Find(L' ') >= 0);
+ if (multiWord)
+ text += L'\"';
+ text += pair.ID;
+ if (multiWord)
+ text += L'\"';
+ text += L' ';
+ text += pair.Value;
+ text += L'\x0D';
+ text += L'\n';
+ }
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/TextPairs.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/TextPairs.h
new file mode 100644
index 000000000..2670e0307
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/TextPairs.h
@@ -0,0 +1,31 @@
+// TextPairs.h
+
+#ifndef __FM_TEXT_PAIRS_H
+#define __FM_TEXT_PAIRS_H
+
+#include "Common/MyString.h"
+
+struct CTextPair
+{
+ UString ID;
+ UString Value;
+};
+
+class CPairsStorage
+{
+ CObjectVector<CTextPair> Pairs;
+ int FindID(const UString &id, int &insertPos);
+ int FindID(const UString &id);
+ void Sort();
+public:
+ void Clear() { Pairs.Clear(); };
+ bool ReadFromString(const UString &text);
+ void SaveToString(UString &text);
+
+ bool GetValue(const UString &id, UString &value);
+ UString GetValue(const UString &id);
+ void AddPair(const CTextPair &pair);
+ void DeletePair(const UString &id);
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/UpdateCallback100.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/UpdateCallback100.cpp
new file mode 100644
index 000000000..3701d2bbf
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/UpdateCallback100.cpp
@@ -0,0 +1,106 @@
+// UpdateCallback100.cpp
+
+#include "StdAfx.h"
+
+#include "MessagesDialog.h"
+#include "PasswordDialog.h"
+#include "UpdateCallback100.h"
+
+CUpdateCallback100Imp::~CUpdateCallback100Imp()
+{
+ if (ShowMessages && !Messages.IsEmpty())
+ {
+ CMessagesDialog messagesDialog;
+ messagesDialog.Messages = &Messages;
+ messagesDialog.Create(_parentWindow);
+ }
+}
+
+void CUpdateCallback100Imp::AddErrorMessage(LPCWSTR message)
+{
+ Messages.Add(message);
+}
+
+STDMETHODIMP CUpdateCallback100Imp::SetNumFiles(UInt64 numFiles)
+{
+ ProgressDialog.ProgressSynch.SetNumFilesTotal(numFiles);
+ return S_OK;
+}
+
+STDMETHODIMP CUpdateCallback100Imp::SetTotal(UInt64 size)
+{
+ ProgressDialog.ProgressSynch.SetProgress(size, 0);
+ return S_OK;
+}
+
+STDMETHODIMP CUpdateCallback100Imp::SetCompleted(const UInt64 *completeValue)
+{
+ RINOK(ProgressDialog.ProgressSynch.ProcessStopAndPause());
+ if (completeValue != NULL)
+ ProgressDialog.ProgressSynch.SetPos(*completeValue);
+ return S_OK;
+}
+
+STDMETHODIMP CUpdateCallback100Imp::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
+{
+ ProgressDialog.ProgressSynch.SetRatioInfo(inSize, outSize);
+ return S_OK;
+}
+
+STDMETHODIMP CUpdateCallback100Imp::CompressOperation(const wchar_t *name)
+{
+ ProgressDialog.ProgressSynch.SetCurrentFileName(name);
+ return S_OK;
+}
+
+STDMETHODIMP CUpdateCallback100Imp::DeleteOperation(const wchar_t *name)
+{
+ ProgressDialog.ProgressSynch.SetCurrentFileName(name);
+ return S_OK;
+}
+
+STDMETHODIMP CUpdateCallback100Imp::OperationResult(Int32 /* operationResult */)
+{
+ NumFiles++;
+ ProgressDialog.ProgressSynch.SetNumFilesCur(NumFiles);
+ return S_OK;
+}
+
+STDMETHODIMP CUpdateCallback100Imp::UpdateErrorMessage(const wchar_t *message)
+{
+ AddErrorMessage(message);
+ return S_OK;
+}
+
+STDMETHODIMP CUpdateCallback100Imp::CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password)
+{
+ *password = NULL;
+ *passwordIsDefined = BoolToInt(_passwordIsDefined);
+ if (!_passwordIsDefined)
+ return S_OK;
+ return StringToBstr(_password, password);
+}
+
+STDMETHODIMP CUpdateCallback100Imp::SetTotal(const UInt64 * /* files */, const UInt64 * /* bytes */)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CUpdateCallback100Imp::SetCompleted(const UInt64 * /* files */, const UInt64 * /* bytes */)
+{
+ return ProgressDialog.ProgressSynch.ProcessStopAndPause();
+}
+
+STDMETHODIMP CUpdateCallback100Imp::CryptoGetTextPassword(BSTR *password)
+{
+ *password = NULL;
+ if (!_passwordIsDefined)
+ {
+ CPasswordDialog dialog;
+ if (dialog.Create(_parentWindow) == IDCANCEL)
+ return E_ABORT;
+ _password = dialog.Password;
+ _passwordIsDefined = true;
+ }
+ return StringToBstr(_password, password);
+}
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/UpdateCallback100.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/UpdateCallback100.h
new file mode 100644
index 000000000..5ae194a2a
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/UpdateCallback100.h
@@ -0,0 +1,72 @@
+// UpdateCallback100.h
+
+#ifndef __UPDATE_CALLBACK100_H
+#define __UPDATE_CALLBACK100_H
+
+#include "Common/MyCom.h"
+#include "Common/MyString.h"
+
+#include "../Agent/IFolderArchive.h"
+#include "ProgressDialog2.h"
+#include "../../IPassword.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+class CUpdateCallback100Imp:
+ public IFolderArchiveUpdateCallback,
+ public ICryptoGetTextPassword2,
+ public ICryptoGetTextPassword,
+ public IArchiveOpenCallback,
+ public ICompressProgressInfo,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP5(
+ IFolderArchiveUpdateCallback,
+ ICryptoGetTextPassword2,
+ ICryptoGetTextPassword,
+ IArchiveOpenCallback,
+ ICompressProgressInfo)
+
+ INTERFACE_IProgress(;)
+ INTERFACE_IArchiveOpenCallback(;)
+ INTERFACE_IFolderArchiveUpdateCallback(;)
+
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+ STDMETHOD(CryptoGetTextPassword2)(Int32 *passwordIsDefined, BSTR *password);
+private:
+ bool _passwordIsDefined;
+ UString _password;
+
+ void AddErrorMessage(LPCWSTR message);
+ bool ShowMessages;
+
+public:
+ CUpdateCallback100Imp(): ShowMessages(true) {}
+ ~CUpdateCallback100Imp();
+ CProgressDialog ProgressDialog;
+ HWND _parentWindow;
+ UStringVector Messages;
+ UInt64 NumFolders;
+ UInt64 NumFiles;
+
+ void Init(HWND parentWindow,
+ bool passwordIsDefined, const UString &password)
+ {
+ _passwordIsDefined = passwordIsDefined;
+ _password = password;
+ _parentWindow = parentWindow;
+ NumFolders = NumFiles = 0;
+ }
+ void StartProgressDialog(const UString &title)
+ {
+ ProgressDialog.Create(title, _parentWindow);
+ }
+
+};
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ViewSettings.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ViewSettings.cpp
new file mode 100644
index 000000000..53974eab1
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ViewSettings.cpp
@@ -0,0 +1,426 @@
+// ViewSettings.h
+
+#include "StdAfx.h"
+
+#include "Common/IntToString.h"
+#include "Common/StringConvert.h"
+
+#include "ViewSettings.h"
+#include "Windows/Registry.h"
+#include "Windows/Synchronization.h"
+
+using namespace NWindows;
+using namespace NRegistry;
+
+#define REG_PATH_FM TEXT("Software") TEXT(STRING_PATH_SEPARATOR) TEXT("7-ZIP") TEXT(STRING_PATH_SEPARATOR) TEXT("FM")
+
+static const TCHAR *kCUBasePath = REG_PATH_FM;
+static const TCHAR *kCulumnsKeyName = REG_PATH_FM TEXT(STRING_PATH_SEPARATOR) TEXT("Columns");
+
+static const TCHAR *kPositionValueName = TEXT("Position");
+static const TCHAR *kPanelsInfoValueName = TEXT("Panels");
+static const TCHAR *kToolbars = TEXT("Toolbars");
+
+static const WCHAR *kPanelPathValueName = L"PanelPath";
+static const TCHAR *kListMode = TEXT("ListMode");
+static const TCHAR *kFolderHistoryValueName = TEXT("FolderHistory");
+static const TCHAR *kFastFoldersValueName = TEXT("FolderShortcuts");
+static const TCHAR *kCopyHistoryValueName = TEXT("CopyHistory");
+
+/*
+class CColumnInfoSpec
+{
+ UInt32 PropID;
+ Byte IsVisible;
+ UInt32 Width;
+};
+
+struct CColumnHeader
+{
+ UInt32 Version;
+ UInt32 SortID;
+ Byte Ascending;
+};
+*/
+
+static const UInt32 kColumnInfoSpecHeader = 12;
+static const UInt32 kColumnHeaderSize = 12;
+
+static const UInt32 kColumnInfoVersion = 1;
+
+static NSynchronization::CCriticalSection g_RegistryOperationsCriticalSection;
+
+class CTempOutBufferSpec
+{
+ CByteBuffer Buffer;
+ UInt32 Size;
+ UInt32 Pos;
+public:
+ operator const Byte *() const { return (const Byte *)Buffer; }
+ void Init(UInt32 dataSize)
+ {
+ Buffer.SetCapacity(dataSize);
+ Size = dataSize;
+ Pos = 0;
+ }
+ void WriteByte(Byte value)
+ {
+ if (Pos >= Size)
+ throw "overflow";
+ ((Byte *)Buffer)[Pos++] = value;
+ }
+ void WriteUInt32(UInt32 value)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ WriteByte((Byte)value);
+ value >>= 8;
+ }
+ }
+ void WriteBool(bool value)
+ {
+ WriteUInt32(value ? 1 : 0);
+ }
+};
+
+class CTempInBufferSpec
+{
+public:
+ Byte *Buffer;
+ UInt32 Size;
+ UInt32 Pos;
+ Byte ReadByte()
+ {
+ if (Pos >= Size)
+ throw "overflow";
+ return Buffer[Pos++];
+ }
+ UInt32 ReadUInt32()
+ {
+ UInt32 value = 0;
+ for (int i = 0; i < 4; i++)
+ value |= (((UInt32)ReadByte()) << (8 * i));
+ return value;
+ }
+ bool ReadBool()
+ {
+ return (ReadUInt32() != 0);
+ }
+};
+
+void SaveListViewInfo(const UString &id, const CListViewInfo &viewInfo)
+{
+ const CObjectVector<CColumnInfo> &columns = viewInfo.Columns;
+ CTempOutBufferSpec buffer;
+ UInt32 dataSize = kColumnHeaderSize + kColumnInfoSpecHeader * columns.Size();
+ buffer.Init(dataSize);
+
+ buffer.WriteUInt32(kColumnInfoVersion);
+ buffer.WriteUInt32(viewInfo.SortID);
+ buffer.WriteBool(viewInfo.Ascending);
+ for(int i = 0; i < columns.Size(); i++)
+ {
+ const CColumnInfo &column = columns[i];
+ buffer.WriteUInt32(column.PropID);
+ buffer.WriteBool(column.IsVisible);
+ buffer.WriteUInt32(column.Width);
+ }
+ {
+ NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
+ CKey key;
+ key.Create(HKEY_CURRENT_USER, kCulumnsKeyName);
+ key.SetValue(GetSystemString(id), (const Byte *)buffer, dataSize);
+ }
+}
+
+void ReadListViewInfo(const UString &id, CListViewInfo &viewInfo)
+{
+ viewInfo.Clear();
+ CObjectVector<CColumnInfo> &columns = viewInfo.Columns;
+ CByteBuffer buffer;
+ UInt32 size;
+ {
+ NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
+ CKey key;
+ if(key.Open(HKEY_CURRENT_USER, kCulumnsKeyName, KEY_READ) != ERROR_SUCCESS)
+ return;
+ if (key.QueryValue(GetSystemString(id), buffer, size) != ERROR_SUCCESS)
+ return;
+ }
+ if (size < kColumnHeaderSize)
+ return;
+ CTempInBufferSpec inBuffer;
+ inBuffer.Size = size;
+ inBuffer.Buffer = (Byte *)buffer;
+ inBuffer.Pos = 0;
+
+
+ UInt32 version = inBuffer.ReadUInt32();
+ if (version != kColumnInfoVersion)
+ return;
+ viewInfo.SortID = inBuffer.ReadUInt32();
+ viewInfo.Ascending = inBuffer.ReadBool();
+
+ size -= kColumnHeaderSize;
+ if (size % kColumnInfoSpecHeader != 0)
+ return;
+ int numItems = size / kColumnInfoSpecHeader;
+ columns.Reserve(numItems);
+ for(int i = 0; i < numItems; i++)
+ {
+ CColumnInfo columnInfo;
+ columnInfo.PropID = inBuffer.ReadUInt32();
+ columnInfo.IsVisible = inBuffer.ReadBool();
+ columnInfo.Width = inBuffer.ReadUInt32();
+ columns.Add(columnInfo);
+ }
+}
+
+static const UInt32 kWindowPositionHeaderSize = 5 * 4;
+static const UInt32 kPanelsInfoHeaderSize = 3 * 4;
+
+/*
+struct CWindowPosition
+{
+ RECT Rect;
+ UInt32 Maximized;
+};
+
+struct CPanelsInfo
+{
+ UInt32 NumPanels;
+ UInt32 CurrentPanel;
+ UInt32 SplitterPos;
+};
+*/
+
+#ifdef _WIN32
+void SaveWindowSize(const RECT &rect, bool maximized)
+{
+ CSysString keyName = kCUBasePath;
+ CKey key;
+ NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
+ key.Create(HKEY_CURRENT_USER, keyName);
+ // CWindowPosition position;
+ CTempOutBufferSpec buffer;
+ buffer.Init(kWindowPositionHeaderSize);
+ buffer.WriteUInt32(rect.left);
+ buffer.WriteUInt32(rect.top);
+ buffer.WriteUInt32(rect.right);
+ buffer.WriteUInt32(rect.bottom);
+ buffer.WriteBool(maximized);
+ key.SetValue(kPositionValueName, (const Byte *)buffer, kWindowPositionHeaderSize);
+}
+
+bool ReadWindowSize(RECT &rect, bool &maximized)
+{
+ CSysString keyName = kCUBasePath;
+ CKey key;
+ NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
+ if(key.Open(HKEY_CURRENT_USER, keyName, KEY_READ) != ERROR_SUCCESS)
+ return false;
+ CByteBuffer buffer;
+ UInt32 size;
+ if (key.QueryValue(kPositionValueName, buffer, size) != ERROR_SUCCESS)
+ return false;
+ if (size != kWindowPositionHeaderSize)
+ return false;
+ CTempInBufferSpec inBuffer;
+ inBuffer.Size = size;
+ inBuffer.Buffer = (Byte *)buffer;
+ inBuffer.Pos = 0;
+ rect.left = inBuffer.ReadUInt32();
+ rect.top = inBuffer.ReadUInt32();
+ rect.right = inBuffer.ReadUInt32();
+ rect.bottom = inBuffer.ReadUInt32();
+ maximized = inBuffer.ReadBool();
+ return true;
+}
+#endif
+
+void SavePanelsInfo(UInt32 numPanels, UInt32 currentPanel, UInt32 splitterPos)
+{
+ CSysString keyName = kCUBasePath;
+ CKey key;
+ NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
+ key.Create(HKEY_CURRENT_USER, keyName);
+
+ CTempOutBufferSpec buffer;
+ buffer.Init(kPanelsInfoHeaderSize);
+ buffer.WriteUInt32(numPanels);
+ buffer.WriteUInt32(currentPanel);
+ buffer.WriteUInt32(splitterPos);
+ key.SetValue(kPanelsInfoValueName, (const Byte *)buffer, kPanelsInfoHeaderSize);
+}
+
+bool ReadPanelsInfo(UInt32 &numPanels, UInt32 &currentPanel, UInt32 &splitterPos)
+{
+ CSysString keyName = kCUBasePath;
+ CKey key;
+ NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
+ if(key.Open(HKEY_CURRENT_USER, keyName, KEY_READ) != ERROR_SUCCESS)
+ return false;
+ CByteBuffer buffer;
+ UInt32 size;
+ if (key.QueryValue(kPanelsInfoValueName, buffer, size) != ERROR_SUCCESS)
+ return false;
+ if (size != kPanelsInfoHeaderSize)
+ return false;
+ CTempInBufferSpec inBuffer;
+ inBuffer.Size = size;
+ inBuffer.Buffer = (Byte *)buffer;
+ inBuffer.Pos = 0;
+ numPanels = inBuffer.ReadUInt32();
+ currentPanel = inBuffer.ReadUInt32();
+ splitterPos = inBuffer.ReadUInt32();
+ return true;
+}
+
+void SaveToolbarsMask(UInt32 toolbarMask)
+{
+ CKey key;
+ key.Create(HKEY_CURRENT_USER, kCUBasePath);
+ key.SetValue(kToolbars, toolbarMask);
+}
+
+static const UInt32 kDefaultToolbarMask = 8 | 4 | 1;
+
+UInt32 ReadToolbarsMask()
+{
+ CKey key;
+ if(key.Open(HKEY_CURRENT_USER, kCUBasePath, KEY_READ) != ERROR_SUCCESS)
+ return kDefaultToolbarMask;
+ UInt32 mask;
+ if (key.QueryValue(kToolbars, mask) != ERROR_SUCCESS)
+ return kDefaultToolbarMask;
+ return mask;
+}
+
+
+static UString GetPanelPathName(UInt32 panelIndex)
+{
+ WCHAR panelString[32];
+ ConvertUInt64ToString(panelIndex, panelString);
+ return UString(kPanelPathValueName) + panelString;
+}
+
+
+void SavePanelPath(UInt32 panel, const UString &path)
+{
+ CKey key;
+ NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
+ key.Create(HKEY_CURRENT_USER, kCUBasePath);
+ key.SetValue(GetPanelPathName(panel), path);
+}
+
+bool ReadPanelPath(UInt32 panel, UString &path)
+{
+ CKey key;
+ NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
+ if(key.Open(HKEY_CURRENT_USER, kCUBasePath, KEY_READ) != ERROR_SUCCESS)
+ return false;
+ return (key.QueryValue(GetPanelPathName(panel), path) == ERROR_SUCCESS);
+}
+
+void SaveListMode(const CListMode &listMode)
+{
+ CKey key;
+ key.Create(HKEY_CURRENT_USER, kCUBasePath);
+ UInt32 t = 0;
+ for (int i = 0; i < 2; i++)
+ t |= ((listMode.Panels[i]) & 0xFF) << (i * 8);
+ key.SetValue(kListMode, t);
+}
+
+void ReadListMode(CListMode &listMode)
+{
+ CKey key;
+ listMode.Init();
+ if(key.Open(HKEY_CURRENT_USER, kCUBasePath, KEY_READ) != ERROR_SUCCESS)
+ return;
+ UInt32 t;
+ if (key.QueryValue(kListMode, t) != ERROR_SUCCESS)
+ return;
+ for (int i = 0; i < 2; i++)
+ {
+ listMode.Panels[i] = (t & 0xFF);
+ t >>= 8;
+ }
+}
+
+
+void SaveStringList(LPCTSTR valueName, const UStringVector &folders)
+{
+ UInt32 sizeInChars = 0;
+ int i;
+ for (i = 0; i < folders.Size(); i++)
+ sizeInChars += folders[i].Length() + 1;
+ CBuffer<wchar_t> buffer;
+ buffer.SetCapacity(sizeInChars);
+ int pos = 0;
+ for (i = 0; i < folders.Size(); i++)
+ {
+ MyStringCopy((wchar_t *)buffer + pos, (const wchar_t *)folders[i]);
+ pos += folders[i].Length() + 1;
+ }
+ CKey key;
+ NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
+ key.Create(HKEY_CURRENT_USER, kCUBasePath);
+ key.SetValue(valueName, buffer, sizeInChars * sizeof(wchar_t));
+}
+
+void ReadStringList(LPCTSTR valueName, UStringVector &folders)
+{
+ folders.Clear();
+ CKey key;
+ NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
+ if(key.Open(HKEY_CURRENT_USER, kCUBasePath, KEY_READ) != ERROR_SUCCESS)
+ return;
+ CByteBuffer buffer;
+ UInt32 dataSize;
+ if (key.QueryValue(valueName, buffer, dataSize) != ERROR_SUCCESS)
+ return;
+ if (dataSize % sizeof(wchar_t) != 0)
+ return;
+ const wchar_t *data = (const wchar_t *)(const Byte *)buffer;
+ int sizeInChars = dataSize / sizeof(wchar_t);
+ UString string;
+ for (int i = 0; i < sizeInChars; i++)
+ {
+ wchar_t c = data[i];
+ if (c == L'\0')
+ {
+ folders.Add(string);
+ string.Empty();
+ }
+ else
+ string += c;
+ }
+}
+
+void SaveFolderHistory(const UStringVector &folders)
+ { SaveStringList(kFolderHistoryValueName, folders); }
+void ReadFolderHistory(UStringVector &folders)
+ { ReadStringList(kFolderHistoryValueName, folders); }
+
+void SaveFastFolders(const UStringVector &folders)
+ { SaveStringList(kFastFoldersValueName, folders); }
+void ReadFastFolders(UStringVector &folders)
+ { ReadStringList(kFastFoldersValueName, folders); }
+
+void SaveCopyHistory(const UStringVector &folders)
+ { SaveStringList(kCopyHistoryValueName, folders); }
+void ReadCopyHistory(UStringVector &folders)
+ { ReadStringList(kCopyHistoryValueName, folders); }
+
+void AddUniqueStringToHeadOfList(UStringVector &list,
+ const UString &string)
+{
+ for(int i = 0; i < list.Size();)
+ if (string.CompareNoCase(list[i]) == 0)
+ list.Delete(i);
+ else
+ i++;
+ list.Insert(0, string);
+}
+
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ViewSettings.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ViewSettings.h
new file mode 100644
index 000000000..c27e70e6f
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/ViewSettings.h
@@ -0,0 +1,100 @@
+// ViewSettings.h
+
+#ifndef __VIEWSETTINGS_H
+#define __VIEWSETTINGS_H
+
+#include "Common/MyString.h"
+
+struct CColumnInfo
+{
+ PROPID PropID;
+ bool IsVisible;
+ UInt32 Width;
+};
+
+inline bool operator==(const CColumnInfo &a1, const CColumnInfo &a2)
+{
+ return (a1.PropID == a2.PropID) &&
+ (a1.IsVisible == a2.IsVisible) && (a1.Width == a2.Width);
+}
+
+inline bool operator!=(const CColumnInfo &a1, const CColumnInfo &a2)
+{
+ return !(a1 == a2);
+}
+
+struct CListViewInfo
+{
+ CObjectVector<CColumnInfo> Columns;
+ PROPID SortID;
+ bool Ascending;
+
+ void Clear()
+ {
+ SortID = 0;
+ Ascending = true;
+ Columns.Clear();
+ }
+
+ int FindColumnWithID(PROPID propID) const
+ {
+ for (int i = 0; i < Columns.Size(); i++)
+ if (Columns[i].PropID == propID)
+ return i;
+ return -1;
+ }
+
+ bool IsEqual(const CListViewInfo &aNewInfo) const
+ {
+ if (Columns.Size() != aNewInfo.Columns.Size() ||
+ // SortIndex != aNewInfo.SortIndex ||
+ SortID != aNewInfo.SortID ||
+ Ascending != aNewInfo.Ascending)
+ return false;
+ for (int i = 0; i < Columns.Size(); i++)
+ if (Columns[i] != aNewInfo.Columns[i])
+ return false;
+ return true;
+ }
+};
+
+void SaveListViewInfo(const UString &id, const CListViewInfo &viewInfo);
+void ReadListViewInfo(const UString &id, CListViewInfo &viewInfo);
+
+#ifdef _WIN32
+void SaveWindowSize(const RECT &rect, bool maximized);
+bool ReadWindowSize(RECT &rect, bool &maximized);
+#endif
+
+void SavePanelsInfo(UInt32 numPanels, UInt32 currentPanel, UInt32 splitterPos);
+bool ReadPanelsInfo(UInt32 &numPanels, UInt32 &currentPanel, UInt32 &splitterPos);
+
+void SaveToolbarsMask(UInt32 toolbarMask);
+UInt32 ReadToolbarsMask();
+
+void SavePanelPath(UInt32 panel, const UString &path);
+bool ReadPanelPath(UInt32 panel, UString &path);
+
+struct CListMode
+{
+ UInt32 Panels[2];
+ void Init() { Panels[0] = Panels[1] = 3; }
+ CListMode() { Init(); }
+};
+
+void SaveListMode(const CListMode &listMode);
+void ReadListMode(CListMode &listMode);
+
+void SaveFolderHistory(const UStringVector &folders);
+void ReadFolderHistory(UStringVector &folders);
+
+void SaveFastFolders(const UStringVector &folders);
+void ReadFastFolders(UStringVector &folders);
+
+void SaveCopyHistory(const UStringVector &folders);
+void ReadCopyHistory(UStringVector &folders);
+
+void AddUniqueStringToHeadOfList(UStringVector &list,
+ const UString &string);
+
+#endif
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Add2PNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Add2PNG.h
new file mode 100644
index 000000000..a507a3066
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Add2PNG.h
@@ -0,0 +1,20 @@
+static const unsigned char ADD2_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x12, 0x59, 0x20, 0xcb, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x3b, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0x63, 0x60, 0xc0, 0x0b, 0x78, 0xef, 0xde,
+0xbd, 0x8b, 0xe0, 0xac, 0x5a, 0xb5, 0xb6, 0x80, 0x6c, 0x0e, 0xc8, 0x28,
+0x20, 0x07, 0x62, 0x20, 0x50, 0x18, 0x02, 0x40, 0x92, 0x64, 0x71, 0xe0,
+0xa6, 0x81, 0x4c, 0x2f, 0x2f, 0x2f, 0x07, 0x72, 0x80, 0x64, 0x01, 0xf9,
+0x0e, 0x85, 0x1a, 0x05, 0x01, 0x70, 0xa3, 0x70, 0x01, 0x00, 0x61, 0xed,
+0x52, 0x81, 0x19, 0x73, 0x26, 0x18, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45,
+0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/AddPNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/AddPNG.h
new file mode 100644
index 000000000..be1ac9124
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/AddPNG.h
@@ -0,0 +1,22 @@
+static const unsigned char ADD_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x24,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x3d, 0x6b, 0xa4, 0x39, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x4d, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0x63, 0x60, 0xa0, 0x01, 0xe0, 0xbd, 0x0b,
+0x04, 0x17, 0xb0, 0x49, 0xac, 0x02, 0x82, 0xeb, 0x43, 0x5b, 0x02, 0xe4,
+0xb7, 0xbb, 0x20, 0x09, 0x30, 0x03, 0x49, 0xe2, 0xd6, 0x2a, 0x24, 0xb0,
+0xb6, 0x60, 0xc8, 0x4a, 0xa0, 0x7a, 0x10, 0x49, 0x82, 0xbd, 0xbc, 0xbc,
+0xbc, 0x16, 0x1c, 0x24, 0x40, 0x46, 0x39, 0x92, 0x04, 0xe9, 0x81, 0x38,
+0xf0, 0x12, 0x20, 0xbf, 0x61, 0x93, 0x60, 0x00, 0xf9, 0xad, 0x1c, 0x9b,
+0x04, 0xcd, 0x00, 0x00, 0xa3, 0xbb, 0xae, 0x61, 0x7b, 0x93, 0x6d, 0x0f,
+0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
+0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Copy2PNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Copy2PNG.h
new file mode 100644
index 000000000..14781e2a1
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Copy2PNG.h
@@ -0,0 +1,22 @@
+static const unsigned char COPY2_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x12, 0x59, 0x20, 0xcb, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x52, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0x95, 0xce, 0x31, 0x0a, 0xc0, 0x30, 0x08,
+0x40, 0x51, 0xb7, 0xdc, 0xd4, 0x4d, 0x70, 0xf3, 0x9a, 0x99, 0xec, 0xe4,
+0x5d, 0x9a, 0x18, 0x68, 0xff, 0x1a, 0xc9, 0xf2, 0x79, 0x22, 0x11, 0xb9,
+0x9a, 0xc9, 0x28, 0x46, 0x92, 0xd2, 0x18, 0xda, 0x54, 0xb5, 0x5e, 0xa5,
+0xda, 0x59, 0xf0, 0xd4, 0x3d, 0x93, 0x61, 0x8c, 0x4d, 0xbf, 0x38, 0xe2,
+0xe9, 0x6b, 0x7e, 0xae, 0x2d, 0x90, 0x11, 0x3e, 0x22, 0xb2, 0xe1, 0xfb,
+0x81, 0x23, 0x00, 0x52, 0x00, 0x21, 0x5c, 0xcd, 0x0b, 0x7e, 0x4c, 0x37,
+0xbb, 0x3f, 0x86, 0x84, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
+0x44, 0xae, 0x42, 0x60, 0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/CopyPNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/CopyPNG.h
new file mode 100644
index 000000000..69770b9e0
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/CopyPNG.h
@@ -0,0 +1,26 @@
+static const unsigned char COPY_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x24,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x3d, 0x6b, 0xa4, 0x39, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x80, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0xbd, 0xd1, 0x31, 0x0e, 0x80, 0x20, 0x0c,
+0x85, 0xe1, 0x6e, 0x4e, 0x5c, 0x93, 0x8d, 0xa4, 0x1b, 0xd7, 0x64, 0x2a,
+0x53, 0xef, 0xe2, 0x43, 0x23, 0x12, 0xed, 0x5b, 0xe9, 0x60, 0x62, 0x7e,
+0xbf, 0x00, 0x22, 0xb2, 0x7d, 0x1a, 0x0b, 0xce, 0x82, 0x31, 0x62, 0x85,
+0x85, 0x4c, 0x88, 0x65, 0x42, 0x2c, 0x13, 0x82, 0x10, 0x13, 0x84, 0x85,
+0x24, 0x77, 0xec, 0xdf, 0xc7, 0x8c, 0xf0, 0x92, 0x84, 0x17, 0xbd, 0x3e,
+0xbe, 0xa7, 0xb1, 0x50, 0x58, 0x98, 0xe4, 0x17, 0x0a, 0x0b, 0x9d, 0xad,
+0xa1, 0x24, 0xf4, 0xb9, 0x38, 0x0e, 0xa0, 0xcb, 0x39, 0x1e, 0x20, 0x52,
+0x6b, 0x55, 0x39, 0xf0, 0xac, 0xb6, 0x82, 0xef, 0xbf, 0x52, 0x12, 0x42,
+0x30, 0xee, 0x23, 0x04, 0x08, 0x31, 0xc0, 0x9d, 0xc7, 0x40, 0x8c, 0x00,
+0x71, 0x02, 0x84, 0x81, 0xcd, 0x73, 0x02, 0xb6, 0x2b, 0x69, 0xbd, 0x15,
+0x92, 0x2f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
+0x42, 0x60, 0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Delete2PNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Delete2PNG.h
new file mode 100644
index 000000000..5f0907754
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Delete2PNG.h
@@ -0,0 +1,23 @@
+static const unsigned char DELETE2_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x12, 0x59, 0x20, 0xcb, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x5a, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0x9d, 0x8e, 0xc1, 0x11, 0x00, 0x21, 0x08,
+0x03, 0x69, 0xc0, 0x5e, 0x6d, 0xe0, 0x0a, 0xc9, 0xc3, 0x9e, 0xf8, 0x31,
+0x76, 0x73, 0x80, 0x06, 0x7d, 0xde, 0x5c, 0x46, 0xf3, 0x60, 0x27, 0x10,
+0x91, 0xcf, 0x6a, 0x65, 0xae, 0xa9, 0x34, 0x9f, 0x61, 0x6c, 0x8b, 0x19,
+0xa0, 0xcb, 0x92, 0x60, 0xc4, 0xef, 0x44, 0xfe, 0x6c, 0x6f, 0x03, 0x0a,
+0x24, 0x22, 0x58, 0x29, 0x82, 0x24, 0x2a, 0x77, 0xe6, 0x00, 0x9e, 0xc9,
+0xc4, 0x83, 0xd3, 0xc0, 0xae, 0x06, 0xbe, 0xaa, 0x55, 0x03, 0xa3, 0x05,
+0xea, 0xb4, 0x1f, 0x7a, 0x01, 0xc5, 0x78, 0x3b, 0x10, 0xc3, 0x1f, 0xc3,
+0xce, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60,
+0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/DeletePNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/DeletePNG.h
new file mode 100644
index 000000000..7795bc0a8
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/DeletePNG.h
@@ -0,0 +1,26 @@
+static const unsigned char DELETE_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x24,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x3d, 0x6b, 0xa4, 0x39, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x81, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0xc5, 0xd1, 0xc1, 0x0d, 0x80, 0x30, 0x08,
+0x05, 0x50, 0x17, 0x60, 0x57, 0xd7, 0xe1, 0xd0, 0x9d, 0x7a, 0x23, 0x6e,
+0x63, 0x2c, 0x14, 0x2d, 0xff, 0x7b, 0x55, 0x2e, 0xfd, 0x31, 0xbc, 0x58,
+0xe8, 0xb6, 0x7d, 0x57, 0x1d, 0x82, 0x97, 0xb4, 0x1a, 0xa2, 0x0e, 0xed,
+0x25, 0x44, 0x9f, 0x6a, 0x5b, 0x43, 0x02, 0xf5, 0xce, 0x0c, 0xb7, 0x18,
+0x9d, 0xe3, 0xdc, 0x09, 0xb9, 0x0e, 0x5b, 0x6f, 0x35, 0x08, 0x82, 0x20,
+0x08, 0x82, 0x10, 0xe0, 0x84, 0x00, 0x27, 0x0c, 0x04, 0x41, 0xc0, 0x66,
+0x78, 0x8a, 0x8e, 0xdf, 0xe3, 0x1f, 0x2f, 0x80, 0x90, 0x9c, 0x83, 0x01,
+0xab, 0xbb, 0xcd, 0x2b, 0x09, 0x92, 0xd8, 0x12, 0x90, 0x39, 0x03, 0x90,
+0x5c, 0x2b, 0x79, 0x41, 0x1f, 0x5a, 0xf0, 0x05, 0xad, 0x84, 0x49, 0x66,
+0x9f, 0xd4, 0x75, 0x19, 0x84, 0x3f, 0xeb, 0x04, 0x1a, 0xa7, 0x7e, 0xab,
+0x5a, 0xf7, 0xe4, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44,
+0xae, 0x42, 0x60, 0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Extract2PNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Extract2PNG.h
new file mode 100644
index 000000000..ee01ef69d
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Extract2PNG.h
@@ -0,0 +1,18 @@
+static const unsigned char EXTRACT2_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x12, 0x59, 0x20, 0xcb, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x22, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0x63, 0x60, 0xa0, 0x17, 0xe0, 0xbd, 0x0b,
+0x05, 0x17, 0x40, 0x9c, 0x33, 0x50, 0x70, 0x9d, 0x5c, 0x0e, 0xcc, 0x34,
+0x10, 0x87, 0xa1, 0x1c, 0x06, 0xe8, 0xe6, 0x1b, 0x00, 0xa6, 0x78, 0x38,
+0x15, 0x21, 0xee, 0x22, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
+0x44, 0xae, 0x42, 0x60, 0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/ExtractPNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/ExtractPNG.h
new file mode 100644
index 000000000..807f8e4f6
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/ExtractPNG.h
@@ -0,0 +1,18 @@
+static const unsigned char EXTRACT_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x24,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x3d, 0x6b, 0xa4, 0x39, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x28, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0x63, 0x60, 0x18, 0x05, 0xa4, 0x81, 0xbb,
+0x28, 0x00, 0x49, 0xe2, 0xce, 0x19, 0x24, 0x70, 0xb6, 0x60, 0xc8, 0x4a,
+0xa0, 0x7a, 0x10, 0x49, 0x82, 0xbd, 0x1c, 0x19, 0x20, 0x49, 0x8c, 0x02,
+0x8a, 0x00, 0x00, 0x11, 0x6c, 0x7c, 0x67, 0x00, 0x94, 0xd4, 0x2c, 0x00,
+0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Info2PNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Info2PNG.h
new file mode 100644
index 000000000..b517084c9
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Info2PNG.h
@@ -0,0 +1,21 @@
+static const unsigned char INFO2_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x12, 0x59, 0x20, 0xcb, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x46, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0x63, 0x60, 0x40, 0x07, 0xbc, 0x77, 0xef,
+0x5e, 0x40, 0x70, 0x76, 0xef, 0xbe, 0x8e, 0x83, 0x73, 0xf7, 0x2e, 0x82,
+0xc3, 0x50, 0x5e, 0x5e, 0x8e, 0x61, 0x10, 0x54, 0x15, 0xc2, 0x34, 0xa0,
+0x7e, 0x84, 0x01, 0xbc, 0x77, 0x91, 0x4d, 0xab, 0xc5, 0x6d, 0x0f, 0xe9,
+0x1c, 0x90, 0xd1, 0x70, 0x5b, 0x41, 0x96, 0xc2, 0xa5, 0x40, 0xce, 0x41,
+0x38, 0xbb, 0xbc, 0x1c, 0x97, 0xb3, 0x09, 0x03, 0x00, 0x3a, 0xb2, 0x32,
+0x23, 0xbc, 0x78, 0x77, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
+0x44, 0xae, 0x42, 0x60, 0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/InfoPNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/InfoPNG.h
new file mode 100644
index 000000000..18109837c
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/InfoPNG.h
@@ -0,0 +1,22 @@
+static const unsigned char INFO_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x24,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x3d, 0x6b, 0xa4, 0x39, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x57, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0x63, 0x60, 0xa0, 0x05, 0xb8, 0x0b, 0x04,
+0x17, 0xb0, 0x49, 0xdc, 0xde, 0xbd, 0x7b, 0xf7, 0x75, 0xea, 0x48, 0x80,
+0xec, 0xc0, 0x2a, 0xc1, 0x5e, 0x0e, 0x04, 0xc4, 0xba, 0x94, 0x2c, 0xc0,
+0x7b, 0x17, 0x87, 0x07, 0x79, 0x77, 0xef, 0xc6, 0xee, 0x5c, 0xdc, 0x12,
+0x77, 0x71, 0x79, 0xb0, 0x9c, 0x8a, 0x61, 0x35, 0x18, 0x25, 0x20, 0x3e,
+0xbf, 0x7b, 0x17, 0x53, 0x02, 0x1c, 0x56, 0xbb, 0xf7, 0x16, 0x10, 0x2f,
+0x71, 0x17, 0x02, 0x30, 0x24, 0x18, 0xca, 0x21, 0x00, 0x53, 0x62, 0x30,
+0x01, 0x00, 0xd3, 0xa5, 0x67, 0xc0, 0x11, 0x9d, 0x79, 0xc0, 0x00, 0x00,
+0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Move2PNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Move2PNG.h
new file mode 100644
index 000000000..6eafd8dfd
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Move2PNG.h
@@ -0,0 +1,21 @@
+static const unsigned char MOVE2_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x12, 0x59, 0x20, 0xcb, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x4c, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0x95, 0xce, 0xb1, 0x0d, 0xc0, 0x20, 0x0c,
+0x44, 0xd1, 0xeb, 0xb2, 0x18, 0xad, 0x77, 0xa1, 0x63, 0x4d, 0x0a, 0x4b,
+0xa9, 0xbc, 0x4b, 0x82, 0x41, 0xf0, 0x5b, 0xae, 0xfb, 0x3c, 0xc9, 0x42,
+0xba, 0x5a, 0x67, 0x04, 0xc3, 0x49, 0x6e, 0x8c, 0x92, 0x14, 0x39, 0x2f,
+0x36, 0xdf, 0xd6, 0x3a, 0xc3, 0x18, 0x83, 0x8e, 0x54, 0xc4, 0xcb, 0x6b,
+0x3f, 0xe8, 0x69, 0x63, 0x9e, 0xb0, 0x7f, 0x50, 0x11, 0x00, 0x05, 0x40,
+0x84, 0xab, 0x7d, 0xa9, 0x14, 0x30, 0x23, 0x6c, 0x8b, 0xd3, 0x1c, 0x00,
+0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/MovePNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/MovePNG.h
new file mode 100644
index 000000000..a0dc143a9
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/MovePNG.h
@@ -0,0 +1,25 @@
+static const unsigned char MOVE_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x24,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x3d, 0x6b, 0xa4, 0x39, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x71, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0xbd, 0xd1, 0xb1, 0x0d, 0xc0, 0x20, 0x0c,
+0x05, 0x51, 0x2f, 0xc0, 0x56, 0x6e, 0xd9, 0x85, 0x2e, 0x6b, 0x52, 0x58,
+0xa2, 0x62, 0x97, 0x98, 0x22, 0x84, 0x10, 0x5f, 0xcb, 0x6f, 0x4f, 0x4f,
+0x08, 0x10, 0x39, 0xbe, 0x4a, 0xa1, 0x53, 0x30, 0x22, 0x96, 0x29, 0x28,
+0x10, 0x53, 0x20, 0xa6, 0x40, 0x3c, 0xc4, 0xc4, 0xc3, 0x42, 0x52, 0x9f,
+0x1b, 0xe1, 0x25, 0x49, 0xbf, 0xab, 0x14, 0x32, 0x85, 0x49, 0x7e, 0x21,
+0x53, 0x68, 0x74, 0x46, 0x81, 0xd0, 0xe6, 0xe1, 0xdb, 0x3d, 0x1e, 0x20,
+0x72, 0xcd, 0xd9, 0x0a, 0xf6, 0xb7, 0x2a, 0x10, 0x42, 0x30, 0xfe, 0x23,
+0x04, 0x1e, 0x62, 0xe0, 0x7f, 0x1e, 0x03, 0x31, 0x00, 0xd2, 0x01, 0x08,
+0x81, 0xc3, 0xbb, 0x01, 0xf5, 0x5d, 0x59, 0xea, 0x53, 0xc3, 0x86, 0x77,
+0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
+0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/ParentFolder.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/ParentFolder.h
new file mode 100644
index 000000000..544b9c7cf
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/ParentFolder.h
@@ -0,0 +1,91 @@
+static unsigned char PARENT_FOLDER_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10,
+0x08, 0x03, 0x00, 0x00, 0x00, 0x28, 0x2d, 0x0f, 0x53, 0x00, 0x00, 0x03,
+0x00, 0x50, 0x4c, 0x54, 0x45, 0x01, 0x67, 0x01, 0x08, 0x6e, 0x05, 0x08,
+0x77, 0x04, 0x0c, 0x79, 0x07, 0x11, 0x70, 0x0a, 0x11, 0x7c, 0x09, 0x16,
+0x7c, 0x0c, 0x17, 0x79, 0x13, 0x1f, 0x78, 0x1f, 0x37, 0x7a, 0x0b, 0x21,
+0x7d, 0x21, 0x14, 0x8c, 0x0b, 0x19, 0x98, 0x0d, 0x1c, 0xa0, 0x0f, 0x22,
+0x81, 0x17, 0x27, 0x8c, 0x14, 0x27, 0x8f, 0x14, 0x26, 0x8b, 0x1a, 0x27,
+0x8c, 0x1b, 0x2f, 0x94, 0x1f, 0x31, 0x81, 0x1b, 0x2f, 0x81, 0x2f, 0x3b,
+0x85, 0x2e, 0x3d, 0x8a, 0x3d, 0x3e, 0x8a, 0x3f, 0x3c, 0xa1, 0x1f, 0x34,
+0xb3, 0x1b, 0x41, 0x8c, 0x3e, 0x51, 0x8e, 0x29, 0x43, 0xad, 0x22, 0x44,
+0xb7, 0x22, 0x49, 0xbd, 0x25, 0x59, 0xbe, 0x39, 0x61, 0x93, 0x2e, 0x4e,
+0x8f, 0x41, 0x6b, 0xa5, 0x6c, 0x6c, 0xa6, 0x6d, 0x79, 0xad, 0x7a, 0x57,
+0xc4, 0x2c, 0x67, 0xcc, 0x34, 0x6c, 0xd1, 0x39, 0x60, 0xc5, 0x40, 0x75,
+0xda, 0x42, 0x74, 0xd8, 0x47, 0x7f, 0xe3, 0x4c, 0xb9, 0x9c, 0x11, 0x81,
+0xac, 0x47, 0x85, 0xea, 0x53, 0x8e, 0xf4, 0x5c, 0xcc, 0x99, 0x01, 0xd6,
+0xa5, 0x17, 0xd1, 0xa4, 0x1e, 0xd3, 0xa9, 0x2c, 0xdd, 0xaf, 0x35, 0xde,
+0xb5, 0x36, 0xdf, 0xba, 0x3c, 0xe6, 0xbc, 0x3e, 0xde, 0xbe, 0x51, 0xd9,
+0xb9, 0x58, 0xdb, 0xbe, 0x66, 0xe2, 0xb8, 0x43, 0xe6, 0xbc, 0x51, 0xdf,
+0xc3, 0x6b, 0xe6, 0xc2, 0x44, 0xec, 0xc6, 0x4e, 0xea, 0xc0, 0x57, 0xf2,
+0xcc, 0x5b, 0xe2, 0xc6, 0x71, 0xe6, 0xc9, 0x79, 0xe6, 0xd1, 0x63, 0xf2,
+0xd5, 0x64, 0xf5, 0xdf, 0x79, 0xff, 0xdc, 0x77, 0xef, 0xe0, 0x7b, 0xfc,
+0xe4, 0x7c, 0x89, 0xb7, 0x8b, 0x8f, 0xbc, 0x87, 0xb7, 0xd3, 0xba, 0xdf,
+0xec, 0x86, 0xdf, 0xe6, 0xaf, 0xe3, 0xce, 0x92, 0xe4, 0xd3, 0x9e, 0xe4,
+0xd4, 0x9e, 0xec, 0xd9, 0x99, 0xec, 0xd9, 0x9f, 0xfc, 0xd4, 0x83, 0xff,
+0xdb, 0x89, 0xe5, 0xd6, 0xa3, 0xe5, 0xd7, 0xab, 0xef, 0xdf, 0xab, 0xff,
+0xe8, 0x83, 0xff, 0xea, 0x95, 0xff, 0xf2, 0x8c, 0xff, 0xf9, 0x93, 0xff,
+0xff, 0x99, 0xef, 0xf5, 0xbc, 0xf2, 0xe6, 0xa4, 0xff, 0xe6, 0xa0, 0xff,
+0xf2, 0xa9, 0xff, 0xf8, 0xa6, 0xff, 0xff, 0xac, 0xff, 0xff, 0xbe, 0xc6,
+0xdb, 0xc9, 0xd6, 0xe3, 0xd9, 0xea, 0xe2, 0xca, 0xeb, 0xe7, 0xd6, 0xee,
+0xea, 0xdb, 0xf5, 0xea, 0xc1, 0xff, 0xf4, 0xc8, 0xff, 0xfe, 0xc6, 0xfc,
+0xf9, 0xcf, 0xff, 0xff, 0xd1, 0xff, 0xff, 0xd9, 0xe5, 0xed, 0xe9, 0xff,
+0xff, 0xe7, 0xf3, 0xf4, 0xf7, 0xff, 0xff, 0xf2, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xd0, 0xf6, 0xa4, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0e, 0xc4, 0x00, 0x00,
+0x0e, 0xc4, 0x01, 0x95, 0x2b, 0x0e, 0x1b, 0x00, 0x00, 0x00, 0xc1, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0x63, 0x28, 0x86, 0x02, 0x15, 0x89, 0x74,
+0x30, 0xcd, 0x00, 0xe5, 0xfb, 0x32, 0xf1, 0xb0, 0x7b, 0x23, 0x09, 0x14,
+0x72, 0xf1, 0x4a, 0xc9, 0x09, 0x88, 0xa6, 0xc1, 0x05, 0x94, 0xb9, 0xa5,
+0xe4, 0xd5, 0xd4, 0x25, 0x19, 0x55, 0xc1, 0x02, 0xa6, 0xa6, 0xa6, 0x0c,
+0xcc, 0xac, 0xb2, 0xea, 0x1a, 0x1c, 0xac, 0xac, 0x20, 0x01, 0xd3, 0xe0,
+0xbc, 0x78, 0xa0, 0x18, 0xbf, 0x86, 0x96, 0x38, 0xc4, 0x0c, 0xd3, 0xdc,
+0xb8, 0xb8, 0xd4, 0xfc, 0x5c, 0x36, 0x2d, 0x1d, 0x31, 0xa8, 0x40, 0x72,
+0x2c, 0x10, 0x98, 0x72, 0xea, 0x68, 0x2b, 0x99, 0x9a, 0x82, 0x05, 0xa2,
+0xbd, 0xdc, 0xec, 0xcd, 0x43, 0xa4, 0xf5, 0x15, 0x7c, 0x4a, 0xec, 0xc0,
+0x02, 0x61, 0x36, 0x91, 0x45, 0x05, 0xb9, 0x7c, 0x06, 0x82, 0xfe, 0x09,
+0xe1, 0x60, 0x81, 0x50, 0xe7, 0x94, 0xb8, 0x38, 0x3f, 0x61, 0x4d, 0xc5,
+0x24, 0x4b, 0x88, 0x19, 0x8e, 0xd9, 0x31, 0x31, 0x31, 0x7a, 0x42, 0x22,
+0x9e, 0xee, 0x01, 0x10, 0x01, 0xdb, 0x9c, 0xa8, 0xa8, 0x28, 0x16, 0x19,
+0x57, 0x07, 0xb3, 0x2c, 0x88, 0x80, 0x4b, 0xa2, 0x87, 0x93, 0x85, 0xae,
+0xa1, 0xb1, 0x55, 0x10, 0xd4, 0xda, 0x10, 0x23, 0x43, 0x13, 0xeb, 0xc0,
+0x8c, 0x62, 0x98, 0x6f, 0x4d, 0x4d, 0x23, 0x32, 0x8b, 0xe1, 0x00, 0x00,
+0xfc, 0x33, 0x50, 0x72, 0x6d, 0x03, 0x36, 0xf2, 0x00, 0x00, 0x00, 0x00,
+0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Test2PNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Test2PNG.h
new file mode 100644
index 000000000..80a768ac6
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/Test2PNG.h
@@ -0,0 +1,21 @@
+static const unsigned char TEST2_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x12, 0x59, 0x20, 0xcb, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x47, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0xb5, 0xcd, 0xbb, 0x11, 0x00, 0x20, 0x08,
+0x03, 0x50, 0x16, 0x60, 0x57, 0x47, 0xb5, 0xb3, 0xc2, 0x0d, 0xcc, 0x0c,
+0x22, 0x9f, 0xc3, 0xde, 0x33, 0x05, 0x29, 0x5e, 0xee, 0x20, 0xfa, 0x1e,
+0x16, 0x91, 0x1e, 0x97, 0x26, 0xb0, 0x9a, 0x17, 0x31, 0x80, 0x71, 0x06,
+0xda, 0x3d, 0xc0, 0x29, 0xc0, 0x29, 0xc1, 0x28, 0xc1, 0x29, 0xc1, 0x68,
+0xd4, 0xc7, 0x0b, 0x94, 0x0a, 0x94, 0x2e, 0x78, 0xc9, 0x06, 0xae, 0xb5,
+0x39, 0x27, 0x85, 0x82, 0xfa, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45,
+0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/TestPNG.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/TestPNG.h
new file mode 100644
index 000000000..c1c0887eb
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/res/TestPNG.h
@@ -0,0 +1,25 @@
+static const unsigned char TEST_png[] = {
+0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x24,
+0x04, 0x03, 0x00, 0x00, 0x00, 0x3d, 0x6b, 0xa4, 0x39, 0x00, 0x00, 0x00,
+0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
+0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
+0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
+0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
+0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
+0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x75, 0x49,
+0x44, 0x41, 0x54, 0x78, 0x9c, 0xd5, 0xd1, 0x31, 0x1a, 0x80, 0x20, 0x08,
+0x05, 0x60, 0xc7, 0x96, 0xee, 0xdb, 0xd8, 0x05, 0xb8, 0x9b, 0x9b, 0x53,
+0xdd, 0xa0, 0xce, 0x10, 0x20, 0xfa, 0x55, 0xef, 0xd5, 0x2e, 0x23, 0xf2,
+0x2b, 0x60, 0x4a, 0x63, 0xc4, 0x66, 0x91, 0x31, 0x3f, 0x9f, 0x1a, 0xc7,
+0x82, 0x07, 0xbb, 0x1d, 0x94, 0xf5, 0x1f, 0xdc, 0x6f, 0x7d, 0x00, 0xf1,
+0x2a, 0xf2, 0xc2, 0xe4, 0x65, 0x99, 0xbc, 0xd0, 0xc9, 0xbb, 0xa5, 0x4e,
+0xa0, 0xa5, 0x20, 0x38, 0x43, 0x10, 0x32, 0x43, 0x25, 0x64, 0xe8, 0x4a,
+0xd8, 0xd0, 0x12, 0x79, 0xd8, 0x52, 0x23, 0xb8, 0x25, 0xe1, 0xa0, 0x11,
+0xb2, 0x56, 0x27, 0xec, 0x1f, 0x9c, 0x30, 0x60, 0x84, 0x02, 0x23, 0x1c,
+0x28, 0xe1, 0x40, 0xc9, 0x07, 0x18, 0x21, 0x2e, 0x97, 0xf8, 0xa1, 0xe3,
+0xf9, 0x5b, 0x6d, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44,
+0xae, 0x42, 0x60, 0x82, 0x00,
+};
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/resource.h b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/resource.h
new file mode 100644
index 000000000..4bebb95a6
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/resource.h
@@ -0,0 +1,168 @@
+#define IDI_FAM 101
+#define IDI_FM 101
+#define IDR_MENUBAR1 103
+#define IDM_MENU 103
+#define IDR_ACCELERATOR1 209
+#define IDM_FILE_OPEN 210
+#define IDM_FILE_OPEN_INSIDE 211
+#define IDM_FILE_OPEN_OUTSIDE 212
+#define IDM_FILE_VIEW 220
+#define IDM_FILE_EDIT 221
+#define IDM_RENAME 230
+#define IDM_COPY_TO 231
+#define IDM_MOVE_TO 232
+#define IDM_DELETE 233
+#define IDM_FILE_SPLIT 238
+#define IDM_FILE_COMBINE 239
+#define IDM_FILE_PROPERTIES 240
+#define IDM_FILE_COMMENT 241
+#define IDM_FILE_CRC 242
+#define IDM_CREATE_FOLDER 250
+#define IDM_CREATE_FILE 251
+#define IDM_EDIT_CUT 320
+#define IDM_EDIT_COPY 321
+#define IDM_EDIT_PASTE 322
+#define IDM_SELECT_ALL 330
+#define IDM_DESELECT_ALL 331
+#define IDM_INVERT_SELECTION 332
+#define IDM_SELECT 333
+#define IDM_DESELECT 334
+#define IDM_SELECT_BY_TYPE 335
+#define IDM_DESELECT_BY_TYPE 336
+#define IDM_VIEW_LARGE_ICONS 410
+#define IDM_VIEW_SMALL_ICONS 411
+#define IDM_VIEW_LIST 412
+#define IDM_VIEW_DETAILS 413
+#define IDM_VIEW_ARANGE_BY_NAME 420
+#define IDM_VIEW_ARANGE_BY_TYPE 421
+#define IDM_VIEW_ARANGE_BY_DATE 422
+#define IDM_VIEW_ARANGE_BY_SIZE 423
+#define IDM_VIEW_ARANGE_NO_SORT 424
+#define IDM_OPEN_ROOT_FOLDER 430
+#define IDM_OPEN_PARENT_FOLDER 431
+#define IDM_FOLDERS_HISTORY 432
+#define IDM_VIEW_REFRESH 440
+#define IDM_VIEW_FLAT_VIEW 449
+#define IDM_VIEW_TWO_PANELS 450
+#define IDM_VIEW_TOOLBARS 451
+#define IDM_VIEW_STANDARD_TOOLBAR 460
+#define IDM_VIEW_ARCHIVE_TOOLBAR 461
+#define IDM_VIEW_TOOLBARS_LARGE_BUTTONS 462
+#define IDM_VIEW_TOOLBARS_SHOW_BUTTONS_TEXT 463
+#define IDM_OPTIONS 510
+#define IDM_BENCHMARK 511
+#define IDM_HELP_CONTENTS 610
+#define IDM_ABOUT 620
+#define IDS_BOOKMARK 720
+#define IDB_ADD 2002
+#define IDB_EXTRACT 2003
+#define IDB_TEST 2004
+#define IDB_COPY 2010
+#define IDB_MOVE 2011
+#define IDB_DELETE 2012
+#define IDB_INFO 2013
+#define IDB_ADD2 2082
+#define IDB_EXTRACT2 2083
+#define IDB_TEST2 2084
+#define IDB_COPY2 2090
+#define IDB_MOVE2 2091
+#define IDB_DELETE2 2092
+#define IDB_INFO2 2093
+#define IDS_APP_TITLE 2200
+#define IDS_COPY 2201
+#define IDS_MOVE 2202
+#define IDS_COPY_TO 2203
+#define IDS_MOVE_TO 2204
+#define IDS_COPYING 2205
+#define IDS_MOVING 2206
+#define IDS_CANNOT_COPY 2207
+#define IDS_OPERATION_IS_NOT_SUPPORTED 2208
+
+#define IDS_CONFIRM_FILE_DELETE 2210
+#define IDS_CONFIRM_FOLDER_DELETE 2211
+#define IDS_CONFIRM_ITEMS_DELETE 2212
+#define IDS_WANT_TO_DELETE_FILE 2213
+#define IDS_WANT_TO_DELETE_FOLDER 2214
+#define IDS_WANT_TO_DELETE_ITEMS 2215
+#define IDS_DELETING 2216
+#define IDS_ERROR_DELETING 2217
+#define IDS_ERROR_LONG_PATH_TO_RECYCLE 2218
+
+#define IDS_RENAMING 2220
+#define IDS_ERROR_RENAMING 2221
+#define IDS_CONFIRM_FILE_COPY 2222
+#define IDS_WANT_TO_COPY_FILES 2223
+
+
+#define IDS_CREATE_FOLDER 2230
+#define IDS_CREATE_FOLDER_NAME 2231
+#define IDS_CREATE_FOLDER_DEFAULT_NAME 2232
+#define IDS_CREATE_FOLDER_ERROR 2233
+#define IDS_CREATE_FILE 2240
+#define IDS_CREATE_FILE_NAME 2241
+#define IDS_CREATE_FOLDER_DEFAULT_FILE_NAME 2242
+#define IDS_CREATE_FILE_DEFAULT_NAME 2242
+#define IDS_CREATE_FILE_ERROR 2243
+#define IDS_SELECT 2250
+#define IDS_DESELECT 2251
+#define IDS_SELECT_MASK 2252
+#define IDS_FOLDERS_HISTORY 2260
+#define IDS_N_SELECTED_ITEMS 2270
+#define IDS_FILES_COLON 2274
+#define IDS_FOLDERS_COLON 2275
+#define IDS_SIZE_COLON 2276
+
+#define IDS_TOO_MANY_ITEMS 2279
+#define IDS_WANT_UPDATE_MODIFIED_FILE 2280
+#define IDS_CANNOT_UPDATE_FILE 2281
+#define IDS_CANNOT_START_EDITOR 2282
+#define IDS_OPENNING 2283
+#define IDS_VIRUS 2284
+#define IDS_COMPUTER 2300
+#define IDS_NETWORK 2301
+#define IDS_DOCUMENTS 2302
+#define IDS_ADD 2400
+#define IDS_EXTRACT 2401
+#define IDS_TEST 2402
+#define IDS_BUTTON_COPY 2420
+#define IDS_BUTTON_MOVE 2421
+#define IDS_BUTTON_DELETE 2422
+#define IDS_BUTTON_INFO 2423
+#define IDS_PROP_TOTAL_SIZE 3100
+#define IDS_PROP_FREE_SPACE 3101
+#define IDS_PROP_CLUSTER_SIZE 3102
+#define IDS_PROP_VOLUME_NAME 3103
+#define IDS_PROP_LOCAL_NAME 3200
+#define IDS_PROP_PROVIDER 3201
+#define IDS_OPTIONS 4000
+#define IDS_COMMENT 4001
+#define IDS_COMMENT2 4002
+#define IDS_SYSTEM 4010
+
+#define IDS_SPLITTING 4020
+#define IDS_SPLIT_CONFIRM_TITLE 4021
+#define IDS_SPLIT_CONFIRM_MESSAGE 4022
+#define IDS_SPLIT_VOL_MUST_BE_SMALLER 4023
+
+#define IDS_COMBINE 4030
+#define IDS_COMBINE_TO 4031
+#define IDS_COMBINING 4032
+#define IDS_COMBINE_SELECT_ONE_FILE 4033
+#define IDS_COMBINE_CANT_DETECT_SPLIT_FILE 4034
+#define IDS_COMBINE_CANT_FIND_MORE_THAN_ONE_PART 4035
+
+#define IDS_CHECKSUM_CALCULATING 4040
+#define IDS_CHECKSUM_INFORMATION 4041
+#define IDS_CHECKSUM_CRC_DATA 4042
+#define IDS_CHECKSUM_CRC_DATA_NAMES 4043
+
+#define IDS_SCANNING 4050
+#define IDS_PROPERTIES 4060
+
+#define IDS_PROGRESS_TESTING 4100
+#define IDS_MESSAGE_NO_ERRORS 4200
+
+#define IDS_MESSAGE_UNSUPPORTED_OPERATION_FOR_LONG_PATH_FOLDER 4301
+#define IDS_SELECT_ONE_FILE 4302
+#define IDS_SELECT_FILES 4303
+#define IDS_FILE_EXIST 4304
diff --git a/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/wxFM.cpp b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/wxFM.cpp
new file mode 100644
index 000000000..1fa11d1e7
--- /dev/null
+++ b/installerbuilder/libinstaller/3rdparty/p7zip_9.04/unix/CPP/7zip/UI/FileManager/wxFM.cpp
@@ -0,0 +1,345 @@
+// wxFM.cpp
+
+#include "StdAfx.h"
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+// for all others, include the necessary headers (this file is usually all you
+// need because it includes almost all "standard" wxWidgets headers)
+#ifndef WX_PRECOMP
+ #include "wx/wx.h"
+#endif
+
+// #include "../GUI/p7zip_32.xpm"
+
+int Main1(int argc,TCHAR **argv);
+
+/*
+int Main1(int argc,TCHAR **argv)
+{
+ // FIXME
+ Sleep(10000);
+}
+*/
+
+
+#include "Windows/Registry.h"
+using namespace NWindows;
+using namespace NRegistry;
+
+
+#include "Common/StringConvert.h"
+#include "Windows/FileDir.h"
+#include "Windows/Synchronization.h"
+
+// FIXME #include "ExtractRes.h"
+#include "../Explorer/MyMessages.h"
+
+// FIXME #include "ExtractGUI.h"
+// FIXME #include "UpdateGUI.h"
+// FIXME #include "BenchmarkDialog.h"
+#include "RegistryUtils.h"
+
+using namespace NWindows;
+using namespace NFile;
+
+#include "../FileManager/ProgramLocation.h"
+
+static LPCWSTR kHelpFileName = L"help/";
+
+void ShowHelpWindow(HWND hwnd, LPCWSTR topicFile)
+{
+ UString path;
+ if (!::GetProgramFolderPath(path))
+ return;
+ path += kHelpFileName;
+ path += topicFile;
+ printf("ShowHelpWindow(%p,%ls)=>%ls\n",hwnd,topicFile,(const wchar_t *)path);
+ // HtmlHelp(hwnd, GetSystemString(path), HH_DISPLAY_TOPIC, NULL);
+ wxString path2(path);
+ wxLaunchDefaultBrowser(path2);
+}
+
+////////////////////////////// TRIES ///////////////////////////////////
+
+// FIXME : duplicate
+
+#if 0
+static const TCHAR *kCUBasePath = TEXT("Software/7-ZIP");
+static const WCHAR *kLangValueName = L"Lang";
+
+void SaveRegLang(const UString &langFile)
+{
+ CKey key;
+ key.Create(HKEY_CURRENT_USER, kCUBasePath);
+ key.SetValue(kLangValueName, langFile);
+}
+
+void ReadRegLang(UString &langFile)
+{
+ langFile.Empty();
+ CKey key;
+ if (key.Open(HKEY_CURRENT_USER, kCUBasePath, KEY_READ) == ERROR_SUCCESS)
+ key.QueryValue(kLangValueName, langFile);
+}
+#endif
+
+
+//////////////////////////////////
+
+#define NEED_NAME_WINDOWS_TO_UNIX
+#include "myPrivate.h" // global_use_utf16_conversion
+
+void mySplitCommandLineW(int numArguments, TCHAR **arguments,UStringVector &parts) {
+
+ parts.Clear();
+ for(int ind=0;ind < numArguments; ind++) {
+ UString tmp = arguments[ind];
+ // tmp.Trim(); " " is a valid filename ...
+ if (!tmp.IsEmpty()) {
+ parts.Add(tmp);
+ }
+ }
+}
+
+// ----------------------------------------------------------------------------
+// private classes
+// ----------------------------------------------------------------------------
+
+// Define a new frame type
+#if 0
+class MyFrame: public wxFrame
+{
+public:
+ // ctor
+ MyFrame(wxFrame *frame, const wxString& title, int x, int y, int w, int h);
+ // virtual ~MyFrame();
+
+ // operations
+ void WriteText(const wxString& text) { m_txtctrl->WriteText(text); }
+
+protected:
+ // callbacks
+ void OnWorkerEvent(wxCommandEvent& event);
+private:
+ // just some place to put our messages in
+ wxTextCtrl *m_txtctrl;
+ DECLARE_EVENT_TABLE()
+};
+
+enum {
+ WORKER_EVENT=100 // this one gets sent from the worker thread
+};
+
+BEGIN_EVENT_TABLE(MyFrame, wxFrame)
+ EVT_MENU(WORKER_EVENT, MyFrame::OnWorkerEvent)
+ // EVT_IDLE(MyFrame::OnIdle)
+END_EVENT_TABLE()
+
+// My frame constructor
+MyFrame::MyFrame(wxFrame *frame, const wxString& title,
+ int x, int y, int w, int h)
+ : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
+{
+ //FIXME this->SetIcon(wxICON(p7zip_32));
+
+#if wxUSE_STATUSBAR
+ CreateStatusBar(2);
+#endif // wxUSE_STATUSBAR
+
+ m_txtctrl = new wxTextCtrl(this, wxID_ANY, _T(""), wxPoint(0, 0), wxSize(0, 0), wxTE_MULTILINE | wxTE_READONLY);
+}
+
+void myCreateHandle(int n);
+void MyFrame::OnWorkerEvent(wxCommandEvent& event)
+{
+ int n = event.GetInt();
+ myCreateHandle(n);
+}
+
+wxWindow * g_window=0;
+#endif
+
+
+// Define a new application type, each program should derive a class from wxApp
+class MyApp : public wxApp
+{
+public:
+ // override base class virtuals
+ // ----------------------------
+
+ // this one is called on application startup and is a good place for the app
+ // initialization (doing it here and not in the ctor allows to have an error
+ // return: if OnInit() returns false, the application terminates)
+ virtual bool OnInit();
+};
+
+// Create a new application object: this macro will allow wxWidgets to create
+// the application object during program execution (it's better than using a
+// static object for many reasons) and also implements the accessor function
+// wxGetApp() which will return the reference of the right type (i.e. MyApp and
+// not wxApp)
+IMPLEMENT_APP(MyApp)
+
+time_t g_T0 = 0;
+
+#if 0
+class MyThread : public wxThread
+{
+ int _argc;
+ TCHAR **_argv;
+public:
+ MyThread(int argc,TCHAR **argv): wxThread(),_argc(argc), _argv(argv) {}
+
+ // thread execution starts here
+ virtual void *Entry()
+ {
+ int ret = Main1(_argc,_argv);
+ exit(ret);
+ }
+};
+#endif
+
+// 'Main program' equivalent: the program execution "starts" here
+bool MyApp::OnInit()
+{
+ // don't parse the command-line options !
+ // : if ( !wxApp::OnInit() ) return false;
+
+ { // define P7ZIP_HOME_DIR
+ extern void my_windows_split_path(const AString &p_path, AString &dir , AString &base);
+ static char p7zip_home_dir[MAX_PATH];
+
+ UString fullPath;
+ NDirectory::MyGetFullPathName(wxApp::argv[0], fullPath);
+ AString afullPath = GetAnsiString(fullPath);
+
+ AString dir,name;
+
+ my_windows_split_path(afullPath,dir,name);
+
+ const char *dir2 = nameWindowToUnix((const char *)dir);
+ snprintf(p7zip_home_dir,sizeof(p7zip_home_dir),"P7ZIP_HOME_DIR=%s/",dir2);
+ p7zip_home_dir[sizeof(p7zip_home_dir)-1] = 0;
+ putenv(p7zip_home_dir);
+ // DEBUG printf("putenv(%s)\n",p7zip_home_dir);
+ }
+ global_use_utf16_conversion = 1; // UNICODE !
+
+ g_T0 = time(0);
+ // DEBUG printf("MAIN Thread : 0x%lx\n",wxThread::GetCurrentId());
+
+ // Create the main frame window
+#if 0
+ MyFrame *frame = new MyFrame((wxFrame *)NULL, _T("7-zip Main Window"), 50, 50, 450, 340);
+ // Don't Show the frame !
+ frame->Show(true); // FIXME
+
+ SetTopWindow(frame);
+
+ g_window = frame;
+#endif
+
+ /*
+ MyThread *thread = new MyThread(wxApp::argc,wxApp::argv);
+ thread->Create(); // != wxTHREAD_NO_ERROR
+ thread->Run();
+ */
+
+ wxInitAllImageHandlers();
+
+ Main1(wxApp::argc,wxApp::argv);
+
+ // success: wxApp::OnRun() will be called which will enter the main message
+ // loop and the application will run. If we returned false here, the
+ // application would exit immediately.
+ return true;
+}
+
+DWORD WINAPI GetTickCount(VOID) {
+ static wxStopWatch sw;
+ return sw.Time();
+}
+
+//////////////////////////////////////////
+
+#if 0
+#include "resource.h"
+#include "ExtractRes.h"
+
+static CStringTable g_stringTable[] =
+{
+ /* resource.rc */
+ /***************/
+ { IDS_OPEN_TYPE_ALL_FILES, L"All Files" },
+ { IDS_METHOD_STORE, L"Store" },
+ { IDS_METHOD_NORMAL, L"Normal" },
+ { IDS_METHOD_MAXIMUM, L"Maximum" },
+ { IDS_METHOD_FAST, L"Fast" },
+ { IDS_METHOD_FASTEST, L"Fastest" },
+ { IDS_METHOD_ULTRA, L"Ultra" },
+ { IDS_COMPRESS_NON_SOLID, L"Non-solid" },
+ { IDS_COMPRESS_SOLID, L"Solid" },
+
+ { IDS_COMPRESS_UPDATE_MODE_ADD, L"Add and replace files" },
+ { IDS_COMPRESS_UPDATE_MODE_UPDATE, L"Update and add files" },
+ { IDS_COMPRESS_UPDATE_MODE_FRESH, L"Freshen existing files" },
+ { IDS_COMPRESS_UPDATE_MODE_SYNCHRONIZE, L"Synchronize files" },
+ { IDS_COMPRESS_SET_ARCHIVE_DIALOG_TITLE, L"Browse" },
+ { IDS_COMPRESS_INCORRECT_VOLUME_SIZE, L"Incorrect volume size" },
+ { IDS_COMPRESS_SPLIT_CONFIRM_MESSAGE, L"Specified volume size: {0} bytes.\nAre you sure you want to split archive into such volumes?" },
+
+ { IDS_PASSWORD_USE_ASCII, L"Use only English letters, numbers and special characters (!, #, $, ...) for password." },
+ { IDS_PASSWORD_PASSWORDS_DO_NOT_MATCH, L"Passwords do not match" },
+ { IDS_PASSWORD_IS_TOO_LONG, L"Password is too long" },
+
+ { IDS_PROGRESS_COMPRESSING, L"Compressing" },
+ { IDS_PROGRESS_TESTING, L"Testing" },
+ { IDS_MESSAGE_NO_ERRORS, L"There are no errors" },
+ { IDS_FILES_COLON, L"Files:" },
+ { IDS_FOLDERS_COLON, L"Folders:" },
+ { IDS_SIZE_COLON, L"Size:" },
+ { IDS_COMPRESSED_COLON, L"Compressed size:" },
+ { IDS_ARCHIVES_COLON, L"Archives:" },
+
+ /* Extract.rc */
+ /**************/
+ { IDS_CANNOT_CREATE_FOLDER , L"Cannot create folder '{0}'"},
+ { IDS_OPEN_IS_NOT_SUPORTED_ARCHIVE, L"File is not supported archive."},
+
+ { IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_CRC , L"CRC failed in '{0}'. File is broken."},
+ { IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_DATA_ERROR , L"Data error in '{0}'. File is broken"},
+ { IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_UNSUPPORTED_METHOD , L"Unsupported compression method for '{0}'."},
+ { IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_CRC_ENCRYPTED , L"CRC failed in encrypted file '{0}'. Wrong password?"},
+ { IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_DATA_ERROR_ENCRYPTED , L"Data error in encrypted file '{0}'. Wrong password?"},
+
+ { IDS_EXTRACT_SET_FOLDER , L"Specify a location for extracted files."},
+ { IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_CANNOT_OPEN_FILE, L"Can not open output file '{0}'."},
+ { IDS_PROGRESS_EXTRACTING, L"Extracting" },
+
+ { IDS_CANT_OPEN_ARCHIVE , L"Can not open file '{0}' as archive"},
+ { IDS_CANT_OPEN_ENCRYPTED_ARCHIVE , L"Can not open encrypted archive '{0}'. Wrong password?"},
+
+ { 0 , 0 }
+};
+
+REGISTER_STRINGTABLE(g_stringTable)
+#endif
+
+
+///////////////////////////////////////////
+
+namespace NFsFolder {
+
+ // FIXME
+ bool wxw_CopyFile(LPCWSTR existingFile, LPCWSTR newFile, bool overwrite)
+ {
+ return wxCopyFile(wxString(existingFile), wxString(newFile), overwrite);
+ }
+}
+