Skip to content
This repository has been archived by the owner. It is now read-only.

[Enhancement] Download directory should be configurable #307

Closed
ilinkuo opened this Issue Jun 28, 2013 · 8 comments

Comments

Projects
None yet
4 participants
@ilinkuo
Copy link

ilinkuo commented Jun 28, 2013

I want to use Chocolatey in a restricted corporate environment where we'are only able to run things if they are installed into a specific directory. I can get Chocolatey itself to install to that directory via the ChocolateyInstall environment variable according to the instructions at https://github.com/chocolatey/chocolatey/wiki/Installation. However, when chocolatey tries to install apps, it downloads the installer exe to the default download location -- c:\Users\MyUSERId\APPDATA\LOCAL\TEMP\CHOCOLATEY... and tries to run the .exe from there. This is not allowed. It needs to be run in a subdirectory of ChocolateyInstall, preferably %ChocolateyInstall%\temp

@ferventcoder

This comment has been minimized.

Copy link
Contributor

ferventcoder commented Jun 29, 2013

This sounds pretty solid. It might be a version or two before we get to this though.

@TomOne

This comment has been minimized.

Copy link

TomOne commented Sep 4, 2013

Good suggestion. This would also be more compliant to package managers for Linux. They also have a specific folder where they download their packages. It’s called “package cache”. In apt-get for example, this cache can be cleared with apt-get clean. It would be great if we had such a command in chocolatey.

@ferventcoder

This comment has been minimized.

Copy link
Contributor

ferventcoder commented Sep 4, 2013

Like I suggested, what we need first is a way to pass a universal switch to chocolatey for directory to install has to happen first and then packages will need to buy into that some.

@ChaseFlorell

This comment has been minimized.

Copy link

ChaseFlorell commented Nov 19, 2014

We're having this exact same issue. If we can pass the directory in as a switch when we do the initial chocolatey install (install.ps1), we could save the string to the chocolatey.config and have chocolatey check there first before defaulting to the path specified in the $env:Temp variable. If it exists, use it, else, use the $env:Temp

note: currently we run a script before doing any choco install, but if we forget, all hell breaks loose.

$tempPath = "C:\temp"
New-Item $tempPath -Type Directory -Force
$env:TEMP = $tempPath
@ferventcoder

This comment has been minimized.

Copy link
Contributor

ferventcoder commented Nov 19, 2014

Seems like you could have an internal fork of chocolatey where you make that change right in the first lines of chocolatey.ps1 :)

@ferventcoder

This comment has been minimized.

Copy link
Contributor

ferventcoder commented Nov 19, 2014

At least as stop gap. It would be really easy to make the change here but I'm reluctant as the really easy changes is what has kept around the POSH version for two years past it's usefulness.

@ChaseFlorell

This comment has been minimized.

Copy link

ChaseFlorell commented Nov 19, 2014

That's just because you created such a great structure that most changes are easy ones.
For us, we can't wait for the next incarnation of Choco, so we "could" fork and run our own, but it would definitely be nice to be able to simply create a non-impactful PR :)

@ferventcoder ferventcoder changed the title Download directory should go under ChocolateyInstall\temp Download directory should be configurable (don't assume that %USERPROFILE% and $env:TEMP are predefined) Jan 2, 2015

@ferventcoder

This comment has been minimized.

Copy link
Contributor

ferventcoder commented Jan 2, 2015

This partially closes #647.

@ferventcoder ferventcoder changed the title Download directory should be configurable (don't assume that %USERPROFILE% and $env:TEMP are predefined) Download directory should be configurable (don't assume $env:TEMP is predefined) Jan 2, 2015

@ferventcoder ferventcoder added 3 - Done and removed 0 - Backlog labels Jan 2, 2015

ferventcoder added a commit that referenced this issue Jan 2, 2015

(GH-307) Add cacheLocation
This allows you to override the default cacheLocation in $env:Temp\chocolatey.

This also resolves part of (GH-647) that mentions not assuming that $env:Temp is set.

ferventcoder added a commit that referenced this issue Jan 2, 2015

Merge branch 'stable'
* stable:
  0.9.8.29-beta1
  (doc) update changelog/nuspec
  (GH-647) Don't assume $env:TEMP is predefined
  (GH-647) Don't assume $env:USERPROFILE is set
  (GH-307) Add cacheLocation

@ferventcoder ferventcoder changed the title Download directory should be configurable (don't assume $env:TEMP is predefined) [Enhancement] Download directory should be configurable Jan 2, 2015

@ferventcoder ferventcoder self-assigned this Jan 2, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.