Make the temp directory configurable #554
Make the temp directory configurable #554
Conversation
Enable users to specify an alternate temp directory in the chocolatey configuration. If <tempDir> is not present, then $env:TEMP is used as a default. This enables companies with IT policies that prevent executing files in the %TEMP% directory to continue to use Chocolatey. Sample Configuration File with value specified: <?xml version="1.0"?> <chocolatey> <tempDir>%USERPROFILE%\Temp</tempDir> <useNuGetForSources>false</useNuGetForSources> <checksumFiles>true</checksumFiles> <virusCheck>false</virusCheck> <sources> <source id="chocolatey" value="https://chocolatey.org/api/v2/" /> </sources> </chocolatey>
@@ -198,7 +198,7 @@ param( | |||
if(!(test-path "$env:windir\Microsoft.Net\$fx\v4.0.30319")) { | |||
$NetFx4ClientUrl = 'http://download.microsoft.com/download/5/6/2/562A10F9-C9F4-4313-A044-9C94E0A8FAC8/dotNetFx40_Client_x86_x64.exe' | |||
$NetFx4FullUrl = 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe' | |||
Install-ChocolateyPackage "NetFx4.0" 'exe' -silentArgs "/q /norestart /repair /log `'$env:Temp\NetFx4Install.log`'" -url "$NetFx4ClientUrl" -url64bit "$NetFx4ClientUrl" -validExitCodes @(0, 3010) | |||
Install-ChocolateyPackage "NetFx4.0" 'exe' -silentArgs "/q /norestart /repair /log `'$(Get-TempDir)\NetFx4Install.log`'" -url "$NetFx4ClientUrl" -url64bit "$NetFx4ClientUrl" -validExitCodes @(0, 3010) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this would be available yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you are correct, I'll remove.
After moving Get-TempDir into src/helper/functions I have run into the dependency issue you warned me of. Once in the helpers directory, Get-TempDir is unable to use src/functions/Get-ConfigValue. I don't understand the difference between src/functions and src/helper/functions. How would you recommend that I proceed? |
@carolynvs apologies, somehow this fell of my radar.
|
This implements #307 |
@carolynvs I went with a bit of an easier fix for now. It helps with when package maintainers are also not using our defined functions and using |
I just pushed 0.9.8.29-beta1 with the functionality in it. |
Enable users to specify an alternate temp directory in the chocolatey configuration.
If is not present, then $env:TEMP is used as a default.
This enables companies with IT policies that prevent executing files
in the %TEMP% directory to continue to use Chocolatey (see discussion at https://groups.google.com/forum/#!topic/chocolatey/V8aU7VnB5eM)
Sample Configuration File with value specified: