Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (GH-7) install - unpacking log debut output
  (GH-78) Unpack self should use relative directory
  • Loading branch information
ferventcoder committed Feb 8, 2015
2 parents 4e180cf + 82d2760 commit 6ab6f8d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
17 changes: 15 additions & 2 deletions nuget/chocolatey/tools/chocolateysetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $sysDrive = $env:SystemDrive
$tempDir = $env:TEMP
$defaultChocolateyPathOld = "$sysDrive\Chocolatey"
$ErrorActionPreference = 'Stop'
$debugMode = $false

function Initialize-Chocolatey {
<#
Expand All @@ -30,9 +31,16 @@ function Initialize-Chocolatey {
param(
[Parameter(Mandatory=$false)][string]$chocolateyPath = ''
)
if ($env:ChocolateyEnvironmentDebug -ne $null) {
$debugMode = $true
}

$chocoNew = Join-Path $thisScriptFolder 'chocolateyInstall\choco.exe'
& $chocoNew unpackself --force
if ($debugMode) {
& $chocoNew unpackself -fdv
} else {
& $chocoNew unpackself -f
}

$installModule = Join-Path $thisScriptFolder 'chocolateyInstall\helpers\chocolateyInstaller.psm1'
Import-Module $installModule -Force
Expand Down Expand Up @@ -200,7 +208,12 @@ param(
$chocoExe = Join-Path $chocInstallFolder 'choco.exe'
$chocoExeDest = Join-Path $chocolateyPath 'choco.exe'
Copy-Item $chocoExe $chocoExeDest -force
& $chocoExeDest unpackself --force

if ($debugMode) {
& $chocoExeDest unpackself -fdv
} else {
& $chocoExeDest unpackself -f
}
}

function Ensure-ChocolateyLibFiles {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void run(ChocolateyConfiguration configuration)
AssemblyFileExtractor.extract_all_resources_to_relative_directory(
_fileSystem,
assembly,
ApplicationParameters.InstallLocation,
_fileSystem.get_directory_name(Assembly.GetExecutingAssembly().Location),
folders,
ApplicationParameters.ChocolateyFileResources,
overwriteExisting: configuration.Force);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public static void extract_all_resources_to_relative_directory(IFileSystem fileS
//var fileLocation = fileSystem.combine_paths("", resourceString.ToString().Split('.')) + resourceName.Substring(fileExtensionLocation);

var filePath = fileSystem.combine_paths(directoryPath, fileLocation);
"chocolatey".Log().Debug("Unpacking {0} to '{1}'".format_with(fileLocation,filePath));
extract_binary_file_from_assembly(fileSystem, assembly, resourceName, filePath, overwriteExisting);
}
}
Expand Down

0 comments on commit 6ab6f8d

Please sign in to comment.