Skip to content

Commit

Permalink
(GH-532) Fix - Temp uses 8.3 Path
Browse files Browse the repository at this point in the history
When determining the cache location and using the `TEMP` environment
variable, ensure that it is coming back as a Full Path and not as an
8.3 path. This happens on some systems when you simply call for the
Environment Variable. However `Path.GetTempPath()` provides a fully
qualified path instead of a shortened path. Use that instead.
  • Loading branch information
ferventcoder committed Jan 11, 2016
1 parent 47ef0b5 commit 76ae7e2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private static void set_machine_sources(ChocolateyConfiguration config, ConfigFi
private static void set_config_items(ChocolateyConfiguration config, ConfigFileSettings configFileSettings, IFileSystem fileSystem)
{
var cacheLocation = set_config_item(ApplicationParameters.ConfigSettings.CacheLocation, configFileSettings, string.IsNullOrWhiteSpace(configFileSettings.CacheLocation) ? string.Empty : configFileSettings.CacheLocation, "Cache location if not TEMP folder.");
config.CacheLocation = !string.IsNullOrWhiteSpace(cacheLocation) ? cacheLocation : System.Environment.GetEnvironmentVariable("TEMP");
config.CacheLocation = !string.IsNullOrWhiteSpace(cacheLocation) ? cacheLocation : fileSystem.get_temp_path(); // System.Environment.GetEnvironmentVariable("TEMP");
if (string.IsNullOrWhiteSpace(config.CacheLocation))
{
config.CacheLocation = fileSystem.combine_paths(ApplicationParameters.InstallLocation, "temp");
Expand Down

0 comments on commit 76ae7e2

Please sign in to comment.