简体   繁体   English

使用Visual Studio For Installer签名的问题

[英]Issue with signing with Visual Studio For the Installer

I have a Visual Studio 2015 C# Solution, it has about 8 assemblies and executable and some exes require elevated permission. 我有一个Visual Studio 2015 C#解决方案,它具有大约8个程序集和可执行文件,并且某些exe需要提升的权限。 So I sign my executable and assemblies with a certificate on the post-build of each executable and assembly. 因此,我在每个可执行文件和程序集的生成后都用证书签署了可执行文件和程序集。 Then I sign them on the pre-build of the installer, and then I post-build my MSI. 然后,在安装程序的预构建版本上对它们进行签名,然后对MSI进行后续构建。

As a result, the MSI is signed while the install, but the executable that requires elevated permission does not, and it has the same date and time as the MSI (just a second before). 结果,在安装时对MSI进行了签名,但是不需要提升权限的可执行文件却被签名,并且它的日期和时间与MSI相同(仅一秒钟之前)。

Here is the script that I am using.. 这是我正在使用的脚本。

"c:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe" sign /f C:\Work\source\Certificate\CodeSign.pfx /p xxxxpasswordxxxx /tr http://tsa.starfieldtech.com /td SHA256 "c:\source\app\bin\Debug\app.exe"

What am I doing wrong? 我究竟做错了什么?

Update: As per Microsoft signtool removes administrative privileges? 更新:根据Microsoft signtool删除管理特权吗? I have set the requestedExecutionLevel to requireAdministrator in the app's manifest. 我在应用程序的清单中将requestedExecutionLevel设置为requireAdministrator。

After seeing what VS does with the file, it adds the files to the OBJ folder, so I had to sign the file that was in the obj\\debug folder on pre-compile, and it works. 在看到VS处理文件后,它将文件添加到OBJ文件夹中,因此我必须对预编译obj \\ debug文件夹中的文件进行签名,然后它才能工作。 "c:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64\\signtool.exe" sign /f C:\\Work\\source\\Certificate\\CodeSign.pfx /p xxxxpasswordxxxx /tr http://tsa.starfieldtech.com /td SHA256 "c:\\source\\app\\obj\\Debug\\app.exe" “ c:\\ Program Files(x86)\\ Windows Kits \\ 10 \\ bin \\ x64 \\ signtool.exe”符号/ f C:\\ Work \\ source \\ Certificate \\ CodeSign.pfx / p xxxxpasswordxxxx / tr http://tsa.starfieldtech .com / td SHA256“ c:\\ source \\ app \\ obj \\ Debug \\ app.exe”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM