WiX Toolset Insignia错误INSG0001拒绝访问路径

时间:2018-02-21 13:29:23

标签: visual-studio deployment installation wix digital-signature

您好我使用WiX Toolset v3.11来部署多个项目。这在一段时间内没有问题。我在Visual Studio 2017中使用Post-build事件命令行对我的安装包进行数字签名。不幸的是,我的计算机上的USB出现问题,所以我不得不重新安装Windows 10.因为重新安装Post-build命令不再运行。我希望这个解决方案很容易被忽视。

发布构建命令

"C:\Program Files (x86)\WiX Toolset v3.11\bin\insignia.exe" -ib Installer.exe -o engine.exe
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86\signtool.exe" sign /f "c:\users\username\documents\Cert.pfx" /p "password" /d "My Software" /fd sha256 /tr http://timestamp.comodoca.com/rfc3161 /td sha256 "engine.exe"
"C:\Program Files (x86)\WiX Toolset v3.11\bin\insignia.exe" -ab engine.exe Installer.exe -o Installer.exe 
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86\signtool.exe" sign /f "c:\users\username\documents\Cert.pfx" /p "password" /d "My Software" /fd sha256 /tr http://timestamp.comodoca.com/rfc3161 /td sha256 "$(TargetPath)"
del engine.exe

构建

的输出
Windows Installer XML Toolset Inscriber version 3.11.1.2318
2>  Copyright (c) .NET Foundation and contributors. All rights reserved.
2>Insignia.exe(0,0): error INSG0001: Access to the path is denied.
2>  Exception Type: System.UnauthorizedAccessException
2>  Stack Trace:
2>     at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
2>     at System.IO.__Error.WinIOError()
2>     at System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost)
2>     at Microsoft.Tools.WindowsInstallerXml.Inscriber.InscribeBundleEngine(String bundleFile, String outputFile)
2>     at Microsoft.Tools.WindowsInstallerXml.Tools.Insignia.Run(String[] args)
2>  Done Adding Additional Store
2>  Number of errors: 1
2>EXEC(0,0): error : File not found: engine.exe
2>  Windows Installer XML Toolset Inscriber version 3.11.1.2318
2>  Copyright (c) .NET Foundation and contributors. All rights reserved.
2>Insignia.exe(0,0): error INSG0001: Could not find file 'C:\Users\username\Documents\Visual Studio 2017\Projects\My Sotware\Bootstrapper\bin\Release\engine.exe'.
2>  Exception Type: System.IO.FileNotFoundException
2>  Stack Trace:
2>     at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
2>     at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
2>     at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
2>     at Microsoft.Tools.WindowsInstallerXml.Inscriber.InscribeBundle(String bundleFile, String signedEngineFile, String outputFile)
2>     at Microsoft.Tools.WindowsInstallerXml.Tools.Insignia.Run(String[] args)
2>  Done Adding Additional Store
2>  Successfully signed: C:\Users\username\Documents\Visual Studio 2017\Projects\My Software\Bootstrapper\bin\Release\Installer.exe
2>  Could Not Find C:\Users\username\Documents\Visual Studio 2017\Projects\My Software\Bootstrapper\bin\Release\engine.exe
2>C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\wix2010.targets(2832,5): error MSB3073: The command ""C:\Program Files (x86)\WiX Toolset v3.11\bin\insignia.exe" -ib Installer.exe -o engine.exe
2>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86\signtool.exe" sign /f "c:\users\username\documents\Cert.pfx" /p "password" /d "My Software" /fd sha256 /tr http://timestamp.comodoca.com/rfc3161 /td sha256 "engine.exe"
2>"C:\Program Files (x86)\WiX Toolset v3.11\bin\insignia.exe" -ab engine.exe Installer.exe -o Installer.exe 
2>"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86\signtool.exe" sign /f "c:\users\username\documents\Cert.pfx" /p "password" /d "My Software" /fd sha256 /tr http://timestamp.comodoca.com/rfc3161 /td sha256 "C:\Users\username\Documents\Visual Studio 2017\Projects\My Software\Bootstrapper\bin\Release\Installer.exe"
2>del engine.exe" exited with code -1.
2>Done building project "Bootstrapper.wixproj" -- FAILED.

1 个答案:

答案 0 :(得分:0)

作为参考,解决方案确实很简单,我的安全软件BitDefender Total Security 2018阻止访问。

允许访问

  • 打开Bitdefender
  • 点击“查看功能”链接(向右侧)
  • 在“销售文件”磁贴中,单击“应用程序访问”
  • 将“WiX工具集铭文”切换为“允许”