chocolatey - 如何告诉巧克力垫片使用安装文件所在的原始网络位置的路径
问题描述
当基于本地网络上的安装程序安装本地托管的巧克力包时,我可以看到创建了一个 shim。我理解的这个垫片指向原始安装程序。但要使其正常工作,需要在网络位置运行 shim,以便安装程序可以找到其他需要的文件。我尝试使用以下方法将网络位置添加到路径中:
Install-ChocolateyPath
但我没有成功。我还尝试在与网络上的原始文件相同的目录中创建一个 Setup.exe.ignore 文件,但没有成功。我已经看到了参考,--shimgen-usetargetworkingdirectory
但我不知道如何实现它。任何帮助是极大的赞赏。
解决方案
所以我自己想出了这个,并认为我会分享。在chocolateyinstall.ps1
我使用Install-ChocolateyInstallPackage
而不是Install-ChocolateyPackage
解决了与路径相关的问题并在与原始安装文件相同的目录中运行垫片。
更多信息在这里:
https://chocolatey.org/docs/helpers-install-chocolatey-package
https://chocolatey.org/docs/helpers-install-chocolatey-install-package
中的评论chocolateyinstall.ps1
说明了一切。
## If you are making your own internal packages (organizations), you can embed the installer or
## put on internal file share and use the following instead (you'll need to add $file to the above)
Install-ChocolateyInstallPackage @packageArgs # https://chocolatey.org/docs/helpers-install-chocolatey-install-package
推荐阅读
- r - ggplot:如何为多个绘图添加标签(使用 geom_text,没有图例)?
- python - Selenium webdriverwait (.text_to_be_present _in_element 没有) 似乎工作,我找不到任何解决方案
- javascript - 更改代码编辑器插件的 JavaScript
- mongodb - Express-session + Passport + MongoDB - req.isAuthenticated() 在登录后总是返回 false
- javascript - chrome.contextMenus.create 的 onclick 回调中的“info”的类型是什么?
- java - 无法使用 json 对象读取 jsonarray,NPE
- hibernate - 在 ManyToMany 中重命名外键约束
- c - 如何正确处理字符串数组的动态分配?
- vb.net - 如何在 VB.NET 中通过 datgarid 设置单元格颜色并修改其文本
- pyqt5 - 如何编写 Python 代码 pyqt5 在主窗口上附加 2 个小部件