55 Commits

Author SHA1 Message Date
Martijn Laan
01dc41cb81
Actually, do move Extract(7Zip)ArchiveRedir's outer exception handling up one level. Does not add extra duplicate code and still keeps it as 6.4.3. 2025-06-06 20:11:14 +02:00
Martijn Laan
4c583c14b7
Make Extract7ZipArchiveRedir's exception to like it was in 6.4.3, and therefore do same for ExtractArchiveRedir. These functions are purely for [Code] so should be ok like this.
Todo: look at ArchiveFind*, which is more integrated and should allow the caller to differentiate between ESevenZipError and other stuff.
2025-06-06 19:32:38 +02:00
Martijn Laan
d35d8bf543
Finish new messages / exception handling. 2025-06-04 10:10:08 +02:00
Martijn Laan
f637222d2b
Merge branch 'files-extractarchive' into files-extractarchive-newmessages2 2025-06-04 10:07:02 +02:00
Martijn Laan
8e10a447fe
Be like SevenZipDLLDecoder again. 2025-06-04 09:14:31 +02:00
Martijn Laan
36177fd98a
Redo the message change. Todo: commit updated Default.isl. 2025-06-03 20:09:20 +02:00
Martijn Laan
f5e057387a
Add missing exception handling here as well. Keeping it simple by just requesting an abort. 2025-05-29 15:55:58 +02:00
Martijn Laan
f770e48db8
Finishing touches. 2025-05-28 20:34:25 +02:00
Martijn Laan
3f417868d3
Merge branch 'main' into 7zdll 2025-05-28 16:31:32 +02:00
Martijn Laan
82a13227cf
Various tweaks. 2025-05-28 16:31:06 +02:00
Martijn Laan
60f07053ac
Merge branch 'main' into 7zdll 2025-05-26 15:12:30 +02:00
Martijn Laan
64d20b80f3
Add support for overwriting read-only files. 2025-05-26 15:11:54 +02:00
Martijn Laan
6218a86f54
Mark Extract7ZipArchive as obsolete/renamed. If it's called anyway and a 7-Zip DLL is available, still use the DLL version. 2025-05-24 14:11:35 +02:00
Martijn Laan
9f4ec000ec
Add TExtractionWizardPage.AddEx. Todo: test & doc. Also some other minor tweaks.
Left the lack of password support as an internal implementation detail of Extract7ZipArchiveRedir.
2025-05-22 12:10:32 +02:00
Martijn Laan
4d26869349
DownloadTemporaryFileOrExtract7ZipArchiveProcessMessages -> DownloadTemporaryFileOrExtractArchiveProcessMessages. 2025-05-22 09:45:35 +02:00
Martijn Laan
ab1463ce46
Remove the Get/SetCurrentDir calls as they are no longer needed. 2025-05-21 21:07:14 +02:00
Martijn Laan
45053d7f16
Add missing ValidateAndCombinePath call to the SetFileAttributes handler. This should make it possible to remove the Get/SetCurrentDir calls. 2025-05-21 08:31:50 +02:00
Martijn Laan
13333a63b3 Fix ForceDirectories not using DisableFsRedir. Not caused by revert, was left like this in 4a4c5130.
Still need to figure out if this really works or not. Thought just doing SetCurrentDir was ok but now I'm not sure.
2025-05-20 13:51:02 +02:00
Martijn Laan
028432c711 Revert adding Redir suffixes + TRedir<T>. 2025-05-20 13:35:14 +02:00
Martijn Laan
4a4c51302f
Add Redir support to Extract7ZipArchive. 2025-05-19 20:42:17 +02:00
Martijn Laan
a1bffc816c
Clarify the name of functions taking a DisableFsRedir parameter but not having the ...Redir name. Especially helps if the call just says False for DisableFsRedir.
Also always set DisableFsRedir to False in InternalExtractTemporaryFile and DownloadTemporaryFile just like it already does for everything else working on the temp dir.
2025-05-19 19:29:09 +02:00
Martijn Laan
dbc53c6e5e
Fix comment. 2025-05-17 14:58:32 +02:00
Martijn Laan
99474e50d0
Move PathHasInvalidCharacters and ValidateAndCombinePath into PathFunc. 2025-05-17 08:43:41 +02:00
Jordan Russell
0eb19b4d4c
SevenZipDecoder: Add extra layer of filename validation.
Instead of relying on PathExpand (GetFullPathName) alone to catch directory escape attempts, add our own checks.

We also now strictly reject path components with trailing dots or spaces.
2024-11-27 04:39:23 -06:00
Martijn Laan
6910a147a5
Finishing touches. 2024-11-15 16:44:10 +01:00
Martijn Laan
96853695e2
Update for new messages. 2024-11-15 00:02:22 +01:00
Martijn Laan
aa1e83a139
Strengthen CreateFileW's check. 2024-11-14 23:20:23 +01:00
Martijn Laan
c0633da04d
Earlier comment about new issue was wrong: it does actually use the current dir but our CreateFile sanity check was denying access to the archive when the dest dir was not the dir of the archive. Fix this. Should be on main but doing it here to avoid conflicts (due to State var addition). 2024-11-14 19:20:53 +01:00
Martijn Laan
8d38ccb084
Finish/fix the page + make Extract7ZipArchive use exceptions on errors, just like DownloadTemporaryFile. Todo: fix messages. Also found new issue (not related to this branch): turns out 7zMain.c doesn't work from the current dir like I thought, instead it works from the archive dir. So the DestDir parameter doesn't work at the moment, doh! 2024-11-14 18:45:08 +01:00
Martijn Laan
c96fdb04a4
Fix the archive name todo + log cleanup (there was double logging). 2024-11-14 15:54:11 +01:00
Martijn Laan
dc634c99de
Work on adding CreateExtractionPage and also make some other improvements. Some todos left as mentioned in the code and also didn't actually test the page yet. 2024-11-14 15:35:20 +01:00
Martijn Laan
81557149a4
Add abort option. 2024-11-09 13:40:56 +01:00
Martijn Laan
23bac8824d
Be like DownloadTemporaryFile. 2024-11-09 13:32:19 +01:00
Martijn Laan
bda8555b87
Add basic progress reporting for 7-Zip extracting, not yet actually used. 2024-11-09 13:19:47 +01:00
Jordan Russell
31a7a16cdf
ExpandedDestDir needs trailing backslash. 2024-11-03 00:54:57 -05:00
Martijn Laan
bb0a079926
Update the 7-Zip sanity checking to check for PathExpand failure. 2024-11-02 12:52:58 +01:00
Martijn Laan
70de42e2e7
Sanity check the names of directories and files 7-Zip wants to create. Also enable the preexisting CreateFileA check for BCC32. 2024-10-29 19:02:18 +01:00
Martijn Laan
ca6d2a76e1
Various 7-Zip related improvements. 2024-10-08 19:26:28 +02:00
Martijn Laan
0a71d3bbe1
Improve various 7-zip. 2024-10-08 19:16:10 +02:00
Martijn Laan
74546834cd
Fix. 2024-10-05 20:50:30 +02:00
Martijn Laan
1d270afdc2
Don't continue if SetCurrentDir fails. 2024-10-05 16:10:28 +02:00
Martijn Laan
b6b5c41872
7zMain.c always sends #10 as newline but its call to FormatMessage can cause #13#10 anyway. 2024-10-05 15:47:52 +02:00
Martijn Laan
803270a32d
Expose to [Code] and update whatsnew. 2024-10-05 10:40:28 +02:00
Martijn Laan
a05d89daf2
Avoid duplicate alloc/free code. 2024-10-05 09:53:27 +02:00
Martijn Laan
74b3066ad8
Collect 7-Zip output into lines. Simpler than TCreateProcessOutputReader's version because 7-Zip only sends #10. (And even if it did send #13#10 it would still be simpler because they would never arrive separately.)
Todo:
-Merge ISLzmaDec.c and IS7zDec.c
-Expose to [Code]
-Document
(Only semi related:)
-Redo speed test as documented in whatsnew (may be better than it says if tested more pure)
2024-10-03 19:45:32 +02:00
Martijn Laan
cb54c19249
Fix comment position. 2024-10-03 19:21:10 +02:00
Martijn Laan
551bcbecc9
Add comments. Not sure why Delphi insists on having these even though it knows they aren't needed, as shown by the missing 'breakpoint dots'. 2024-10-03 19:15:06 +02:00
Martijn Laan
17be212776
Move the stdio.h/stdout change outside 7zMain.c. This means using the SDK without any changes at all would work, isn't that cool? 2024-10-03 19:04:32 +02:00
Martijn Laan
d0f6c549d3
Finish workaround. It works 💪 2024-10-03 18:34:24 +02:00
Martijn Laan
144a32834c
Workaround stdcall issue. Not yet finished so also not yet tested. 2024-10-03 15:52:04 +02:00