Xav83 / chocolatey-packages

Implementation of the template to create and maintain chocolatey packages both manual and automatic (mostly automatic)
https://chocolatey.org/profiles/Xav83
Apache License 2.0
3 stars 4 forks source link

conan package doesnt add conan to PATH #7

Closed jayvdb closed 1 year ago

jayvdb commented 2 years ago

conan is installed into C:\Program Files\Conan\conan , but that is not added to the PATH.

Xav83 commented 2 years ago

Hi @jayvdb !

With which version of conan do you experience this issue ?

jayvdb commented 2 years ago

this was when after using choco to install https://community.chocolatey.org/packages/conan

$ /c/Program\ Files/Conan/conan/conan --version
Conan version 1.50.0
Xav83 commented 2 years ago

And the 'User Path' of your Windows system doesn't contain the path C:\Program Files/Conan/conan ?

Screenshot from 2022-07-17 18-25-44

stefansli commented 2 years ago

Can the recipe be changed to add Conan to the system path or provide an option to install for all users?

Xav83 commented 2 years ago

@jayvdb does your problematic matches the one described by @vectorsli ?

@vectorsli If I have understand the documentation of Install-ChocolateyPath, in #8, I have modified the conan package so that it will modify the PATH associated to the process running the installation. Would that solve your issue ?

stefansli commented 2 years ago

@Xav83 Thanks for your response. From my understanding of the documentation, the required "scope" would be Machine.

Xav83 commented 2 years ago

📝 NOTE Administrative Access Required when -PathType 'Machine'. https://docs.chocolatey.org/en-us/create/functions/install-chocolateypath

Which means that if I set it to Machine, everyone using the conan package, and whom don't have the Admin right, won't be able to install/update it.

I suppose that the Process value allows you to modify the PATH related to the context from which you run the install/upgrade command.

stefansli commented 2 years ago

Doesn't chocolatey complain when it's not running with administrative rights?

Alternatively one could let Chocolatey create a shim for conan.exe: https://docs.chocolatey.org/en-us/create/functions/install-binfile

Xav83 commented 2 years ago

Hi @vectorsli,

To keep you up to date, I have sent a message to the Chocolatey community, on Discord, in order to come up with the better solution for this issue :wink:

Xav83 commented 2 years ago

So, I have updated the PR #8, to allow the users to to specify, at the installation, the PATH in which they want conan to be added. On Discord, a member of the Chocolatey community has notified me about this possibility (cf. Chocolatey documentation) and that seems to be the best option in order to allow everyone to customize their installation to meet their need.

@vectorsli, will this solution meet your needs, or do you see any issue with it ? I'll wait for you feedback before integrating the PR :wink: