Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choco install doesn't expand envvars, and installation into a custom location fails #748

Open
hmemcpy opened this issue May 25, 2016 · 7 comments

Comments

@hmemcpy
Copy link
Contributor

hmemcpy commented May 25, 2016

What You Are Seeing?

...
PATH environment variable does not have %localappdata%\Chocolatey\bin in it. Adding...
Import-Module : The specified module '%localappdata%\Chocolatey\helpers\chocolateyInstaller.psm1' was not loaded
because no valid module file was found in any module directory.
At C:\Users\hmemcpy\AppData\Local\Temp\chocolatey\chocInstall\tools\chocolateysetup.psm1:95 char:3
+   Import-Module "$realModule" -Force
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ResourceUnavailable: (%localappdata%\...yInstaller.psm1:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

What is Expected?

Chocolatey expands all environment variables, so ChocolateyInstall pointing to %localappdata%\Chocolatey will succeed.

How Did You Get This To Happen? (Steps to Reproduce)

  1. Define ChocolateyInstall to point to %localappdata%\Chocolatey
  2. Attempt to install Choco from powershell command line
@ferventcoder
Copy link
Member

@hmemcpy can you try this with the beta? I think it may have resolved this - we did a ton of work surrounding env vars.

The kind of env var registry key you are looking for is an expanding registry key, so you definitely need to review #699

@ferventcoder
Copy link
Member

Especially #699 (comment)

@ferventcoder
Copy link
Member

If you created the environment variable and saved it yourself prior to install of choco, how did you create it? You would have needed to create the expanding registry value, which I'm not sure you can do with the GUI.

@ferventcoder
Copy link
Member

@hmemcpy ping.

@hmemcpy
Copy link
Contributor Author

hmemcpy commented May 28, 2016

Sorry, sorry!
Yeah, I've created the envvar myself (wanted to have choco installed in a non-ProgramData location, so I set ChocolateyInstall manually to %localappdata%\Chocolatey (using RapidEE, but it shouldn't matter)

I would like to try it with the beta, is there a way to force install choco from scratch with the beta version?

@ferventcoder
Copy link
Member

@hmemcpy yes. Adjust your install call to use https://chocolatey.org/installabsolutelatest.ps1 instead.

OR

Set an environment variable right before you call install. $env:chocolateyVersion = 'BETA_VERSION' where the beta version is what you are looking for.

There is a list of the variables you can pass at the top of https://chocolatey.org/install.ps1

@ferventcoder
Copy link
Member

If you create the environment variable yourself, it _must_ be an expanding registry value (REG_EXPAND_SZ) for Chocolatey to see the value appropriately.

What I believe we are triaging here is whether Chocolatey should just give users the benefit of the doubt and expand the values (even if the values are just REG_SZ). Is that an accurate description of what you are asking for here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants