0

I am trying to install Chocolately on our servers at work, but I have a problem due certain McAfee rules that prevent us from unzipping or running an executable's from the Temp directory (From reviewing the Chocolately code, the $env:TEMP variable is used in a few places). I have tried to update the $env:TEMP variable myself, but there are policies that set it back immediately. I have even tried to update the $env:TEMP variable and install Chocolatey in the same powershell session, but it seems to set it back again.

Does anyone have any other suggestions / ideas? Any help is much appreciated. Thank you

JSM85
  • 3
  • 1
  • 3
  • 1
    You'll probably need to change the overzealous McAfee rules in order for this to work, or modify the code so that it works correctly in your environment. I bet the author of the module could add in support for a different `temp` folder, but if that doesn't exist right now, then you'll need to take another route. –  Feb 28 '14 at 00:28

1 Answers1

1

In Chocolatey this is controlled by CacheLocation - choco config get cachelocation (if empty, it uses $env:TEMP, otherwise it uses the value it is set to). This was added in 0.9.9. The specific commit to add cacheLocation was dc47d644.

For the installation of Chocolatey itself, you can adjust this simply by setting $env:TEMP='c:\some\location prior to running the installation script.

Original Accepted Answer:

Wow, this is interesting. I'm guessing we need to be able to make it settable. That's pretty insane that something would limit the use of the TEMP folder like that, but I can definitely see why someone would want to do that.

What I think I would do is to just go into the scripts for chocolatey and change everything not to use temp folder. There are probably 2 or 3 places where this is. You will need to out of band the install for chocolatey though as it attempts to do the same. Use nuget to install chocolatey, and then open a powershell session and run that installer - Check on the wiki for specific instructions on that https://github.com/chocolatey/chocolatey/wiki/Installation#wiki-nugetexe--powershell-method

ferventcoder
  • 11,952
  • 3
  • 57
  • 90
  • Hi @ferventcoder thanks for getting back to me. I had tried that out too, and adapted the install script to just install chocolatey, but then I found trying to install certain packages (like cinst elastic) required changing the temp directory in other scripts (e.g. Install-ChocolateyZipPackage). My only concern regarding changing these values is that it is not a sustainable model and I would have to update my version of the chocolatey scripts whenever an update was made available. But I think this may have to be the solution for the time being. Chocolatey is a great product btw, top work! – JSM85 Mar 01 '14 at 14:43
  • @JSM85 Yeah, it wasn't meant to be configurable at all. I didn't believe the workaround would be one that would not be without its issues. :/ – ferventcoder Mar 02 '14 at 16:44