Skip to content

Instantly share code, notes, and snippets.

@alan-copeland-keysight
Last active August 10, 2022 02:53
Show Gist options
  • Save alan-copeland-keysight/ad9db08e3b7549ea8051514dcc5d3fa4 to your computer and use it in GitHub Desktop.
Save alan-copeland-keysight/ad9db08e3b7549ea8051514dcc5d3fa4 to your computer and use it in GitHub Desktop.
Install Windows OpenTAP 9.18.4 with Editor CE on Ubuntu 20.04 with Wine 7
#!/bin/bash
# enable 32-bit
sudo dpkg --add-architecture i386
# add key for wine packages
sudo wget -nc -O /usr/share/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
# add wine packages to get wine 7
sudo wget -nc -P /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources
sudo apt update
# install wine
sudo apt install winehq-stable winetricks winbind -y
# initiliaze the default wine environment (default prefix)
WINEDLLOVERRIDES=mscoree=d wineboot --init
# download updated winetricks version 20220411 (includes Consolas font)
wget https://raw.githubusercontent.com/Winetricks/winetricks/20220411/src/winetricks
chmod +x winetricks
# install .NET 4.8
./winetricks -q dotnet48
# disable .NET CLR Optimization service, as it hangs occasionally
wine reg ADD "HKLM\\System\\CurrentControlSet\\Services\\clr_optimization_v4.0.30319_32" /v Start /t REG_DWORD /d 4 /f
wine reg ADD "HKLM\\System\\CurrentControlSet\\Services\\clr_optimization_v4.0.30319_64" /v Start /t REG_DWORD /d 4 /f
# install .NET 6 Desktop x86/x64
wget https://download.visualstudio.microsoft.com/download/pr/b4a17a47-2fe8-498d-b817-30ad2e23f413/00020402af25ba40990c6cc3db5cb270/windowsdesktop-runtime-6.0.8-win-x64.exe
wget https://download.visualstudio.microsoft.com/download/pr/61747fc6-7236-4d5e-85e5-a5df5f480f3a/02203594bf1331f0875aa6491419ffa1/windowsdesktop-runtime-6.0.8-win-x86.exe
wine ./windowsdesktop-runtime-6.0.8-win-x64.exe /install /quiet /norestart
wine ./windowsdesktop-runtime-6.0.8-win-x86.exe /install /quiet /norestart
# install fonts and directx
./winetricks -q corefonts dxvk155 d3dcompiler_47 consolas
# set the windows version to Windows 10
winecfg /v win10
# disable HW acceleration if running in a VM (PackageManager has issues)
wine reg add "HKCU\\SOFTWARE\\Microsoft\\Avalon.Graphics" /v DisableHWAcceleration /t REG_DWORD /d 1 /f
# download Windows OpenTAP 9.18.4 installer
wget https://opentap.io/assets/releases/OpenTAP.9.18.4.exe
# install OpenTAP
touch ./log.txt
wine ./OpenTAP.9.18.4.exe --quiet --bitness x64 &
# wait for OpenTAP install to finish
tail -f ./log.txt | sed '/Installation completed/ q'
kill $(pidof OpenTAP.9.18.4.exe)
# accept the OpenTAP Editor Community Edition EULA programmatically
wine reg add "HKCU\\SOFTWARE\\Keysight\\Test Automation" /v "EULA Accept" /t REG_SZ /d "Alan Copeland<[email protected]>" -f
# install Editor CE
wine ~/.wine/drive_c/Program\ Files/OpenTAP/tap.exe package install -y 'Editor CE'
# add aliases to make running OpenTAP easy outside of the script
echo alias tap=\'wine ~/.wine/drive_c/Program\\ Files/OpenTAP/tap.exe\' | tee -a ~/.bashrc
echo alias tapeditor=\'wine ~/.wine/drive_c/Program\\ Files/OpenTAP/editor.exe\' | tee -a ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment