Update installer multi-select

This commit is contained in:
Fmstrat 2020-11-19 23:05:07 -05:00 committed by Oskar Manhart
parent a7b2dce33d
commit 01e0bb3b09
2 changed files with 63 additions and 43 deletions

View File

@ -377,16 +377,17 @@ on_checkbox_input_enter() {
fi
done
if (( ${#_checkbox_list[@]} <= 5 )); then
tput cud $((${#_checkbox_list[@]}-${_current_index}))
tput cub "$(tput cols)"
if (( ${#_checkbox_list[@]} <= 5 )); then
for i in $(seq $((${#_checkbox_list[@]}+1))); do
tput el1
tput el
tput cuu1
done
else
tput cud $((6-${_current_row}))
tput cub "$(tput cols)"
for i in $(seq 8); do
tput el1
tput el

View File

@ -2,6 +2,9 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MAKEDEMO=0
USEDEMO=1
. "${DIR}/install/inquirer.sh"
INSTALLED_EXES=()
@ -26,9 +29,11 @@ function waInstall() {
function waFindInstalled() {
echo -n " Checking for installed apps in RDP machine (this may take a while)..."
if [ $USEDEMO != 1 ]; then
rm -f ${HOME}/.local/share/winapps/installed.bat
rm -f ${HOME}/.local/share/winapps/installed.tmp
rm -f ${HOME}/.local/share/winapps/installed
rm -f ${HOME}/.local/share/winapps/detected
cp "${DIR}/install/ExtractPrograms.ps1" ${HOME}/.local/share/winapps/ExtractPrograms.ps1
for F in $(ls "${DIR}/apps"); do
. "${DIR}/apps/${F}/info"
@ -56,12 +61,23 @@ function waFindInstalled() {
exit
fi
done
if [ $MAKEDEMO = 1 ]; then
rm -rf /tmp/winapps_demo
cp -a ${HOME}/.local/share/winapps /tmp/winapps_demo
exit
fi
else
rm -rf ${HOME}/.local/share/winapps
cp -a /tmp/winapps_demo ${HOME}/.local/share/winapps
#sleep 3
fi
echo " Finished."
}
function waConfigureApp() {
. "${SYS_PATH}/apps/${1}/info"
echo -n " Configuring ${NAME}..."
if [ ${USEDEMO} != 1 ]; then
${SUDO} rm -f "${APP_PATH}/${1}.desktop"
echo "[Desktop Entry]
Name=${NAME}
@ -79,6 +95,7 @@ MimeType=${MIME_TYPES}
${BIN_PATH}/winapps ${1} $@
" |${SUDO} tee "${BIN_PATH}/${1}" > /dev/null
${SUDO} chmod a+x "${BIN_PATH}/${1}"
fi
echo " Finished."
}
@ -191,6 +208,7 @@ MIME_TYPES=\"\"
function waConfigureWindows() {
echo -n " Configuring Windows..."
if [ ${USEDEMO} != 1 ]; then
${SUDO} rm -f "${APP_PATH}/windows.desktop"
${SUDO} mkdir -p "${SYS_PATH}/icons"
${SUDO} cp "${DIR}/icons/windows.svg" "${SYS_PATH}/icons/windows.svg"
@ -209,6 +227,7 @@ Categories=Windows
${BIN_PATH}/winapps windows
" |${SUDO} tee "/${BIN_PATH}/windows" > /dev/null
${SUDO} chmod a+x "${BIN_PATH}/windows"
fi
echo " Finished."
}