您好,我使用WiX Toolset v3.11来部署几个项目。一段时间以来,这项工作一直没有问题。我使用Visual Studio 2017中的生成后事件命令行对安装包进行数字签名。不幸的是,我的电脑上的USB出现了问题,所以我不得不重新安装Windows 10。由于重新安装后生成命令不再运行。我希望解决方案是我忽略的简单问题。
生成后命令
"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.