2 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
27da810f34 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-06-05 07:23:52 +00:00
Oskar Manhart
8ecb806b97 doc: use openbsd-netcat on arch
Closes #508
2025-06-05 09:21:55 +02:00
4 changed files with 10 additions and 79 deletions

View File

@@ -17,7 +17,6 @@ WinApps works by:
- The GNU/Linux `/home` directory is accessible within Windows via the `\\tsclient\home` mount. - The GNU/Linux `/home` directory is accessible within Windows via the `\\tsclient\home` mount.
- Integration with `Nautilus`, allowing you to right-click files to open them with specific Windows applications based on the file MIME type. - Integration with `Nautilus`, allowing you to right-click files to open them with specific Windows applications based on the file MIME type.
- The [official taskbar widget](https://github.com/winapps-org/WinApps-Launcher) enables seamless administration of the Windows subsystem and offers an easy way to launch Windows applications. - The [official taskbar widget](https://github.com/winapps-org/WinApps-Launcher) enables seamless administration of the Windows subsystem and offers an easy way to launch Windows applications.
- Microsoft Office links (e.g. ms-word://) from the host system are automatically opened in the Windows subsystem. (Note: You may need to use an [User Agent switcher](https://github.com/ray-lothian/UserAgent-Switcher/) Browser Extension and set the User-Agent to Windows, as as the Office webapps typically hide the "Open in Desktop App" option for Linux users.)
## Supported Applications ## Supported Applications
**WinApps supports <u>*ALL*</u> Windows applications.** **WinApps supports <u>*ALL*</u> Windows applications.**
@@ -312,7 +311,7 @@ Install the required dependencies.
``` ```
- Arch Linux: - Arch Linux:
```bash ```bash
sudo pacman -Syu --needed -y curl dialog freerdp git iproute2 libnotify gnu-netcat sudo pacman -Syu --needed -y curl dialog freerdp git iproute2 libnotify openbsd-netcat
``` ```
- OpenSUSE: - OpenSUSE:
```bash ```bash
@@ -453,31 +452,6 @@ AUTOPAUSE_TIME="300"
# DEFAULT VALUE: '' (BLANK) # DEFAULT VALUE: '' (BLANK)
# VALID VALUES: The command required to run FreeRDPv3 on your system (e.g., 'xfreerdp', 'xfreerdp3', etc.). # VALID VALUES: The command required to run FreeRDPv3 on your system (e.g., 'xfreerdp', 'xfreerdp3', etc.).
FREERDP_COMMAND="" FREERDP_COMMAND=""
# [TIMEOUTS]
# NOTES:
# - These settings control various timeout durations within the WinApps setup.
# - Increasing the timeouts is only necessary if the corresponding errors occur.
# - Ensure you have followed all the Troubleshooting Tips in the error message first.
# PORT CHECK
# - The maximum time (in seconds) to wait when checking if the RDP port on Windows is open.
# - Corresponding error: "NETWORK CONFIGURATION ERROR" (exit status 13).
# DEFAULT VALUE: '5'
PORT_TIMEOUT="5"
# RDP CONNECTION TEST
# - The maximum time (in seconds) to wait when testing the initial RDP connection to Windows.
# - Corresponding error: "REMOTE DESKTOP PROTOCOL FAILURE" (exit status 14).
# DEFAULT VALUE: '30'
RDP_TIMEOUT="30"
# APPLICATION SCAN
# - The maximum time (in seconds) to wait for the script that scans for installed applications on Windows to complete.
# - Corresponding error: "APPLICATION QUERY FAILURE" (exit status 15).
# DEFAULT VALUE: '60'
APP_SCAN_TIMEOUT="60"
``` ```
> [!IMPORTANT] > [!IMPORTANT]

View File

@@ -1,9 +0,0 @@
[Desktop Entry]
Name=Microsoft Office Protocol Handler
Comment=Handle Microsoft Office URI schemes via WinApps
Exec=winapps manual %u
Terminal=false
Type=Application
MimeType=x-scheme-handler/ms-word;x-scheme-handler/ms-excel;x-scheme-handler/ms-powerpoint;x-scheme-handler/ms-outlook;x-scheme-handler/ms-access;x-scheme-handler/ms-visio;x-scheme-handler/ms-project;x-scheme-handler/ms-teams;x-scheme-handler/ms-whiteboard;x-scheme-handler/ms-officeapp;
NoDisplay=true
Categories=Office;Utility;

View File

@@ -11,12 +11,12 @@
... ...
}: }:
let let
rev = "e2e9fd9b7b66bd1432c2a7186017da5c281d5b9e"; rev = "885d02079a36aa9696de46440c5b29b95278f904";
hash = "sha256-N6ArgdiJyhWNALqpRxLR6RDDMsiqEf2RxWLQ2z7T23Y="; hash = "sha256-hkD1siuwlRNOnXpDETZEQlIb/j91hkCspAUl/m5BB6g=";
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "winapps"; pname = "winapps";
version = "0-unstable-2025-06-10"; version = "0-unstable-2025-05-26";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "winapps-org"; owner = "winapps-org";

View File

@@ -96,9 +96,6 @@ MULTIMON="false" # Imported variable.
DEBUG="true" # Imported variable. DEBUG="true" # Imported variable.
FREERDP_COMMAND="" # Imported variable. FREERDP_COMMAND="" # Imported variable.
MULTI_FLAG="" # Set based on value of $MULTIMON. MULTI_FLAG="" # Set based on value of $MULTIMON.
PORT_TIMEOUT=5 # Default port check timeout.
RDP_TIMEOUT=30 # Default RDP connection test timeout.
APP_SCAN_TIMEOUT=60 # Default application scan timeout.
# PERMISSIONS AND DIRECTORIES # PERMISSIONS AND DIRECTORIES
SUDO="" # Set to "sudo" if the user specifies '--system', or "" if the user specifies '--user'. SUDO="" # Set to "sudo" if the user specifies '--system', or "" if the user specifies '--user'.
@@ -991,7 +988,7 @@ function waCheckPortOpen() {
fi fi
# Check for an open RDP port. # Check for an open RDP port.
if ! timeout "$PORT_TIMEOUT" nc -z "$RDP_IP" "$RDP_PORT" &>/dev/null; then if ! timeout 5 nc -z "$RDP_IP" "$RDP_PORT" &>/dev/null; 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"
@@ -1004,7 +1001,6 @@ function waCheckPortOpen() {
# Display the suggested action(s). # Display the suggested action(s).
echo "--------------------------------------------------------------------------------" echo "--------------------------------------------------------------------------------"
echo "Please ensure Remote Desktop is configured on Windows as per the WinApps README." echo "Please ensure Remote Desktop is configured on Windows as per the WinApps README."
echo -e "Then you can try increasing the ${COMMAND_TEXT}PORT_TIMEOUT${CLEAR_TEXT} in ${COMMAND_TEXT}${CONFIG_PATH}${CLEAR_TEXT}."
echo "--------------------------------------------------------------------------------" echo "--------------------------------------------------------------------------------"
# Terminate the script. # Terminate the script.
@@ -1059,8 +1055,8 @@ function waCheckRDPAccess() {
# Initialise the time counter. # Initialise the time counter.
ELAPSED_TIME=0 ELAPSED_TIME=0
# Wait a maximum of $RDP_TIMEOUT seconds for the background process to complete. # Wait a maximum of 30 seconds for the background process to complete.
while [ "$ELAPSED_TIME" -lt "$RDP_TIMEOUT" ]; do while [ "$ELAPSED_TIME" -lt 30 ]; do
# Check if the FreeRDP process is complete or if the test file exists. # Check if the FreeRDP process is complete or if the test file exists.
if ! ps -p "$FREERDP_PROC" &>/dev/null || [ -f "$TEST_PATH" ]; then if ! ps -p "$FREERDP_PROC" &>/dev/null || [ -f "$TEST_PATH" ]; then
break break
@@ -1095,7 +1091,6 @@ function waCheckRDPAccess() {
echo " - Ensure the user is logged out of Windows prior to initiating the WinApps installation." echo " - Ensure the user is logged out of Windows prior to initiating the WinApps installation."
echo " - Ensure the credentials within the WinApps configuration file are correct." echo " - Ensure the credentials within the WinApps configuration file are correct."
echo -e " - Utilise a new certificate by removing relevant certificate(s) in ${COMMAND_TEXT}${HOME}/.config/freerdp/server${CLEAR_TEXT}." echo -e " - Utilise a new certificate by removing relevant certificate(s) in ${COMMAND_TEXT}${HOME}/.config/freerdp/server${CLEAR_TEXT}."
echo -e " - Try increasing the ${COMMAND_TEXT}RDP_TIMEOUT${CLEAR_TEXT} in ${COMMAND_TEXT}${CONFIG_PATH}${CLEAR_TEXT}."
echo " - If using 'libvirt', ensure the Windows VM is correctly named as specified within the README." echo " - If using 'libvirt', ensure the Windows VM is correctly named as specified within the README."
echo " - If using 'libvirt', ensure 'Remote Desktop' is enabled within the Windows VM." echo " - If using 'libvirt', ensure 'Remote Desktop' is enabled within the Windows VM."
echo " - If using 'libvirt', ensure you have merged 'RDPApps.reg' into the Windows VM's registry." echo " - If using 'libvirt', ensure you have merged 'RDPApps.reg' into the Windows VM's registry."
@@ -1142,10 +1137,6 @@ function waFindInstalled() {
# Extract the name of the application from the absolute path of the folder. # Extract the name of the application from the absolute path of the folder.
APPLICATION="$(basename "$APPLICATION")" APPLICATION="$(basename "$APPLICATION")"
if [[ "$APPLICATION" == "ms-office-protocol-handler.desktop" ]]; then
continue
fi
# Source 'Info' File Containing: # Source 'Info' File Containing:
# - The Application Name (FULL_NAME) # - The Application Name (FULL_NAME)
# - The Shortcut Name (NAME) # - The Shortcut Name (NAME)
@@ -1193,8 +1184,8 @@ function waFindInstalled() {
# Initialise the time counter. # Initialise the time counter.
ELAPSED_TIME=0 ELAPSED_TIME=0
# Wait a maximum of $APP_SCAN_TIMEOUT seconds for the batch script to finish running. # Wait a maximum of 60 seconds for the batch script to finish running.
while [ $ELAPSED_TIME -lt "$APP_SCAN_TIMEOUT" ]; do while [ $ELAPSED_TIME -lt 60 ]; do
# Check if the FreeRDP process is complete or if the 'installed' file exists. # Check if the FreeRDP process is complete or if the 'installed' file exists.
if ! ps -p "$FREERDP_PROC" &>/dev/null || [ -f "$INST_FILE_PATH" ]; then if ! ps -p "$FREERDP_PROC" &>/dev/null || [ -f "$INST_FILE_PATH" ]; then
break break
@@ -1225,7 +1216,6 @@ function waFindInstalled() {
# Display the suggested action(s). # Display the suggested action(s).
echo "--------------------------------------------------------------------------------" echo "--------------------------------------------------------------------------------"
echo -e "Please view the log at ${COMMAND_TEXT}${FREERDP_LOG}${CLEAR_TEXT}." echo -e "Please view the log at ${COMMAND_TEXT}${FREERDP_LOG}${CLEAR_TEXT}."
echo -e "You can try increasing the ${COMMAND_TEXT}APP_SCAN_TIMEOUT${CLEAR_TEXT} in ${COMMAND_TEXT}${CONFIG_PATH}${CLEAR_TEXT}."
echo "--------------------------------------------------------------------------------" echo "--------------------------------------------------------------------------------"
# Terminate the script. # Terminate the script.
@@ -1330,9 +1320,9 @@ MimeType=${MIME_TYPES}"
function waConfigureOfficiallySupported() { function waConfigureOfficiallySupported() {
# Declare variables. # Declare variables.
local OSA_LIST=() # Stores a list of all officially supported applications installed on Windows. local OSA_LIST=() # Stores a list of all officially supported applications installed on Windows.
local OFFICE_APPS=("access" "access-o365" "access-o365-x86" "access-x86" "adobe-cc" "acrobat9" "acrobat-x-pro" "aftereffects-cc" "audition-cc" "bridge-cc" "bridge-cc-x86" "bridge-cs6" "bridge-cs6-x86" "cmd" "dymo-connect" "excel" "excel-o365" "excel-o365-x86" "excel-x86" "excel-x86-2010" "explorer" "iexplorer" "illustrator-cc" "lightroom-cc" "linqpad8" "mirc" "mspaint" "onenote" "onenote-o365" "onenote-o365-x86" "onenote-x86" "outlook" "outlook-o365" "outlook-o365-x86" "powerpoint" "powerpoint-o365" "powerpoint-o365-x86" "powerpoint-x86" "publisher" "publisher-o365" "publisher-o365-x86" "publisher-x86" "project" "project-x86" "remarkable-desktop" "ssms20" "visual-studio-comm" "visual-studio-ent" "visual-studio-pro" "visio" "visio-x86" "word" "word-o365" "word-o365-x86" "word-x86" "word-x86-2010")
# Read the list of officially supported applications that are installed on Windows into an array, returning an empty array if no such files exist. # Read the list of officially supported applications that are installed on Windows into an array, returning an empty array if no such files exist.
# This will remove leading and trailing whitespace characters as well as ignore empty lines.
readarray -t OSA_LIST < <(grep -v '^[[:space:]]*$' "$INST_FILE_PATH" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' 2>/dev/null || true) readarray -t OSA_LIST < <(grep -v '^[[:space:]]*$' "$INST_FILE_PATH" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' 2>/dev/null || true)
# Create application entries for each officially supported application. # Create application entries for each officially supported application.
@@ -1346,19 +1336,6 @@ function waConfigureOfficiallySupported() {
# Configure the application. # Configure the application.
waConfigureApp "$OSA" svg waConfigureApp "$OSA" svg
# Check if the application is an Office app and copy the protocol handler.
if [[ " ${OFFICE_APPS[*]} " == *" $OSA "* ]]; then
# Determine the target directory based on whether the installation is for the system or user.
if [[ "$OPT_SYSTEM" -eq 1 ]]; then
TARGET_DIR="$SYS_APP_PATH"
else
TARGET_DIR="$USER_APP_PATH"
fi
# Copy the protocol handler to the appropriate directory.
$SUDO cp "./apps/ms-office-protocol-handler.desktop" "$TARGET_DIR/ms-office-protocol-handler.desktop"
fi
# Print feedback. # Print feedback.
echo -e "${DONE_TEXT}Done!${CLEAR_TEXT}" echo -e "${DONE_TEXT}Done!${CLEAR_TEXT}"
done done
@@ -1690,21 +1667,10 @@ function waEnsureOnPath() {
# Name: 'waUninstall' # Name: 'waUninstall'
# Role: Uninstalls WinApps. # Role: Uninstalls WinApps.
function waUninstall() { function waUninstall() {
# Print feedback. # Print feedback.
[ "$OPT_SYSTEM" -eq 1 ] && echo -e "${BOLD_TEXT}REMOVING SYSTEM INSTALLATION.${CLEAR_TEXT}" [ "$OPT_SYSTEM" -eq 1 ] && echo -e "${BOLD_TEXT}REMOVING SYSTEM INSTALLATION.${CLEAR_TEXT}"
[ "$OPT_USER" -eq 1 ] && echo -e "${BOLD_TEXT}REMOVING USER INSTALLATION.${CLEAR_TEXT}" [ "$OPT_USER" -eq 1 ] && echo -e "${BOLD_TEXT}REMOVING USER INSTALLATION.${CLEAR_TEXT}"
# Determine the target directory for the protocol handler based on the installation type.
if [[ "$OPT_SYSTEM" -eq 1 ]]; then
TARGET_DIR="$SYS_APP_PATH"
else
TARGET_DIR="$USER_APP_PATH"
fi
# Remove the 'ms-office-protocol-handler.desktop' file if it exists.
$SUDO rm -f "$TARGET_DIR/ms-office-protocol-handler.desktop"
# Declare variables. # Declare variables.
local WINAPPS_DESKTOP_FILES=() # Stores a list of '.desktop' file paths. local WINAPPS_DESKTOP_FILES=() # Stores a list of '.desktop' file paths.
local WINAPPS_APP_BASH_SCRIPTS=() # Stores a list of bash script paths. local WINAPPS_APP_BASH_SCRIPTS=() # Stores a list of bash script paths.