I'll do the complicated trickery later, once I can actually run my application from a wineprefix inside the AppImage. For the time being, I'm extracting the wineprefix manually and trying to run my application from there - but without success.
@DarkShadow44:
This is what I'm doing right now:
Code: Select all
#!/bin/bash
# Author : Ismael Barros² <[email protected]>
# License : BSD http://en.wikipedia.org/wiki/BSD_license
export APPDIR="$(dirname "$(readlink -f "$0")")"
export APPPKG="$(basename "$APPIMAGE")"
LOGFILE=$(mktemp "/tmp/AppRun-log-${APPPKG}.XXXXXXXXXX")
BINARY="forge.exe"
BINARY_ARGS=
WINETRICKS="dotnet46"
. "$APPDIR/util.sh"
# Uncomment this if the app needs relative paths specified on the command line
#eval arguments="$(patch_relative_paths "$@")"
#set -- "${arguments[@]}"
export PATH="$APPDIR/opt/wine-staging/bin:${PATH}"
[ -z "$*" ] && show_usage "$APPDIR/usage.txt"
"$APPDIR/opt/wine-staging/bin/wineserver" -k
setup_keepResolution
# export WINEPREFIX="$HOME/.local/share/AppImage/forge_wine"
export WINEPREFIX="$HOME/.forge7"
export WINEARCH="win32"
export WINEDEBUG="-all"
export WINEDLLOVERRIDES="mshtml,mscoree=,winemenubuilder.exe=n"
export LD_LIBRARY_PATH=${APPDIR}/opt/wine-staging/lib64:${LD_LIBRARY_PATH}
export WINESERVER=${APPDIR}/opt/wine-staging/bin/wineserver
export WINELOADER=${APPDIR}/opt/wine-staging/bin/wine
export WINEDLLPATH=${APPDIR}/opt/wine-staging/lib:${APPDIR}/opt/wine-staging/lib/wine
export WINEDLLOVERRIDES="mscoree,mshtml="
# use wine from the AppImage
export WINE="$APPDIR/opt/wine-staging/bin/wine"
CONF=
for i in $@; do
case $i in
@conf) CONF=1; shift ;;
@reset) rm -rfv "$WINEPREFIX"; shift ;;
esac
done
if [ ! -d "$WINEPREFIX" ]; then
echo "no wineprefix"
cp -r "$APPDIR/.forge7" "$WINEPREFIX"
echo "copied wineprefix in ($WINEPREFIX)"
find "$WINEPREFIX" -type d -exec chmod 775 "{}" \;
find "$WINEPREFIX" -type f -exec chmod 664 "{}" \;
# chown -R "${USER}" "${WINEPREFIX}"
# mkdir -p "${WINEPREFIX}/dosdevices"
# mkdir -p "${WINEPREFIX}/drive_c"
# mkdir -p "${WINEPREFIX}/drive_c/StarCraft"
# ln -nfs "${WINEPREFIX}/drive_c" "${WINEPREFIX}/dosdevices/c:"
# ln -nfs "${HOME}" "${WINEPREFIX}/dosdevices/y:"
# ln -nfs "/" "${WINEPREFIX}/dosdevices/z:"
for i in "${APPDIR}/"*.reg; do
[ -f "$i" ] && cp -v "$i" "${WINEPREFIX}"
done
echo "copied .reg files in"
mkdir -p ~/.cache/winetricks/
echo "made winetricks dir"
if [ "$WINETRICKS" ]; then
for i in $APPDIR/winetricks/*; do
ln --symbolic --force "$i" ~/.cache/winetricks/
echo "created symbolink link for $i into winetricks cache"
done
# "$APPDIR/opt/wine-staging/bin/winetricks" --verbose --unattended $WINETRICKS
# "$APPDIR/opt/wine-staging/bin/winetricks" --unattended "dotnet46"
# echo "winetricks ran"
run_withLocalLibs "$APPDIR/opt/wine-staging/bin/wineboot"
WINEPREFIX="$HOME/.forge7" WINEARCH=win32 wine /home/vadi/Downloads/netfx_setupverifier_new/netfx_setupverifier.exe
# run_withLocalLibs "$APPDIR/opt/wine-staging/bin/wine" /home/vadi/Downloads/netfx_setupverifier_new/netfx_setupverifier.exe
# exit
fi
fi
cd "$WINEPREFIX"
echo "cd into $WINEPREFIX"
"$APPDIR/opt/wine-staging/bin/wineboot"
echo "rebooted wine"
if [ $CONF ]; then
run_withLocalLibs "$APPDIR/opt/wine-staging/bin/winecfg" $@
else
run_withLocalLibs "$APPDIR/opt/wine-staging/bin/wine" "$APPDIR/$BINARY" $BINARY_ARGS "$@"
fi
echo "Ran app."
The strange thing is that if I run
Code: Select all
WINEPREFIX="$HOME/.forge7" WINEARCH=win32 wine /home/vadi/Downloads/netfx_setupverifier_new/netfx_setupverifier.exe
from the command line manually, after the AppImage is run, it works fine. I'm puzzled as to what could the difference be.