通过 MSI 安装后,可执行文件未签名

发布于 2024-09-27 20:30:00 字数 472 浏览 2 评论 0原文

我们有一个应用程序,需要用户是管理员才能运行。因此,在 app.manifest 中,我们设置了

我们有一个密钥来签署我们的程序集,我已经能够使用它来签署 MSI 和我们应用程序的可执行文件。应用程序的可执行文件在项目的构建后事件中通过 signtool.exe 进行签名。

如果我查看 bin 目录,可执行文件确实已正确签名,但将其打包到 msi 并安装到另一台计算机上后,可执行文件不再签名。

这通常不会是一个大问题,除非我们需要管理员权限,因此当用户收到 UAC 提示时,它会显示未知的发布者。

打包成 MSI 后如何才能对可执行文件进行签名?

We have an application that requires the user to be an admin to run. So, in the app.manifest we have set up

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

We have a key to sign our assemblies with, which I have been able to use for signing the MSI and the executable of our application. The application's executable is signed via signtool.exe in the post build event for the project.

If I look in the bin directory, the executable is indeed signed correctly, but after it is packaged into the msi and installed on another machine, the executable is no longer signed.

This would normally not be a huge issue except that we require admin priviledges, so when the user gets the UAC prompt, it displays an unknown publisher.

How can I get the executable to be signed after it is packaged into an MSI?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遗忘曾经 2024-10-04 20:30:00

我终于在一个不起眼的博客上找到了答案。

编译MSI时,它不会从bin目录中拉取,而是从obj目录中拉取。基本上,我签署了错误的可执行文件。

I finally found the answer on an obscure blog.

When the MSI is compiled, it does not pull from the bin directory, it pulls from the obj directory. Basically, I had been signing the wrong executable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文