巧克力安装软件包失败

问题描述 投票:0回答:1

对于那些熟悉创建Chocolatey包的人,有人可以提供帮助以解决为什么此包不起作用吗?它打包了,但是当我测试(仅安装软件包)时,它将无法工作。这是chocolateyinstall.ps1文件:

$ErrorActionPreference = 'Stop'; # stop on all errors
$toolsDir   = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$fileLocation = Join-Path $toolsDir 'armcc.exe'
$packagename = 'ARM_RVCT'

$packageArgs = @{
  packageName   = $packageName
  unzipLocation = $toolsDir
  fileType      = 'EXE' #only one of these: exe, msi, msu
  #url           = $url
  #url64bit      = $url64
  file         = $fileLocation

  softwareName  = 'ARM_RVCT*' #part or all of the Display Name as you see it in Programs and Features. It should be enough to be unique

  silentArgs    = '/S' # ALLUSERS=1 DISABLEDESKTOPSHORTCUT=1 ADDDESKTOPICON=0 ADDSTARTMENU=0
  validExitCodes= @(0)
}

Install-ChocolateyInstallPackage @packageArgs # https://chocolatey.org/docs/helpers-install-chocolatey-install-package

[当我执行choco pack然后运行choco install arm_rvct时,得到以下输出:

Installing the following packages:
arm_rvct
By installing you accept licenses for the packages.

arm_rvct v3.1
arm_rvct package files install completed. Performing other installation steps.
Installing ARM_RVCT...
Microsoft.PowerShell.Commands.WriteErrorException
Error: C3079E: armcc command with no effect
Error: C3065E: type of input file '/S' unknown
Microsoft.PowerShell.Commands.WriteErrorException
ERROR: Running ["C:\ProgramData\chocolatey\lib\arm_rvct\tools\armcc.exe" /S ] was not successful. Exit code was '1'. See log for possible error messages.
The install of arm_rvct was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\arm_rvct\tools\chocolateyinstall.ps1'.
 See log for details.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - arm_rvct (exited 1) - Error while running 'C:\ProgramData\chocolatey\lib\arm_rvct\tools\chocolateyinstall.ps1'.
 See log for details.
powershell cmd arm chocolatey
1个回答
0
投票

它告诉您错误消息中的问题是什么:

Error: C3079E: armcc command with no effect
Error: C3065E: type of input file '/S' unknown

首先,看起来您可能正在注释掉,或者至少没有为armcc.exe提供必需的参数。其次,在/S的上下文中看起来armcc.exe不是用于静默安装的-它想要一个您当前不作为静默arg的一部分提供的输入文件。


armcc.exe不是安装程序-如果您没有适合您的工具链的安装程序,请考虑将工具链放入zip存档中,将该zip嵌入到您的软件包中,然后使用Install-ChocolateyZipPackage而不是Install-ChocolateyZipPackage(后者用于安装exe或msi安装程序)。

这将自动为可执行文件生成一些填充,并将它们放在路径上。请注意,由于这看起来像是针对Install-ChocolateyInstallPackage编译器的,因此,如果它通常接受管道输入,则Chocolatey垫片实际上不支持管道输入,因此请牢记该限制,并牢记生成的垫片。


当然,如果有ARM工具链的正式Windows安装程序,我建议嵌入该安装程序,而不是在工具链中使用手工zip存档。

© www.soinside.com 2019 - 2024. All rights reserved.