【发布时间】:2020-02-21 14:23:01
【问题描述】:
我将不得不创建一堆本地巧克力包,但我仍然无法创建我的第一个。为了解决这个问题,我需要使用installer.exe 进行包装吗?
这是我第一次尝试打包时使用chocolateyinstall.ps1 的示例,我在尝试制作的ARM RVCT 安装程序中使用了armcc.exe。
$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
fileType = 'EXE' #only one of these: exe, msi, msu
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
validExitCodes= @(0, 3010, 1641)
silentArgs = '/VERYSILENT'
#silentArgs = '/s' # InstallShield
#silentArgs = '/s /v"/qn"' # InstallShield with MSI
#silentArgs = '/s' # Wise InstallMaster
#silentArgs = '-s' # Squirrel
#silentArgs = '-q' # Install4j
#silentArgs = '-s' # Ghost
# Note that some installers, in addition to the silentArgs above, may also need assistance of AHK to achieve silence.
#silentArgs = '' # none; make silent with input macro script like AutoHotKey (AHK)
}
Install-ChocolateyInstallPackage @packageArgs # https://chocolatey.org/docs/helpers-install-chocolatey-install-package
我刚刚离开了我能找到的文档,但真的不知道要查找什么。我知道我的包裹需要本地采购,但仅此而已。如果我能创建一个成功的包并真正理解它,我想我应该能够成功地完成其余的包。
【问题讨论】:
标签: powershell cmd command-prompt chocolatey