11#! /bin/bash
22
33nvlibs_dir=" $( dirname " $( readlink -fm " $0 " ) " ) "
4- bottles_dir=" $HOME /.var/app/com.usebottles.bottles/data/bottles/bottles "
4+ bottles_dir=" $HOME /.var/app/com.usebottles.bottles/data/bottles"
55win=' drive_c/windows/system32'
66lib=' x64'
77
8+ # Check flatpak and native bottles_dir
9+ [ -d " $bottles_dir " ] || bottles_dir=" $HOME /.local/share/bottles"
10+ [ -d " $bottles_dir " ] || {
11+ echo " Bottles directory not found."
12+ exit 1
13+ }
14+
815if [ ! -f " $nvlibs_dir /$lib /nvcuda.dll" ]; then
916 echo " Files not found in $nvlibs_dir /$lib " >&2
1017 exit 1
@@ -14,21 +21,21 @@ if [ -z "$1" ]; then
1421 echo -ne " BOTTLE is not set!\n"
1522 echo -ne " This is a list of your available bottles:\n"
1623 echo -ne " \n=========================================\n"
17- ls -1 $bottles_dir
24+ ls -1 " $bottles_dir /bottles "
1825 echo -ne " =========================================\n\n"
1926 echo -ne " Specify your bottle. Eg: ./bottles-install.sh MyBottle\n"
2027 exit 1
2128fi
2229
23- if [ ! -f " $bottles_dir /$1 /$win /dxgi.dll" ]; then
24- echo -ne " Windows files not found in $bottles_dir \ $ 1! check bottle installation\n " >&2
30+ if [ ! -f " $bottles_dir /bottles/ $1 /$win /dxgi.dll" ]; then
31+ echo -e " Windows files not found in $bottles_dir /bottles/ $1 ! Check bottle installation. " >&2
2532 exit 1
2633else
2734 BOTTLE=" $1 "
2835fi
2936
3037function install {
31- cp -f " $nvlibs_dir /$lib /$1 " " $bottles_dir /$BOTTLE /$win /"
38+ cp -f " $nvlibs_dir /$lib /$1 " " $bottles_dir /bottles/ $BOTTLE /$win /"
3239}
3340
3441fun=install
4653if [[ " $response " =~ ^[Yy]$ ]]; then
4754 lib=' x64'
4855 nvapi_ver=" dxvk-nvapi-$( cat version | grep DXVK | cut -d' ' -f2- | tr -d ' \"' ) "
49- nvapi_dir=" $HOME /.var/app/com.usebottles.bottles/data/bottles /nvapi/$nvapi_ver "
56+ nvapi_dir=" $bottles_dir /nvapi/$nvapi_ver "
5057 if [ -f " $nvapi_dir /$lib /nvapi64.dll" ]; then
5158 echo -ne " Already installed! Skipping\n" >&2
5259 else
0 commit comments