在cmder中安装了chocolatey管理器,然后使用choco install命令来安装软件,我想知道安装软件时如何修改路径?
我在命令行下输入choco install -?并没有找到修改路径的参数
Just pass --install-directory=value along and Chocolatey will determine what the actual call to the native installer needs to be and manage that for you!
chocolatey免费版本,本人已验证过可行:
choco install jdk10 -ia "INSTALLDIR=""D:\DevPrograms\Java\JDK\jdk10.0.1-x64"""
参考官方文档:
https://chocolatey.org/docs/getting-started#overriding-default-install-directory-or-other-advanced-install-concepts
如果是pro或business版本,可以使用--install-directory参数,参见文档:https://chocolatey.org/docs/commands-install#installarguments
--dir, --directory, --installdir, --installdirectory, --install-dir, --install-directory=VALUE
加上 --params="'/InstallationPath:xxxxxxxxx'" 就可以了
其中,xxxxxxxxx,是你想要安装到的目录