forked from dragoonDorise/EmuDeck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installCLI.sh
executable file
·1119 lines (962 loc) · 27.2 KB
/
installCLI.sh
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
#!/bin/bash
#
##
## Pid Lock...
##
#
mkdir -p "$HOME/.config/EmuDeck"
PIDFILE="$HOME/.config/EmuDeck/installCLI.pid"
devMode=$1
if [ -f "$PIDFILE" ]; then
PID=$(cat "$PIDFILE")
ps -p "$PID" > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Process already running"
exit 1
else
## Process not found assume not running
echo $$ > "$PIDFILE"
if [ $? -ne 0 ]; then
echo "Could not create PID file"
exit 1
fi
fi
else
echo $$ > "$PIDFILE"
if [ $? -ne 0 ]; then
echo "Could not create PID file"
exit 1
fi
fi
function finish {
echo "Script terminating. Exit code $?"
}
trap finish EXIT
#
##
## Init... This code is needed for both Zenity and non Zenity modes
##
#
#
##
## Do we need Zenity?... Anything in the second param will skip zenity
##
#
#Clean up previous installations
rm ~/emudek.log 2>/dev/null # This is emudeck's old log file, it's not a typo!
rm -rf ~/dragoonDoriseTools
#Creating log file
LOGFILE="$HOME/emudeck/emudeckCLI.log"
mv "$LOGFILE" "$HOME/emudeck/emudeckCLI.last.log" #backup last log
echo "${@}" > "$LOGFILE" #might as well log out the parameters of the run
exec > >(tee "${LOGFILE}") 2>&1
date "+%Y.%m.%d-%H:%M:%S %Z"
#Mark if this not a fresh install
FOLDER="$HOME/.config/EmuDeck/"
if [ -d "$FOLDER" ]; then
echo "" > "$HOME/.config/EmuDeck/.finished"
fi
sleep 1
SECONDTIME="$HOME/.config/EmuDeck/.finished"
# Seeting up the progress Bar for the rest of the installation
#
##
## set backend location
##
# I think this should just be in the source, so there's one spot for initialization. hrm, no i'm wrong. Here is best.
EMUDECKGIT="$HOME/.config/EmuDeck/backend"
#
##
echo 'Downloading files...'
##
#
#
##
## Branch to download
##
#
case $devMode in
"BETA") branch="beta" ;;
"DEV") branch="dev" ;;
"EmuReorg") branch="EmuReorg" ;;
*) branch="main" ;;
esac
echo $branch > "$HOME/.config/EmuDeck/branch.txt"
#We create all the needed folders for installation
if [[ ! -e $EMUDECKGIT ]]; then
mkdir -p "$EMUDECKGIT"
#Cloning EmuDeck files
git clone https://github.com/dragoonDorise/EmuDeck.git "$EMUDECKGIT"
else
git status "$EMUDECKGIT" --porcelain
if [[ ! $noPull == true ]]; then
echo "Resetting install files."
#git fetch origin
#git reset --hard origin/$branch
#git clean -ffdx
fi
fi
#
##
## EmuDeck is installed, start setting up stuff
##
#
#Test if we have a successful clone
if [ -d "$EMUDECKGIT" ]; then
echo -e "Files Downloaded!"
clear
#cat $EMUDECKGIT/logo.ans
version=$(cat "$EMUDECKGIT/version.md")
echo -e "${BOLD}EmuDeck ${version}${NONE}"
echo -e ""
cat "$EMUDECKGIT/latest.md"
else
echo -e ""
echo -e "Backend Files are missing!"
echo -e "Please close this window and try again in a few minutes"
sleep 999999
exit
fi
#
##
## Source all functions and previous values if they exist.
## We source the settings.sh from the emudeck folder if it exists, inside here too.
##
#
source "$EMUDECKGIT/functions/all.sh"
#
#Environment Check
#
getEnvironmentDetails
testRealDeck
#This part of the code is where all the settings are created
STARTOPTIONS=(1 "Rerun Emudeck"
2 "Change a Config Option"
3 "Install or update an Emulator"
4 "Full reset an Emulator")
RUNCHOICE=$(dialogCLI "What should we do today?" "${STARTOPTIONS[@]}")
case $RUNCHOICE in
1) echo "You chose to rerun EmuDeck"
;;
2) echo "Change a Config Option"
;;
3) echo "Install or update an Emulator"
;;
4) echo "Full reset an Emulator"
;;
*) echo "Cancelled"
;;
esac
if [ -z "$RUNCHOICE" ]; then
echo "No choice made"
exit
fi
if [ "$RUNCHOICE" == 1 ]; then
#
# Initialize locations
#
locationTable=()
locationTable+=("Internal" "$HOME") #always valid
#built in SD Card reader
sdCardFull=$(getSDPath)
sdValid=$(testLocationValid "SD" "$sdCardFull")
echo "$sdCardFull $sdValid"
if [[ ! $sdValid =~ "Invalid" ]]; then
locationTable+=("SD Card" "$sdCardFull")
fi
#
# Installation mode selection
#
OPTIONS=(1 "Easy Mode"
2 "Expert Mode")
modeChoice=$(dialogCLI "Do you want to use Easy Mode or Expert Mode?" "${OPTIONS[@]}")
if [ "$modeChoice" == "2" ]; then
setSetting expert true
echo "Mode selected: Expert"
locationTable+=("Custom" "CUSTOM") #in expert mode we'll allow the user to pick an arbitrary place.
else
setSetting expert false
echo "Mode selected: Easy"
fi
#
#Storage Selection
#
storageSelection(){
destination=$(dialogCLI "Where would you like Emudeck to be installed? SDCardStatus: $sdValid" "${locationTable[@]}")
if [ -n "$destination" ]; then
echo "Storage: ${destination}"
if [[ $destination == "Custom" ]]; then
clear
echo "type your custom location. It will be tested for validity."
read -r destination
customValid=$(testLocationValid "Custom" "${destination}")
echo "$customValid"
if [[ $customValid =~ "Invalid" ]]; then
echo "User chose invalid location. Retry."
#zenity pop up explaining why
pause
storageSelection
fi
fi
else
echo "No storage choice made"
exit
fi
}
storageSelection
#New paths based on where the user picked.
setSetting emulationPath "${destination}/Emulation"
setSetting romsPath "${destination}/Emulation/roms"
setSetting toolsPath "${destination}/Emulation/tools"
setSetting biosPath "${destination}/Emulation/bios"
setSetting savesPath "${destination}/Emulation/saves"
setSetting storagePath "${destination}/Emulation/storage"
setSetting ESDEscrapData "${destination}/Emulation/tools/downloaded_media/"
#Folder creation... This code is repeated outside of this if for the no zenity mode
mkdir -p "$emulationPath"
mkdir -p "$toolsPath"/launchers
mkdir -p "$savesPath"
mkdir -p "$romsPath"
mkdir -p "$storagePath"
mkdir -p "$biosPath"/yuzu
##Generate rom folders
setMSG "Creating roms folder in $destination"
sleep 3
rsync -r --ignore-existing "$EMUDECKGIT/roms/" "$romsPath"/
#End repeated code
#
# Start of Expert mode configuration
# The idea is that Easy mode is unatended, so everything that's out
# out of the ordinary has to had its flag enabled/disabled on Expert mode
#
if [ "$expert" == "true" ]; then
echo "Expert mode begin"
#one entry per expert mode feature
table=()
table+=( "CHDScript" "Install the latest version of our CHD conversion script?" ON )
table+=( "PowerTools" "Install Power Tools for CPU control? (password required)" ON )
table+=( "SteamGyro" "Setup the SteamDeckGyroDSU for gyro control (password required)" ON )
table+=( "updateSRM" "Install/Update Steam Rom Manager? Customizations will not be reset." ON )
table+=( "updateESDE" "Install/Update Emulation Station DE? Customizations and scrapes will not be reset." ON )
table+=( "selectEmulators" "Select the emulators to install." ON )
table+=( "selectEmulatorConfig" "Customize the emulator configuration reset. (note: Fixes will be skipped if boxes are unchecked)" ON )
table+=( "selectRABezels" "Turn on Bezels for Retroarch?" ON )
table+=( "selectRAAutoSave" "Turn on Retroarch AutoSave/Restore state?" ON )
table+=( "snesAR" "SNES 8:7 Aspect Ratio? (unchecked is 4:3)" ON )
table+=( "selectWideScreen" "Customize Emulator Widescreen Selection?" ON )
table+=( "setRAEnabled" "Enable Retroachievments in Retroarch?" ON )
table+=( "setRASignIn" "Change RetroAchievements Sign in?" ON )
table+=( "doESDEThemePicker" "Choose your EmulationStation-DE Theme?" ON )
#table+=(TRUE "doXboxButtons" "Should facebutton letters match between Nintendo and Steamdeck? (default is matched location)")
expertModeFeatureList=$(whiptail --title "Check list example" --checklist "Choose user's permissions" 50 78 4 "${table[@]}")
echo "user selected: $expertModeFeatureList"
#set flags to true for selected expert mode features
if [[ "$expertModeFeatureList" == *"CHDScript"* ]]; then
setSetting doInstallCHD true
fi
if [[ "$expertModeFeatureList" == *"PowerTools"* ]]; then
setSetting doInstallPowertools true
fi
if [[ "$expertModeFeatureList" == *"SteamGyro"* ]]; then
setSetting doInstallGyro true
fi
if [[ "$expertModeFeatureList" == *"updateSRM"* ]]; then
setSetting doSetupSRM true
fi
if [[ "$expertModeFeatureList" == *"updateESDE"* ]]; then
setSetting doInstallESDE true
fi
if [[ "$expertModeFeatureList" == *"selectEmulators"* ]]; then
setSetting doSelectEmulators true
fi
if [[ "$expertModeFeatureList" == *"selectEmulatorConfig"* ]]; then
setSetting doResetEmulators true
fi
if [[ "$expertModeFeatureList" == *"selectRABezels"* ]]; then
setSetting RABezels true
fi
if [[ "$expertModeFeatureList" == *"selectRAAutoSave"* ]]; then
setSetting RAautoSave true
fi
if [[ "$expertModeFeatureList" == *"snesAR"* ]]; then
setSetting SNESAR 43
fi
if [[ "$expertModeFeatureList" == *"selectWideScreen"* ]]; then
setSetting doSelectWideScreen true
fi
if [[ "$expertModeFeatureList" == *"setRASignIn"* ]]; then
setSetting doRASignIn true
fi
if [[ "$expertModeFeatureList" == *"setRAEnable"* ]]; then
setSetting doRAEnable true
fi
if [[ "$expertModeFeatureList" == *"doESDEThemePicker"* ]]; then
setSetting doESDEThemePicker true
fi
if [[ $doInstallPowertools == "true" || $doInstallGyro == "true" || $isRealDeck == "false" ]]; then
hasPass=$(passwd -S "$USER" | awk -F " " '{print $2}')
if [[ ! $hasPass == "P" ]]; then
text="$(printf "<b>Password not set.</b>\n Please set one now in the terminal.\nYou will not see text entry in the terminal for your password. This is normal.\nOnce set, you will be prompted to enter it in a new window.")"
zenity --error \
--title="EmuDeck" \
--width=400 \
--text="${text}" 2>/dev/null
sleep 1
clear
echo "Enter a new password for the local Deck account here. You will have to enter it twice. No visual indication of typing will occur."
echo "Please remember it."
passwd
ans=$?
if [[ $ans == 1 ]]; then
echo "Setting password failed."
fi
fi
PASSWD="$(zenity --password --title="Password Entry" --text="Enter Deck User Password (not Steam account!)" 2>/dev/null)"
echo "$PASSWD" | sudo -v -S
ans=$?
if [[ $ans == 1 ]]; then
#incorrect password
PASSWD="$(zenity --password --title="Password Entry" --text="Password was incorrect. Try again. (Did you remember to set a password for linux before running this?)" 2>/dev/null)"
echo "$PASSWD" | sudo -v -S
ans=$?
if [[ $ans == 1 ]]; then
text="$(printf "<b>Password not accepted.</b>\n Expert mode tools which require a password will not work. Disabling them.")"
zenity --error \
--title="EmuDeck" \
--width=400 \
--text="${text}" 2>/dev/null
setSetting doInstallPowertools false
setSetting doInstallGyro false
fi
fi
fi
if [[ $doSelectEmulators == "true" ]]; then
emuTable=()
emuTable+=(TRUE "Multiple" "RetroArch")
emuTable+=(TRUE "Metroid Prime" "PrimeHack")
emuTable+=(TRUE "PS2" "PCSX2")
emuTable+=(TRUE "PS2" "PCSX2-QT")
emuTable+=(TRUE "PS3" "RPCS3")
emuTable+=(TRUE "3DS" "Citra")
emuTable+=(TRUE "GC/Wii" "Dolphin")
emuTable+=(TRUE "PSX" "Duckstation")
emuTable+=(TRUE "PSP" "PPSSPP")
emuTable+=(TRUE "Switch" "Yuzu")
emuTable+=(TRUE "WiiU" "Cemu")
emuTable+=(TRUE "XBox" "Xemu")
#if we are in beta / dev install, allow Xenia. Still false by default though. Will only work on expert mode, and explicitly turned on.
if [[ $branch == "beta" || $branch == "dev" ]]; then
emuTable+=(FALSE "Xbox360" "Xenia")
fi
#Emulator selector
text="$(printf "What emulators do you want to install?")"
emusToInstall=$(zenity --list \
--title="EmuDeck" \
--height=500 \
--width=250 \
--ok-label="OK" \
--cancel-label="Exit" \
--text="${text}" \
--checklist \
--column="Select" \
--column="System" \
--column="Emulator" \
--print-column=3 \
"${emuTable[@]}" 2>/dev/null)
ans=$?
if [ $ans -eq 0 ]; then
echo "Emu Install selected: $emusToInstall"
if [[ "$emusToInstall" == *"RetroArch"* ]]; then
setSetting doInstallRA true
fi
if [[ "$emusToInstall" == *"PrimeHack"* ]]; then
setSetting doInstallPrimeHacks true
fi
if [[ "$emusToInstall" == *"PCSX2"* ]]; then
setSetting doInstallPCSX2 true
fi
if [[ "$emusToInstall" == *"PCSX2-QT"* ]]; then
setSetting doInstallPCSX2QT true
fi
if [[ "$emusToInstall" == *"RPCS3"* ]]; then
setSetting doInstallRPCS3 true
fi
if [[ "$emusToInstall" == *"Citra"* ]]; then
setSetting doInstallCitra true
fi
if [[ "$emusToInstall" == *"Dolphin"* ]]; then
setSetting doInstallDolphin true
fi
if [[ "$emusToInstall" == *"Duckstation"* ]]; then
setSetting doInstallDuck true
fi
if [[ "$emusToInstall" == *"PPSSPP"* ]]; then
setSetting doInstallPPSSPP true
fi
if [[ "$emusToInstall" == *"Yuzu"* ]]; then
setSetting doInstallYuzu true
fi
if [[ "$emusToInstall" == *"Cemu"* ]]; then
setSetting doInstallCemu true
fi
if [[ "$emusToInstall" == *"Xemu"* ]]; then
setSetting doInstallXemu true
fi
if [[ "$emusToInstall" == *"Xenia"* ]]; then
setSetting doInstallXenia true
fi
#if [[ "$emusToInstall" == *"MelonDS"* ]]; then
# doInstallMelon=true
#fi
else
exit
fi
fi
if [[ $doSelectWideScreen == "true" ]]; then
#Emulators screenHacks
emuTable=()
emuTable+=(TRUE "Dolphin")
emuTable+=(TRUE "Duckstation")
emuTable+=(TRUE "PCSX2-QT")
emuTable+=(TRUE "RA-BeetlePSX")
emuTable+=(TRUE "RA-Flycast")
emuTable+=(TRUE "Xemu")
text="$(printf "Selected Emulators will use WideScreen Hacks")"
wideToInstall=$(zenity --list \
--title="EmuDeck" \
--height=500 \
--width=250 \
--ok-label="OK" \
--cancel-label="Exit" \
--text="${text}" \
--checklist \
--column="Widescreen?" \
--column="Emulator" \
"${emuTable[@]}" 2>/dev/null)
ans=$?
if [ $ans -eq 0 ]; then
echo "Widescreen choices: $wideToInstall"
if [[ "$wideToInstall" == *"Duckstation"* ]]; then
setSetting duckWide true
else
setSetting duckWide false
fi
if [[ "$wideToInstall" == *"Dolphin"* ]]; then
setSetting DolphinWide true
else
setSetting DolphinWide false
fi
if [[ "$wideToInstall" == *"RA-Flycast"* ]]; then
setSetting DreamcastWide true
else
setSetting DreamcastWide false
fi
if [[ "$wideToInstall" == *"BeetlePSX"* ]]; then
setSetting BeetleWide true
else
setSetting BeetleWide false
fi
if [[ "$wideToInstall" == *"Xemu"* ]]; then
setSetting XemuWide true
else
setSetting XemuWide false
fi
if [[ "$wideToInstall" == *"PCSX2-QT"* ]]; then
setSetting PCSX2QTWide true
else
setSetting PCSX2QTWide false
fi
else
exit
fi
fi
if [[ $doResetEmulators == "true" ]]; then
# Configuration that only appplies to previous users
if [ -f "$SECONDTIME" ]; then
emuTable=()
emuTable+=(TRUE "RetroArch")
emuTable+=(TRUE "PrimeHack")
emuTable+=(TRUE "PCSX2")
emuTable+=(TRUE "PCSX2-QT")
emuTable+=(TRUE "RPCS3")
emuTable+=(TRUE "Citra")
emuTable+=(TRUE "Dolphin")
emuTable+=(TRUE "Duckstation")
emuTable+=(TRUE "PPSSPP")
emuTable+=(TRUE "Yuzu")
emuTable+=(TRUE "Cemu")
emuTable+=(TRUE "Xemu")
emuTable+=(TRUE "Steam Rom Manager")
emuTable+=(TRUE "EmulationStation DE")
text="$(printf "<b>EmuDeck will reset the following Emulator's configurations by default.</b>\nWhich systems do you want <b>reset</b> to the newest version of the defaults?\nWe recommend you keep all of them checked so everything gets updated and known issues are fixed.\nIf you want to mantain any custom configuration on an emulator unselect its name from this list.")"
emusToReset=$(zenity --list \
--title="EmuDeck" \
--height=500 \
--width=250 \
--ok-label="OK" \
--cancel-label="Exit" \
--text="${text}" \
--checklist \
--column="Reset?" \
--column="Emulator" \
"${emuTable[@]}" 2>/dev/null)
ans=$?
#Nova fix'
cat "$EMUDECKGIT/logo.ans"
echo -e "EmuDeck ${version}"
if [ $ans -eq 0 ]; then
echo "Emulators to reinstall selected: $emusToReset"
if [[ "$emusToReset" == *"RetroArch"* ]]; then
setSetting doSetupRA true
fi
if [[ "$emusToReset" == *"PrimeHack"* ]]; then
setSetting doSetupPrimeHacks true
fi
if [[ "$emusToReset" == *"PCSX2"* ]]; then
setSetting doSetupPCSX2 true
fi
if [[ "$emusToReset" == *"PCSX2"* ]]; then
setSetting doSetupPCSX2QT true
fi
if [[ "$emusToReset" == *"RPCS3"* ]]; then
setSetting doSetupRPCS3 true
fi
if [[ "$emusToReset" == *"Citra"* ]]; then
setSetting doSetupCitra true
fi
if [[ "$emusToReset" == *"Dolphin"* ]]; then
setSetting doSetupDolphin true
fi
if [[ "$emusToReset" == *"Duckstation"* ]]; then
setSetting doSetupDuck true
fi
if [[ "$emusToReset" == *"PPSSPP"* ]]; then
setSetting doSetupPPSSPP true
fi
if [[ "$emusToReset" == *"Yuzu"* ]]; then
setSetting doSetupYuzu true
fi
if [[ "$emusToReset" == *"Cemu"* ]]; then
setSetting doSetupCemu true
fi
if [[ "$emusToReset" == *"Xemu"* ]]; then
setSetting doSetupXemu true
fi
if [[ "$emusToReset" == *"Xenia"* ]]; then
setSetting doSetupXenia false #false until we add above
fi
#if [[ "$emusToReset" == *"MelonDS"* ]]; then
# setSetting doSetupMelonDS true
#fi
if [[ "$emusToReset" == *"Steam Rom Manager"* ]]; then
setSetting doSetupSRM true
fi
if [[ "$emusToReset" == *"EmulationStation DE"* ]]; then
setSetting doSetupESDE true
fi
else
echo ""
fi
fi
fi
else
#easy mode settings
setSetting doInstallRA true
setSetting doInstallDolphin true
setSetting doInstallPCSX2 true
setSetting doInstallPCSX2QT true
setSetting doInstallRPCS3 true
setSetting doInstallYuzu true
setSetting doInstallCitra true
setSetting doInstallDuck true
setSetting doInstallCemu true
setSetting doInstallXenia false
setSetting doInstallPrimeHacks true
setSetting doInstallPPSSPP true
setSetting doInstallXemu true
#doInstallMelon=true
#widescreen off by default
setSetting duckWide false
setSetting DolphinWide false
setSetting DreamcastWide false
setSetting BeetleWide false
setSetting XemuWide false
setSetting pcsx2QTWide false
fi # end Expert if
else
#We only load functions and config when no Zenity selected
#source "$EMUDECKGIT"/functions/all.sh - if we ALWAYS source,
#then we can do stuff like having the settings exactly the way they were on second run.
#source $HOME/emudeck/settings.sh put it inside all.sh
#Folder creation... This code is repeated outside of this if for the yes zenity mode
mkdir -p "$emulationPath"
mkdir -p "$toolsPath"/launchers
mkdir -p "$savesPath"
mkdir -p "$romsPath"
mkdir -p "$storagePath"
mkdir -p "$biosPath"/yuzu
##Generate rom folders
setMSG "Creating roms folder in $romsPath"
sleep 3
rsync -r --ignore-existing "$EMUDECKGIT/roms/" "$romsPath"
#End repeated code
fi
#
##
## End of Zenity configuration
##
#
#
##
## Start of installation
##
#
#Support for non-holo based OS's
#Only on Zenity for now
if [ "$zenity" == true ]; then
if [[ $isRealDeck == false ]]; then
OS_setupPrereqsArch
fi
fi
#setup Proton-Launch.sh
#because this path gets updated by sed, we really should be installing it every time and allowing it to be updated every time. In case the user changes their path.
cp "$EMUDECKGIT/tools/proton-launch.sh" "${toolsPath}/proton-launch.sh"
chmod +x "${toolsPath}/proton-launch.sh"
cp "$EMUDECKGIT/tools/appID.py" "${toolsPath}/appID.py"
# Setup emu-launch.sh
cp "${EMUDECKGIT}/tools/emu-launch.sh" "${toolsPath}/emu-launch.sh"
chmod +x "${toolsPath}/emu-launch.sh"
#ESDE Installation
if [ $doInstallESDE == "true" ]; then
ESDE_install
fi
#SRM Installation
if [ $doInstallSRM == "true" ]; then
SRM_install
fi
#Emulators Installation
if [ "$doInstallPCSX2" == "true" ]; then
PCSX2_install
fi
if [ "$doInstallPCSX2QT" == "true" ]; then
PCSX2QT_install
fi
if [ $doInstallPrimeHacks == "true" ]; then
Primehack_install
fi
if [ $doInstallRPCS3 == "true" ]; then
RPCS3_install
fi
if [ $doInstallCitra == "true" ]; then
Citra_install
fi
if [ $doInstallDolphin == "true" ]; then
Dolphin_install
fi
if [ $doInstallDuck == "true" ]; then
DuckStation_install
fi
if [ $doInstallRA == "true" ]; then
RetroArch_install
fi
if [ $doInstallPPSSPP == "true" ]; then
PPSSPP_install
fi
if [ $doInstallYuzu == "true" ]; then
Yuzu_install
fi
if [ $doInstallXemu == "true" ]; then
Xemu_install
fi
if [ $doInstallCemu == "true" ]; then
Cemu_install
fi
#Xenia - We need to install Xenia after creating the Roms folders!
if [ "$doInstallXenia" == "true" ]; then
Xenia_install
fi
#Steam RomManager Config
if [ "$doSetupSRM" == "true" ]; then
SRM_init
fi
#ESDE Config
if [ "$doSetupESDE" == "true" ]; then
ESDE_init
fi
#Emus config
#setMSG "Configuring Steam Input for emulators.." moved to emu install
setMSG "Configuring emulators"
if [ "$doSetupRA" == "true" ]; then
RetroArch_init
fi
if [ "$doSetupPrimeHacks" == "true" ]; then
Primehack_init
fi
if [ "$doSetupDolphin" == "true" ]; then
Dolphin_init
fi
if [ "$doSetupPCSX2" == "true" ]; then
PCSX2_init
fi
if [ "$doSetupPCSX2QT" == "true" ]; then
PCSX2QT_init
fi
if [ "$doSetupRPCS3" == "true" ]; then
RPCS3_init
fi
if [ "$doSetupCitra" == "true" ]; then
Citra_init
fi
if [ "$doSetupDuck" == "true" ]; then
DuckStation_init
fi
if [ "$doSetupYuzu" == "true" ]; then
Yuzu_init
fi
if [ "$doSetupPPSSPP" == "true" ]; then
PPSSPP_init
fi
if [ "$doSetupXemu" == "true" ]; then
Xemu_init
fi
#Proton Emus
if [ "$doSetupCemu" == "true" ]; then
Cemu_init
fi
if [ "$doSetupXenia" == "true" ]; then
Xenia_init
fi
#Fixes repeated Symlink for older installations
Yuzu_finalize
#
##
##End of installation
##
#
##
##
## Customizations.
##
##
#RA Bezels
RetroArch_setBezels #needs to change
#RA AutoSave
if [ "$RAautoSave" == true ]; then
RetroArch_autoSaveOn
else
RetroArch_autoSaveOff
fi
if [ "$zenity" == true ]; then
#Old Widescreen hacks
if [ "$duckWide" == true ]; then
DuckStation_wideScreenOn
else
DuckStation_wideScreenOff
fi
if [ "$pcsx2QTWide" == true ]; then
PCSX2QT_wideScreenOn
else
PCSX2QT_wideScreenOff
fi
if [ "$DolphinWide" == true ]; then
Dolphin_wideScreenOn
else
Dolphin_wideScreenOff
fi
if [ "$XemuWide" == true ]; then
Xemu_wideScreenOn
else
Xemu_wideScreenOff
fi
if [ "$DreamcastWide" == true ]; then
RetroArch_Flycast_wideScreenOn
else
RetroArch_Flycast_wideScreenOff
fi
#RA SNES Aspect Ratio
RetroArch_setSNESAR #needs to change
else
#
#New Aspect Ratios
#
#Sega Games
#Master System
#Genesis
#Sega CD
#Sega 32X
case $arSega in
"32")
RetroArch_mastersystem_ar32
RetroArch_genesis_ar32
RetroArch_segacd_ar32
RetroArch_sega32x_ar32
;;
*)
RetroArch_mastersystem_ar43
RetroArch_genesis_ar43
RetroArch_segacd_ar43
RetroArch_sega32x_ar43
if [ "$RABezels" == true ]; then
RetroArch_mastersystem_bezelOn
RetroArch_genesis_bezelOn
RetroArch_segacd_bezelOn
RetroArch_sega32x_bezelOn
fi
;;
esac
#Snes and NES
case $arSnes in
"87")
if [ "$RABezels" == true ]; then
RetroArch_snes_bezelOn
fi
RetroArch_snes_ar87
RetroArch_nes_ar87
;;
"32")
RetroArch_snes_ar32
RetroArch_nes_ar32
;;
*)
RetroArch_snes_ar43
RetroArch_nes_ar43
if [ "$RABezels" == true ]; then
RetroArch_snes_bezelOn
fi
;;
esac
# Classic 3D Games
#Dreamcast
#PSX
#Nintendo 64
#Saturn
#Xbox
if [ "$arClassic3D" == 169 ]; then
RetroArch_Beetle_PSX_HW_wideScreenOn
DuckStation_wideScreenOn
RetroArch_Flycast_wideScreenOn
Xemu_wideScreenOn
#"Bezels off"
RetroArch_dreamcast_bezelOff
RetroArch_psx_bezelOff
else
#"SET 4:3"
RetroArch_Flycast_wideScreenOff
RetroArch_Beetle_PSX_HW_wideScreenOff
DuckStation_wideScreenOff
Xemu_wideScreenOff
#"Bezels on"
if [ "$RABezels" == true ]; then
RetroArch_dreamcast_bezelOn
RetroArch_psx_bezelOn
fi
fi
# GameCube
if [ "$arDolphin" == 169 ]; then
Dolphin_wideScreenOn
else
Dolphin_wideScreenOff
fi
fi
#
#New Shaders
#
RetroArch_setShadersCRT
RetroArch_setShadersMAT
#RetroAchievments