Thank you Martin!
This really helps. When I set SignTool, the .tmp file is signed as well.
I have set it in the following way:
In the iss-file:
[Setup]
SignTool=mysign
When running the packager:
"c:\Program Files (x86)\Inno Setup 6\iscc.exe" /Smysign="y:\builder\sign.bat MyInstaller $f" /DMyAppVersion=%VER
I have also removed signing of the final distribution .exe that is generated by Inno, as it is now already signed by inno during packaging.
Before consulting here, I searched in the Internet and consulted various AI like Claude. Everywhere the conclusion was that setting SignTool will only cause the installer and uninstaller to be signed, but not the .tmp file that is extracted during the installation. Also the page that you linked above does not state anywhere that also .tmp will be signed and that setting SignTool should therefore be the preferred method instead of using a separate step for signing after inno finishes packaging. Maybe you can put some clarification about that on that page, so that other users and the AI will understand that also the tmp file is signed and that this will solve the problem where the installaition is rejected by Windows when the installer file is signed, but only the tmp file is not signed.
Thank you again and greetings,
Peter