ZarifS
ZarifS

Reputation: 477

Getting Install path of a package just installed by chocolatey in powershell

After I install a package in powershell by using "choco install $package" where package is taken from a config file and would look like "WinRar" so I would be doing choco install WinRar, how do i get the exact path this package was just installed to?

For example when I am installing PhantomJS using this, it gets installed to C:\ProgramData\chocolatey\lib\PhantomJS\tools\phantomjs-2.1.1-windows and I as the developer know that, but since I need to add this to the env path, depending on which version the install command installs, the path will be different. I need to get the exact path so i can set the environmental variable to right place.

PhantomJS is just one example, but a lot of packages get installed into directories where their version is apart of the path and getting the path from the powershell install scripts would really be helpful.

Is there anything like this available for the package manager? I assume figuring out where the package just got installed to should be possible because I see it displayed on my terminal window, just don't know how to access it in powershell.

Thanks.

Upvotes: 4

Views: 3166

Answers (1)

ferventcoder
ferventcoder

Reputation: 12561

Currently there is not a way, but there is a thought to maybe provide back a list of package results with that information (along with more). That is still in a feature request so look for it to be developed in the coming months.

You could parse the Chocolatey output to determine where Chocolatey saw things get installed and we are working to make that detection even better.

Upvotes: 1

Related Questions