What you do is pretty simple, try everything
- Open Inno Setup and select Tools-> Configure Sign Tools

- Click "Add .." and give it a name, let me call it MsSign, since I am using signtool.exe from Microsoft , you should now have something like this

- You will then be asked about the command line tool that you use to sign, since I am using signtool.exe, which I will use
signtool.exe sign / tr http://timestamp.digicert.com / td sha256 / fd sha256 / a $ p
Pay attention to $ p at the end, Inno Setup needs this ... Now you should have it, and note that I added the path to signtool.exe to my path variables and that I use the DigiCert time server to timestamp my signature . 
Now in the script add the following code to the installation segment
SignTool = MsSign $ f
this line tells the compiler to use the code signature, it will use the variable that I called MsSign and sign the output generated by the installation.
it should look like this 
When you look at the generated exe file, you will see a digital signature 
Now this works for me, because I prepared my signature store so that the command line can get the signature, and I have only one code signature, so I won’t need to call it, your parameters may differ from mine, and that’s fine until, in the end, your installation works and your code is signed.
Hope that helps and remember you need $ p in a variable
Computer Aided Trading Systems
source share