-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathxIPL_extras
executable file
·721 lines (619 loc) · 17.8 KB
/
xIPL_extras
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
#!/usr/bin/env bash
# Created by: Ohkthx (Schism)
# Purpose of file: This is responsible for installing, patching,
# and launching a ClassicUO Ultima Online client. It has several
# requirements that can be seen inside of the README.md file on
# the main repo.
# Wine variables for installation directory (WINEPREFIX), and architecture.
UO_INSTALL_DIR=".wine64_ultimaonline"
WINE_PREFIX_ROOT="$HOME"
export WINEPREFIX="$WINE_PREFIX_ROOT/$UO_INSTALL_DIR"
export WINEARCH="win64" # WINEARCH has to be win64, ClassicUO is 64-bit.
WINETRICKS_PACKAGES=("dotnet48" "corefonts") # Some typically required packages.
# Client default variables.
UO_SHARD_CLIENT="ClassicUO.exe"
UO_SHARD_CLIENT_DIR="ClassicUO"
UO_SHARD_CLIENT_FLAGS="-force_driver 1"
# Launcher default variables.
UO_SHARD_LAUNCHER="ClassicUOLauncher.exe"
UO_SHARD_LAUNCHER_DIR="."
UO_SHARD_LAUNCHER_FLAGS="-force_driver 1"
# Set all of the environment variables.
set_env() {
# Location that the UOPatcher files will be accessible.
UOPATCHER_REMOTE="https://github.com/Ohkthx/uopatcher"
UOPATCHER_ROOT="$WINEPREFIX/drive_c/Program Files/uopatcher"
UOPATCHER_SRC="$UOPATCHER_ROOT/uopatcher"
UOPATCHER_CORE="$UOPATCHER_SRC/core.py"
UOPATCHER_CONFIG="$UOPATCHER_ROOT/config.ini"
# Server files and client location.
UO_ROOT="$WINEPREFIX/drive_c/Program Files/Ultima Online"
# Backup file name
BACKUP_FILE_NAME="${UO_INSTALL_DIR}.backup"
BACKUP_FILE_COMPRESSED="true"
# Updating Shard Information
SHARD_INFO_DIRECTORY="$TMPDIR"
if [ -z "$SHARD_INFO_DIRECTORY" ]; then
if [ -d "/tmp" ]; then
SHARD_INFO_DIRECTORY="/tmp"
else
echo "[!!] Could not located a temporary directory for installation."
exit 1
fi
fi
SHARD_INFO_FILE="$SHARD_INFO_DIRECTORY/shard_info"
}
PYTHON_EXE="python3"
if command -v python3.11 &>/dev/null; then
PYTHON_EXE="python3.11"
elif command -v python3.10 &>/dev/null; then
PYTHON_EXE="python3.10"
elif command -v python3.9 &>/dev/null; then
PYTHON_EXE="python3.9"
elif command -v python3 &>/dev/null; then
PYTHON_EXE="python3"
elif command -v python &>/dev/null; then
PYTHON_EXE="python"
else
echo "[!!] Could not locate python installation."
exit
fi
IS_MACOS=false
# Used to check if most recent xIPL installed.
# Needs to be updated in the rare case that script_name
# is updated.
LATEST_XIPL_MD5="5fdb830d92681b31e3a7c3c38d406709"
# Creates a WINEPREFIX.
init_wine() {
# Initialize the wine prefix.
if [ ! -d "$WINEPREFIX" ]; then
wineboot -u >/dev/null 2>&1
fi
}
# Downloads a file from a remote source.
download_file() {
local remote_resource="$1"
local local_resource="$2"
# Check which package we are using to pull the updates.
local puller_exe=""
if command -v curl &>/dev/null; then
puller_exe="curl"
elif command -v wget &>/dev/null; then
puller_exe="wget"
fi
if [[ "$puller_exe" == "" ]]; then
echo "[!!] Could not resolve download tool, requires 'curl' or 'wget'"
exit
fi
# Get the headers of the extras file.
local headers="content-length: 0"
case "$puller_exe" in
curl)
headers=$(curl -sI "$remote_resource")
;;
wget)
headers=$(wget -q -S -O - "$remote_resource" 2>&1)
;;
esac
# Extract and clean the content-length of whitespace.
local clength=0
clength=$(echo "$headers" | grep -i content-length | awk -F ': ' '{print $2}')
clength="${clength//[$'\t\r\n ']/}"
# Attempt to get the new extras file.
if [[ "$clength" -gt 32 ]]; then
case "$puller_exe" in
curl)
curl -so "$local_resource" "$remote_resource"
;;
wget)
wget -q "$remote_resource" -O "$local_resource"
;;
esac
if [ ! -f "$local_resource" ]; then
echo "[!!] Failed to download file."
fi
else
echo "[!!] Could not located remote file."
exit
fi
}
# Checks to make sure WINE is installed, along with its requirements.
install_wine() {
local require_brew="false"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo -e "\n[++] Detected OS: Linux"
elif [[ "$OSTYPE" == "cygwin"* ]]; then
echo -e "\n[++] Detected OS: Window (Cygwin)"
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo -e "\n[++] Detected OS: FreeBSD"
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo -e "\n[++] Detected OS: MacOS"
IS_MACOS=true
require_brew="true"
if ! command -v brew &>/dev/null; then
echo " [!!] Brew is required and not installed."
exit
fi
fi
echo "[--] Check WINE and WINETRICKS installation."
if ! command -v perl &>/dev/null; then
echo " [!!] Perl is required and not installed."
exit
elif ! command -v git &>/dev/null; then
echo " [!!] Git is required and not installed."
exit
elif ! command -v python3 &>/dev/null; then
echo " [!!] Python 3 (3.9.1) is required and not installed."
exit
fi
if ! command -v wine &>/dev/null; then
echo " [!!] Wine is required and not installed."
if [[ "$require_brew" == "true" ]]; then
# Install it via Brew if it is MacOS.
brew install --cask --no-quarantine gcenx/wine/wine-crossover >/dev/null 2>&1
else
exit
fi
fi
if ! command -v winetricks &>/dev/null; then
echo " [!!] Winetricks is required and not installed."
if [[ "$require_brew" == "true" ]]; then
# Install it via Brew if it is MacOS.
brew install winetricks >/dev/null 2>&1
else
exit
fi
fi
# Makes sure wine prefix is created.
init_wine
echo "[++] WINE and WINETRICKS installation good."
}
# Checks to make sure the WINETRICKS packages are installed.
install_winetricks() {
echo "[--] Checking WINETRICKS packages."
echo " [!!] Note: dotnet packages will take quite some time."
local packages
packages=$(winetricks list-installed)
# Iterate all required packages and install.
for package in "${WINETRICKS_PACKAGES[@]}"; do
echo -e " [--] Checking: '$package' installed."
local detected_package
detected_package=$(echo "$packages" | grep "$package")
if [ -z "$detected_package" ]; then
echo -e " [!!] '$package' is missing, installing."
winetricks --force "$package" >/dev/null 2>&1
fi
echo -e " [++] Has: '$package' installed."
done
echo -e "[++] WINETRICKS packages are installed."
}
# Checks to make sure UOPatcher is installed.
install_uopatcher() {
echo "[--] Checking: UOPatcher installation."
local shard_name="$1"
if [ ! -f "$UOPATCHER_CORE" ]; then
echo " [!!] UOPatcher has not been downloaded."
git clone "$UOPATCHER_REMOTE" "$UOPATCHER_ROOT" >/dev/null 2>&1
echo " [++] UOPatcher downloaded."
fi
if [ -f "$UOPATCHER_CONFIG" ]; then
# Update the settings.
perl -pi -e "s'^local_root = .*'local_root = ${UO_ROOT}'g" "$UOPATCHER_CONFIG"
perl -pi -e "s'^remote_root = .*'remote_root = ${UO_SHARD_ROOT}'g" "$UOPATCHER_CONFIG"
perl -pi -e "s'^remote_port = .*'remote_port = ${UO_SHARD_PORT}'g" "$UOPATCHER_CONFIG"
else
# Create the configuration
{
cat <<EOF
[DEFAULT]
debug = False
skip_prompt = True
verbose = True
local_root = $UO_ROOT
remote_root = $UO_SHARD_ROOT
remote_port = $UO_SHARD_PORT
EOF
} >"$UOPATCHER_CONFIG"
fi
echo -e "[++] UOPatcher installed.\n"
echo "[++] Loaded Shard Info: $shard_name"
echo "[++] Shard Remote Root: $UO_SHARD_ROOT"
echo -e "[++] Shard Remote Port: $UO_SHARD_PORT\n"
}
# Overrides 'dsound' DLL to fix audio issues on MacOS.
set_dsound_override() {
echo "[--] Checking: DSOUND DLL Override for WINE."
if [[ " ${WINETRICKS_PACKAGES[*]} " != *" dsound "* ]] || [[ "$IS_MACOS" != true ]]; then
echo " [!!] Not required, package not required or wrong OS."
return
fi
# Extract current setting for dsound from WINE's registry
local current_setting=$(wine regedit /E /dev/stdout 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' 2> /dev/null | grep -E '"dsound"=".*"')
# Check if dsound is already set to native
if [[ "$current_setting" == *'"dsound"="native"'* ]]; then
echo " [++] DSOUND DLL already corrected."
else
# Set dsound to native
wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v dsound /d native /f >/dev/null 2>&1
echo " [++] DSOUND DLL corrected."
fi
}
patch_xIPL() {
echo "[--] Checking for xIPL patch."
local xIPL_filename="./xIPL"
if [ ! -f "$xIPL_filename" ]; then
echo " [!!] Unable to located xIPL to check for updates."
return
fi
local xIPL_md5
if command -v md5 &>/dev/null; then
xIPL_md5=$(tail -n +20 "$xIPL_filename" | md5 -q)
elif command -v md5sum &>/dev/null; then
xIPL_md5=$(tail -n +20 "$xIPL_filename" | md5sum | awk '{print $1}')
else
echo " [!!] Unable to located tool to compare md5."
return
fi
if [[ "$LATEST_XIPL_MD5" != "$xIPL_md5" ]]; then
echo " [!!] xIPL not up-to-date, downloading new version."
local resource="https://raw.githubusercontent.com/Ohkthx/xIPL/main/$xIPL_filename"
download_file "$resource" "$xIPL_filename"
fi
if [ -f "$xIPL_filename" ]; then
chmod +x "$xIPL_filename"
fi
echo "[++] Check for xIPL patch complete."
}
# Pull shard information to know how to configure xIPL.
patch_shard_info() {
echo "[--] Pulling Shard '$1' configuration."
local resource="https://raw.githubusercontent.com/Ohkthx/xIPL/main/shards/$1"
download_file "$resource" "$SHARD_INFO_FILE"
}
# Patches WINE settings and sets DLLs if required.
patch_wine() {
echo "[--] Patching Wine, removing auto-mounted drives."
if [ ! -d "$WINEPREFIX" ]; then
echo " [!!] Wine prefix does not exist... cannot continue."
exit 1
fi
# Check if DSOUND needs to be set.
set_dsound_override
if [ -d "$WINEPREFIX/dosdevices" ]; then
local plinks
plinks=$(find "$WINEPREFIX/dosdevices/" -type l -maxdepth 1)
# Iterate all of the mounted drives, unlinking non-C:/ drives.
for fd in $plinks; do
if [ -L "$fd" ]; then
if [ "$fd" != "$WINEPREFIX/dosdevices//c:" ]; then
unlink $fd
fi
fi
done
fi
echo "[++] Wine patching complete."
}
# Checks for UOPatcher updates.
patch_uopatcher() {
echo "[--] Checking: UOPatcher Updates."
if [ ! -f "$UOPATCHER_CORE" ]; then
install_uopatcher "$1"
return
fi
# Should not be able to trigger this.
if [ ! -d "$UOPATCHER_ROOT" ]; then
echo " [!!] UOPatcher should be installed but is not."
exit 1
fi
# Check and pull the update if it exists.
local current_dir
local lversion
local rversion
lversion=$($PYTHON_EXE "$UOPATCHER_CORE" --version)
rversion=$($PYTHON_EXE "$UOPATCHER_CORE" --has-update)
if [[ "$lversion" < "$rversion" ]]; then
echo " [--] UOPatcher requires an update. Updating..."
current_dir=$(pwd)
cd "$UOPATCHER_ROOT" || exit
git pull >/dev/null 2>&1
cd "$current_dir" || exit
lversion="$rversion"
echo " [++] UOPatcher updated."
fi
echo "[++] UOPatcher check complete, current version: $lversion."
}
# Patches the local client, installing any missing files.
patch_client() {
echo "[--] Patching: Client with UOPatcher."
if [ ! -f "$UOPATCHER_CORE" ]; then
echo " [!!] UOPatcher has not been downloaded."
exit
fi
# Run the patcher.
echo -e "\n"
$PYTHON_EXE "$UOPATCHER_CORE" --config "$UOPATCHER_CONFIG"
echo -e "\n"
echo "[++] Client patched."
}
launch_winecfg() {
echo "[++] Starting winecfg."
# Makes sure wine prefix is created.
init_wine
if ! command -v winecfg &>/dev/null; then
echo "[!!] winecfg not accessible. Is Wine installed?"
exit 1
fi
winecfg
echo "[++] Stopped winecfg."
}
launch_winetricks() {
echo "[++] Starting Winetricks."
if ! command -v winetricks &>/dev/null; then
echo "[!!] Winetricks not accessible. Is it installed?"
exit 1
fi
# Makes sure wine prefix is created.
init_wine
local packages
packages=$(winetricks list-installed)
for package in "${@}"; do
echo -e " [--] Checking: '$package' installed."
local detected_package
detected_package=$(echo "$packages" | grep "$package")
if [ -z "$detected_package" ]; then
echo -e " [!!] '$package' is missing, installing."
winetricks --force "$package" >/dev/null 2>&1
fi
echo -e " [++] Has: '$package' installed."
done
echo "[++] Stopped Winetricks."
}
launch_client() {
# Makes sure wine prefix is created.
init_wine
echo "[++] Starting client."
if [ ! -d "$UO_ROOT/$UO_SHARD_CLIENT_DIR" ]; then
echo " [!!] Client directory missing, bad installation."
exit
elif [ ! -f "$UO_ROOT/$UO_SHARD_CLIENT_DIR/$UO_SHARD_CLIENT" ]; then
echo " [!!] Client missing, bad installation."
exit
fi
cd "$UO_ROOT/$UO_SHARD_CLIENT_DIR" || exit
wine "$UO_SHARD_CLIENT" $UO_SHARD_CLIENT_FLAGS >/dev/null 2>&1
echo "[++] Stopped client."
}
launch_launcher() {
# Makes sure wine prefix is created.
init_wine
echo "[++] Starting launcher."
if [ ! -d "$UO_ROOT/$UO_SHARD_LAUNCHER_DIR" ]; then
echo " [!!] Launcher directory missing. Cannot start."
exit
elif [ ! -f "$UO_ROOT/$UO_SHARD_LAUNCHER_DIR/$UO_SHARD_LAUNCHER" ]; then
echo " [!!] Launcher missing. Cannot start."
exit
fi
cd "$UO_ROOT/$UO_SHARD_LAUNCHER_DIR" || exit
wine "$UO_SHARD_LAUNCHER" $UO_SHARD_LAUNCHER_FLAGS >/dev/null 2>&1
echo "[++] Stopped launcher."
}
confirm() {
read -r -p "Do you wish to continue? [Y/n] " input
case $input in
[yY][eE][sS] | [yY])
echo "true"
;;
*)
echo "false"
;;
esac
}
uninstall() {
local files=(
"$WINEPREFIX"
"$WINE_PREFIX_ROOT/$BACKUP_FILE_NAME"
"$WINE_PREFIX_ROOT/${BACKUP_FILE_NAME}.tgz"
"./xIPL_extras"
"./xIPL"
)
local remove="false"
# Iterate each file, and prompt for deletion.
for i in "${files[@]}"; do
if [ -f "$i" ]; then
echo -e "\nRemoving -> $i"
remove=$(confirm)
if [[ "$remove" == "true" ]]; then
rm -rf "$i"
echo " REMOVED -> $i."
fi
elif [ -d "$i" ]; then
echo -e "\nRemoving -> $i"
remove=$(confirm)
if [[ "$remove" == "true" ]]; then
rm -rf "$i"
echo " REMOVED -> $i."
fi
fi
done
}
backup_prefix() {
echo "[--] Creating backup of the current WINE PREFIX."
local filename="$BACKUP_FILE_NAME"
if [[ "$BACKUP_FILE_COMPRESSED" == "true" ]]; then
filename="${BACKUP_FILE_NAME}.tgz"
fi
# Make sure we are not overriding another backup.
if [ -d "$filename" ]; then
echo "Backup already exists, do you wish to override it?"
local remove
remove=$(confirm)
if [[ "$remove" == "false" ]]; then
return
fi
fi
# Create the backup.
local current_dir
if [[ "$BACKUP_FILE_COMPRESSED" == "true" ]]; then
current_dir=$(pwd)
cd "$WINE_PREFIX_ROOT" || exit
tar czf "$filename" "$UO_INSTALL_DIR"
cd "$current_dir" || exit
else
cp -RP "$WINEPREFIX" "$WINE_PREFIX_ROOT/$filename"
fi
echo "[++] Backup completed."
}
restore_prefix() {
echo "[--] Restoring from a WINE PREFIX backup."
# Get the backup file name or directory.
local filename="$BACKUP_FILE_NAME"
if [[ "$BACKUP_FILE_COMPRESSED" == "true" ]]; then
filename="${BACKUP_FILE_NAME}.tgz"
if [ ! -f "$WINE_PREFIX_ROOT/$filename" ]; then
echo " [!!] Backup does not exist."
return
fi
else
if [ ! -d "$WINE_PREFIX_ROOT/$filename" ]; then
echo " [!!] Backup does not exist."
return
fi
fi
# Restore from file.
local current_dir
if [[ "$BACKUP_FILE_COMPRESSED" == "true" ]]; then
current_dir=$(pwd)
cd "$WINE_PREFIX_ROOT" || exit
tar xzf "$filename"
cd "$current_dir" || exit
else
cp -RP "$WINE_PREFIX_ROOT/$filename" "$WINEPREFIX"
fi
echo "[++] WINE PREFIX restoration complete."
}
usage() {
echo -e "\nusage: $1 [--no-patch] [--no-winetricks] [--uninstall] [--help]"
echo -e "\n--help Shows this message."
echo "--uninstall Uninstalls the xIPL and all associated files."
echo "--winecfg Starts winecfg in the proper environment."
echo "--winetricks Must be last flag, installs remaining arguments."
echo "--shard Specify a remote server file config to use."
echo "--remote-config Same as the above command."
echo "--local-config Specify a local server file config to use."
echo "--launcher Starts the launcher instead of the client."
echo -e "\n--backup Create a backup of the WINE PREFIX."
echo "--restore Override current WINE PREFIX with a backup."
echo -e "\n--no-patch Skips patching the client."
echo "--no-update Skips updating the xIPL_extras file."
echo "--no-refresh Skips updating the shards configuration file."
echo "--no-winetricks Skips the Winetricks validation."
echo -e "\nReport issues to:"
echo -e " https://github.com/Ohkthx/xIPL"
}
start_ipl() {
local script_name="$0"
local shard_name="none"
local skip_patch="false"
local skip_refresh="false"
local skip_winetricks="false"
local start_launcher="false"
local shard_file_override="false"
# Default environment.
set_env
# Parse the parameters.
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--help)
usage "$script_name"
exit
;;
--shard)
shift
shard_name="$1"
shift
;;
--remote-config)
shift
shard_name="$1"
shift
;;
--local-config)
shift
SHARD_INFO_FILE="$1"
shard_name="$1"
shard_file_override="true"
shift
;;
--uninstall)
uninstall
exit
;;
--winecfg)
launch_winecfg
exit
;;
--winetricks)
shift
launch_winetricks "$@"
exit
;;
--launcher)
shift
start_launcher="true"
;;
--backup)
backup_prefix
exit
;;
--restore)
restore_prefix
exit
;;
--no-patch)
shift
skip_patch="true"
;;
--no-refresh)
shift
skip_refresh="true"
;;
--no-winetricks)
shift
skip_winetricks="true"
;;
*)
shift
;;
esac
done
# Make sure the xIPL is up-to-date.
patch_xIPL
if [[ "$skip_refresh" == "false" && "$shard_file_override" == "false" ]]; then
# Pull the updated shard configuration.
patch_shard_info "$shard_name"
fi
# Make sure the file exists.
if [ ! -f "$SHARD_INFO_FILE" ]; then
echo "[!!] Shard Information file missing, cannot continue."
exit
fi
# Load the shard information file and update environment
. "$SHARD_INFO_FILE"
set_env
# Step 1: INSTALL, Ensure all files and packages are installed.
install_wine
if [[ "$skip_winetricks" == "false" ]]; then install_winetricks; fi
install_uopatcher "$shard_name"
# Step 2: PATCH, Validate and modify settings/configurations and files.
patch_wine
patch_uopatcher "$shard_name"
if [[ "$skip_patch" == "false" ]]; then patch_client; fi
# Step 3: LAUNCH, start the client.
if [[ "$start_launcher" == "false" ]]; then
launch_client
else
launch_launcher
fi
}