Skip to content
Snippets Groups Projects
Commit 7be11ce0 authored by David Verelst's avatar David Verelst
Browse files

more fixes to wine configurator

parent 0e550354
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
function wine_init_config(){
function wine_init_config () {
echo "-------- initialize winecfg"
# execute winecfg to trigger init configuration, might fail to complete
# on Jess since winefix has not been executed
WINEARCH=$WINEARCH WINEPREFIX=$WINEDIRNAME wine winecfg
# winefix only applies to Jess
if [[ ${_HOSTNAME_:0:1} == "j" ]] ; then
`$WINE_ENV_VARS` winefix
echo "-------- apply winefix"
WINEARCH=$WINEARCH WINEPREFIX=$WINEDIRNAME winefix
fi
# try to execute a non existant executable to trigger init configuration
`$WINE_ENV_VARS` wine dummy
# create a directory on the user home drive in which executables are placed
EXE_DIR_UNIX="/home/$USER/wine_exe/$WINEARCH/"
mkdir -p $EXE_DIR_UNIX
......@@ -22,33 +25,36 @@ function wine_init_config(){
EXE_DIR_WINE="c:/users/$USER/My Documents/wine_exe/$WINEARCH/"
echo "-------- adding $EXE_DIR_UNIX to wine system PATH"
echo "-------- this is equivalent to $EXE_DIR_WINE in Windows terms."
echo
# create file with registry key name and path as the value
printf 'REGEDIT4\n[HKEY_CURRENT_USER\\Environment]\n"PATH"="'"$EXE_DIR_WINE"'"' >> ./tmp.reg
$WINE_ENV_VARS wine regedit ./tmp.reg
WINEARCH=$WINEARCH WINEPREFIX=$WINEDIRNAME wine regedit ./tmp.reg
# do not show GUI crash dialogs
rm ./tmp.reg
printf '[HKEY_CURRENT_USER\\Software\\Wine\\WineDbg]\n"ShowCrashDialog"=dword:00000000' >> ./tmp.reg
$WINE_ENV_VARS wine regedit ./tmp.reg
WINEARCH=$WINEARCH WINEPREFIX=$WINEDIRNAME wine regedit ./tmp.reg
rm ./tmp.reg
# add an alias to .bashrc, but only for the 32-bit variant
if [[ ${_HOSTNAME_:0:1} == "g" ]] ; then
if [[ $WINEARCH == "win32" ]] ; then
echo "-------- adding alias $WINE_ALIAS to ~/.bashrc"
echo "alias $WINE_ALIAS='$WINE_ENV_VARS wine'" >> ~/.bashrc
source ~/.bashrc
echo "-------- See if HAWC2 runs..."
$WINE_ENV_VARS wine hawc2-latest.exe
echo "-------- See if HAWC2 runs..."
WINEARCH=$WINEARCH WINEPREFIX=$WINEDIRNAME wine hawc2-latest.exe
fi
}
_HOSTNAME_=`hostname`
# default 64-bit mode only relevant on Jess
# 64-bit mode only relevant on Jess
if [[ ${_HOSTNAME_:0:1} == "j" ]] ; then
echo "-------- SETUP DEFAULT 64-bit wine environment in ~/.wine"
echo
echo "====================================================================="
echo "-------- SETUP 64-bit wine environment in ~/.wine"
echo "====================================================================="
WINEARCH="win64"
WINEDIRNAME="/home/$USER/.wine"
WINE_ENV_VARS="WINEPREFIX=$WINEDIRNAME"
......@@ -58,12 +64,13 @@ if [[ ${_HOSTNAME_:0:1} == "j" ]] ; then
fi
# 32-bit mode for both Gorm and Jess
echo
echo "====================================================================="
echo "-------- SETUP 32-bit wine environment in ~/.wine32"
echo "====================================================================="
WINEARCH="win32"
WINEDIRNAME="/home/$USER/.wine32-clean"
WINEDIRNAME="/home/$USER/.wine32"
WINE_ENV_VARS="WINEARCH=$WINEARCH WINEPREFIX=$WINEDIRNAME"
export WINEARCH=$WINEARCH
export WINEPREFIX=$WINEDIRNAME
WINE_ALIAS="wine32"
HAWC2EXES=/home/MET/hawc2exe/$WINEARCH
wine_init_config
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment