You can add the following PostBuildEvent to your VS Setup project (project properties):
Windows 8.0:
"C:Program Files (x86)Windows Kits8.0inx86signtool.exe" sign /a $(BuiltOuputPath)
Windows 10:
"C:Program Files (x86)Windows Kits10inx86signtool.exe" sign /a $(BuiltOuputPath)
See this MSDN documentation for signtool usage. You can use the /f flag to specify the signing certificate, /p to specify the cert's password, etc
Also, note that $(BuildOuputPath) is misspelled. This is on purpose. Thanks microsoft...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…