6 #include "Common/Wildcard.h"
7 #include "Windows/FileFind.h"
8 #include "../../Archive/IArchive.h"
10 #include "UpdateAction.h"
11 #include "ArchiveOpenCallback.h"
12 #include "UpdateCallback.h"
14 #include "LoadCodecs.h"
18 UString Prefix; // path(folder) prefix including slash
19 UString Name; // base name
20 UString BaseExtension; // archive type extension or "exe" extension
21 UString VolExtension; // archive type extension for volumes
24 UString TempPrefix; // path(folder) for temp location
27 CArchivePath(): Temp(false) {};
29 void ParseFromPath(const UString &path)
31 SplitPathToParts(path, Prefix, Name);
34 int dotPos = Name.ReverseFind(L'.');
37 if (dotPos == Name.Length() - 1)
39 Name = Name.Left(dotPos);
40 BaseExtension.Empty();
43 if (BaseExtension.CompareNoCase(Name.Mid(dotPos + 1)) == 0)
45 BaseExtension = Name.Mid(dotPos + 1);
46 Name = Name.Left(dotPos);
49 BaseExtension.Empty();
52 UString GetPathWithoutExt() const
57 UString GetFinalPath() const
59 UString path = GetPathWithoutExt();
60 if (!BaseExtension.IsEmpty())
61 path += UString(L'.') + BaseExtension;
66 UString GetTempPath() const
68 UString path = TempPrefix + Name;
69 if (!BaseExtension.IsEmpty())
70 path += UString(L'.') + BaseExtension;
77 struct CUpdateArchiveCommand
79 UString UserArchivePath;
80 CArchivePath ArchivePath;
81 NUpdateArchive::CActionSet ActionSet;
84 struct CCompressionMethodMode
87 CObjectVector<CProperty> Properties;
88 CCompressionMethodMode(): FormatIndex(-1) {}
93 CCompressionMethodMode MethodMode;
95 CObjectVector<CUpdateArchiveCommand> Commands;
96 bool UpdateArchiveItself;
97 CArchivePath ArchivePath;
102 bool OpenShareForWrite;
105 UString StdInFileName;
109 bool EMailRemoveAfter;
110 UString EMailAddress;
114 bool Init(const CCodecs *codecs, const UString &arcPath, const UString &arcType);
117 UpdateArchiveItself(true),
122 EMailRemoveAfter(false),
123 OpenShareForWrite(false)
125 CRecordVector<UInt64> VolumesSizes;
134 // UStringVector ErrorPaths;
135 // CRecordVector<DWORD> ErrorCodes;
136 CErrorInfo(): SystemError(0) {};
139 struct CUpdateErrorInfo: public CErrorInfo
143 #define INTERFACE_IUpdateCallbackUI2(x) \
144 INTERFACE_IUpdateCallbackUI(x) \
145 virtual HRESULT OpenResult(const wchar_t *name, HRESULT result) x; \
146 virtual HRESULT StartScanning() x; \
147 virtual HRESULT CanNotFindError(const wchar_t *name, DWORD systemError) x; \
148 virtual HRESULT FinishScanning() x; \
149 virtual HRESULT StartArchive(const wchar_t *name, bool updating) x; \
150 virtual HRESULT FinishArchive() x; \
152 struct IUpdateCallbackUI2: public IUpdateCallbackUI
154 INTERFACE_IUpdateCallbackUI2(=0)
157 HRESULT UpdateArchive(
159 const NWildcard::CCensor &censor,
160 CUpdateOptions &options,
161 CUpdateErrorInfo &errorInfo,
162 IOpenCallbackUI *openCallback,
163 IUpdateCallbackUI2 *callback);