我正在尝试创建一个巧克力软件包来执行无人参与的Visual Studio 2015 Enterprise安装。这将是我们在内部使用的内容,因此我们拥有包含vs_enterprise.exe
可执行文件的网络共享。网络共享还包含一个包文件夹,该文件夹包含可在安装Visual Studio时选择安装的Visual Studio包。例如:Windows Dev Tools,Xamarin SDK,FSharp SDK等......
使用以下命令使用chocolatey进行安装时,我在尝试从Microsoft下载软件包时遇到错误:choco install -fdv <path to nuspec>
这是日志中的错误:
[1E34:1D5C][2016-06-03T17:54:54]w343: Prompt for source of package: Preparation_Uninstall_vs_enterprise, payload: Preparation_Uninstall_vs_enterprise, path: C:\Users\myuser\AppData\Local\Temp\chocolatey\VisualStudio2015Enterprise\14.0.25123.00\packages\vs_enterprise\Preparation.exe
[1E34:1C6C][2016-06-03T17:54:54]i000: MUX: Vital packages to be installed: 24
[1E34:1C6C][2016-06-03T17:54:54]i000: MUX: Total packages to be installed: 141
[1E34:1D5C][2016-06-03T17:54:54]i000: MUX: Next Source: Web, Attempted: 1, Limit:3
[1E34:1D5C][2016-06-03T17:54:54]i000: MUX: Source retrieved: Web
[1E34:1C6C][2016-06-03T17:54:54]i000: MUX: Updating progress percentages: Burn: 0.635617296502411, Secondary installer: 0.364382703497589
[1E34:1D5C][2016-06-03T17:54:54]i000: MUX: Package:Preparation_Uninstall_vs_enterprise, PayloadId:Preparation_Uninstall_vs_enterprise Url: bits://go.microsoft.com/fwlink/?prd=12514&pver=Dev14&sbp=d14rel&plcid=0x409&clcid=0x409&ar=25123.00.00&sar=S80_RCPrep&o1=3B4A490AB282CB3A99A329F3C8715B20B7A0BFB1, Attempting count: 1
[1E34:1D5C][2016-06-03T17:54:54]i000: MUX: Existing last unconfirmed source: Web
[1E34:1D5C][2016-06-03T17:54:54]i338: Acquiring package: Preparation_Uninstall_vs_enterprise, payload: Preparation_Uninstall_vs_enterprise, download from: bits://go.microsoft.com/fwlink/?prd=12514&pver=Dev14&sbp=d14rel&plcid=0x409&clcid=0x409&ar=25123.00.00&sar=S80_RCPrep&o1=3B4A490AB282CB3A99A329F3C8715B20B7A0BFB1
[0F1C:1850][2016-06-03T17:54:54]e000: Error 0x800b0003: Failed authenticode verification of payload: C:\ProgramData\Package Cache\.unverified\Preparation_Uninstall_vs_enterprise
[0F1C:1850][2016-06-03T17:54:54]e000: Error 0x800b0003: Failed to verify signature of payload: Preparation_Uninstall_vs_enterprise
[0F1C:1850][2016-06-03T17:54:54]e310: Failed to verify payload: Preparation_Uninstall_vs_enterprise at path: C:\ProgramData\Package Cache\.unverified\Preparation_Uninstall_vs_enterprise, error: 0x800b0003, delete: Yes
[0F1C:1850][2016-06-03T17:54:54]e000: Error 0x800b0003: Failed to cache payload: Preparation_Uninstall_vs_enterprise
[1E34:1D5C][2016-06-03T17:54:54]i000: MUX: Set Result: Return Code=-2146762749 (0x800B0003), Error Message=, Result Detail=, Vital=False, Package Action=Verify, Package Id=Preparation_Uninstall_vs_enterprise
[1E34:1D5C][2016-06-03T17:54:54]e314: Failed to cache payload: Preparation_Uninstall_vs_enterprise from working path: C:\Users\myuser\AppData\Local\Temp\{675a5109-38d6-406c-9e75-d0e922f87a58}\Preparation_Uninstall_vs_enterprise, error: 0x800b0003.
[1E34:1D5C][2016-06-03T17:54:54]e349: Application requested retry of payload: Preparation_Uninstall_vs_enterprise, encountered error: 0x800b0003. Retrying...
但是,如果我通过双击网络共享上的vs_enterprise.exe文件手动安装,则日志显示正在从网络共享安装软件包,并且Visual Studio安装正确。
[0AE8:081C][2016-06-03T17:21:59]i338: Acquiring package: Preparation_Uninstall_vs_enterprise, payload: Preparation_Uninstall_vs_enterprise, copy from: \\network\share\Visual Studio 2015 Enterprise with Update 2\packages\vs_enterprise\Preparation.exe
有没有办法可以强制无人参与安装在网络共享上查找软件包而不是尝试下载它们?
答案 0 :(得分:1)
是的,这是支持的,但您需要一个不同的帮助器。你没有发布你的脚本,所以我假设你正在使用Install-ChocolateyPackage
(你运行choco new visualstudio2015
来创建包,对吧?)。
查看Chocolatey PowerShell functions的文档以获取完整参考。
Install-ChocolateyPackage
提及以下内容:
将软件安装到&#34;程序和功能&#34;基于远程文件 下载。在本地或嵌入时使用
Install-ChocolateyInstallPackage
文件。
有一个名为Install-ChocolateyInstallPackage
的函数,它只使用文件,无论是嵌入在包中还是在本地文件共享中。
使用指向nuspec的路径调用choco install可能实际上是导致您看到错误的原因。这主要用于测试 - choco必须编译包以便能够运行安装,并且它可能试图将本地内容用于执行此操作。因此,针对该nuspec运行choco pack
以首先编译包。
建议您拨打choco install visualstudio2015 --source \\the_share\folder_with_compiled_nupkgs
。
该文件夹中应该有一个已编译的visualstudio2015。 version .nupkg,它是已编译的nuspec。
如果您想了解更多深度信息,请参阅https://chocolatey.org/docs/commands-install#examples
HTH