chr
2026-04-05 fe750b791d5b517cc4e9bc8e99a9a75139a0cfba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
#
# Script to install OpenTAP. Run this after untar.
#
# Copyright Keysight Technologies 2012-2019
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
NETCORE_INSTALLED="$(dotnet --list-runtimes | grep -E "NETCore\.App.6")"
if [ -z "$NETCORE_INSTALLED" ]; then
    printf 'OpenTAP depends on dotnet core runtime 6.0 which is not installed.
Please see https://docs.microsoft.com/en-us/dotnet/core/install/runtime for installation instructions
'
fi
 
DEST_DIR="$HOME/.tap"
BIN_DIR="$HOME/bin"
 
echo "TAP will be installed in $DEST_DIR, and shortcuts in $BIN_DIR"
 
if [ -e "$DEST_DIR" ] && [ -n "$(ls -A "$DEST_DIR")" ]; then
    echo "Warning: $DEST_DIR is not empty. This script is intended for clean installs."
    echo "If you are upgrading OpenTAP, the preferred method is 'tap package install OpenTAP'."
    echo "Upgrading with this script may lead to a broken install."
fi
 
while true; do
    read -r -p 'Do you wish to install OpenTAP?
' yn
 
    case $yn in
    [Yy]*) break ;;
    [Nn]*) exit ;;
    *) echo "Please answer yes or no." ;;
    esac
done
 
mkdir -p "$DEST_DIR"
mkdir -p "$BIN_DIR"
 
echo "Unzipping tap"
unzip "$(pwd)/*.TapPackage" -d "$DEST_DIR" # *: match OpenTAPLinux and just TAPLinux.
 
cd "$DEST_DIR" || exit 1
chmod -R +rws "$DEST_DIR"
 
chmod +x tap
 
cd "$BIN_DIR" || exit 1
 
echo "Creating shortcut"
ln -s -f "$DEST_DIR/tap" tap
 
echo "Installer finished"