Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- prefixroot="$HOME/wineprefixes"
- name="eve"
- arch="win32"
- shared=""
- del=false
- print=false
- EVEBINARYURL="http://binaries.eveonline.com/EveLauncher-1104888.exe"
- EVEINSTALER="$(source ~/.config/user-dirs.dirs; echo $XDG_DOWNLOAD_DIR)/evelauncher.exe"
- while test $# -gt 0
- do
- case "$1" in
- --32)
- arch="win32"
- ;;
- --64)
- arch="win64"
- ;;
- --shared=*)
- shared=$(echo "$1" | sed s/--shared=//g)
- ;;
- --print)
- print=true
- ;;
- --proot=*)
- prefixroot=$(echo "$1" | sed s/--proot=//g)
- ;;
- --delete)
- del=true
- ;;
- --help)
- echo "create a wine prefixe. options are :
- --32 to create a 32-bit wine prefix [default]
- --64 to create a 64-bit wine prefix
- --delete an existing eve prefix instead of creating it
- --help show this and exit
- --print print variables then exit, do not modify existing prefixes
- --proot=X specify the wineprefix root. default is $prefixroot
- --shared=X to specify your shared Eve folder (for settings). default is none, meaning settings are not shared"
- exit 0
- ;;
- *)
- name="$1"
- ;;
- esac
- shift
- done
- prefix="$prefixroot/$name"
- launcher=$(source ~/.config/user-dirs.dirs; echo $XDG_DESKTOP_DIR)/"$name"
- if [ "$print" = true ]
- then
- echo shared = "$shared"
- echo prefix = "$prefix"
- echo prefixroot= "$prefixroot"
- echo name = "$name"
- echo arch = "$arch"
- echo eveinstaller = "$EVEINSTALER"
- exit 0
- fi
- if [ ! -z "$shared" ]
- then mkdir -p "$shared" ; fi
- if [ -d "$prefix" ]
- then
- if [ "$del" = true ]
- then
- rm -rf "$prefix"
- rm "$launcher"
- else
- echo "prefix $prefix already present and not requested to delete with --delete. Exiting."
- exit 0
- fi
- else
- mkdir -p prefix
- WINEPREFIX="$prefix" WINEARCH="$arch" wine wineboot
- WINEPREFIX="$prefix" WINEARCH="$arch" winetricks corefonts
- #create symlinks to shared and configs
- if [ ! -z "$shared" ]
- then
- mkdir -p "$prefix/drive_c/users/$USER/Local Settings"
- mkdir -p "$shared/Application Data"
- rm "$prefix/drive_c/users/$USER/Local Settings/Application Data" -r
- ln -s "$shared/Application Data" "$prefix/drive_c/users/$USER/Local Settings/"
- mkdir -p "$shared/SharedCache"
- mkdir -p "$prefix/drive_c/EVE/"
- ln -s "$shared/SharedCache" "$prefix/drive_c/EVE/"
- fi
- # make launcher exec on desktop
- echo '#!/bin/bash'$'\n'"cd $prefix"$'\n'"WINEDEBUG=-all WINEPREFIX=$prefix wine "'C:\\\\Eve\\eve.exe' >"$launcher"
- chmod +x "$launcher"
- # dl and start the Eve launcher
- if [ ! -f "$EVEINSTALER" ] ; then wget "$EVEBINARYURL" -O "$EVEINSTALER"; fi
- WINEPREFIX="$prefix" WINEARCH="$arch" wine "$EVEINSTALER"
- fi
Advertisement
Add Comment
Please, Sign In to add comment