mirror of
https://github.com/winapps-org/winapps.git
synced 2025-08-06 02:38:26 +02:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
13
bin/winapps
13
bin/winapps
@@ -44,15 +44,12 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${FREERDP_COMMAND}" ]; then
|
if [ -z "${FREERDP_COMMAND}" ]; then
|
||||||
if command -v xfreerdp &> /dev/null
|
if command -v xfreerdp &>/dev/null; then
|
||||||
then
|
|
||||||
FREERDP_COMMAND="xfreerdp"
|
FREERDP_COMMAND="xfreerdp"
|
||||||
elif command -v xfreerdp3 &> /dev/null
|
elif command -v xfreerdp3 &>/dev/null; then
|
||||||
then
|
|
||||||
FREERDP_COMMAND="xfreerdp3"
|
FREERDP_COMMAND="xfreerdp3"
|
||||||
fi
|
fi
|
||||||
elif command -v "$FREERDP_COMMAND" &> /dev/null
|
elif command -v "$FREERDP_COMMAND" &>/dev/null; then
|
||||||
then
|
|
||||||
dprint "Using custom freerdp command $FREERDP_COMMAND"
|
dprint "Using custom freerdp command $FREERDP_COMMAND"
|
||||||
else
|
else
|
||||||
echo "You have supplied a custom FreeRDP command, but the command is not available."
|
echo "You have supplied a custom FreeRDP command, but the command is not available."
|
||||||
@@ -86,7 +83,7 @@ if [ "$MULTIMON" = "true" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Append additional flags or parameters to FreeRDP
|
# Append additional flags or parameters to FreeRDP
|
||||||
if [[ -n "$RDP_FLAGS" ]]; then
|
if [[ -n $RDP_FLAGS ]]; then
|
||||||
FREERDP_COMMAND="$FREERDP_COMMAND $RDP_FLAGS"
|
FREERDP_COMMAND="$FREERDP_COMMAND $RDP_FLAGS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -120,7 +117,7 @@ elif [ "$1" = "windows" ]; then
|
|||||||
"+dynamic-resolution"
|
"+dynamic-resolution"
|
||||||
"+auto-reconnect"
|
"+auto-reconnect"
|
||||||
"+home-drive"
|
"+home-drive"
|
||||||
"/wm-class:\"Microsoft Windows\""
|
'/wm-class:"Microsoft Windows"'
|
||||||
"/v:${RDP_IP}"
|
"/v:${RDP_IP}"
|
||||||
)
|
)
|
||||||
# Run the command in the background, redirecting both stdout and stderr to /dev/null
|
# Run the command in the background, redirecting both stdout and stderr to /dev/null
|
||||||
|
@@ -71,19 +71,19 @@ function inqMenu() {
|
|||||||
# Each option is enclosed in double quotes within the output string.
|
# Each option is enclosed in double quotes within the output string.
|
||||||
# For example: '"Option 1 " "The Second Option " " Option Number 3 "'
|
# For example: '"Option 1 " "The Second Option " " Option Number 3 "'
|
||||||
SELECTED_OPTIONS_STRING=$(dialog \
|
SELECTED_OPTIONS_STRING=$(dialog \
|
||||||
--keep-tite \
|
--keep-tite \
|
||||||
--clear \
|
--clear \
|
||||||
--no-shadow \
|
--no-shadow \
|
||||||
--menu \
|
--menu \
|
||||||
"$DIALOG_TEXT" \
|
"$DIALOG_TEXT" \
|
||||||
"$DIALOG_HEIGHT" \
|
"$DIALOG_HEIGHT" \
|
||||||
"$DIALOG_WIDTH" \
|
"$DIALOG_WIDTH" \
|
||||||
"$OPTION_NUMBER" \
|
"$OPTION_NUMBER" \
|
||||||
"${DIALOG_OPTIONS[@]}" \
|
"${DIALOG_OPTIONS[@]}" \
|
||||||
2>&1 >/dev/tty) || exit 0
|
2>&1 >/dev/tty) || exit 0
|
||||||
|
|
||||||
# Remove white space added previously.
|
# Remove white space added previously.
|
||||||
RETURN_STRING=$(echo "$SELECTED_OPTIONS_STRING" | \
|
RETURN_STRING=$(echo "$SELECTED_OPTIONS_STRING" |
|
||||||
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
|
|
||||||
# Remove escapes (introduced by 'dialog' if options have parentheses).
|
# Remove escapes (introduced by 'dialog' if options have parentheses).
|
||||||
@@ -154,30 +154,30 @@ function inqChkBx() {
|
|||||||
# Each option is enclosed in double quotes within the output string.
|
# Each option is enclosed in double quotes within the output string.
|
||||||
# For example: '"Option 1 " "The Second Option " " Option Number 3 "'
|
# For example: '"Option 1 " "The Second Option " " Option Number 3 "'
|
||||||
SELECTED_OPTIONS_STRING=$(dialog \
|
SELECTED_OPTIONS_STRING=$(dialog \
|
||||||
--keep-tite \
|
--keep-tite \
|
||||||
--clear \
|
--clear \
|
||||||
--no-shadow \
|
--no-shadow \
|
||||||
--checklist \
|
--checklist \
|
||||||
"$DIALOG_TEXT" \
|
"$DIALOG_TEXT" \
|
||||||
"$DIALOG_HEIGHT" \
|
"$DIALOG_HEIGHT" \
|
||||||
"$DIALOG_WIDTH" \
|
"$DIALOG_WIDTH" \
|
||||||
"$OPTION_NUMBER" \
|
"$OPTION_NUMBER" \
|
||||||
"${DIALOG_OPTIONS[@]}" \
|
"${DIALOG_OPTIONS[@]}" \
|
||||||
2>&1 >/dev/tty) || exit 0
|
2>&1 >/dev/tty) || exit 0
|
||||||
|
|
||||||
# Convert the output string into an array.
|
# Convert the output string into an array.
|
||||||
# shellcheck disable=SC2001
|
# shellcheck disable=SC2001
|
||||||
while IFS= read -r LINE; do
|
while IFS= read -r LINE; do
|
||||||
LINE="${LINE/#\"}" # Remove leading double quote.
|
LINE="${LINE/#\"/}" # Remove leading double quote.
|
||||||
LINE="${LINE/%\"}" # Remove trailing double quote.
|
LINE="${LINE/%\"/}" # Remove trailing double quote.
|
||||||
RETURN_ARRAY+=("$LINE") # Add to array.
|
RETURN_ARRAY+=("$LINE") # Add to array.
|
||||||
done < <(echo "$SELECTED_OPTIONS_STRING" | sed 's/\" \"/\"\n\"/g')
|
done < <(echo "$SELECTED_OPTIONS_STRING" | sed 's/\" \"/\"\n\"/g')
|
||||||
|
|
||||||
# Final modifications.
|
# Final modifications.
|
||||||
for (( i=0; i<${#RETURN_ARRAY[@]}; i++ )); do
|
for ((i = 0; i < ${#RETURN_ARRAY[@]}; i++)); do
|
||||||
# Remove white space added previously.
|
# Remove white space added previously.
|
||||||
# shellcheck disable=SC2001
|
# shellcheck disable=SC2001
|
||||||
RETURN_ARRAY[i]=$(echo "${RETURN_ARRAY[i]}" | \
|
RETURN_ARRAY[i]=$(echo "${RETURN_ARRAY[i]}" |
|
||||||
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
|
|
||||||
# Remove escapes (introduced by 'dialog' if options have parentheses).
|
# Remove escapes (introduced by 'dialog' if options have parentheses).
|
||||||
|
113
installer.sh
113
installer.sh
@@ -33,15 +33,15 @@ readonly EC_APPQUERY_FAIL="14" # Failed to query the Windows VM for in
|
|||||||
# 'BIN'
|
# 'BIN'
|
||||||
readonly SYS_BIN_PATH="/usr/local/bin" # UNIX path to 'bin' directory for a '--system' WinApps installation.
|
readonly SYS_BIN_PATH="/usr/local/bin" # UNIX path to 'bin' directory for a '--system' WinApps installation.
|
||||||
readonly USER_BIN_PATH="${HOME}/.local/bin" # UNIX path to 'bin' directory for a '--user' WinApps installation.
|
readonly USER_BIN_PATH="${HOME}/.local/bin" # UNIX path to 'bin' directory for a '--user' WinApps installation.
|
||||||
readonly USER_BIN_PATH_WIN="\\\\tsclient\\home\\.local\\bin" # WINDOWS path to 'bin' directory for a '--user' WinApps installation.
|
readonly USER_BIN_PATH_WIN='\\tsclient\home\.local\bin' # WINDOWS path to 'bin' directory for a '--user' WinApps installation.
|
||||||
# 'APP'
|
# 'APP'
|
||||||
readonly SYS_APP_PATH="/usr/share/applications" # UNIX path to 'applications' directory for a '--system' WinApps installation.
|
readonly SYS_APP_PATH="/usr/share/applications" # UNIX path to 'applications' directory for a '--system' WinApps installation.
|
||||||
readonly USER_APP_PATH="${HOME}/.local/share/applications" # UNIX path to 'applications' directory for a '--user' WinApps installation.
|
readonly USER_APP_PATH="${HOME}/.local/share/applications" # UNIX path to 'applications' directory for a '--user' WinApps installation.
|
||||||
readonly USER_APP_PATH_WIN="\\\\tsclient\\home\\.local\\share\\applications" # WINDOWS oath to 'applications' directory for a '--user' WinApps installation.
|
readonly USER_APP_PATH_WIN='\\tsclient\home\.local\share\applications' # WINDOWS oath to 'applications' directory for a '--user' WinApps installation.
|
||||||
# 'APPDATA'
|
# 'APPDATA'
|
||||||
readonly SYS_APPDATA_PATH="/usr/local/share/winapps" # UNIX path to 'application data' directory for a '--system' WinApps installation.
|
readonly SYS_APPDATA_PATH="/usr/local/share/winapps" # UNIX path to 'application data' directory for a '--system' WinApps installation.
|
||||||
readonly USER_APPDATA_PATH="${HOME}/.local/share/winapps" # UNIX path to 'application data' directory for a '--user' WinApps installation.
|
readonly USER_APPDATA_PATH="${HOME}/.local/share/winapps" # UNIX path to 'application data' directory for a '--user' WinApps installation.
|
||||||
readonly USER_APPDATA_PATH_WIN="\\\\tsclient\\home\\.local\\share\\winapps" # WINDOWS path to 'application data' directory for a '--user' WinApps installation.
|
readonly USER_APPDATA_PATH_WIN='\\tsclient\home\.local\share\winapps' # WINDOWS path to 'application data' directory for a '--user' WinApps installation.
|
||||||
# 'Installed Batch Script'
|
# 'Installed Batch Script'
|
||||||
readonly BATCH_SCRIPT_PATH="${USER_APPDATA_PATH}/installed.bat" # UNIX path to a batch script used to search the Windows VM for applications.
|
readonly BATCH_SCRIPT_PATH="${USER_APPDATA_PATH}/installed.bat" # UNIX path to a batch script used to search the Windows VM for applications.
|
||||||
readonly BATCH_SCRIPT_PATH_WIN="${USER_APPDATA_PATH_WIN}\\installed.bat" # WINDOWS path to a batch script used to search the Windows VM for applications.
|
readonly BATCH_SCRIPT_PATH_WIN="${USER_APPDATA_PATH_WIN}\\installed.bat" # WINDOWS path to a batch script used to search the Windows VM for applications.
|
||||||
@@ -68,16 +68,15 @@ readonly INQUIRER_PATH="./install/inquirer.sh"
|
|||||||
# REMOTE DESKTOP CONFIGURATION
|
# REMOTE DESKTOP CONFIGURATION
|
||||||
readonly VM_NAME="RDPWindows" # Name of the Windows VM.
|
readonly VM_NAME="RDPWindows" # Name of the Windows VM.
|
||||||
readonly RDP_PORT=3389 # Port used for RDP on the Windows VM.
|
readonly RDP_PORT=3389 # Port used for RDP on the Windows VM.
|
||||||
readonly WINAPPS_CONFIG="\
|
readonly WINAPPS_CONFIG='RDP_USER="MyWindowsUser"
|
||||||
RDP_USER=\"MyWindowsUser\"
|
RDP_PASS="MyWindowsPassword"
|
||||||
RDP_PASS=\"MyWindowsPassword\"
|
#RDP_DOMAIN="MYDOMAIN"
|
||||||
#RDP_DOMAIN=\"MYDOMAIN\"
|
#RDP_IP="192.168.123.111"
|
||||||
#RDP_IP=\"192.168.123.111\"
|
|
||||||
#RDP_SCALE=100
|
#RDP_SCALE=100
|
||||||
#RDP_FLAGS=\"\"
|
#RDP_FLAGS=""
|
||||||
#MULTIMON=\"true\"
|
#MULTIMON="true"
|
||||||
#DEBUG=\"true\"
|
#DEBUG="true"
|
||||||
#FREERDP_COMMAND=\"xfreerdp\"" # Default WinApps configuration file content.
|
#FREERDP_COMMAND="xfreerdp"' # Default WinApps configuration file content.
|
||||||
|
|
||||||
### GLOBAL VARIABLES ###
|
### GLOBAL VARIABLES ###
|
||||||
# USER INPUT
|
# USER INPUT
|
||||||
@@ -219,7 +218,7 @@ function waCheckInput() {
|
|||||||
inqMenu "Install or uninstall WinApps?" OPTIONS SELECTED_OPTION
|
inqMenu "Install or uninstall WinApps?" OPTIONS SELECTED_OPTION
|
||||||
|
|
||||||
# Set flags.
|
# Set flags.
|
||||||
if [[ "$SELECTED_OPTION" == "Uninstall" ]]; then
|
if [[ $SELECTED_OPTION == "Uninstall" ]]; then
|
||||||
OPT_UNINSTALL=1
|
OPT_UNINSTALL=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -228,9 +227,9 @@ function waCheckInput() {
|
|||||||
inqMenu "Configure WinApps for the current user '$(whoami)' or the whole system?" OPTIONS SELECTED_OPTION
|
inqMenu "Configure WinApps for the current user '$(whoami)' or the whole system?" OPTIONS SELECTED_OPTION
|
||||||
|
|
||||||
# Set flags.
|
# Set flags.
|
||||||
if [[ "$SELECTED_OPTION" == "Current User" ]]; then
|
if [[ $SELECTED_OPTION == "Current User" ]]; then
|
||||||
OPT_USER=1
|
OPT_USER=1
|
||||||
elif [[ "$SELECTED_OPTION" == "System" ]]; then
|
elif [[ $SELECTED_OPTION == "System" ]]; then
|
||||||
OPT_SYSTEM=1
|
OPT_SYSTEM=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -240,7 +239,7 @@ function waCheckInput() {
|
|||||||
inqMenu "Automatically install supported applications or choose manually?" OPTIONS SELECTED_OPTION
|
inqMenu "Automatically install supported applications or choose manually?" OPTIONS SELECTED_OPTION
|
||||||
|
|
||||||
# Set flags.
|
# Set flags.
|
||||||
if [[ "$SELECTED_OPTION" == "Automatic" ]]; then
|
if [[ $SELECTED_OPTION == "Automatic" ]]; then
|
||||||
OPT_AOSA=1
|
OPT_AOSA=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -571,7 +570,7 @@ function waCheckVMRunning() {
|
|||||||
# Obtain VM Status
|
# Obtain VM Status
|
||||||
VM_STATE=$(virsh list --all | grep -w "$VM_NAME")
|
VM_STATE=$(virsh list --all | grep -w "$VM_NAME")
|
||||||
|
|
||||||
if [[ "$VM_STATE" == *"shut off"* ]]; then
|
if [[ $VM_STATE == *"shut off"* ]]; then
|
||||||
# Complete the previous line.
|
# Complete the previous line.
|
||||||
echo -e "${FAIL_TEXT}Failed!${CLEAR_TEXT}\n"
|
echo -e "${FAIL_TEXT}Failed!${CLEAR_TEXT}\n"
|
||||||
|
|
||||||
@@ -589,7 +588,7 @@ function waCheckVMRunning() {
|
|||||||
|
|
||||||
# Terminate the script.
|
# Terminate the script.
|
||||||
return "$EC_VM_OFF"
|
return "$EC_VM_OFF"
|
||||||
elif [[ "$VM_STATE" == *"paused"* ]]; then
|
elif [[ $VM_STATE == *"paused"* ]]; then
|
||||||
# Complete the previous line.
|
# Complete the previous line.
|
||||||
echo -e "${FAIL_TEXT}Failed!${CLEAR_TEXT}\n"
|
echo -e "${FAIL_TEXT}Failed!${CLEAR_TEXT}\n"
|
||||||
|
|
||||||
@@ -607,7 +606,7 @@ function waCheckVMRunning() {
|
|||||||
|
|
||||||
# Terminate the script.
|
# Terminate the script.
|
||||||
return "$EC_VM_PAUSED"
|
return "$EC_VM_PAUSED"
|
||||||
elif [[ "$VM_STATE" != *"running"* ]]; then
|
elif [[ $VM_STATE != *"running"* ]]; then
|
||||||
# Complete the previous line.
|
# Complete the previous line.
|
||||||
echo -e "${FAIL_TEXT}Failed!${CLEAR_TEXT}\n"
|
echo -e "${FAIL_TEXT}Failed!${CLEAR_TEXT}\n"
|
||||||
|
|
||||||
@@ -714,19 +713,17 @@ function waCheckRDPAccess() {
|
|||||||
# [INFO][com.freerdp.core] - [rdp_print_errinfo]: ERRINFO_LOGOFF_BY_USER (0x0000000C):The disconnection was initiated by the user logging off their session on the server.
|
# [INFO][com.freerdp.core] - [rdp_print_errinfo]: ERRINFO_LOGOFF_BY_USER (0x0000000C):The disconnection was initiated by the user logging off their session on the server.
|
||||||
# shellcheck disable=SC2140,SC2027 # Disable warnings regarding unquoted strings.
|
# shellcheck disable=SC2140,SC2027 # Disable warnings regarding unquoted strings.
|
||||||
"$FREERDP_COMMAND" \
|
"$FREERDP_COMMAND" \
|
||||||
/cert:tofu \
|
/cert:tofu \
|
||||||
/d:"$RDP_DOMAIN" \
|
/d:"$RDP_DOMAIN" \
|
||||||
/u:"$RDP_USER" \
|
/u:"$RDP_USER" \
|
||||||
/p:"$RDP_PASS" \
|
/p:"$RDP_PASS" \
|
||||||
/scale:"$RDP_SCALE" \
|
/scale:"$RDP_SCALE" \
|
||||||
+auto-reconnect \
|
+auto-reconnect \
|
||||||
+home-drive \
|
+home-drive \
|
||||||
-wallpaper \
|
-wallpaper \
|
||||||
+dynamic-resolution \
|
+dynamic-resolution \
|
||||||
/app:\
|
/app:program:"C:\Windows\System32\cmd.exe",cmd:"/C type NUL > "$TEST_PATH_WIN" && tsdiscon" \
|
||||||
program:"C:\Windows\System32\cmd.exe",\
|
/v:"$RDP_IP" &>"$FREERDP_LOG" &
|
||||||
cmd:"/C type NUL > "$TEST_PATH_WIN" && tsdiscon" \
|
|
||||||
/v:"$RDP_IP" &>"$FREERDP_LOG" &
|
|
||||||
|
|
||||||
# Store the FreeRDP process ID.
|
# Store the FreeRDP process ID.
|
||||||
FREERDP_PROC=$!
|
FREERDP_PROC=$!
|
||||||
@@ -826,37 +823,35 @@ function waFindInstalled() {
|
|||||||
source "./apps/${APPLICATION}/info"
|
source "./apps/${APPLICATION}/info"
|
||||||
|
|
||||||
# Append commands to batch file.
|
# Append commands to batch file.
|
||||||
echo "IF EXIST \"${WIN_EXECUTABLE}\" ECHO ${APPLICATION} >> ${TMP_INST_FILE_PATH_WIN}" >> "$BATCH_SCRIPT_PATH"
|
echo "IF EXIST \"${WIN_EXECUTABLE}\" ECHO ${APPLICATION} >> ${TMP_INST_FILE_PATH_WIN}" >>"$BATCH_SCRIPT_PATH"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Append a command to the batch script to run the PowerShell script and store it's output in the 'detected' file.
|
# Append a command to the batch script to run the PowerShell script and store it's output in the 'detected' file.
|
||||||
# shellcheck disable=SC2129 # Silence warning regarding repeated redirects.
|
# shellcheck disable=SC2129 # Silence warning regarding repeated redirects.
|
||||||
echo "powershell.exe -ExecutionPolicy Bypass -File ${PS_SCRIPT_HOME_PATH_WIN} > ${DETECTED_FILE_PATH_WIN}" >> "$BATCH_SCRIPT_PATH"
|
echo "powershell.exe -ExecutionPolicy Bypass -File ${PS_SCRIPT_HOME_PATH_WIN} > ${DETECTED_FILE_PATH_WIN}" >>"$BATCH_SCRIPT_PATH"
|
||||||
|
|
||||||
# Append a command to the batch script to rename the temporary file containing the names of all detected officially supported applications.
|
# Append a command to the batch script to rename the temporary file containing the names of all detected officially supported applications.
|
||||||
echo "RENAME ${TMP_INST_FILE_PATH_WIN} installed" >> "$BATCH_SCRIPT_PATH"
|
echo "RENAME ${TMP_INST_FILE_PATH_WIN} installed" >>"$BATCH_SCRIPT_PATH"
|
||||||
|
|
||||||
# Append a command to the batch script to terminate the remote desktop session once all previous commands are complete.
|
# Append a command to the batch script to terminate the remote desktop session once all previous commands are complete.
|
||||||
echo "tsdiscon" >> "$BATCH_SCRIPT_PATH"
|
echo "tsdiscon" >>"$BATCH_SCRIPT_PATH"
|
||||||
|
|
||||||
# Silently execute the batch script within the Windows VM in the background (Log Output To File)
|
# Silently execute the batch script within the Windows VM in the background (Log Output To File)
|
||||||
# Note: The following final line is expected within the log, indicating successful execution of the 'tsdiscon' command and termination of the RDP session.
|
# Note: The following final line is expected within the log, indicating successful execution of the 'tsdiscon' command and termination of the RDP session.
|
||||||
# [INFO][com.freerdp.core] - [rdp_print_errinfo]: ERRINFO_LOGOFF_BY_USER (0x0000000C):The disconnection was initiated by the user logging off their session on the server.
|
# [INFO][com.freerdp.core] - [rdp_print_errinfo]: ERRINFO_LOGOFF_BY_USER (0x0000000C):The disconnection was initiated by the user logging off their session on the server.
|
||||||
# shellcheck disable=SC2140,SC2027 # Disable warnings regarding unquoted strings.
|
# shellcheck disable=SC2140,SC2027 # Disable warnings regarding unquoted strings.
|
||||||
"$FREERDP_COMMAND" \
|
"$FREERDP_COMMAND" \
|
||||||
/cert:tofu \
|
/cert:tofu \
|
||||||
/d:"$RDP_DOMAIN" \
|
/d:"$RDP_DOMAIN" \
|
||||||
/u:"$RDP_USER" \
|
/u:"$RDP_USER" \
|
||||||
/p:"$RDP_PASS" \
|
/p:"$RDP_PASS" \
|
||||||
/scale:"$RDP_SCALE" \
|
/scale:"$RDP_SCALE" \
|
||||||
+auto-reconnect \
|
+auto-reconnect \
|
||||||
+home-drive \
|
+home-drive \
|
||||||
-wallpaper \
|
-wallpaper \
|
||||||
+dynamic-resolution \
|
+dynamic-resolution \
|
||||||
/app:\
|
/app:program:"C:\Windows\System32\cmd.exe",cmd:"/C "$BATCH_SCRIPT_PATH_WIN"" \
|
||||||
program:"C:\Windows\System32\cmd.exe",\
|
/v:"$RDP_IP" &>"$FREERDP_LOG" &
|
||||||
cmd:"/C "$BATCH_SCRIPT_PATH_WIN"" \
|
|
||||||
/v:"$RDP_IP" &>"$FREERDP_LOG" &
|
|
||||||
|
|
||||||
# Store the FreeRDP process ID.
|
# Store the FreeRDP process ID.
|
||||||
FREERDP_PROC=$!
|
FREERDP_PROC=$!
|
||||||
@@ -1058,7 +1053,7 @@ function waConfigureApps() {
|
|||||||
WIN_EXECUTABLE="${WIN_EXECUTABLE##*\\}"
|
WIN_EXECUTABLE="${WIN_EXECUTABLE##*\\}"
|
||||||
|
|
||||||
# Trim any leading or trailing whitespace characters from the executable file name.
|
# Trim any leading or trailing whitespace characters from the executable file name.
|
||||||
read -r WIN_EXECUTABLE <<< "$(echo "$WIN_EXECUTABLE" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
read -r WIN_EXECUTABLE <<<"$(echo "$WIN_EXECUTABLE" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
||||||
|
|
||||||
# Add the executable file name (in lowercase) to the array.
|
# Add the executable file name (in lowercase) to the array.
|
||||||
INSTALLED_EXES+=("${WIN_EXECUTABLE,,}")
|
INSTALLED_EXES+=("${WIN_EXECUTABLE,,}")
|
||||||
@@ -1080,7 +1075,7 @@ function waConfigureApps() {
|
|||||||
inqMenu "How would you like to handle officially supported applications?" OPTIONS APP_INSTALL
|
inqMenu "How would you like to handle officially supported applications?" OPTIONS APP_INSTALL
|
||||||
|
|
||||||
# Remove unselected officially supported applications from the 'install' file.
|
# Remove unselected officially supported applications from the 'install' file.
|
||||||
if [[ "$APP_INSTALL" == "Choose specific officially supported applications to set up" ]]; then
|
if [[ $APP_INSTALL == "Choose specific officially supported applications to set up" ]]; then
|
||||||
inqChkBx "Which officially supported applications would you like to set up?" APPS SELECTED_APPS
|
inqChkBx "Which officially supported applications would you like to set up?" APPS SELECTED_APPS
|
||||||
|
|
||||||
# Clear/create the 'install' file.
|
# Clear/create the 'install' file.
|
||||||
@@ -1094,12 +1089,12 @@ function waConfigureApps() {
|
|||||||
SELECTED_APP="${SELECTED_APP%%)}"
|
SELECTED_APP="${SELECTED_APP%%)}"
|
||||||
|
|
||||||
# Add the substring back to the 'install' file.
|
# Add the substring back to the 'install' file.
|
||||||
echo "$SELECTED_APP" >> "$INST_FILE_PATH"
|
echo "$SELECTED_APP" >>"$INST_FILE_PATH"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure selected (or all) officially supported applications.
|
# Configure selected (or all) officially supported applications.
|
||||||
if [[ "$APP_INSTALL" != "Skip setting up any officially supported applications" ]]; then
|
if [[ $APP_INSTALL != "Skip setting up any officially supported applications" ]]; then
|
||||||
waConfigureOfficiallySupported
|
waConfigureOfficiallySupported
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -1143,7 +1138,7 @@ function waConfigureDetectedApps() {
|
|||||||
EXE_FILENAME_NOEXT="${EXE_FILENAME%.*}"
|
EXE_FILENAME_NOEXT="${EXE_FILENAME%.*}"
|
||||||
|
|
||||||
# Check if the executable was previously configured as part of setting up officially supported applications.
|
# Check if the executable was previously configured as part of setting up officially supported applications.
|
||||||
if [[ ! " ${INSTALLED_EXES[*]} " == *" ${EXE_FILENAME_LOWERCASE} "* ]]; then
|
if [[ " ${INSTALLED_EXES[*]} " != *" ${EXE_FILENAME_LOWERCASE} "* ]]; then
|
||||||
# If not previously configured, add the application to the list of detected applications.
|
# If not previously configured, add the application to the list of detected applications.
|
||||||
APPS+=("${NAMES[$INDEX]} (${EXE_FILENAME_NOEXT})")
|
APPS+=("${NAMES[$INDEX]} (${EXE_FILENAME_NOEXT})")
|
||||||
fi
|
fi
|
||||||
@@ -1165,9 +1160,9 @@ function waConfigureDetectedApps() {
|
|||||||
inqMenu "How would you like to handle other detected applications?" OPTIONS APP_INSTALL
|
inqMenu "How would you like to handle other detected applications?" OPTIONS APP_INSTALL
|
||||||
|
|
||||||
# Store selected detected applications.
|
# Store selected detected applications.
|
||||||
if [[ "$APP_INSTALL" == "Select which applications to set up" ]]; then
|
if [[ $APP_INSTALL == "Select which applications to set up" ]]; then
|
||||||
inqChkBx "Which other applications would you like to set up?" APPS SELECTED_APPS
|
inqChkBx "Which other applications would you like to set up?" APPS SELECTED_APPS
|
||||||
elif [[ "$APP_INSTALL" == "Set up all detected applications" ]]; then
|
elif [[ $APP_INSTALL == "Set up all detected applications" ]]; then
|
||||||
readarray -t SELECTED_APPS <<<"${APPS[@]}"
|
readarray -t SELECTED_APPS <<<"${APPS[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1184,7 +1179,7 @@ function waConfigureDetectedApps() {
|
|||||||
# Loop through all detected applications to find the detected application being processed.
|
# Loop through all detected applications to find the detected application being processed.
|
||||||
for INDEX in "${!NAMES[@]}"; do
|
for INDEX in "${!NAMES[@]}"; do
|
||||||
# Check for a matching detected application entry.
|
# Check for a matching detected application entry.
|
||||||
if [[ "${NAMES[$INDEX]}" == "$PROGRAM_NAME" ]] && [[ "${EXES[$INDEX]}" == *"\\$EXE_FILENAME_NOEXT"* ]]; then
|
if [[ ${NAMES[$INDEX]} == "$PROGRAM_NAME" ]] && [[ ${EXES[$INDEX]} == *"\\$EXE_FILENAME_NOEXT"* ]]; then
|
||||||
# Print feedback.
|
# Print feedback.
|
||||||
echo -n "Creating an application entry for ${PROGRAM_NAME}... "
|
echo -n "Creating an application entry for ${PROGRAM_NAME}... "
|
||||||
|
|
||||||
@@ -1237,14 +1232,14 @@ function waInstall() {
|
|||||||
waCheckDependencies
|
waCheckDependencies
|
||||||
|
|
||||||
# Update $MULTI_FLAG.
|
# Update $MULTI_FLAG.
|
||||||
if [[ "$MULTIMON" == "true" ]]; then
|
if [[ $MULTIMON == "true" ]]; then
|
||||||
MULTI_FLAG="/multimon"
|
MULTI_FLAG="/multimon"
|
||||||
else
|
else
|
||||||
MULTI_FLAG="+span"
|
MULTI_FLAG="+span"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Append additional FreeRDP flags if required.
|
# Append additional FreeRDP flags if required.
|
||||||
if [[ -n "$RDP_FLAGS" ]]; then
|
if [[ -n $RDP_FLAGS ]]; then
|
||||||
FREERDP_COMMAND="${FREERDP_COMMAND} ${RDP_FLAGS}"
|
FREERDP_COMMAND="${FREERDP_COMMAND} ${RDP_FLAGS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user