问题
The vast majority of our business users run Windows 7, and our ClickOnce application installs, updates and runs as it should without any pop-up warnings.
The same application is throwing up the following on Windows 10
Of course 'More info' appears to be part of the text rather than something you can click with 'Don't run' appearing to be the only option
If you do click 'More Info' it states the publisher is unknown (although it displayed it just fine whilst updating!!!)
The Code Signing Certificate is valid and it still installs/updates and runs without warnings on Win 7 boxes.
Any ideas what they have changed now?
Thanks
回答1:
I assume you are using Signing tab - but it only signs setup.exe - and not the actual application.exe file. This way you don't get a "warning" prompt when you install the app, but you get it when you run it. You need to sign application.exe separately - and there is no UI for that in Visual Studio, you need to use PostBuild task: https://stackoverflow.com/a/18636102/1246870
i'm not sure why this works okay in Windows 7 - in my case Win7 did not work as well - but based on your comment, this can be the solution...
回答2:
With many thanks to avs099 - have marked that as the answer as it got me the closest so far! I ended up using BeforePublish..
Using IE11 I exported the certificate to a directory ( Internet Options > Content > Certificates > Export ), then copied and pasted it into the project. Then unloaded the project and added the following between
<Target Name="BeforePublish">
</Target>
tags
<Exec Command=""C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe" sign /f "MyCert_2016.pfx" /p "MySecretPassword" /t http://timestamp.comodoca.com/authenticode "C:\Users\MyName\My Documents\Visual Studio 2015\Projects\MyProject\MyProject\obj\Release\My.exe"" />
Then reloaded the project - published and now it runs on Windows 10 without any objections - just as well as it had gone from blue warnings to red ones :-(
Between the answer by avs099 and this link I made sense out of it after lots of build errors - this site was informative but placed the certificate in a full path, not relative
来源:https://stackoverflow.com/questions/32365144/signed-clickonce-app-throwing-unknown-publisher-with-windows-10