如何在 Chocolatey 中配置 installation/package

How can I configurate an installation/package in Chocolatey

我是 Chocolatey 的新手,现在正在使用它。我的目标是通过一个 PowerShell 脚本安装和升级我所有的基本应用程序。

我有一个 atm 问题。当我手动安装例如CCleaner 然后如果我想要 桌面图标 或者如果回收站有一个新的 [= 我可以通过向导进行配置33=]-CCleaner-条目。 我总是禁用它们。

我找不到配置我的 powershell 命令以禁用这两个选项的方法。

这是包裹的 link:https://chocolatey.org/packages/ccleaner

如果 Chocolately 中没有选项,是否建议我在安装 CCleaner 后在我的脚本中操作注册表?这对其他应用程序有何影响?

感谢您的付出!

简短的回答是,这取决于 :-(

一些软件包,例如 git allows you to use the concept of Package Parameters 用于控制安装程序的不同功能。

现在 CCleaner 包也有包参数的概念,但仅用于指定用于安装的语言环境。您可以在 chocolateyInstall.ps1 文件 here.

中看到可用的包参数

现在,可以直接将安装参数传递给本机安装程序。这记录在这里:

https://chocolatey.org/docs/commands-install#options-and-switches

具体来说:

--ia, --installargs, --installarguments, --install-arguments=VALUE InstallArguments - Install Arguments to pass to the native installer in the package. Defaults to unspecified.

-o, --override, --overrideargs, --overridearguments, --override-arguments OverrideArguments - Should install arguments be used exclusively without appending to current package passed arguments? Defaults to false.

choco install 命令中使用这些参数将允许您进一步控制安装。

困难的部分是找出需要将哪些参数传递给安装程序才能执行您想要的操作。这没有标准,这是必须在每个包的基础上完成的事情。