@@ -14,13 +14,17 @@ REPO_PATH="https://github.com/ZOOM-Platform/zoom-platform.sh"
14
14
INNOEXT_BIN=" /tmp/innoextract_zoom"
15
15
LAUNCH_SCRIPTS_PATH=" $HOME " /.local/share/zoom-platform
16
16
UMU_BIN=umu-run
17
+ CACHE_DIR=" $HOME " /.cache/zoom-platform
17
18
18
19
# Check if dialogs can be used and set tool
19
20
CAN_USE_DIALOGS=0
20
21
USE_ZENITY=1
21
22
(command -v kdialog > /dev/null || command -v zenity > /dev/null) && [ -n " $DISPLAY " ] && CAN_USE_DIALOGS=1
22
23
[ $CAN_USE_DIALOGS -eq 1 ] && ! command -v zenity > /dev/null && USE_ZENITY=0
23
24
25
+ # Create cahce directory
26
+ mkdir -p " $CACHE_DIR "
27
+
24
28
# .shellcheck will consume ram trying to parse INNOEXTRACT_BINARY_B64
25
29
# when developing, just load the bin from working dir
26
30
get_innoext_string () {
@@ -115,6 +119,46 @@ trim_string() {
115
119
awk ' {$1=$1;print}'
116
120
}
117
121
122
+ # Download the umu-launcher zipapp
123
+ download_umu_zipapp () {
124
+ _url=" $1 "
125
+ _url_resp=$( curl -o " $CACHE_DIR " /umu-launcher.tar.xz " $_url " -Ls -H " User-Agent: zoom-platform.sh/$INSTALLER_VERSION (+https://zoom-platform.sh/)" )
126
+ _url_exit=$?
127
+ if [ $_url_exit -ne 0 ]; then
128
+ fatal_error " Could not download umu-launcher. Please install it manually."
129
+ fi
130
+
131
+ if ! command -v tar > /dev/null; then
132
+ fatal_error " tar was not found on this system."
133
+ fi
134
+
135
+ tar --overwrite-dir -C " $CACHE_DIR " -xf " $CACHE_DIR " /umu-launcher.tar.xz umu/umu-run
136
+ rm -f " $CACHE_DIR " /umu-launcher.tar.xz
137
+ chmod +x " $CACHE_DIR " /umu/umu-run
138
+ UMU_BIN=" $CACHE_DIR " /umu/umu-run
139
+ }
140
+
141
+ # Get umu-launcher's url from lutris' runtime api
142
+ get_umu_url () {
143
+ _api_resp=$( curl -Ls -H " User-Agent: zoom-platform.sh/$INSTALLER_VERSION (+https://zoom-platform.sh/)" \
144
+ ' https://lutris.net/api/runtimes?format=json' )
145
+ _api_exit=$?
146
+ if [ $_api_exit -eq 0 ]; then
147
+ _parsed_str=" $( printf ' %s' " $_api_resp " | awk -F' "' ' /"name":"umu"/ {for(i=1; i<=NF; i++) if($i=="url") {print $(i+2); exit}}' ) "
148
+ # Validate parsed output
149
+ case $_parsed_str in
150
+ " https://" * )
151
+ printf ' %s' " $_parsed_str "
152
+ exit 0
153
+ ;;
154
+ * )
155
+ exit 1
156
+ ;;
157
+ esac
158
+ fi
159
+ exit 1
160
+ }
161
+
118
162
get_umu_id () {
119
163
_guid=" $1 "
120
164
_api_resp=$( curl -Ls -H " User-Agent: zoom-platform.sh/$INSTALLER_VERSION (+https://zoom-platform.sh/)" \
456
500
# Check if UWU is installed
457
501
if command -v umu-run > /dev/null; then
458
502
UMU_BIN=umu-run
503
+ log_info " Using umu native"
459
504
elif command -v " $HOME " /.local/share/umu/umu-run > /dev/null; then
460
505
UMU_BIN=" $HOME " /.local/share/umu/umu-run
506
+ log_info " Using $HOME /.local/share/umu/umu-run"
461
507
elif command -v /usr/bin/umu-run > /dev/null; then
462
508
UMU_BIN=/usr/bin/umu-run
509
+ log_info " Using /usr/bin/umu-run"
463
510
elif flatpak info org.openwinecomponents.umu.umu-launcher > /dev/null 2>&1 ; then
464
511
UMU_BIN=" FLATPAK"
465
512
log_info " Using umu Flatpak"
466
513
else
467
- fatal_error " umu is not installed"
514
+ _umu_url=" $( get_umu_url) "
515
+ download_umu_zipapp " $_umu_url "
516
+ # fatal_error "umu is not installed"
468
517
fi
469
518
470
519
# If dialogs are usable and installer wasn't specified, show a dialog
@@ -651,7 +700,8 @@ umu_launch "$INPUT_INSTALLER" \
651
700
652
701
# Watch the install log
653
702
_currentfile=0
654
- _filecount=$(( "$(get_header_val 'file_count')"+ "$(get_header_val 'icon_count')"))
703
+ # _filecount=$(("$(get_header_val 'file_count')"+"$(get_header_val 'icon_count')"))
704
+ _filecount=219
655
705
_readlog=1
656
706
while [ $_readlog -eq 1 ]; do
657
707
sleep 0.010
0 commit comments