Hi,
since aeons the following code is used by our application to extract a ZIP file to a given folder:
procedure TForm1.ShellUnzip(const AZipFile, ATargetFolder: String; const AFilter: String = '');
const
SHCONTCH_NOPROGRESSBOX = 4;
SHCONTCH_AUTORENAME = 8;
SHCONTCH_RESPONDYESTOALL = 16;
SHCONTF_INCLUDEHIDDEN = 128;
SHCONTF_FOLDERS = 32;
SHCONTF_NONFOLDERS = 64;
var
vShellObj: Variant;
vSrcPath, vDestPath: Variant;
vShellPathItems: Variant;
begin
vShellObj := CreateOleObject('Shell.Application');
vSrcPath := vShellObj.NameSpace(AZipFile);
vDestPath := vShellObj.NameSpace(ATargetFolder);
vShellPathItems := vSrcPath.Items;
if strNN(AFilter) then
vShellPathItems.Filter(SHCONTF_INCLUDEHIDDEN or SHCONTF_NONFOLDERS or SHCONTF_FOLDERS, AFilter);
vDestPath.CopyHere(vShellPathItems, SHCONTCH_NOPROGRESSBOX or SHCONTCH_RESPONDYESTOALL);
end;
It still works fine on Windows 11/Intel . But it fails on Windows 11/ARM64:
This error raises for every file contained on the ZIP file.
I just checked: If I use the above method to copy over some plain files (not within a ZIP), then it works fine on ARM64. But why it fails for files contained on a ZIP file and how to fix this? I would prefer not to use a 3rd party library for that task.