Skip to content

Commit 8236f56

Browse files
committed
Added uninstaller, fixed counter.
1 parent f23f5de commit 8236f56

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ USE_ZENITY=1
2222
(command -v kdialog >/dev/null || command -v zenity >/dev/null) && [ -n "$DISPLAY" ] && CAN_USE_DIALOGS=1
2323
[ $CAN_USE_DIALOGS -eq 1 ] && ! command -v zenity >/dev/null && USE_ZENITY=0
2424

25-
# Create cahce directory
25+
# Create cache directory
2626
mkdir -p "$CACHE_DIR"
2727

2828
# .shellcheck will consume ram trying to parse INNOEXTRACT_BINARY_B64
@@ -700,8 +700,7 @@ umu_launch "$INPUT_INSTALLER" \
700700

701701
# Watch the install log
702702
_currentfile=0
703-
# _filecount=$(("$(get_header_val 'file_count')"+"$(get_header_val 'icon_count')"))
704-
_filecount=219
703+
_filecount=$(($(get_header_val 'file_count')+$(get_header_val 'icon_count')))
705704
_readlog=1
706705
while [ $_readlog -eq 1 ]; do
707706
sleep 0.010
@@ -847,6 +846,18 @@ EOL
847846
fi
848847
done
849848

849+
# Create uninstaller
850+
cat >"$INSTALL_PATH/uninstall.sh" <<EOL
851+
#!/bin/sh
852+
printf "You are about to remove %s's data and shortcuts. Are you sure you want to continue? [y/N]\n" "$GAME_NAME_SAFE"
853+
read in
854+
if [ "\$in" = "y" ] || [ "\$in" = "yes" ] || [ "\$in" = "Y" ] || [ "\$in" = "YES" ]; then
855+
rm -rf "$APPLICATIONS_PATH"
856+
rm -rf "$INSTALL_PATH"
857+
fi
858+
EOL
859+
chmod +x "$INSTALL_PATH/uninstall.sh"
860+
850861
# If user chose to create Desktop shortcuts in the installer, symlink to XDG desktop
851862
# Shortcut names placed on the Desktop are always the same as what was made in the Start Menu
852863
if [ $CREATE_DESKTOP_ENTRIES -eq 1 ]; then

0 commit comments

Comments
 (0)