Skip to content

Dependency on 7zip needs to be updated for Chef 15 and and the download url for it needs to be turned into an attribute. #143

@rgjoshi24

Description

@rgjoshi24

In the file install.ps1 there is an external uri dependency to download 7zip, it needs to be made as an attribute, so that we can download it from any internally hosted location.


$7zaExe = Join-Path $tempDir '7za.exe'
$unzipMethod = '7zip'
$useWindowsCompression = $env:chocolateyUseWindowsCompression
if ($useWindowsCompression -ne $null -and $useWindowsCompression -eq 'true') {
Write-Output 'Using built-in compression to unzip'
$unzipMethod = 'builtin'
} elseif (-Not (Test-Path ($7zaExe))) {
Write-Output "Downloading 7-Zip commandline tool prior to extraction."

download 7zip

Download-File 'https://chocolatey.org/7za.exe' "$7zaExe"
}

Also change the logic to use archive_file for Chef 15 and above...


if CHEF::VERSION.to_i >= 15
archive_file 'whatever'
else
include_recipe '7zip::default'

whatever 7zip resource
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions