问题描述
对于那些熟悉创建Chocolatey软件包的人,有人可以提供帮助以解决为什么此软件包不起作用的情况吗?它打包了,但是当我测试(仅安装软件包)时,它将无法工作.这是chocolateyinstall.ps1
文件:
For those who are familiar with creating Chocolatey packages, can someone offer help to why this one isn't working? It packs, but when I test (install only package), it won't work.Here is the chocolateyinstall.ps1
file:
$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
时,我得到以下输出:
When I do choco pack
and then run choco install arm_rvct
, I get this output:
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.
推荐答案
它确切地告诉您错误消息中的问题是什么:
It tells you exactly what the problem is in the error message:
Error: C3079E: armcc command with no effect
Error: C3065E: type of input file '/S' unknown
首先,您似乎正在注释掉,或者至少没有为armcc.exe
提供必需的参数.其次,在armcc.exe
上下文中,/S
似乎不是用于静默安装的-它想要一个您当前不作为静默arg的一部分提供的输入文件.
First, it looks like you might be commenting out, or at the very least, not providing required parameters for armcc.exe
. Second, it looks like /S
in the context of armcc.exe
isn't for a silent install - it wants an input file which you are not currently providing as part of your silent args.
armcc.exe
不是安装程序-如果您没有适合您的工具链的安装程序,请考虑将工具链放入zip存档中,将该zip嵌入您的软件包中,然后使用 Install-ChocolateyZipPackage
而不是 Install-ChocolateyInstallPackage
(后者用于安装exe或msi安装程序).
armcc.exe
isn't an installer btw - if you don't have a proper installer for your toolchain, consider putting the toolchain in a zip archive, embedding that zip in your package, and then install with Install-ChocolateyZipPackage
instead of Install-ChocolateyInstallPackage
(the latter is for installing exe or msi installers).
这将自动为可执行文件生成一些填充,并将它们放在路径上.请注意,由于这看起来像是针对arm_rvct
编译器的,因此,如果它通常接受管道输入,则Chocolatey垫片实际上不支持管道输入,因此请牢记这一限制,并牢记生成的垫片.
This should automatically generate some shims for your executables and place them on the path. Note that since this looks like it's for the arm_rvct
compiler, if that normally accepts pipeline input, Chocolatey shims actually do not support pipeline input, so keep that limitation with generated shims in mind.
看起来确实有一个 ARM工具链的官方安装程序.但是,安装说明发行说明不提供任何静默安装说明.也就是说,这是未记录的安装程序的普遍问题-但这并不意味着您也无法付出任何努力来执行静默安装.
It does look like there is an official installer for the ARM toolchain. However, the installation instructions in the release notes don't provide any silent install instructions. That said, this is a common problem with undocumented installers - but it doesn't mean that you can't perform a silent install either, with some effort on your side.
您可以尝试运行setup.exe /S
或使用msiexec /i "ARM Compiler 6.13.msi" /qn
引用的ARM Compiler 6.13.msi
.如果上述两种方法都不起作用,则可以选择与供应商联系以询问静默安装的工作方式,也可以采用将已安装文件打包并将其打包为zip的方法.请注意,安装程序(尤其是对于devkit和工具链的安装程序)可能会在Windows中注册程序集,如果简单的文件安装无法正常工作,则反向工程可能会变得很复杂.
You can either try running setup.exe /S
or the referenced ARM Compiler 6.13.msi
with msiexec /i "ARM Compiler 6.13.msi" /qn
. If neither of these work, you have the options of reaching out to the vendor to ask how silent installs work, or you can go the route of taking the installed files and packaging them into a zip. Note that installers, especially for devkits and toolchains, may register assemblies in Windows and this can get complicated to reverse engineer if a simple file install doesn't work.
在这种情况下,供应商将是了解您如何在整个组织中部署此程序包的最佳资源.
In this case though, the vendor would be the best resource to understand how you are able to deploy this package throughout your organization.
这篇关于Chocolatey安装程序包失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!