aboutsummaryrefslogtreecommitdiffstats
path: root/tools/win-setup.ps1
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2019-09-24 09:41:15 +0200
committerAnders Broman <a.broman58@gmail.com>2019-09-24 10:46:47 +0000
commit41cf95c4ebc9159e36254ca125227722c3bf9a92 (patch)
tree0fbac3f291509a6f6e890e038988b996640b14a0 /tools/win-setup.ps1
parent10edd0749a40087586975f513859f56535e5f2bb (diff)
win-setup: Use an environment variable to chose not to use 7zip.
Company security policies may make it impossible to use 7zip from a powershell script. Use an environment variable to chose to use the built in Expand-Archive instead. Change-Id: I4fc914c089e25e9cfedf79aef14c42a54b44b845 Reviewed-on: https://code.wireshark.org/review/34601 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tools/win-setup.ps1')
-rw-r--r--tools/win-setup.ps19
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/win-setup.ps1 b/tools/win-setup.ps1
index 9130934230..a44c12808d 100644
--- a/tools/win-setup.ps1
+++ b/tools/win-setup.ps1
@@ -320,6 +320,15 @@ function DownloadArchive($fileName, $checksum, $subDir) {
if ($subDir -and -not (Test-Path $archiveDir -PathType 'Container')) {
New-Item -ItemType Directory -Path $archiveDir > $null
}
+ if (Test-Path 'env:WIRESHARK_DO_NOT_USE_7ZIP') {
+ # Display a progress bar while extracting and overwriting existing files.
+ Expand-Archive $archiveFile $archiveDir -Force -ErrorVariable $expandError
+ if ($expandError) {
+ exit 1
+ }
+ return
+ }
+
$activity = "Extracting into $($archiveDir)"
Write-Progress -Activity "$activity" -Status "Running 7z x $archiveFile ..."
& "$SevenZip" x "-o$archiveDir" -y "$archiveFile" 2>&1 |