0

I created a 7-zip self-extracting archive with a size of 4,37GB. When I use the signtool (tried already the 64-bit and 32-bit variant), it failed to sign this file.

I got the errors: SignTool error: This file format cannot be signed because it is not recognized. SignTool Error: An error occurred while attempting to sign: <7zip_selfextract.exe>

When I create in the same way via 7zip an self-extracting archive that is smaller then 4GB, the signing happens without any problems.

Anyone knowing about file size limitations in the signtool or ran against the same issue?

cvechelp
  • 36
  • 3

1 Answers1

0

It does not matter whether you will be able to sign it or not; Windows cannot run exe file that is over 4gb.

You can find explanation for that limit here: https://superuser.com/questions/667593/is-it-possible-to-run-a-larger-than-4gb-exe

Signtool is limited as well: https://web.archive.org/web/20120630022739/connect.microsoft.com/VisualStudio/feedback/details/519201/signtool-exe-cant-sign-big-file I did not found more up to date article but all packages I work with as long as they are under 4gb work fine with signtool. This seems to be same limit as with operating system as well.

As for in my case with signtool I had file truncated to size of part that was over 4gb (lets say file was 4,5gb and as output I got 0,5gb - might have been caused by something else in build pipeline - I did not investigate it further). I got rid of some packages that were there for convenience sake and increased compression level. If it is impossible for you (extra extraction time, not enough gain, etc.); try to do something like https://sourceforge.net/p/sevenzip/discussion/45797/thread/677bd204/ or use different solution.

  • Thx for the info. We worked around the problem by compressing the +4GB folder in multiple segment files with 7ZIP (with a max of 2GB per file). In this scenario, only the exe file is signed and this will handle our use case. – cvechelp Feb 07 '19 at 08:09