对于那些熟悉创建 Chocolatey 包的人来说,有人可以提供帮助来解释为什么这个包不起作用吗?它可以打包,但是当我测试(仅安装包)时,它不起作用。
这里是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
,我得到这个输出:
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.
它在错误消息中准确地告诉您问题所在:
Error: C3079E: armcc command with no effect
Error: C3065E: type of input file '/S' unknown
首先,看起来您可能会注释掉,或者至少没有提供所需的参数armcc.exe
。其次,它看起来像/S
在这样的背景下armcc.exe
不适用于静默安装 - 它需要一个输入文件,您当前未将其作为静默参数的一部分提供。
armcc.exe
顺便说一句,它不是安装程序 - 如果您的工具链没有合适的安装程序,请考虑将工具链放入 zip 存档中,将该 zip 嵌入到您的包中,然后使用Install-ChocolateyZipPackage代替Install-ChocolateyInstallPackage(后者用于安装 exe 或 msi 安装程序)。
这应该会自动为您的可执行文件生成一些填充程序并将它们放在路径上。请注意,因为这看起来像是针对arm_rvct
编译器,如果通常接受管道输入,Chocolatey 垫片实际上不支持管道输入,因此请记住生成垫片的限制。
看起来确实有一个官方安装程序用于 ARM 工具链。但是,那安装说明发行说明中没有提供任何静默安装说明。也就是说,这是无证安装程序的常见问题 - 但这并不意味着您也不能执行静默安装,只需您付出一些努力。
您可以尝试运行setup.exe /S
或引用的ARM Compiler 6.13.msi
with msiexec /i "ARM Compiler 6.13.msi" /qn
。如果这些都不起作用,您可以选择联系供应商询问静默安装如何工作,或者您可以采取获取已安装文件并将其打包成 zip 的方式。请注意,安装程序(尤其是开发套件和工具链的安装程序)可能会在 Windows 中注册程序集,如果简单的文件安装不起作用,则逆向工程可能会变得复杂。
但在这种情况下,供应商将是了解如何在整个组织中部署此软件包的最佳资源。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)