Save you certificate file (E.G. MyCertificate.pfx) to a network location (E.G. \\MyServer\MyShare$\MyCertificates\). This can be a local folder.
Find the location of signtool.exe on your PC.
Substitute the path to your signtool.exe in the following code.
Substitute the path to your certificate file and the name of your certificate file in the following code.
Substitute MyPassword in the following code with the password for your certificate file.
Code: Select all
"C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe" sign /f "\\MyServer\MyShare$\MyCertificates\MyCertificate.pfx" /p MyPassword /v "$(TargetPath)"
Project / Project Properties /Compile / Build Events / Edit Post-build
And add your modified code to the "Post-build event command line".
Re build your EXE and now it will be signed using your certificate file.