Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Only update resources when necessary to keep signature valid #3323
This fixes #2526. Pyinstaller is updating the resources for python35.dll and makes its signature invalid. This then prevents that dll from being signed with the 'signtool' utility (which then can have more consequences, like the inability to publish the app to a repository where signing is mandatory).
In this commit, the resource update is skipped if it is not necessary, i.e. it is only performed if there have been som redirections or if the dll has been made private.
Test scenario: run pyinstaller on a Python app (https://github.com/tlecomte/friture) without these changes and 'signtool' fails to sign python35.dll with the error code 0x800700C1, ERROR_BAD_EXE_FORMAT. With these changes, the packaged python35.dll still shows its "Python Software Foundation" signature, and 'signtool' can successfully re-sign it.
Maybe pyinstaller could also remove the signature when it has to update the resources, so that the dll can be re-signed ? (since signtool seemed to be unhappy with a dll that has an invalid signature).