-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxow64
1437 lines (1345 loc) · 60.1 KB
/
xow64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# https://github.com/ar37-rs/xow64-wine
WINE_LATEST=10.4-stable
BOX64_LATEST=0.3.5
# export WLR_USE_UNIX_SOCKET=1
# using glthread relatively faster for wined3d (very intense cpu)
# export MESA_GLTHREAD=true
export WINEESYNC_TERMUX=1
export WINEESYNC=1
if [[ "$1" == "proot=true" ]]; then
if [[ $(echo $PREFIX) == "/data/data/com.termux/files/usr" ]]; then
echo "Proot Mode is only available on proot."
exit
fi
if [ ! -d ~/xow64_prefix ]; then
mkdir ~/xow64_prefix
fi
touch ~/xow64_prefix/.xow64-proot
touch ~/xow64_prefix/.xow64-box64-custom
echo "proot mode enabled."
exit
elif [[ "$1" == "proot=false" ]]; then
rm -rf ~/xow64_prefix/.xow64-proot
rm -rf ~/xow64_prefix/.xow64-box64-custom
echo "proot mode disabled."
exit
elif [[ "$1" == "box64-custom=true" ]]; then
if [ ! -d ~/xow64_prefix ]; then
mkdir ~/xow64_prefix
fi
touch ~/xow64_prefix/.xow64-box64-custom
echo "using custom box64."
exit
elif [[ "$1" == "box64-custom=false" ]]; then
if [ ! -d ~/xow64_prefix ]; then
mkdir ~/xow64_prefix
fi
rm -rf ~/xow64_prefix/.xow64-box64-custom
echo "using default builtin box64."
exit
else
if [ -f ~/xow64_prefix/.xow64-proot ]; then
export TPH=~/xow64_prefix
else
export TPH=/data/data/com.termux/files/home
fi
if [ ! -d $TPH/xow64_wine ]; then
mkdir $TPH/xow64_wine
fi
XOW64_WINEPREFIX=.xow64_wine
WPREFIX=$XOW64_WINEPREFIX
if [ -f $TPH/xow64_wine/.wine-prefix ]; then
CHECKED_PREFIX=$(cat $TPH/xow64_wine/.wine-prefix)
if [[ $CHECKED_PREFIX == "" ]]; then
export WINEPREFIX=$TPH/.xow64_wine
echo "info:"
echo "WINEPREFIX=${TPH}/.xow64_wine"
echo " "
else
WPREFIX=$CHECKED_PREFIX
export WINEPREFIX=$TPH/$CHECKED_PREFIX
echo "info:"
echo "WINEPREFIX=${TPH}/${CHECKED_PREFIX}"
echo " "
fi
else
export WINEPREFIX=$TPH/.xow64_wine
echo "info:"
echo "WINEPREFIX=${TPH}/.xow64_wine"
echo " "
fi
if [ -f $TPH/xow64_wine/.wine-version ]; then
WINE_VERSION=$(cat $TPH/xow64_wine/.wine-version)
if [[ $WINE_VERSION == "" ]]; then
WINE_VERSION=$WINE_LATEST
fi
else
WINE_VERSION=$WINE_LATEST
fi
export BOX64_PATH=$TPH/xow64_wine/${WINE_VERSION}/bin:$BOX64_PATH
if [ -f $TPH/.xow64-proot ]; then
export BOX64_RCFILE=/etc/box64.box64rc
export BOX64_LD_LIBRARY_PATH=$TPH/xow64_wine/${WINE_VERSION}/lib/wine/i386-windows:$TPH/xow64_wine/${WINE_VERSION}/lib/wine/x86_64-windows:$TPH/xow64_wine/${WINE_VERSION}/lib/wine/i386-unix:$TPH/xow64_wine/${WINE_VERSION}/lib/wine/x86_64-unix:$BOX64_LD_LIBRARY_PATH
else
if [ ! -d $TPH/xow64_box64 ]; then
mkdir $TPH/xow64_box64
fi
if [ -f $TPH/xow64_box64/.box64-version ]; then
XOW64_BOXV=$(cat $TPH/xow64_box64/.box64-version)
if [[ $XOW64_BOXV == "" ]]; then
XOW64_BOXV=$BOX64_LATEST
fi
else
XOW64_BOXV=$BOX64_LATEST
fi
export BOX64_RCFILE=$TPH/xow64_box64/${XOW64_BOXV}/etc/box64.box64rc
export BOX64_LD_LIBRARY_PATH=$TPH/xow64_wine/${WINE_VERSION}/lib/wine/i386-windows:$TPH/xow64_wine/${WINE_VERSION}/lib/wine/x86_64-windows:$TPH/xow64_wine/${WINE_VERSION}/lib/wine/x86_64-unix:$TPH/xow64_box64/${XOW64_BOXV}/lib/x86_64-linux-gnu:$TPH/xow64_box64/${XOW64_BOXV}/lib/i386-linux-gnu
fi
# BOX64 options
export BOX64_MMAP32=1
export BOX64_X11THREADS=1
export BOX64_DYNAREC_SAFEFLAGS=2
# currently is only working for box64 < 0.3.3
# export BOX64_INPROCESSGPU=1
# export BOX64_NOSANDBOX=1
if [ -f $TPH/xow64_wine/.no_debug ]; then
export WINEDEBUG=-all
fi
if [ -f $TPH/.xow64-proot ]; then
echo "xow64 on proot mode"
export WINE_CA_CERT_PATH=/etc/ssl/certs
export EXEX=exec
else
export LD_LIBRARY_PATH=$TPH/xow64_box64/lib/aarch64-linux-gnu:$TPH/xow64_box64/lib/aarch64-linux-gnu/gstreamer-1.0:$TPH/xow64_box64/lib/aarch64-linux-gnu/pulseaudio:$TPH/xow64_box64/lib/aarch64-linux-gnu/mpg123:$LD_LIBRARY_PATH
export WINE_CA_CERT_PATH=$PREFIX/glibc/etc/ssl/certs
export EXEX="grun -s"
fi
if [ -f $TPH/.xow64-box64-custom ]; then
BOX64D=$(which box64)
if [[ $BOX64D == "" ]]; then
echo "box64 not found, make sure box64 is installed."
if [ -f $TPH/.xow64-proot ]; then
echo "xow64 on proot mode."
fi
exit
fi
export BOX64X=$BOX64D
else
export BOX64X=$TPH/xow64_box64/${XOW64_BOXV}/box64
fi
IS_EQUAL=1
check_wineprefix() {
if [ -f $TPH/xow64_wine/.wine-prefix ]; then
CHECKED_PREFIX=$(cat $TPH/xow64_wine/.wine-prefix)
if [[ $CHECKED_PREFIX != $XOW64_WINEPREFIX ]]; then
IS_EQUAL=0
fi
fi
}
pan_info() {
echo "info:"
if [ -f $TPH/xow64_drivers/.panthor ]; then
echo "Panthor is only supported on some mali devices."
echo "with kernel 6.10+"
else
echo "Panfrost is only supported on some mali devices."
echo "with kernel 5.10+"
fi
}
proot_info() {
if [ -f $TPH/.xow64-proot ]; then
echo "the related option is not available on proot mode."
exit
fi
}
vkinfo() {
if [ -f $TPH/xow64_wine/.vk-radeon ]; then
echo "using radeon vulkan driver."
export LIBGL_DRI3_DISABLE=0
export LIBGL_ALWAYS_SOFTWARE=0
export MESA_GL_VERSION_OVERRIDE=4.6COMPAT
export MESA_GLSL_VERSION_OVERRIDE=460
export MESA_GLES_VERSION_OVERRIDE=3.2
export MESA_LOADER_DRIVER_OVERRIDE=zink
if [ -f $TPH/.xow64-proot ]; then
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.aarch64.json
else
if [ -f $PREFIX/glibc/share/vulkan/icd.d/radeon_icd.aarch64.json ]; then
export VK_ICD_FILENAMES=$PREFIX/glibc/share/vulkan/icd.d/radeon_icd.aarch64.json
else
export LD_LIBRARY_PATH=$TPH/xow64_drivers/lib:$LD_LIBRARY_PATH && export LD_LIBRARY_PATH=$TPH/xow64_drivers/lib/d3d:$LD_LIBRARY_PATH
export LIBGL_DRIVERS_PATH=$TPH/xow64_drivers/lib/dri
export VK_ICD_FILENAMES=$TPH/xow64_drivers/share/vulkan/icd.d/radeon_icd.aarch64.json
fi
fi
elif [ -f $TPH/xow64_wine/.vk-turnip ]; then
echo "using adreno/turnip vulkan driver."
export LIBGL_DRI3_DISABLE=0
export LIBGL_ALWAYS_SOFTWARE=0
export MESA_GL_VERSION_OVERRIDE=4.6COMPAT
export MESA_GLSL_VERSION_OVERRIDE=460
export MESA_GLES_VERSION_OVERRIDE=3.2
export MESA_LOADER_DRIVER_OVERRIDE=zink
export TU_DEBUG=noconform
if [ -f $TPH/.xow64-proot ]; then
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/freedreno_icd.aarch64.json
else
export VK_ICD_FILENAMES=$PREFIX/glibc/share/vulkan/icd.d/freedreno_icd.aarch64.json
fi
elif [ -f $TPH/xow64_wine/.vk-llvmpipe ]; then
echo "using llvmpipe vulkan driver."
if [ -f $TPH/.xow64-proot ]; then
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.aarch64.json
else
if [ -f $TPH/xow64_drivers/share/vulkan/icd.d/lvp_icd.aarch64.json ]; then
export VK_ICD_FILENAMES=$TPH/xow64_drivers/share/vulkan/icd.d/lvp_icd.aarch64.json
else
export VK_ICD_FILENAMES=$PREFIX/glibc/share/vulkan/icd.d/lvp_icd.aarch64.json
fi
fi
fi
if [ -f $TPH/xow64_wine/.dxvk-proton ]; then
echo "with dxvk-proton (vkd3d) enabled."
fi
}
wine_q() {
kill -9 $(pgrep -f ".exe") 2>/dev/null
kill -9 $(pgrep -f ".cmd") 2>/dev/null
kill -9 $(pgrep -f ".bat") 2>/dev/null
}
dllsoverride() {
if [ ! -f $TPH/${WPREFIX}/user.reg ]; then
$EXEX $BOX64X $TPH/xow64_wine/${WINE_VERSION}/bin/wine wineboot
fi
if [ -f $TPH/${WPREFIX}/user.reg ]; then
cd && cat << EOF >> $TPH/${WPREFIX}/user.reg
[Software\\\Wine\\\DllOverrides]
"di"="native,builtin"
"dinput"="native,builtin"
"dinput8"="native,builtin"
"xinput1_1"="native,builtin"
"xinput1_2"="native,builtin"
"xinput1_3"="native,builtin"
"xinput1_4"="native,builtin"
"xinput9_1_0"="native,builtin"
EOF
fi
}
wine_inf() {
if [ -d /data/data/com.termux/files/usr/glibc/share/wine ]; then
rm -rf /data/data/com.termux/files/usr/glibc/share/wine
fi
if [ -d $TPH/xow64_wine/${WINE_VERSION}/share/wine ]; then
cp -r $TPH/xow64_wine/${WINE_VERSION}/share/wine /data/data/com.termux/files/usr/glibc/share
fi
}
install_wine() {
if [ -f $TPH/xow64_wine/.wine-version ]; then
WINE_VERSION=$(cat $TPH/xow64_wine/.wine-version)
if [[ $WINE_VERSION == "" ]]; then
WINE_VERSION=$WINE_LATEST
fi
else
WINE_VERSION=$WINE_LATEST
fi
echo "Downloading wine..."
if [ -f $TPH/.xow64-proot ]; then
cd && rm -rf ~/xow64-wine-${WINE_VERSION}.tar.xz && cd && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64-wine-${WINE_VERSION}.tar.xz && mv ~/xow64-wine-${WINE_VERSION}.tar.xz $TPH/xow64-wine-${WINE_VERSION}.tar.xz && cd $TPH && echo "extracting xow64-wine-${WINE_VERSION}.tar.xz..." && tar -xf $TPH/xow64-wine-${WINE_VERSION}.tar.xz && rm -rf $TPH/xow64-wine-${WINE_VERSION}.tar.xz && echo "Downloading wined3d components..." && cd && rm -rf ~/wined3d-${WINE_VERSION}.tar.xz && rm -rf ~/xow64_wine/${WINE_VERSION}/wined3d-${WINE_VERSION}.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/wined3d-${WINE_VERSION}.tar.xz && mv ~/wined3d-${WINE_VERSION}.tar.xz $TPH/xow64_wine/${WINE_VERSION}/wined3d-${WINE_VERSION}.tar.xz
else
cd && rm -rf $TPH/xow64-wine-${WINE_VERSION}.tar.xz && cd && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64-wine-${WINE_VERSION}.tar.xz && echo "extracting xow64-wine-${WINE_VERSION}.tar.xz..." && tar -xf $TPH/xow64-wine-${WINE_VERSION}.tar.xz && rm -rf $TPH/xow64-wine-${WINE_VERSION}.tar.xz && echo " " && echo "Downloading wined3d components..." && cd && rm -rf $TPH/wined3d-${WINE_VERSION}.tar.xz && rm -rf $TPH/xow64_wine/${WINE_VERSION}/wined3d-${WINE_VERSION}.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/wined3d-${WINE_VERSION}.tar.xz && mv $TPH/wined3d-${WINE_VERSION}.tar.xz $TPH/xow64_wine/${WINE_VERSION}/wined3d-${WINE_VERSION}.tar.xz
fi
wine_inf
dllsoverride
}
UPDATE_BOX64=0
install_box64() {
if [ -f $TPH/xow64_box64/.box64-version ]; then
XOW64_BOXV=$(cat $TPH/xow64_box64/.box64-version)
if [[ $XOW64_BOXV == "" ]]; then
XOW64_BOXV=$BOX64_LATEST
fi
else
XOW64_BOXV=$BOX64_LATEST
fi
if [ ! -f $TPH/xow64_box64/${XOW64_BOXV}/box64 ]; then
UPDATE_BOX64=1
fi
if [[ $UPDATE_BOX64 == "1" ]]; then
echo "Downloading box64-${XOW64_BOXV}..." && cd && rm -rf $TPH/xow64_box64-${XOW64_BOXV}.tar.xz && rm -rf && cd && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/xow64_box64-${XOW64_BOXV}.tar.xz && echo "extracting xow64_box64-${XOW64_BOXV}.tar.xz..." && tar -xf $TPH/xow64_box64-${XOW64_BOXV}.tar.xz && rm -rf $TPH/xow64_box64-${XOW64_BOXV}.tar.xz && echo "done."
else
echo "using box64 v${XOW64_BOXV}"
fi
}
init_envirs() {
if [ -f $TPH/xow64_wine/.envirs ]; then
ENVIR=$(cat $TPH/xow64_wine/.envirs)
for i in $ENVIR
do
RIVNE=$(echo ${i#[} | rev | cut -c2- | rev)
export $RIVNE
done
fi
}
init_envirs
if [ -f $TPH/xow64_wine/.wined3d-3.21 ]; then
echo "using wined3d version 3.21"
elif [ -f $TPH/xow64_wine/.wined3d-4.21 ]; then
echo "using wined3d version 4.21"
fi
if [[ "$1" == "env-add" ]]; then
if [[ $2 =~ [a-zA-Z0-9]+$ ]]; then
ENVIR=
if [[ -f $TPH/xow64_wine/.envirs ]]; then
ENVIR=$(cat $TPH/xow64_wine/.envirs)
rm -rf $TPH/xow64_wine/.envirs
fi
for i in $ENVIR
do
RIVNE=$(echo ${i#[} | rev | cut -c2- | rev)
if [[ $2 != $RIVNE ]]; then
cd && cat << EOF >> $TPH/xow64_wine/.envirs
[${RIVNE}]
EOF
fi
done
cd && cat << EOF >> $TPH/xow64_wine/.envirs
[${2}]
EOF
echo "the new specific environment variable:"
echo
echo "${2}"
echo
echo "has been added."
else
echo "invalid environment variable: ${2}."
fi
elif [[ "$1" == "env-remove" ]]; then
if [[ $2 =~ [a-zA-Z0-9]+$ && -f $TPH/xow64_wine/.envirs ]]; then
ENVIR=$(cat $TPH/xow64_wine/.envirs)
rm -rf $TPH/xow64_wine/.envirs
for i in $ENVIR
do
RIVNE=$(echo ${i#[} | rev | cut -c2- | rev)
if [[ $2 != $RIVNE ]]; then
cd && cat << EOF >> $TPH/xow64_wine/.envirs
[${RIVNE}]
EOF
fi
done
echo "the specific environment variable:"
echo
echo "${2}"
echo
echo "${2} has been removed."
else
echo "the specific environment variable not found."
fi
elif [[ "$1" == "env-info" ]]; then
if [ -f $TPH/xow64_wine/.envirs ]; then
echo "list of environment variable/s added:"
echo
ENVIR=$(cat $TPH/xow64_wine/.envirs)
for i in $ENVIR
do
RIVNE=$(echo ${i#[} | rev | cut -c2- | rev)
echo $RIVNE
done
echo " "
else
echo "no environment variables added yet."
fi
elif [[ "$1" == "env-default" ]]; then
if [ -f $TPH/xow64_wine/.envirs ]; then
rm -rf $TPH/xow64_wine/.envirs
fi
echo "environment variables changed to default."
elif [[ $1 =~ WINEPREFIX=[.a-zA-Z0-9_]+$ ]]; then
if [[ $1 == WINEPREFIX=. ]]; then
echo "invalid ${1}"
echo "make sure enter to valid name for the prefix"
exit
fi
if [[ $1 =~ WINEPREFIX=[.a-zA-Z0-9_]+$ ]]; then
if [ ! -d $TPH/xow64_wine ]; then
mkdir $TPH/xow64_wine
fi
NEW_WINEPREFIX=${1#WINEPREFIX=}
echo "${NEW_WINEPREFIX}" > $TPH/xow64_wine/.wine-prefix
echo "using new:"
echo "WINEPREFIX=${TPH}/${NEW_WINEPREFIX}"
else
echo "invalid ${1}"
echo "make sure enter to valid name for the prefix"
exit
fi
elif [[ "$1" == "wine=10.4-devel" ]]; then
echo "10.4-devel" > $TPH/xow64_wine/.wine-version
if [ ! -d $TPH/xow64_wine/10.4-devel ]; then
install_wine
echo "done."
else
wine_inf
echo "using wine 10.4 devel"
fi
elif [[ "$1" == "wine=10.4-staging" ]]; then
echo "10.4-staging" > $TPH/xow64_wine/.wine-version
if [ ! -d $TPH/xow64_wine/10.4-staging ]; then
install_wine
echo "done."
else
wine_inf
echo "using wine 10.4 staging"
fi
elif [[ "$1" == "wine=10.4-stable" || "$1" == "wine=default" ]]; then
echo "10.4-stable" > $TPH/xow64_wine/.wine-version
if [ ! -d $TPH/xow64_wine/10.4-stable ]; then
install_wine
echo "done."
else
wine_inf
echo "using wine 10.4 stable"
fi
elif [[ "$1" == "wine=9.18-staging" ]]; then
echo "9.18-staging" > $TPH/xow64_wine/.wine-version
if [ ! -d $TPH/xow64_wine/9.18-staging ]; then
install_wine
echo "done."
else
wine_inf
echo "using wine 9.18 staging"
fi
elif [[ "$1" == "install" || "$1" == "update-all" ]]; then
wine_q
if [ -f $TPH/.xow64-proot ]; then
echo "Installing and updating all xow64 components..." && rm -rf ~/xow64_wine_patch.tar.xz && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64_wine_patch.tar.xz && mv ~/xow64_wine_patch.tar.xz $TPH/xow64_wine_patch.tar.xz && cd $TPH && echo "extracting xow64_wine_patch.tar.xz..." && tar -xf xow64_wine_patch.tar.xz && rm -rf $TPH/xow64_wine_patch.tar.xz && rm -rf $TPH/xow64_box64 && cd && install_wine
if [ ! -d $TPH/xow64_drivers ]; then
mkdir $TPH/xow64_drivers
fi
else
cd && pkg update && pkg install tar virglrenderer angle-android openssl wget which glibc-repo && pkg update && pkg install glibc glibc-runner glib*glibc libx11-glibc pulseaudio-glibc libpulse-glibc mesa-*glibc vulkan-tools*-glibc freetype-glibc fontconfig-glibc libxcomposite-glibc libxcursor-glibc libxrender-glibc libxi-glibc libxinerama-glibc libxkbcommon-glibc libxrandr-glibc libxrender-glibc libgnutls-glibc openssl-glibc zstd-glibc zlib-glibc libxshmfence-glibc vulkan-icd-loader-glibc && echo "Installing and updating all xow64 components..." && rm -rf $TPH/xow64_box64-${XOW64_BOXV}.tar.xz && rm -rf $TPH/xow64_wine_patch.tar.xz && cd && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/xow64_box64-${XOW64_BOXV}.tar.xz && echo "extracting xow64_box64-${XOW64_BOXV}.tar.xz..." && tar -xf $TPH/xow64_box64-${XOW64_BOXV}.tar.xz && rm -rf $TPH/xow64_box64-${XOW64_BOXV}.tar.xz && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64_wine_patch.tar.xz && echo "extracting xow64_wine_patch.tar.xz..." && tar -xf $TPH/xow64_wine_patch.tar.xz && rm -rf $TPH/xow64_wine_patch.tar.xz && cd && install_wine
fi
check_wineprefix
if [[ $IS_EQUAL == "0" ]]; then
WPREFIX=$(cat $TPH/xow64_wine/.wine-prefix)
mv $TPH/.xow64_wine $TPH/xow64_wine/${WPREFIX} && cp -r $TPH/xow64_wine/${WPREFIX} $TPH/ && rm -rf $TPH/xow64_wine/${WPREFIX} && rm -rf $TPH/.xow64_wine
fi
echo "done."
elif [[ "$1" == "install-deps" ]]; then
proot_info
cd && pkg update && pkg install tar virglrenderer angle-android openssl wget which glibc-repo && pkg update && pkg install glibc glibc-runner glib*glibc libx11-glibc pulseaudio-glibc libpulse-glibc mesa-*glibc vulkan-tools*-glibc freetype-glibc fontconfig-glibc libxcomposite-glibc libxcursor-glibc libxrender-glibc libxi-glibc libxinerama-glibc libxkbcommon-glibc libxrandr-glibc libxrender-glibc libgnutls-glibc openssl-glibc zstd-glibc zlib-glibc libxshmfence-glibc vulkan-icd-loader-glibc && echo "done."
elif [[ "$1" == "reinstall-deps" ]]; then
proot_info
cd && pkg update && pkg reinstall tar openssl wget which glibc-repo && pkg update && pkg reinstall glibc glibc-runner glib*glibc libx11-glibc pulseaudio-glibc libpulse-glibc mesa-*glibc vulkan-tools*-glibc freetype-glibc fontconfig-glibc libxcomposite-glibc libxcursor-glibc libxrender-glibc libxi-glibc libxinerama-glibc libxkbcommon-glibc libxrandr-glibc libxrender-glibc libgnutls-glibc openssl-glibc zstd-glibc zlib-glibc libxshmfence-glibc vulkan-icd-loader-glibc && echo "done."
elif [[ "$1" == "box64=0.3.0" ]]; then
proot_info
echo "0.3.0" > $TPH/xow64_box64/.box64-version
install_box64
elif [[ "$1" == "box64=0.3.1" ]]; then
proot_info
echo "0.3.1" > $TPH/xow64_box64/.box64-version
install_box64
elif [[ "$1" == "box64=0.3.2" ]]; then
proot_info
echo "0.3.2" > $TPH/xow64_box64/.box64-version
install_box64
elif [[ "$1" == "box64=0.3.3" ]]; then
proot_info
echo "0.3.3" > $TPH/xow64_box64/.box64-version
if [[ "$1" == "update-box64" ]]; then
UPDATE_BOX64=1
fi
install_box64
elif [[ "$1" == "box64=0.3.5" || "$1" == "update-box64" ]]; then
proot_info
echo "0.3.5" > $TPH/xow64_box64/.box64-version
if [[ "$1" == "update-box64" ]]; then
UPDATE_BOX64=1
fi
install_box64
elif [[ "$1" == "update-wine" || "$1" == "install-wine" ]]; then
wine_q
install_wine
echo "done."
elif [[ "$1" == "update-patch" || "$1" == "update-patch-exp" ]]; then
wine_q
echo "Updating patch..."
if [ -f $TPH/.xow64-proot ]; then
if [[ "$1" == "update-patch-exp" ]]; then
echo "Updating patch experimental..."
cd && rm -rf ~/xow64_wine_patch.tar.xz && cd && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64_wine_patch_experimental.tar.xz && mv ~/xow64_wine_patch.tar.xz $TPH/xow64_wine_patch_experimental.tar.xz && cd $TPH && echo "extracting xow64_wine_patch_experimental.tar.xz..." && tar -xf xow64_wine_patch_experimental.tar.xz && rm -rf $TPH/xow64_wine_patch_experimental.tar.xz && rm -rf $TPH/xow64_box64
else
echo "Updating patch..."
cd && rm -rf ~/xow64_wine_patch.tar.xz && cd && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64_wine_patch.tar.xz && mv ~/xow64_wine_patch.tar.xz $TPH/xow64_wine_patch.tar.xz && cd $TPH && echo "extracting xow64_wine_patch.tar.xz..." && tar -xf xow64_wine_patch.tar.xz && rm -rf $TPH/xow64_wine_patch.tar.xz && rm -rf $TPH/xow64_box64
fi
else
if [ ! -d $TPH/xow64_box64 ]; then
echo "Installing box64-0.3.3..."
cd && rm -rf $TPH/xow64_box64-${XOW64_BOXV}.tar.xz && rm -rf && cd && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/xow64_box64-${XOW64_BOXV}.tar.xz && echo "extracting xow64_box64-${XOW64_BOXV}.tar.xz..." && tar -xf $TPH/xow64_box64-${XOW64_BOXV}.tar.xz && rm -rf $TPH/xow64_box64-${XOW64_BOXV}.tar.xz
fi
if [[ "$1" == "update-patch-exp" ]]; then
echo "Updating patch experimental..."
cd && rm -rf $TPH/xow64_wine_patch.tar.xz && cd && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64_wine_patch_experimental.tar.xz && echo "extracting xow64_wine_patch_experimental.tar.xz..." && tar -xf $TPH/xow64_wine_patch_experimental.tar.xz && rm -rf $TPH/xow64_wine_patch_experimental.tar.xz
else
echo "Updating patch..."
cd && rm -rf $TPH/xow64_wine_patch.tar.xz && cd && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64_wine_patch.tar.xz && echo "extracting xow64_wine_patch.tar.xz..." && tar -xf $TPH/xow64_wine_patch.tar.xz && rm -rf $TPH/xow64_wine_patch.tar.xz
fi
fi
check_wineprefix
if [[ $IS_EQUAL == "0" ]]; then
WPREFIX=$(cat $TPH/xow64_wine/.wine-prefix)
mv $TPH/.xow64_wine $TPH/xow64_wine/${WPREFIX} && cp -r $TPH/xow64_wine/${WPREFIX} $TPH/ && rm -rf $TPH/xow64_wine/${WPREFIX} && rm -rf $TPH/.xow64_wine
fi
dllsoverride
echo "done."
elif [[ "$1" == "update-drivers" ]]; then
if [ -f $TPH/.xow64-proot ]; then
if [ -f $TPH/xow64_drivers/.virgl ]; then
echo "On proot mode updating vglx script only..."
cd && rm -rf ~/vglx && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/vglx && chmod +x ~/vglx && mv ~/vglx $TPH/xow64_drivers/vglx
echo "done."
exit
else
proot_info
fi
fi
DRIVERS_UPDATE_AVAIL=no
if [ -f $TPH/xow64_wine/.vk-radeon ]; then
DRIVERS_UPDATE_AVAIL=yes
fi
if [ -f $TPH/xow64_drivers/.virgl ]; then
DRIVERS_UPDATE_AVAIL=yes
fi
if [[ $DRIVERS_UPDATE_AVAIL == "no" ]]; then
echo "update-drivers currently available"
echo "for virpipe driver and vulkan radeon/xclipse GPUs only"
echo "for other GPUs use the available drivers on the system."
exit
fi
echo "Updating graphics drivers..."
cd && rm -rf $TPH/xow64_drivers.tar.xz && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64_drivers.tar.xz && echo "extracting xow64_drivers.tar.xz..." && tar -xf $TPH/xow64_drivers.tar.xz && rm -rf $TPH/xow64_drivers.tar.xz
if [ -f $TPH/xow64_drivers/.virgl ]; then
cd && rm -rf $TPH/angle-android_2.1.2-latest.deb && wget https://github.com/ar37-rs/virgl-angle/releases/download/latest/angle-android_2.1.2-latest.deb && mv $TPH/angle-android_2.1.2-latest.deb $TPH/xow64_drivers/angle-android_2.1.2-latest.deb && rm -rf $TPH/virglrenderer_1.1.0-latest_aarch64.deb && wget https://github.com/ar37-rs/virgl-angle/releases/download/latest/virglrenderer_1.1.0-latest_aarch64.deb && mv $TPH/virglrenderer_1.1.0-latest_aarch64.deb $TPH/xow64_drivers/virglrenderer_1.1.0-latest_aarch64.deb && rm -rf $TPH/vglx && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/vglx && chmod +x $TPH/vglx && mv $TPH/vglx $TPH/xow64_drivers/vglx
$TPH/xow64_drivers/vglx q
dpkg -i $TPH/xow64_drivers/angle-android_2.1.2-latest.deb
dpkg -i $TPH/xow64_drivers/virglrenderer_1.1.0-latest_aarch64.deb
$TPH/xow64_drivers/vglx cd .
fi
echo "done."
elif [[ "$1" == "update-angle" ]]; then
proot_info
echo "Updating angle-android..."
if [ -f $TPH/.xow64-proot ]; then
if [ ! -d $TPH/xow64_drivers ]; then
mkdir $TPH/xow64_drivers
fi
fi
cd && rm -rf $TPH/vglx && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/vglx && chmod +x $TPH/vglx && mv $TPH/vglx $TPH/xow64_drivers/vglx && cd && rm -rf $TPH/angle-android_2.1.2-latest.deb && wget https://github.com/ar37-rs/virgl-angle/releases/download/latest/angle-android_2.1.2-latest.deb && mv $TPH/angle-android_2.1.2-latest.deb $TPH/xow64_drivers/angle-android_2.1.2-latest.deb
$TPH/xow64_drivers/vglx q
echo "Installing angle-android..."
dpkg -i $TPH/xow64_drivers/angle-android_2.1.2-latest.deb
echo "done."
$TPH/xow64_drivers/vglx cd .
elif [[ "$1" == "update-virgl" ]]; then
proot_info
echo "Updating virglrenderer..."
if [ -f $TPH/.xow64-proot ]; then
if [ ! -d $TPH/xow64_drivers ]; then
mkdir $TPH/xow64_drivers
fi
fi
cd && rm -rf $TPH/virglrenderer_1.1.0-latest_aarch64.deb && wget https://github.com/ar37-rs/virgl-angle/releases/download/latest/virglrenderer_1.1.0-latest_aarch64.deb && mv $TPH/virglrenderer_1.1.0-latest_aarch64.deb $TPH/xow64_drivers/virglrenderer_1.1.0-latest_aarch64.deb && cd && rm -rf ~/vglx && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/vglx && chmod +x ~/vglx && mv ~/vglx $TPH/xow64_drivers/vglx
echo "Installing virglrenderer..."
dpkg -i $TPH/xow64_drivers/virglrenderer_1.1.0-latest_aarch64.deb
echo "done."
elif [[ "$1" == "update-vkd3d" || "$1" == "update-vkd3d-async" ]]; then
wine_q
echo "Updating dxvk-proton (vkd3d) components..."
if [ -f $TPH/.xow64-proot ]; then
cd && rm -rf ~/xow64_dxvk_proton.tar.xz && rm -rf $TPH/xow64_wine/xow64_dxvk_proton.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/xow64_dxvk_proton.tar.xz && mv ~/xow64_dxvk_proton.tar.xz $TPH/xow64_wine/xow64_dxvk_proton.tar.xz
cd && rm -rf ~/xow64_dxvk_proton_async.tar.xz && rm -rf $TPH/xow64_wine/xow64_dxvk_proton_async.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/xow64_dxvk_proton_async.tar.xz && mv ~/xow64_dxvk_proton_async.tar.xz $TPH/xow64_wine/xow64_dxvk_proton_async.tar.xz
else
cd && rm -rf $TPH/xow64_dxvk_proton.tar.xz && rm -rf $TPH/xow64_wine/xow64_dxvk_proton.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/xow64_dxvk_proton.tar.xz && mv $TPH/xow64_dxvk_proton.tar.xz $TPH/xow64_wine/xow64_dxvk_proton.tar.xz
cd && rm -rf $TPH/xow64_dxvk_proton_async.tar.xz && rm -rf $TPH/xow64_wine/xow64_dxvk_proton_async.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/xow64_dxvk_proton_async.tar.xz && mv $TPH/xow64_dxvk_proton_async.tar.xz $TPH/xow64_wine/xow64_dxvk_proton_async.tar.xz
fi
if [[ "$1" == "update-vkd3d-async" ]]; then
echo "extracting xow64_dxvk_proton_async.tar.xz..." && cd $TPH/xow64_wine && tar -xf xow64_dxvk_proton_async.tar.xz && cd && cp -r $TPH/xow64_wine/.xow64_wine $TPH/ && rm -rf $TPH/xow64_wine/.xow64_wine
else
echo "extracting xow64_dxvk_proton.tar.xz..." && cd $TPH/xow64_wine && tar -xf xow64_dxvk_proton.tar.xz && cd && cp -r $TPH/xow64_wine/.xow64_wine $TPH/ && rm -rf $TPH/xow64_wine/.xow64_wine
fi
check_wineprefix
if [[ $IS_EQUAL == "0" ]]; then
WPREFIX=$(cat $TPH/xow64_wine/.wine-prefix)
mv $TPH/.xow64_wine $TPH/xow64_wine/${WPREFIX} && cp -r $TPH/xow64_wine/${WPREFIX} $TPH/ && rm -rf $TPH/xow64_wine/${WPREFIX} && rm -rf $TPH/.xow64_wine
fi
echo "done."
elif [[ "$1" == "q" ]]; then
echo "quiting wine..."
wine_q
sleep 1
elif [[ "$1" == "vk=radeon" ]]; then
if [ -f $TPH/.xow64-proot ]; then
if [ ! -d $TPH/xow64_wine ]; then
mkdir $TPH/xow64_wine
fi
else
if [ ! -d $TPH/xow64_drivers ]; then
cd && rm -rf $TPH/xow64_drivers.tar.xz && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64_drivers.tar.xz && echo "extracting xow64_drivers.tar.xz..." && tar -xf $TPH/xow64_drivers.tar.xz && rm -rf $TPH/xow64_drivers.tar.xz
fi
fi
if [ -f $TPH/xow64_wine/.vk-turnip ]; then
rm -rf $TPH/xow64_wine/.vk-turnip
fi
if [ -f $TPH/xow64_wine/.vk-llvmpipe ]; then
rm -rf $TPH/xow64_wine/.vk-llvmpipe
fi
touch $TPH/xow64_wine/.vk-radeon
echo "using vulkan radeon driver."
elif [[ "$1" == "vk=turnip" ]]; then
if [ -f $TPH/.xow64-proot ]; then
if [ ! -d $TPH/xow64_wine ]; then
mkdir $TPH/xow64_wine
fi
fi
if [ -f $TPH/xow64_wine/.vk-llvmpipe ]; then
rm -rf $TPH/xow64_wine/.vk-llvmpipe
fi
if [ -f $TPH/xow64_wine/.vk-radeon ]; then
rm -rf $TPH/xow64_wine/.vk-radeon
fi
touch $TPH/xow64_wine/.vk-turnip
echo "using adreno/turnip driver."
elif [[ "$1" == "vk=lvp" ]]; then
if [ -f $TPH/.xow64-proot ]; then
if [ ! -d $TPH/xow64_wine ]; then
mkdir $TPH/xow64_wine
fi
fi
if [ -f $TPH/xow64_wine/.vk-radeon ]; then
rm -rf $TPH/xow64_wine/.vk-radeon
fi
if [ -f $TPH/xow64_wine/.vk-turnip ]; then
rm -rf $TPH/xow64_wine/.vk-turnip
fi
touch $TPH/xow64_wine/.vk-llvmpipe
echo "using vulkan llvmpipe driver."
elif [[ "$1" == "vk=default" ]]; then
if [ -f $TPH/xow64_wine/.vk-turnip ]; then
rm -rf $TPH/xow64_wine/.vk-turnip
fi
if [ -f $TPH/xow64_wine/.vk-radeon ]; then
rm -rf $TPH/xow64_wine/.vk-radeon
fi
if [ -f $TPH/xow64_wine/.vk-llvmpipe ]; then
rm -rf $TPH/xow64_wine/.vk-llvmpipe
fi
echo "using vulkan default driver."
elif [[ "$1" == "driver=virpipe" ]]; then
if [ -f $TPH/xow64_drivers/.panfrost ]; then
rm -rf $TPH/xow64_drivers/.panfrost
fi
if [ -f $TPH/xow64_drivers/.panthor ]; then
rm -rf $TPH/xow64_drivers/.panthor
fi
if [ ! -d $TPH/xow64_drivers ]; then
if [ -f $TPH/.xow64-proot ]; then
mkdir $TPH/xow64_drivers
else
echo "Installing virgl components..." && cd && rm -rf $TPH/xow64_drivers.tar.xz && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64_drivers.tar.xz && echo "extracting xow64_drivers.tar.xz..." && tar -xf $TPH/xow64_drivers.tar.xz && rm -rf $TPH/xow64_drivers.tar.xz
fi
fi
if [ ! -f $TPH/.xow64-proot ]; then
if [ ! -d $TPH/xow64_drivers ]; then
cd && rm -rf $TPH/xow64_drivers.tar.xz && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/xow64_drivers.tar.xz && echo "extracting xow64_drivers.tar.xz..." && tar -xf $TPH/xow64_drivers.tar.xz && rm -rf $TPH/xow64_drivers.tar.xz
fi
if [ ! -f $TPH/xow64_drivers/virglrenderer_1.1.0-latest_aarch64.deb ]; then
cd && rm -rf $TPH/virglrenderer_1.1.0-latest_aarch64.deb && wget https://github.com/ar37-rs/virgl-angle/releases/download/latest/virglrenderer_1.1.0-latest_aarch64.deb && mv $TPH/virglrenderer_1.1.0-latest_aarch64.deb $TPH/xow64_drivers/virglrenderer_1.1.0-latest_aarch64.deb
fi
if [ ! -f $TPH/xow64_drivers/angle-android_2.1.2-latest.deb ]; then
cd && rm -rf $TPH/angle-android_2.1.2-latest.deb && wget https://github.com/ar37-rs/virgl-angle/releases/download/latest/angle-android_2.1.2-latest.deb && mv $TPH/angle-android_2.1.2-latest.deb $TPH/xow64_drivers/angle-android_2.1.2-latest.deb
fi
fi
if [ -f $TPH/.xow64-proot ]; then
if [ ! -d $TPH/xow64_drivers ]; then
mkdir $TPH/xow64_drivers
fi
if [ ! -f $TPH/xow64_drivers/vglx ]; then
cd && rm -rf ~/vglx && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/vglx && chmod +x ~/vglx && mv ~/vglx $TPH/xow64_drivers/vglx
fi
else
if [ ! -f $TPH/xow64_drivers/vglx ]; then
cd && rm -rf $TPH/vglx && wget https://github.com/ar37-rs/xow64-wine/releases/download/latest/vglx && chmod +x $TPH/vglx && mv $TPH/vglx $TPH/xow64_drivers/vglx
fi
fi
if [ ! -f $TPH/xow64_drivers/.virgl ]; then
touch $TPH/xow64_drivers/.virgl
fi
if [ ! -f $TPH/.xow64-proot ]; then
$TPH/xow64_drivers/vglx q
if [ ! -f $PREFIX/opt/angle-android/vulkan/libEGL_angle.so ]; then
echo "Installing angle-android with vulkan validation layer..."
dpkg -i $TPH/xow64_drivers/angle-android_2.1.2-latest.deb
echo "angle-android is installed"
fi
if [ ! -f $PREFIX/bin/virgl_test_server ]; then
echo "Installing virgl..."
dpkg -i $TPH/xow64_drivers/virglrenderer_1.1.0-latest_aarch64.deb
echo "virglrenderer is installed"
fi
$TPH/xow64_drivers/vglx cd .
fi
echo "using virpipe driver"
elif [[ "$1" == "driver=default" ]]; then
if [ -f $TPH/xow64_drivers/.virgl ]; then
rm -rf $TPH/xow64_drivers/.virgl
fi
if [ -f $TPH/xow64_drivers/.panfrost ]; then
rm -rf $TPH/xow64_drivers/.panfrost
fi
if [ -f $TPH/xow64_drivers/.panthor ]; then
rm -rf $TPH/xow64_drivers/.panthor
fi
echo "using default OpenGL/ES driver."
elif [[ "$1" == "driver=panfrost" ]]; then
if [ -f $TPH/xow64_drivers/.virgl ]; then
rm -rf $TPH/xow64_drivers/.virgl
fi
if [ -f $TPH/xow64_drivers/.panthor ]; then
rm -rf $TPH/xow64_drivers/.panthor
fi
if [ -f $TPH/.xow64-proot ]; then
if [ ! -d $TPH/xow64_drivers ]; then
mkdir $TPH/xow64_drivers
fi
fi
touch $TPH/xow64_drivers/.panfrost
echo "using panfrost OpenGL/ES driver."
pan_info
elif [[ "$1" == "driver=panthor" ]]; then
if [ -f $TPH/xow64_drivers/.virgl ]; then
rm -rf $TPH/xow64_drivers/.virgl
fi
if [ -f $TPH/.xow64-proot ]; then
if [ ! -d $TPH/xow64_drivers ]; then
mkdir $TPH/xow64_drivers
fi
fi
touch $TPH/xow64_drivers/.panfrost
touch $TPH/xow64_drivers/.panthor
echo "using panthor OpenGL/ES driver."
pan_info
elif [[ "$1" == "debug=true" ]]; then
if [ -f $TPH/xow64_wine/.no_debug ]; then
rm -rf $TPH/xow64_wine/.no_debug
fi
echo "Wine debugger enabled."
elif [[ "$1" == "debug=false" ]]; then
touch $TPH/xow64_wine/.no_debug
echo "Wine debugger disabled."
elif [[ "$1" == "vgl-compat=2.1" ]]; then
$TPH/xow64_drivers/vglx 2.1COMPAT
elif [[ "$1" == "vgl-compat=3.2" ]]; then
$TPH/xow64_drivers/vglx 3.2COMPAT
elif [[ "$1" == "vgl-compat=3.3" ]]; then
$TPH/xow64_drivers/vglx 3.3COMPAT
elif [[ "$1" == "vgl-compat=4.1" ]]; then
$TPH/xow64_drivers/vglx 4.1COMPAT
elif [[ "$1" == "vgl-compat=4.3" ]]; then
$TPH/xow64_drivers/vglx 4.3COMPAT
elif [[ "$1" == "vgl-cfg=d3d" ]]; then
$TPH/xow64_drivers/vglx config=d3d
elif [[ "$1" == "vgl-cfg=gl" ]]; then
$TPH/xow64_drivers/vglx config=gl
elif [[ "$1" == "vgl-use=angle" ]]; then
$TPH/xow64_drivers/vglx use-angle
elif [[ "$1" == "vgl-use=android" ]]; then
$TPH/xow64_drivers/vglx use-android
elif [[ "$1" == "vkd3d=true" || "$1" == "vkd3d-async=true" ]]; then
if [ ! -f $TPH/${WPREFIX}/user.reg ]; then
$EXEX $BOX64X $TPH/xow64_wine/${WINE_VERSION}/bin/wine wineboot
fi
wine_q
if [[ "$1" == "vkd3d-async=true" ]]; then
echo "Installing dxvk-proton (vkd3d) async components..."
if [ ! -f $TPH/.xow64-proot ]; then
if [ ! -f $TPH/xow64_wine/xow64_dxvk_proton_async.tar.xz ]; then
cd && rm -rf $TPH/xow64_dxvk_proton_async.tar.xz && rm -rf $TPH/xow64_wine/xow64_dxvk_proton_async.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/xow64_dxvk_proton_async.tar.xz && mv $TPH/xow64_dxvk_proton_async.tar.xz $TPH/xow64_wine/xow64_dxvk_proton_async.tar.xz
fi
else
if [ ! -f $TPH/xow64_wine/xow64_dxvk_proton_async.tar.xz ]; then
cd && rm -rf ~/xow64_dxvk_proton_async.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/xow64_dxvk_proton_async.tar.xz && mv ~/xow64_dxvk_proton_async.tar.xz $TPH/xow64_wine/xow64_dxvk_proton_async.tar.xz
fi
fi
else
if [ ! -f $TPH/.xow64-proot ]; then
if [ ! -f $TPH/xow64_wine/xow64_dxvk_proton.tar.xz ]; then
echo "Installing dxvk-proton (vkd3d) components..."
cd && rm -rf $TPH/xow64_dxvk_proton.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/xow64_dxvk_proton.tar.xz && mv $TPH/xow64_dxvk_proton.tar.xz $TPH/xow64_wine/xow64_dxvk_proton.tar.xz
fi
else
if [ ! -f $TPH/xow64_wine/xow64_dxvk_proton.tar.xz ]; then
echo "Installing dxvk-proton (vkd3d) components..."
cd && rm -rf ~/xow64_dxvk_proton.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/xow64_dxvk_proton.tar.xz && mv ~/xow64_dxvk_proton.tar.xz $TPH/xow64_wine/xow64_dxvk_proton.tar.xz
fi
fi
fi
if [[ "$1" == "vkd3d-async=true" ]]; then
echo "extracting xow64_dxvk_proton_async.tar.xz..." && cd $TPH/xow64_wine && tar -xf xow64_dxvk_proton_async.tar.xz && cd && cp -r $TPH/xow64_wine/.xow64_wine $TPH/ && rm -rf $TPH/xow64_wine/.xow64_wine
else
echo "extracting xow64_dxvk_proton.tar.xz..." && cd $TPH/xow64_wine && tar -xf xow64_dxvk_proton.tar.xz && cd && cp -r $TPH/xow64_wine/.xow64_wine $TPH/ && rm -rf $TPH/xow64_wine/.xow64_wine
fi
if [ -f $TPH/xow64_wine/.wined3d-3.21 ]; then
rm -rf $TPH/xow64_wine/.wined3d-3.21
fi
if [ -f $TPH/xow64_wine/.wined3d-4.21 ]; then
rm -rf $TPH/xow64_wine/.wined3d-4.21
fi
check_wineprefix
if [[ $IS_EQUAL == "0" ]]; then
WPREFIX=$(cat $TPH/xow64_wine/.wine-prefix)
mv $TPH/.xow64_wine $TPH/xow64_wine/${WPREFIX} && cp -r $TPH/xow64_wine/${WPREFIX} $TPH/ && rm -rf $TPH/xow64_wine/${WPREFIX} && rm -rf $TPH/.xow64_wine
fi
if [ -f $TPH/${WPREFIX}/user.reg ]; then
cd && cat << EOF >> $TPH/${WPREFIX}/user.reg
[Volatile Environment]
"DXVK_STATE_CACHE_PATH"="C:\\.dxvk"
"DXVK_STATE_CACHE"="reset"
"DXVK_ASYNC"="1"
"DXVK_GPLASYNCCACHE"="1"
[Software\\\Wine\\\DllOverrides]
"di"="native,builtin"
"dxgi"="native,builtin"
"d3d8"="native,builtin"
"d3d9"="native,builtin"
"d3d10core"="native,builtin"
"d3d11"="native,builtin"
"d3d12"="native,builtin"
"d3d12core"="native,builtin"
EOF
if [[ "$1" == "vkd3d-async=true" ]]; then
echo "dxvk-proton (vkd3d) async is activated"
else
echo "dxvk-proton (vkd3d) is activated"
fi
touch $TPH/xow64_wine/.dxvk-proton
fi
echo "done."
elif [[ "$1" == "vkd3d=false" || "$1" == "vkd3d-async=false" ]]; then
wine_q
if [ ! -f $TPH/.xow64-proot ]; then
if [ ! -f $TPH/xow64_wine/${WINE_VERSION}/wined3d-${WINE_VERSION}.tar.xz ]; then
echo "Reinstalling wined3d components..."
cd && rm -rf $TPH/wined3d-${WINE_VERSION}.tar.xz && rm -rf $TPH/xow64_wine/${WINE_VERSION}/wined3d-${WINE_VERSION}.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/wined3d-${WINE_VERSION}.tar.xz && mv $TPH/wined3d-${WINE_VERSION}.tar.xz $TPH/xow64_wine/${WINE_VERSION}/wined3d-${WINE_VERSION}.tar.xz
fi
else
if [ ! -f $TPH/xow64_wine/${WINE_VERSION}/wined3d-${WINE_VERSION}.tar.xz ]; then
echo "Reinstalling wined3d components..."
cd && rm -rf ~/wined3d-${WINE_VERSION}.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/wined3d-${WINE_VERSION}.tar.xz && mv ~/wined3d-${WINE_VERSION}.tar.xz $TPH/xow64_wine/${WINE_VERSION}/wined3d-${WINE_VERSION}.tar.xz
fi
fi
echo "extracting wined3d-${WINE_VERSION}.tar.xz..." && cd $TPH/xow64_wine/${WINE_VERSION} && tar -xf wined3d-${WINE_VERSION}.tar.xz && cd && cp -r $TPH/xow64_wine/${WINE_VERSION}/.xow64_wine $TPH/ && rm -rf $TPH/xow64_wine/${WINE_VERSION}/.xow64_wine
if [ ! -f $TPH/${WPREFIX}/user.reg ]; then
$EXEX $BOX64X $TPH/xow64_wine/${WINE_VERSION}/bin/wine wineboot
wine_q
fi
if [ -f $TPH/${WPREFIX}/user.reg ]; then
sed -i '/dxgi"=/d' $TPH/${WPREFIX}/user.reg
sed -i '/d3d8"=/d' $TPH/${WPREFIX}/user.reg
sed -i '/d3d9"=/d' $TPH/${WPREFIX}/user.reg
sed -i '/d3d10core"=/d' $TPH/${WPREFIX}/user.reg
sed -i '/d3d11"=/d' $TPH/${WPREFIX}/user.reg
sed -i '/d3d12"=/d' $TPH/${WPREFIX}/user.reg
sed -i '/d3d12core"=/d' $TPH/${WPREFIX}/user.reg
fi
if [ -f $TPH/xow64_wine/.dxvk-proton ]; then
rm -rf $TPH/xow64_wine/.dxvk-proton
fi
if [ -f $TPH/xow64_wine/.wined3d-3.21 ]; then
rm -rf $TPH/xow64_wine/.wined3d-3.21
fi
if [ -f $TPH/xow64_wine/.wined3d-4.21 ]; then
rm -rf $TPH/xow64_wine/.wined3d-4.21
fi
check_wineprefix
if [[ $IS_EQUAL == "0" ]]; then
WPREFIX=$(cat $TPH/xow64_wine/.wine-prefix)
mv $TPH/.xow64_wine $TPH/xow64_wine/${WPREFIX} && cp -r $TPH/xow64_wine/${WPREFIX} $TPH/ && rm -rf $TPH/xow64_wine/${WPREFIX} && rm -rf $TPH/.xow64_wine
fi
echo "done."
if [[ "$1" == "vkd3d-async=false" ]]; then
echo "dxvk-proton (vkd3d) async is deactivated"
else
echo "dxvk-proton (vkd3d) is deactivated"
fi
elif [[ "$1" == "wined3d=3.21" ]]; then
wine_q
WINE_VERSION=3.21
if [ ! -f $TPH/.xow64-proot ]; then
if [ ! -f $TPH/xow64_wine/wined3d-${WINE_VERSION}.tar.xz ]; then
echo "Reinstalling wined3d components..."
cd && rm -rf $TPH/wined3d-${WINE_VERSION}.tar.xz && rm -rf $TPH/xow64_wine/${WINE_VERSION}/wined3d-${WINE_VERSION}.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/wined3d-${WINE_VERSION}.tar.xz && mv $TPH/wined3d-${WINE_VERSION}.tar.xz $TPH/xow64_wine/wined3d-${WINE_VERSION}.tar.xz
fi
else
if [ ! -f $TPH/xow64_wine/wined3d-${WINE_VERSION}.tar.xz ]; then
echo "Reinstalling wined3d components..."
cd && rm -rf ~/wined3d-${WINE_VERSION}.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/wined3d-${WINE_VERSION}.tar.xz && mv ~/wined3d-${WINE_VERSION}.tar.xz $TPH/xow64_wine/wined3d-${WINE_VERSION}.tar.xz
fi
fi
echo "extracting wined3d-${WINE_VERSION}.tar.xz..." && cd $TPH/xow64_wine && tar -xf wined3d-${WINE_VERSION}.tar.xz
if [ ! -f $TPH/${WPREFIX}/user.reg ]; then
$EXEX $BOX64X $TPH/xow64_wine/${WINE_VERSION}/bin/wine wineboot
wine_q
fi
if [ -f $TPH/${WPREFIX}/user.reg ]; then
cd && cat << EOF >> $TPH/${WPREFIX}/user.reg
[Software\\\Wine\\\DllOverrides]
"ddraw"="native,builtin"
"dxgi"="native,builtin"
"d3d8"="native,builtin"
"d3d9"="native,builtin"
"d3d10core"="native,builtin"
"d3d10_1"="native,builtin"
"d3d11"="native,builtin"
"libwine"="native,builtin"
"wined3d"="native,builtin"
EOF
fi
if [ -f $TPH/xow64_wine/.dxvk-proton ]; then
rm -rf $TPH/xow64_wine/.dxvk-proton
fi
if [ -f $TPH/xow64_wine/.wined3d-4.21 ]; then
rm -rf $TPH/xow64_wine/.wined3d-4.21
fi
check_wineprefix
if [[ $IS_EQUAL == "0" ]]; then
WPREFIX=$(cat $TPH/xow64_wine/.wine-prefix)
mv $TPH/xow64_wine/.xow64_wine $TPH/xow64_wine/${WPREFIX} && cp -r $TPH/xow64_wine/${WPREFIX} $TPH/ && rm -rf $TPH/xow64_wine/${WPREFIX}
else
cp -r $TPH/xow64_wine/.xow64_wine $TPH/ && rm -rf $TPH/xow64_wine/.xow64_wine
fi
touch $TPH/xow64_wine/.wined3d-3.21
echo
echo "using wined3d version 3.21"
elif [[ "$1" == "wined3d=4.21" ]]; then
wine_q
WINE_VERSION=4.21
if [ ! -f $TPH/.xow64-proot ]; then
if [ ! -f $TPH/xow64_wine/wined3d-${WINE_VERSION}.tar.xz ]; then
echo "Reinstalling wined3d components..."
cd && rm -rf $TPH/wined3d-${WINE_VERSION}.tar.xz && rm -rf $TPH/xow64_wine/${WINE_VERSION}/wined3d-${WINE_VERSION}.tar.xz && wget https://github.com/ar37-rs/xow64-wine/raw/refs/heads/main/components/wined3d-${WINE_VERSION}.tar.xz && mv $TPH/wined3d-${WINE_VERSION}.tar.xz $TPH/xow64_wine/wined3d-${WINE_VERSION}.tar.xz
fi
else