wine/bin/run.sh
Arnaud G. GIBERT 18a1aabd90 - Improve run.sh to allow direct call with appl full path in one argument,
- Now use rx3-docker/x11-pulse:1.2.6-mga9 image,
- Rebuild for updates.
2025-11-29 12:00:41 +01:00

69 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -o errexit
APPL_HOME_DIR="$(dirname "$(dirname "$0")")"
#-------------------------------------------------------------------------------
export APPL_NETWORK="no-internet"
Pre_Cmd="export WINEPREFIX=/tmp/wine; mkdir /tmp/wine;"
while [[ "$1" == "-h" || "$1" == "-i" || "$1" == "-n" ]]
do
if [[ "$1" == "-h" ]]
then
echo "usage: run.sh [-h] [-n] [-i] [<Application_Dir> <Application_Exec> | <Application_Exec>] [Args...]"
echo "with -i enabling internet access,"
echo "with -n enabling non volatile wine directory."
exit 0
fi
if [[ "$1" == "-i" ]]
then
shift;
export APPL_NETWORK="internet"
fi
if [[ "$1" == "-n" ]]
then
shift;
Pre_Cmd=""
fi
done
if [[ -d "$1" ]]
then
export APPL_DIR="$1"
shift
export APPL_NAME="$1"
shift
else
export APPL_DIR="$( dirname $1)"
export APPL_NAME="./$(basename $1)"
shift
fi
APPL_DIR=$(realpath "${APPL_DIR}")
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
export GROUP_NAME=$(id -gn)
cd "${APPL_HOME_DIR}"
sbin/docker_mk_env
docker compose run --rm wine /usr/local/sbin/user_add_exec ${USER_ID} ${USER} ${HOME} ${GROUP_ID} ${GROUP_NAME} "${APPL_DIR}" ${Pre_Cmd} "${APPL_NAME}" "$@"
docker compose down