blob: 14726d3a6ac636df28f1954f339ef3b089e687b7 (
plain)
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
57
58
59
60
61
62
63
64
65
66
|
#!/usr/bin/env bash
set -eu
APP_BASENAME='WISO2025'
EXE="C:/Program Files/WISO/Steuersoftware 2025/${APP_BASENAME}.exe"
PKG_USER_DATA_HOME="${XDG_DATA_HOME:-"${HOME}/.local/share"}/wiso"
echo >&2 'Initializing'
export WINEARCH='win64'
export WINEPREFIX="${PKG_USER_DATA_HOME}/wine"
export WINETRICKS_DOWNLOADER_TIMEOUT="${WINETRICKS_DOWNLOADER_TIMEOUT:-300}"
# Honor app-specific overrides
export WINEDLLOVERRIDES="${WISO_WINEDLLOVERRIDES:-}"
echo >&2 'Checking for Wine prefix'
if ! [ -d "${WINEPREFIX}" ]; then
echo >&2 '==> Bootstrapping Wine prefix'
mkdir -pv "${WINEPREFIX}"
wineboot -i
while [ ! -e "${WINEPREFIX}/system.reg" ]; do
echo >&2 '==> Waiting for registry to be flushed'
sleep 1
done | zenity --progress --auto-close --auto-kill --pulsate \
--title 'Waiting for Wine prefix'
echo >&2 '==> Done'
fi
# Filters the log output of a headless winetricks invocation and
# transforms it into the protocol that `zenity --progress` uses.
# Argument: expected_num_lines
winetricks_progress_for_num_lines() {
local expected_num_lines
expected_num_lines="${1?}"
#shellcheck disable=SC2016
sed -nu -e 's/^Executing load_\(.*\)/\1/p' \
| stdbuf -oL awk -v expected_num_lines="${expected_num_lines}" \
-e '{ print int(100 * NR / expected_num_lines); print "# Installing",$0 }'
}
echo >&2 'Checking if corefonts are installed'
if ! [ -f "${WINEPREFIX}/drive_c/windows/Fonts/corefonts.installed" ]; then
echo >&2 '==> Installing corefonts via Winetricks'
winetricks -f -q --optout corefonts 2>&1 \
| winetricks_progress_for_num_lines 12 \
| zenity 2>/dev/null --progress --auto-close --auto-kill \
--title='Installing corefonts' --text='Launching winetricks'
echo >&2 '==> Done'
fi
echo >&2 'Creating symlinks'
mkdir -p \
"${WINEPREFIX}/../programdata" \
"${WINEPREFIX}/drive_c/ProgramData" \
"${WINEPREFIX}/drive_c/Program Files/WISO"
ln -fns \
'../../../programdata' \
"${WINEPREFIX}/drive_c/ProgramData/Buhl Data Service GmbH"
ln -fns \
'/usr/lib/wiso-steuer-2025/app' \
"${WINEPREFIX}/drive_c/Program Files/WISO/Steuersoftware 2025"
echo >&2 "Launching app with Wine"
wine "${EXE}"
echo >&2 "==> Finished"
|