Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pbsutils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
toolbox
pbsutils
Commits
0e550354
Commit
0e550354
authored
8 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
fixed and refactored wine configuration script
parent
0f6b37c0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config-wine-hawc2.sh
+65
-41
65 additions, 41 deletions
config-wine-hawc2.sh
with
65 additions
and
41 deletions
config-wine-hawc2.sh
+
65
−
41
View file @
0e550354
#!/bin/bash
if
[
"
$1
"
=
""
]
;
then
WINEDIRNAME
=
".wine32"
else
WINEDIRNAME
=
"
$1
"
function
wine_init_config
(){
# winefix only applies to Jess
if
[[
${
_HOSTNAME_
:0:1
}
==
"j"
]]
;
then
`
$WINE_ENV_VARS
`
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
echo
"-------- copying HAWC2 executables from/to:"
echo
"
$HAWC2EXES
/*
$EXE_DIR_UNIX
"
cp
$HAWC2EXES
/
*
"
$EXE_DIR_UNIX
"
# add C:\bin (/home/$USER/$WINEDIRNAME/drive_c/bin/) to Windows PATH variable
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
# 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
rm
./tmp.reg
# add an alias to .bashrc, but only for the 32-bit variant
if
[[
${
_HOSTNAME_
:0:1
}
==
"g"
]]
;
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
}
_HOSTNAME_
=
`
hostname
`
# default 64-bit mode only relevant on Jess
if
[[
${
_HOSTNAME_
:0:1
}
==
"j"
]]
;
then
echo
"-------- SETUP DEFAULT 64-bit wine environment in ~/.wine"
WINEARCH
=
"win64"
WINEDIRNAME
=
"/home/
$USER
/.wine"
WINE_ENV_VARS
=
"WINEPREFIX=
$WINEDIRNAME
"
WINE_ALIAS
=
"wine"
HAWC2EXES
=
/home/MET/hawc2exe/
$WINEARCH
wine_init_config
fi
HAWC2EXES
=
/home/MET/hawc2exe
WINEARCH
=
win32
WINEPREFIX
=
~/
$WINEDIRNAME
wine dummy
mkdir
-p
"/home/
$USER
/
$WINEDIRNAME
/drive_c/bin/"
echo
"-------- copying HAWC2 executables from/to:"
echo
"
$HAWC2EXES
/* /home/
$USER
/
$WINEDIRNAME
/drive_c/bin/"
cp
$HAWC2EXES
/
*
"/home/
$USER
/
$WINEDIRNAME
/drive_c/bin/"
#WINEARCH=win32 WINEPREFIX=~/$WINEDIRNAME wine regedit /E tmp.reg "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment"
#sed -i 's/"PATH"="C:\\\\windows\\\\system32;C:\\\\windows"/"PATH"="C:\\\\windows\\\\system32;C:\\\\windows;C:\\\\bin"/g' tmp.reg
#WINEARCH=win32 WINEPREFIX=~/$WINEDIRNAME wine regedit ./tmp.reg
#rm ./tmp.reg
# add C:\bin (/home/$USER/$WINEDIRNAME/drive_c/bin/) to Windows PATH variable
echo
"-------- adding /home/
$USER
/
$WINEDIRNAME
/drive_c/bin/ to wine system PATH"
echo
"-------- this is equivalent to C:
\b
in in Windows terms."
# seems like this doesn't work since the key Environment doesn't exist by default?
#rm ./tmp.reg
#WINEARCH=win32 WINEPREFIX=~/$WINEDIRNAME wine regedit /E ./tmp.reg "HKEY_CURRENT_USER\Environment"
#printf '"PATH"="c:\\bin"' >> ./tmp.reg
printf
'REGEDIT4\n[HKEY_CURRENT_USER\\Environment]\n"PATH"="c:\\bin"'
>>
./tmp.reg
WINEARCH
=
win32
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
WINEARCH
=
win32
WINEPREFIX
=
~/
$WINEDIRNAME
wine regedit ./tmp.reg
rm
./tmp.reg
# add an alias to .bashrc
echo
"-------- adding alias wine32 to ~/.bashrc"
echo
"alias wine32='WINEARCH=win32 WINEPREFIX=~/
$WINEDIRNAME
wine'"
>>
~/.bashrc
source
~/.bashrc
echo
"-------- See if HAWC2 runs..."
WINEARCH
=
win32
WINEPREFIX
=
~/
$WINEDIRNAME
wine hawc2-123-beta.exe
# 32-bit mode for both Gorm and Jess
echo
"-------- SETUP 32-bit wine environment in ~/.wine32"
WINEARCH
=
"win32"
WINEDIRNAME
=
"/home/
$USER
/.wine32-clean"
WINE_ENV_VARS
=
"WINEARCH=
$WINEARCH
WINEPREFIX=
$WINEDIRNAME
"
export
WINEARCH
=
$WINEARCH
export
WINEPREFIX
=
$WINEDIRNAME
WINE_ALIAS
=
"wine32"
HAWC2EXES
=
/home/MET/hawc2exe/
$WINEARCH
wine_init_config
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment