如何告诉巧克力般的垫片使用从安装文件所在的原始网络位置开始的路径

问题描述 投票:0回答:1

[基于位于本地网络上的安装程序安装本地托管的巧克力包时,我可以看到已创建垫片。我了解此垫片指向原始安装程序。但是,要使其正常工作,需要在网络位置中运行填充程序,以便安装程序可以找到其他所需的文件。我尝试使用以下方法将网络位置添加到路径:Install-ChocolateyPath但是我还没有成功。我也尝试在与网络上原始文件相同的目录中创建Setup.exe.ignore文件,但没有成功。我已经看到了对--shimgen-usetargetworkingdirectory的引用,但是我不知道如何实现它。任何帮助是极大的赞赏。

chocolatey shim
1个回答
0
投票

所以我自己弄清楚了,并认为我会分享。在chocolateyinstall.ps1中,我使用Install-ChocolateyInstallPackage代替了Install-ChocolateyPackage,这解决了与路径有关的问题,并在与原始安装文件相同的目录中运行了Shim。

此处有更多信息:

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
© www.soinside.com 2019 - 2024. All rights reserved.