Jump to content
ULIK

unzip using Windows shell does not work on ARM64

Recommended Posts

Posted (edited)

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:

 

error_copy.thumb.png.5e90332c215bdb3f0ef06ce06afab342.png

 

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.

 

Edited by ULIK
typo

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×