aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGraham Bloice <graham.bloice@trihedral.com>2015-07-24 16:33:27 +0100
committerGraham Bloice <graham.bloice@trihedral.com>2015-07-24 16:03:00 +0000
commite2561da034c1117434bf73235a8ff6436a74eec9 (patch)
treed3d2bcf3febbf756c8024004669f35436170bb9a /tools
parent2eabd353ad37c112d058c7ade42515877d186d4b (diff)
Fix CMake 7zip search
A further fix for the CMake Windows search for 7-zip. Add the destination\bin path to the search path. When downloading from anonsvn only pass the path within the destination not the whole path. Change-Id: I2beec925730fae21d6a63bee5332e1002f49d6ae Reviewed-on: https://code.wireshark.org/review/9770 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/win-setup.ps18
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/win-setup.ps1 b/tools/win-setup.ps1
index 7736397624..b784764ea2 100644
--- a/tools/win-setup.ps1
+++ b/tools/win-setup.ps1
@@ -224,11 +224,13 @@ function DownloadFile($fileName, [Uri] $fileUrl = $null) {
# https://github.com/thoemmi/7Zip4Powershell
function Bootstrap7Zip() {
$searchExes = @("7z.exe", "7za.exe")
+ $binDir = "$Destination\bin"
# First, check $env:Path.
foreach ($exe in $searchExes) {
if (Get-Command $exe -ErrorAction SilentlyContinue) {
$Global:SevenZip = "$exe"
+ Write-Output "Found 7-zip on the path"
return
}
}
@@ -239,6 +241,7 @@ function Bootstrap7Zip() {
"${env:ProgramFiles(x86)}\7-Zip"
"${env:ChocolateyInstall}\bin"
"${env:ChocolateyInstall}\tools"
+ "$binDir"
)
foreach ($dir in $searchDirs) {
@@ -246,6 +249,7 @@ function Bootstrap7Zip() {
foreach ($exe in $searchExes) {
if (Test-Path "$dir\$exe" -PathType 'Leaf') {
$Global:SevenZip = "$dir\$exe"
+ Write-Output "Found 7-zip at $dir\$exe"
return
}
}
@@ -253,13 +257,13 @@ function Bootstrap7Zip() {
}
# Finally, download a copy from anonsvn.
- $binDir = "$Destination\bin"
if ( -not (Test-Path $binDir -PathType 'Container') ) {
New-Item -ItemType 'Container' "$binDir" > $null
}
+ Write-Output "Unable to find 7-zip, retrieving from anonsvn into $binDir\7za.exe"
[Uri] $bbUrl = "https://anonsvn.wireshark.org/wireshark-win32-libs/trunk/bin/7za.exe"
- DownloadFile "$binDir\7za.exe" "$bbUrl"
+ DownloadFile "bin\7za.exe" "$bbUrl"
$Global:SevenZip = "$binDir\7za.exe"
}