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 60 additions and 45 deletions

View File

@@ -311,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
@@ -403,9 +403,18 @@ REMOVABLE_MEDIA="/run/media"
# [ADDITIONAL FREERDP FLAGS & ARGUMENTS] # [ADDITIONAL FREERDP FLAGS & ARGUMENTS]
# NOTES: # NOTES:
# - You can try adding /network:lan to these flags in order to increase performance, however, some users have faced issues with this. # - You can try adding /network:lan to these flags in order to increase performance, however, some users have faced issues with this.
# DEFAULT VALUE: '/cert:tofu /sound /microphone +home-drive' # DEFAULT VALUE: '/cert:tofu /sound /microphone'
# VALID VALUES: See https://github.com/awakecoding/FreeRDP-Manuals/blob/master/User/FreeRDP-User-Manual.markdown # VALID VALUES: See https://github.com/awakecoding/FreeRDP-Manuals/blob/master/User/FreeRDP-User-Manual.markdown
RDP_FLAGS="/cert:tofu /sound /microphone +home-drive" RDP_FLAGS="/cert:tofu /sound /microphone"
# [MULTIPLE MONITORS]
# NOTES:
# - If enabled, a FreeRDP bug *might* produce a black screen.
# DEFAULT VALUE: 'false'
# VALID VALUES:
# - 'true'
# - 'false'
MULTIMON="false"
# [DEBUG WINAPPS] # [DEBUG WINAPPS]
# NOTES: # NOTES:
@@ -443,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]
@@ -482,7 +466,7 @@ APP_SCAN_TIMEOUT="60"
- For domain users, you can uncomment and change `RDP_DOMAIN`. - For domain users, you can uncomment and change `RDP_DOMAIN`.
- On high-resolution (UHD) displays, you can set `RDP_SCALE` to the scale you would like to use (100, 140 or 180). - On high-resolution (UHD) displays, you can set `RDP_SCALE` to the scale you would like to use (100, 140 or 180).
- To add additional flags to the FreeRDP call (e.g. `/prevent-session-lock 120`), uncomment and use the `RDP_FLAGS` configuration option. - To add additional flags to the FreeRDP call (e.g. `/prevent-session-lock 120`), uncomment and use the `RDP_FLAGS` configuration option.
- For multi-monitor setups, you can try adding `/multimon` to `RDP_FLAGS`. A FreeRDP bug may result in a black screen however, in which case you should revert this change. - For multi-monitor setups, you can try enabling `MULTIMON`. A FreeRDP bug may result in a black screen however, in which case you should revert this change.
- If you enable `DEBUG`, a log will be created on each application start in `~/.local/share/winapps/winapps.log`. - If you enable `DEBUG`, a log will be created on each application start in `~/.local/share/winapps/winapps.log`.
- If using a system on which the FreeRDP command is not `xfreerdp` or `xfreerdp3`, the correct command can be specified using `FREERDP_COMMAND`. - If using a system on which the FreeRDP command is not `xfreerdp` or `xfreerdp3`, the correct command can be specified using `FREERDP_COMMAND`.

View File

@@ -49,7 +49,9 @@ REMOVABLE_MEDIA=""
RDP_SCALE=100 RDP_SCALE=100
AUTOPAUSE="off" AUTOPAUSE="off"
AUTOPAUSE_TIME="300" AUTOPAUSE_TIME="300"
MULTIMON="false"
DEBUG="true" DEBUG="true"
MULTI_FLAG=""
# OTHER # OTHER
FREERDP_PID=-1 FREERDP_PID=-1
@@ -210,6 +212,9 @@ function waLoadConfig() {
waThrowExit $EC_MISSING_CONFIG waThrowExit $EC_MISSING_CONFIG
fi fi
# Update 'MULTI_FLAG' based on 'MULTIMON'.
MULTI_FLAG=$([[ $MULTIMON == "true" ]] && echo "/multimon" || echo "+span")
# Update $RDP_SCALE. # Update $RDP_SCALE.
waFixScale waFixScale
# Update when $REMOVABLE_MEDIA is null # Update when $REMOVABLE_MEDIA is null
@@ -516,8 +521,11 @@ function waRunCommand() {
/u:"$RDP_USER" \ /u:"$RDP_USER" \
/p:"$RDP_PASS" \ /p:"$RDP_PASS" \
/scale:"$RDP_SCALE" \ /scale:"$RDP_SCALE" \
+auto-reconnect \
+dynamic-resolution \ +dynamic-resolution \
+auto-reconnect \
+home-drive \
+clipboard \
-wallpaper \
/wm-class:"Microsoft Windows" \ /wm-class:"Microsoft Windows" \
/t:"Windows RDP Session [$RDP_IP]" \ /t:"Windows RDP Session [$RDP_IP]" \
/v:"$RDP_IP" &>/dev/null & /v:"$RDP_IP" &>/dev/null &
@@ -532,7 +540,12 @@ function waRunCommand() {
/u:"$RDP_USER" \ /u:"$RDP_USER" \
/p:"$RDP_PASS" \ /p:"$RDP_PASS" \
/scale:"$RDP_SCALE" \ /scale:"$RDP_SCALE" \
+dynamic-resolution \
+auto-reconnect \ +auto-reconnect \
+home-drive \
+clipboard \
-wallpaper \
"$MULTI_FLAG" \
/app:program:"$2" \ /app:program:"$2" \
/v:"$RDP_IP" &>/dev/null & /v:"$RDP_IP" &>/dev/null &
@@ -564,7 +577,12 @@ function waRunCommand() {
/u:"$RDP_USER" \ /u:"$RDP_USER" \
/p:"$RDP_PASS" \ /p:"$RDP_PASS" \
/scale:"$RDP_SCALE" \ /scale:"$RDP_SCALE" \
+dynamic-resolution \
+auto-reconnect \ +auto-reconnect \
+home-drive \
+clipboard \
-wallpaper \
"$MULTI_FLAG" \
/wm-class:"$FULL_NAME" \ /wm-class:"$FULL_NAME" \
/app:program:"$WIN_EXECUTABLE",icon:"$ICON",name:"$FULL_NAME" \ /app:program:"$WIN_EXECUTABLE",icon:"$ICON",name:"$FULL_NAME" \
/v:"$RDP_IP" &>/dev/null & /v:"$RDP_IP" &>/dev/null &
@@ -585,8 +603,13 @@ function waRunCommand() {
/u:"$RDP_USER" \ /u:"$RDP_USER" \
/p:"$RDP_PASS" \ /p:"$RDP_PASS" \
/scale:"$RDP_SCALE" \ /scale:"$RDP_SCALE" \
+dynamic-resolution \
+auto-reconnect \ +auto-reconnect \
+home-drive \
+clipboard \
/drive:media,"$REMOVABLE_MEDIA" \ /drive:media,"$REMOVABLE_MEDIA" \
-wallpaper \
"$MULTI_FLAG" \
/wm-class:"$FULL_NAME" \ /wm-class:"$FULL_NAME" \
/app:program:"$WIN_EXECUTABLE",icon:"$ICON",name:$"FULL_NAME",cmd:\""$FILE_PATH"\" \ /app:program:"$WIN_EXECUTABLE",icon:"$ICON",name:$"FULL_NAME",cmd:\""$FILE_PATH"\" \
/v:"$RDP_IP" &>/dev/null & /v:"$RDP_IP" &>/dev/null &

View File

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

View File

@@ -92,12 +92,10 @@ VM_NAME="RDPWindows" # Name of the Windows VM (FOR 'libvirt' ONLY).
WAFLAVOR="docker" # Imported variable. WAFLAVOR="docker" # Imported variable.
RDP_SCALE=100 # Imported variable. RDP_SCALE=100 # Imported variable.
RDP_FLAGS="" # Imported variable. RDP_FLAGS="" # Imported variable.
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.
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'.
@@ -990,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"
@@ -1003,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.
@@ -1046,6 +1043,9 @@ function waCheckRDPAccess() {
/p:"$RDP_PASS" \ /p:"$RDP_PASS" \
/scale:"$RDP_SCALE" \ /scale:"$RDP_SCALE" \
+auto-reconnect \ +auto-reconnect \
+home-drive \
-wallpaper \
+dynamic-resolution \
/app:program:"C:\Windows\System32\cmd.exe",cmd:"/C type NUL > $TEST_PATH_WIN && tsdiscon" \ /app:program:"C:\Windows\System32\cmd.exe",cmd:"/C type NUL > $TEST_PATH_WIN && tsdiscon" \
/v:"$RDP_IP" &>"$FREERDP_LOG" & /v:"$RDP_IP" &>"$FREERDP_LOG" &
@@ -1055,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
@@ -1091,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."
@@ -1173,6 +1172,9 @@ function waFindInstalled() {
/p:"$RDP_PASS" \ /p:"$RDP_PASS" \
/scale:"$RDP_SCALE" \ /scale:"$RDP_SCALE" \
+auto-reconnect \ +auto-reconnect \
+home-drive \
-wallpaper \
+dynamic-resolution \
/app:program:"C:\Windows\System32\cmd.exe",cmd:"/C "$BATCH_SCRIPT_PATH_WIN"" \ /app:program:"C:\Windows\System32\cmd.exe",cmd:"/C "$BATCH_SCRIPT_PATH_WIN"" \
/v:"$RDP_IP" &>"$FREERDP_LOG" & /v:"$RDP_IP" &>"$FREERDP_LOG" &
@@ -1182,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
@@ -1214,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.
@@ -1557,6 +1558,13 @@ function waInstall() {
# Check for missing dependencies. # Check for missing dependencies.
waCheckInstallDependencies waCheckInstallDependencies
# Update $MULTI_FLAG.
if [[ $MULTIMON == "true" ]]; then
MULTI_FLAG="/multimon"
else
MULTI_FLAG="+span"
fi
# Update $RDP_SCALE. # Update $RDP_SCALE.
waFixScale waFixScale