/usr/share/libalpm/scripts/wine-upgrade
#! /bin/bash
Prefix="/home/mikko/.local/wine/foobar2000"
if [ ! -d "$Prefix" ]; then
echo "foobar2000 prefix not found"
exit 0
fi
WINEPREFIX="$Prefix" regedit "$Prefix"/fix-launchers.reg
echo "foobar2000 prefix updated"
exit 0
Executing this script manually works as intended so the problem is in the .hook file?
/usr/share/libalpm/hooks/wine-upgrade.hook
[Trigger]
Type = Package
Operation = Upgrade
Target = wine
[Action]
Description = Updating wine prefix for foobar2000...
Exec = /usr/share/libalpm/scripts/wine-upgrade
When = PostTransaction
Edit: I just realized the regedit command should run as user instead of root.
]]>