3 Commits

Author SHA1 Message Date
Michel Memeteau
c4a41b8c07 Merge branch 'main' into legacy-installer 2025-07-10 10:39:59 +02:00
Michel Memeteau
4d189b7164 Initial Winapps.conf 2025-06-23 16:37:47 +02:00
Michel Memeteau
708a521340 increase VM perf defaults 2025-06-23 13:29:08 +02:00
18 changed files with 259 additions and 246 deletions

40
.github/workflows/update-nix.yaml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: "Update Flake Packages"
permissions:
contents: write
pull-requests: write
on:
pull_request:
branches: [main]
types: [labeled]
schedule:
- cron: "0 10 * * 0" # https://crontab.guru/#0_10_*_*_0
jobs:
build:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'rebuild nix')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
trust-runner-user: true
- name: Set up cache
uses: cachix/cachix-action@v15
with:
name: winapps
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Update flake packages
uses: winapps-org/nix-update-action@v1.4.0
with:
extra-args: --version=branch
skip-pr: "${{ github.event_name == 'pull_request' }}"
- name: Build packages
run: nix build .#winapps .#winapps-launcher

5
.gitignore vendored
View File

@@ -1,5 +0,0 @@
/.idea
/.vscode
/result
.DS_Store
**/.DS_Store

View File

@@ -8,7 +8,7 @@ Due to lack of a license, it is All Rights Reserved by the original author.
We have tried contacting Fmstrat about this, but they abandoned the project and did not reply nor apply an open-source license to the project. We have tried contacting Fmstrat about this, but they abandoned the project and did not reply nor apply an open-source license to the project.
However, almost all parts of the codebase have been rewritten and all new contributions require a Contributor License Agreement ([for individuals](https://gist.github.com/oskardotglobal/35f0a72eb45fcc7087e535561383dbc5), [for legal entities](https://gist.github.com/oskardotglobal/75a8cc056e56a439fa6a1551129ae47f)) to be signed. Therefore, the below license is applied to all new contributions made to the project. However, almost all parts of the codebase have been rewritten and all new contributions require a Contributor License Agreement ([for individuals](https://gist.github.com/oskardotglobal/35f0a72eb45fcc7087e535561383dbc5), [for legal entities](https://gist.github.com/oskardotglobal/75a8cc056e56a439fa6a1551129ae47f)) to be signed. Therefore, the below license is applied to all new contributions made to the project.
Refer to a specific file for its respective license. Refer to a specific file for it's respective license.
# GNU AFFERO GENERAL PUBLIC LICENSE # GNU AFFERO GENERAL PUBLIC LICENSE

View File

@@ -17,7 +17,7 @@ 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 a [User Agent Switcher](https://github.com/ray-lothian/UserAgent-Switcher/) browser extension and set the User-Agent to Windows, as the Office webapps typically hide the "Open in Desktop App" option for Linux users.) - 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.**
@@ -398,7 +398,7 @@ RDP_SCALE="100"
# This improves compatibility with most desktop environments (DEs). # This improves compatibility with most desktop environments (DEs).
# ATTENTION: The Filesystem Hierarchy Standard (FHS) recommends /media instead. Verify your system's configuration. # ATTENTION: The Filesystem Hierarchy Standard (FHS) recommends /media instead. Verify your system's configuration.
# - To manually mount devices, you may optionally use /mnt. # - To manually mount devices, you may optionally use /mnt.
# REFERENCE: https://wiki.archlinux.org/title/Udisks#Mount_to_/media # REFERRENCE: https://wiki.archlinux.org/title/Udisks#Mount_to_/media
REMOVABLE_MEDIA="/run/media" REMOVABLE_MEDIA="/run/media"
# [ADDITIONAL FREERDP FLAGS & ARGUMENTS] # [ADDITIONAL FREERDP FLAGS & ARGUMENTS]
@@ -469,19 +469,8 @@ RDP_TIMEOUT="30"
# DEFAULT VALUE: '60' # DEFAULT VALUE: '60'
APP_SCAN_TIMEOUT="60" APP_SCAN_TIMEOUT="60"
# WINDOWS BOOT
# - The maximum time (in seconds) to wait for the Windows VM to boot if it is not running, before attempting to launch an application.
# DEFAULT VALUE: '120'
BOOT_TIMEOUT="120"
``` ```
> [!IMPORTANT]
> To safeguard your Windows password, ensure `~/.config/winapps/winapps.conf` is accessible only by your user account.
> ```bash
> chown $(whoami):$(whoami) ~/.config/winapps/winapps.conf
> chmod 600 ~/.config/winapps/winapps.conf
> ```
> [!IMPORTANT] > [!IMPORTANT]
> `RDP_USER` and `RDP_PASS` must correspond to a complete Windows user account and password, such as those created during Windows setup or for a domain user. User/PIN combinations are not valid for RDP access. > `RDP_USER` and `RDP_PASS` must correspond to a complete Windows user account and password, such as those created during Windows setup or for a domain user. User/PIN combinations are not valid for RDP access.
@@ -495,7 +484,6 @@ BOOT_TIMEOUT="120"
- 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 adding `/multimon` to `RDP_FLAGS`. A FreeRDP bug may result in a black screen however, in which case you should revert this change.
- To enable non-English input and seamless language switching, you can try adding `/kbd:unicode` to `RDP_FLAGS`. This ensures client inputs are sent as Unicode sequences.
- 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`.
@@ -601,6 +589,10 @@ First, make sure Flakes and the `nix` command are enabled.
In your `~/.config/nix/nix.conf`: In your `~/.config/nix/nix.conf`:
``` ```
experimental-features = nix-command flakes experimental-features = nix-command flakes
# specify to use binary cache (optional)
extra-substituters = https://winapps.cachix.org/
extra-trusted-public-keys = winapps.cachix.org-1:HI82jWrXZsQRar/PChgIx1unmuEsiQMQq+zt05CD36g=
extra-trusted-users = <your-username> # replace with your username
``` ```
```bash ```bash
@@ -647,6 +639,12 @@ nix profile install github:winapps-org/winapps#winapps-launcher # optional
... ...
}: }:
{ {
# set up binary cache (optional)
nix.settings = {
substituters = [ "https://winapps.cachix.org/" ];
trusted-public-keys = [ "winapps.cachix.org-1:HI82jWrXZsQRar/PChgIx1unmuEsiQMQq+zt05CD36g=" ];
};
environment.systemPackages = [ environment.systemPackages = [
winapps.packages."${system}".winapps winapps.packages."${system}".winapps
winapps.packages."${system}".winapps-launcher # optional winapps.packages."${system}".winapps-launcher # optional

View File

@@ -50,11 +50,9 @@ RDP_SCALE=100
AUTOPAUSE="off" AUTOPAUSE="off"
AUTOPAUSE_TIME="300" AUTOPAUSE_TIME="300"
DEBUG="true" DEBUG="true"
BOOT_TIMEOUT=120
# OTHER # OTHER
FREERDP_PID=-1 FREERDP_PID=-1
NEEDED_BOOT=false
### TRAPS ### ### TRAPS ###
# Catch SIGINT (CTRL+C) to call 'waCleanUp'. # Catch SIGINT (CTRL+C) to call 'waCleanUp'.
@@ -107,15 +105,15 @@ Please run:
notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Windows failed to resume." notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Windows failed to resume."
;; ;;
"$EC_FAIL_DESTROY") "$EC_FAIL_DESTROY")
dprint "ERROR: FAILED TO FORCE STOP WINDOWS. EXITING." dprint "ERROR: WINDOWS FAILED TO IMMEDIATELY UNGRACEFULLY SHUT DOWN WINDOWS. EXITING."
notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Failed to forcibly stop Windows." notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Failed to ungracefully shut down Windows."
;; ;;
"$EC_SD_TIMEOUT") "$EC_SD_TIMEOUT")
dprint "ERROR: WINDOWS TOOK TOO LONG TO SHUT DOWN. EXITING." dprint "ERROR: WINDOWS TOOK TOO LONG TO SHUT DOWN. EXITING."
notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Windows took too long to shut down." notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Windows took too long to shut down."
;; ;;
"$EC_DIE_TIMEOUT") "$EC_DIE_TIMEOUT")
dprint "ERROR: WINDOWS TOOK TOO LONG TO DIE. EXITING." dprint "ERROR: WINDOWS TOOK TOO LONG TO SHUT DOWN. EXITING."
notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Windows took too long to die." notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Windows took too long to die."
;; ;;
"$EC_RESTART_TIMEOUT") "$EC_RESTART_TIMEOUT")
@@ -158,7 +156,7 @@ function dprint() {
[ "$DEBUG" = "true" ] && echo "[$(date)-$RUNID] $1" >>"$LOG_PATH" [ "$DEBUG" = "true" ] && echo "[$(date)-$RUNID] $1" >>"$LOG_PATH"
} }
# Name: 'waFixRemovableMedia' # Name: 'waFixRemovableMedia'
# Role: If REMOVABLE_MEDIA is empty, default to /run/media (udisks default) and show a warning. # Role: If user left REMOVABLE_MEDIA config null,fallback to /run/media for udisks defaults ,warning.
function waFixRemovableMedia() { function waFixRemovableMedia() {
if [ -z "$REMOVABLE_MEDIA" ]; then if [ -z "$REMOVABLE_MEDIA" ]; then
REMOVABLE_MEDIA="/run/media" # Default for udisks REMOVABLE_MEDIA="/run/media" # Default for udisks
@@ -301,10 +299,9 @@ function waGetFreeRDPCommand() {
function waCheckGroupMembership() { function waCheckGroupMembership() {
# Identify groups the current user belongs to. # Identify groups the current user belongs to.
# shellcheck disable=SC2155 # Silence warnings regarding masking return values through simultaneous declaration and assignment. # shellcheck disable=SC2155 # Silence warnings regarding masking return values through simultaneous declaration and assignment.
local USER_GROUPS=$(id -nG "$(whoami)") local USER_GROUPS=$(groups "$(whoami)")
if ! echo "$USER_GROUPS" | grep -qE '\b(libvirt|libvirtd)\b' || \ if ! (echo "$USER_GROUPS" | grep -q -E "\blibvirt\b") || ! (echo "$USER_GROUPS" | grep -q -E "\bkvm\b"); then
! echo "$USER_GROUPS" | grep -qE '\bkvm\b'; then
waThrowExit "$EC_NOT_IN_GROUP" waThrowExit "$EC_NOT_IN_GROUP"
fi fi
} }
@@ -326,7 +323,6 @@ function waCheckVMRunning() {
if (virsh list --state-shutoff --name | xargs | grep -wq "$VM_NAME"); then if (virsh list --state-shutoff --name | xargs | grep -wq "$VM_NAME"); then
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS." dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows." notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
NEEDED_BOOT=true
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
if (virsh list --state-paused --name | xargs | grep -wq "$VM_NAME"); then if (virsh list --state-paused --name | xargs | grep -wq "$VM_NAME"); then
dprint "WINDOWS PAUSED. RESUMING WINDOWS." dprint "WINDOWS PAUSED. RESUMING WINDOWS."
@@ -348,7 +344,6 @@ function waCheckVMRunning() {
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS." dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows." notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
NEEDED_BOOT=true
break break
fi fi
sleep $TIME_INTERVAL sleep $TIME_INTERVAL
@@ -362,7 +357,6 @@ function waCheckVMRunning() {
dprint "WINDOWS DESTROYED. BOOTING WINDOWS." dprint "WINDOWS DESTROYED. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows." notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
NEEDED_BOOT=true
fi fi
elif (virsh domstate "$VM_NAME" | xargs | grep -wq "dying"); then elif (virsh domstate "$VM_NAME" | xargs | grep -wq "dying"); then
dprint "WINDOWS DYING. WAITING." dprint "WINDOWS DYING. WAITING."
@@ -378,7 +372,6 @@ function waCheckVMRunning() {
dprint "WINDOWS DESTROYED. BOOTING WINDOWS." dprint "WINDOWS DESTROYED. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows." notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
NEEDED_BOOT=true
fi fi
break break
elif (virsh list --state-shutoff --name | xargs | grep -wq "$VM_NAME"); then elif (virsh list --state-shutoff --name | xargs | grep -wq "$VM_NAME"); then
@@ -386,7 +379,6 @@ function waCheckVMRunning() {
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS." dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows." notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
NEEDED_BOOT=true
break break
fi fi
sleep $TIME_INTERVAL sleep $TIME_INTERVAL
@@ -403,45 +395,6 @@ function waCheckVMRunning() {
# Handle non-zero exit statuses. # Handle non-zero exit statuses.
[ "$EXIT_STATUS" -ne 0 ] && waThrowExit "$EXIT_STATUS" [ "$EXIT_STATUS" -ne 0 ] && waThrowExit "$EXIT_STATUS"
# Wait for VM to be fully ready
if [[ "$NEEDED_BOOT" == "true" ]]; then
dprint "WAITING FOR VM TO BE FULLY READY..."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Waiting for Windows to be ready..."
TIME_ELAPSED=0
while (( TIME_ELAPSED < BOOT_TIMEOUT )); do
# Check if VM is running
if (virsh list --state-running --name | xargs | grep -wq "$VM_NAME"); then
# Try to connect to RDP port to verify it's ready
if timeout 1 bash -c ">/dev/tcp/$RDP_IP/$RDP_PORT" 2>/dev/null; then
dprint "VM IS READY"
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Windows is ready."
# Add a delay after Windows is ready
if [ "$NEEDED_BOOT" = "true" ]; then
sleep 10
fi
break
fi
fi
sleep 5
TIME_ELAPSED=$((TIME_ELAPSED + 5))
# Show progress every 30 seconds
if (( TIME_ELAPSED % 30 == 0 )); then
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Still waiting for Windows to be ready... ($TIME_ELAPSED seconds elapsed)"
fi
done
# If we timed out waiting for the VM
if (( TIME_ELAPSED >= BOOT_TIMEOUT )); then
dprint "TIMEOUT WAITING FOR VM TO BE READY"
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Timeout waiting for Windows to be ready. Please try again."
waThrowExit $EC_FAIL_START
fi
fi
} }
# Name: 'waCheckContainerRunning' # Name: 'waCheckContainerRunning'
@@ -473,7 +426,6 @@ function waCheckContainerRunning() {
dprint "WINDOWS CREATED. BOOTING WINDOWS." dprint "WINDOWS CREATED. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows." notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
$COMPOSE_COMMAND --file "$COMPOSE_PATH" start &>/dev/null $COMPOSE_COMMAND --file "$COMPOSE_PATH" start &>/dev/null
NEEDED_BOOT=true
;; ;;
"restarting") "restarting")
dprint "WINDOWS RESTARTING. WAITING." dprint "WINDOWS RESTARTING. WAITING."
@@ -484,7 +436,6 @@ function waCheckContainerRunning() {
EXIT_STATUS=0 EXIT_STATUS=0
dprint "WINDOWS RESTARTED." dprint "WINDOWS RESTARTED."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Restarted Windows." notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Restarted Windows."
NEEDED_BOOT=true
break break
fi fi
sleep $TIME_INTERVAL sleep $TIME_INTERVAL
@@ -500,13 +451,11 @@ function waCheckContainerRunning() {
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS." dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows." notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
$COMPOSE_COMMAND --file "$COMPOSE_PATH" start &>/dev/null $COMPOSE_COMMAND --file "$COMPOSE_PATH" start &>/dev/null
NEEDED_BOOT=true
;; ;;
"dead") "dead")
dprint "WINDOWS DEAD. RECREATING WINDOWS CONTAINER." dprint "WINDOWS DEAD. RECREATING WINDOWS CONTAINER."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Re-creating and booting Windows." notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Re-creating and booting Windows."
$COMPOSE_COMMAND --file "$COMPOSE_PATH" down &>/dev/null && $COMPOSE_COMMAND --file "$COMPOSE_PATH" up -d &>/dev/null $COMPOSE_COMMAND --file "$COMPOSE_PATH" down &>/dev/null && $COMPOSE_COMMAND --file "$COMPOSE_PATH" up -d &>/dev/null
NEEDED_BOOT=true
;; ;;
"unknown") "unknown")
EXIT_STATUS=$EC_UNKNOWN EXIT_STATUS=$EC_UNKNOWN
@@ -515,45 +464,6 @@ function waCheckContainerRunning() {
# Handle non-zero exit statuses. # Handle non-zero exit statuses.
[ "$EXIT_STATUS" -ne 0 ] && waThrowExit "$EXIT_STATUS" [ "$EXIT_STATUS" -ne 0 ] && waThrowExit "$EXIT_STATUS"
# Wait for container to be fully ready
if [[ "$CONTAINER_STATE" == "created" || "$CONTAINER_STATE" == "exited" || "$CONTAINER_STATE" == "dead" || "$CONTAINER_STATE" == "restarting" ]]; then
dprint "WAITING FOR CONTAINER TO BE FULLY READY..."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Waiting for Windows to be ready..."
TIME_ELAPSED=0
while (( TIME_ELAPSED < BOOT_TIMEOUT )); do
# Check if container is running
if [[ $("$WAFLAVOR" inspect --format='{{.State.Status}}' "$CONTAINER_NAME") == "running" ]]; then
# Try to connect to RDP port to verify it's ready
if timeout 1 bash -c ">/dev/tcp/$RDP_IP/$RDP_PORT" 2>/dev/null; then
dprint "CONTAINER IS READY"
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Windows is ready."
# Add a delay after Windows is ready
if [ "$NEEDED_BOOT" = "true" ]; then
sleep 10
fi
break
fi
fi
sleep 5
TIME_ELAPSED=$((TIME_ELAPSED + 5))
# Show progress every 30 seconds
if (( TIME_ELAPSED % 30 == 0 )); then
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Still waiting for Windows to be ready... ($TIME_ELAPSED seconds elapsed)"
fi
done
# If we timed out waiting for the container
if (( TIME_ELAPSED >= BOOT_TIMEOUT )); then
dprint "TIMEOUT WAITING FOR CONTAINER TO BE READY"
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Timeout waiting for Windows to be ready. Please try again."
waThrowExit $EC_FAIL_START
fi
fi
} }
# Name: 'waCheckPortOpen' # Name: 'waCheckPortOpen'
@@ -678,7 +588,7 @@ function waRunCommand() {
+auto-reconnect \ +auto-reconnect \
/drive:media,"$REMOVABLE_MEDIA" \ /drive:media,"$REMOVABLE_MEDIA" \
/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 &
# Capture the process ID. # Capture the process ID.

View File

@@ -14,8 +14,8 @@ services:
# Version of Windows to configure. For valid options, visit: # Version of Windows to configure. For valid options, visit:
# https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-select-the-windows-version # https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-select-the-windows-version
# https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-install-a-custom-image # https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-install-a-custom-image
VERSION: "11" VERSION: "10"
RAM_SIZE: "4G" # RAM allocated to the Windows VM. RAM_SIZE: "8G" # RAM allocated to the Windows VM.
CPU_CORES: "4" # CPU cores allocated to the Windows VM. CPU_CORES: "4" # CPU cores allocated to the Windows VM.
DISK_SIZE: "64G" # Size of the primary hard disk. DISK_SIZE: "64G" # Size of the primary hard disk.
# DISK2_SIZE: "32G" # Uncomment to add an additional hard disk to the Windows VM. Ensure it is mounted as a volume below. # DISK2_SIZE: "32G" # Uncomment to add an additional hard disk to the Windows VM. Ensure it is mounted as a volume below.
@@ -44,6 +44,6 @@ services:
# NOTE: 'disk1' will be mounted as the main drive. THIS DISK WILL BE FORMATTED BY DOCKER. # NOTE: 'disk1' will be mounted as the main drive. THIS DISK WILL BE FORMATTED BY DOCKER.
# All following disks (disk2, ...) WILL NOT BE FORMATTED. # All following disks (disk2, ...) WILL NOT BE FORMATTED.
# - /dev/disk/by-id/<id>:/disk1 # - /dev/disk/by-id/<id>:/disk1
# - /dev/disk/by-id/<id>:/disk2 # - dev/disk/by-id/<id>:/disk2
# group_add: # uncomment this line and the next one for using rootless podman containers # group_add: # uncomment this line and the next one for using rootless podman containers
# - keep-groups # to make /dev/kvm work with podman. needs "crun" installed, "runc" will not work! Add your user to the 'kvm' group or another that can access /dev/kvm. # - keep-groups # to make /dev/kvm work with podman. needs "crun" installed, "runc" will not work! Add your user to the 'kvm' group or another that can access /dev/kvm.

View File

@@ -13,8 +13,8 @@ Although WinApps supports using `QEMU+KVM+libvirt` as a backend for running Wind
> [!IMPORTANT] > [!IMPORTANT]
> The iptables kernel module must be loaded for folder sharing with the host to work. > The iptables kernel module must be loaded for folder sharing with the host to work.
> Check that the output of `lsmod | grep ip_tables` and `lsmod | grep iptable_nat` is non-empty. > Check that the output of `lsmod | grep ip_tables` and `lsmod | grep iptable_nat` is non empty.
> If the output of one of the previous commands is empty, run `echo -e "ip_tables\niptable_nat" | sudo tee /etc/modules-load.d/iptables.conf` and reboot. > If the output of one of the previous command is empty, run `echo -e "ip_tables\niptable_nat" | sudo tee /etc/modules-load.d/iptables.conf` and reboot.
## `Docker` ## `Docker`
### Installation ### Installation

View File

@@ -46,8 +46,6 @@ Together, these components form a powerful and flexible virtualization stack, wi
sudo reboot # Reboot the system to ensure the user is added to the relevant groups. sudo reboot # Reboot the system to ensure the user is added to the relevant groups.
``` ```
Note: On NixOS, the group name for libvirt is `libvirtd` and not `libvirt`. In addition, user and group management on NixOS is handled through the Nix configuration files and not via traditional tools like `usermod`. Please see "Adding User to a group" on [this NixOS Wiki page](https://wiki.nixos.org/wiki/User_management).
Note: Due to a known bug in `rpm-ostree`, which affects various distributions such as Silverblue, Bazzite, Bluefin, Kinoite, Aurora, UCore, and others, the commands provided earlier may not properly add your user to all required groups. If the `groups $USER` command does not show your user as being part of the necessary groups, you'll need to manually add these groups to `/etc/group` if they are present in `/usr/lib/group`. Note: Due to a known bug in `rpm-ostree`, which affects various distributions such as Silverblue, Bazzite, Bluefin, Kinoite, Aurora, UCore, and others, the commands provided earlier may not properly add your user to all required groups. If the `groups $USER` command does not show your user as being part of the necessary groups, you'll need to manually add these groups to `/etc/group` if they are present in `/usr/lib/group`.
To resolve this: To resolve this:
@@ -195,7 +193,7 @@ Together, these components form a powerful and flexible virtualization stack, wi
Example 1: Example 1:
- CPU cores share the same singular L3 cache, so this cannot be optimised. - CPU cores share the same singular L3 cache, so this cannot be optimised.
- CPU cores utilise different L1 and L2 caches, so isolating corresponding thread pairs will help improve performance. - CPU cores utilise different L1 and L2 caches, so isolatng corresponding thread pairs will help improve performance.
- Thus, if limiting the virtual machine to a maximum of 4 threads, there are 10 possible optimal configurations: - Thus, if limiting the virtual machine to a maximum of 4 threads, there are 10 possible optimal configurations:
- T<sub>0</sub>+T<sub>4</sub> - T<sub>0</sub>+T<sub>4</sub>
- T<sub>1</sub>+T<sub>5</sub> - T<sub>1</sub>+T<sub>5</sub>

22
flake.lock generated
View File

@@ -32,28 +32,13 @@
"type": "github" "type": "github"
} }
}, },
"nix-filter": {
"locked": {
"lastModified": 1731533336,
"narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "f7653272fd234696ae94229839a99b73c9ab7de0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1751984180, "lastModified": 1724819573,
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=", "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0", "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -67,7 +52,6 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nix-filter": "nix-filter",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
}, },

View File

@@ -1,29 +1,17 @@
{ {
description = "WinApps Nix packages"; description = "WinApps Nix packages & NixOS module";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"; flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
};
nixConfig = {
extra-substituters = [
"https://cache.garnix.io"
];
extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
}; };
outputs = outputs =
{ {
nixpkgs, nixpkgs,
flake-utils, flake-utils,
nix-filter,
... ...
}: }:
flake-utils.lib.eachDefaultSystem ( flake-utils.lib.eachDefaultSystem (
@@ -31,13 +19,11 @@
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
in in
rec { {
formatter = pkgs.nixfmt-rfc-style; formatter = pkgs.nixfmt-rfc-style;
packages.winapps = pkgs.callPackage ./packages/winapps { inherit nix-filter; }; packages.winapps = pkgs.callPackage ./packages/winapps { };
packages.winapps-launcher = pkgs.callPackage ./packages/winapps-launcher { packages.winapps-launcher = pkgs.callPackage ./packages/winapps-launcher { };
inherit (packages) winapps;
};
} }
); );
} }

View File

@@ -49,7 +49,7 @@ Function GetApplicationIcon {
# Args: # Args:
# - 'Names': An array of application names. # - 'Names': An array of application names.
# - 'Paths': An array of executable paths. # - 'Paths': An array of executable paths.
# - 'Source': The source of the applications (e.g. Windows Registry, Package managers, Universal Windows Platform (UWP), etc.) # - 'Source': The source of the applications (e.g. Windows Registry, Package manangers, Universal Windows Platform (UWP), etc.)
function PrintArrayData { function PrintArrayData {
param ( param (
[string[]]$Names, [string[]]$Names,
@@ -240,7 +240,7 @@ function AppSearchUWP {
PrintArrayData -Names $exeNames -Paths $exePaths -Source "uwp" PrintArrayData -Names $exeNames -Paths $exePaths -Source "uwp"
} }
# Name: 'AppSearchChocolatey' # Name: 'AppSearchWinReg'
# Role: Search for chocolatey shims. # Role: Search for chocolatey shims.
function AppSearchChocolatey { function AppSearchChocolatey {
# Initialise empty arrays. # Initialise empty arrays.
@@ -272,7 +272,7 @@ function AppSearchChocolatey {
} }
} }
# Name: 'AppSearchScoop' # Name: 'AppSearchWinReg'
# Role: Search for scoop shims. # Role: Search for scoop shims.
function AppSearchScoop { function AppSearchScoop {
# Initialise empty arrays. # Initialise empty arrays.

134
install/winapps.conf Normal file
View File

@@ -0,0 +1,134 @@
##################################
# WINAPPS CONFIGURATION FILE #
##################################
# INSTRUCTIONS
# - Leading and trailing whitespace are ignored.
# - Empty lines are ignored.
# - Lines starting with '#' are ignored.
# - All characters following a '#' are ignored.
# [WINDOWS USERNAME]
RDP_USER="docker"
# [WINDOWS PASSWORD]
# NOTES:
# - If using FreeRDP v3.9.0 or greater, you *have* to set a password
RDP_PASS="docker"
# [WINDOWS DOMAIN]
# DEFAULT VALUE: '' (BLANK)
RDP_DOMAIN=""
# [WINDOWS IPV4 ADDRESS]
# NOTES:
# - If using 'libvirt', 'RDP_IP' will be determined by WinApps at runtime if left unspecified.
# DEFAULT VALUE:
# - 'docker': '127.0.0.1'
# - 'podman': '127.0.0.1'
# - 'libvirt': '' (BLANK)
#RDP_IP="127.0.0.1"
# [VM NAME]
# NOTES:
# - Only applicable when using 'libvirt'
# - The libvirt VM name must match so that WinApps can determine VM IP, start the VM, etc.
# DEFAULT VALUE: 'RDPWindows'
#VM_NAME="RDPWindows"
# [WINAPPS BACKEND]
# DEFAULT VALUE: 'docker'
# VALID VALUES:
# - 'docker'
# - 'podman'
# - 'libvirt'
# - 'manual'
WAFLAVOR="docker"
# [DISPLAY SCALING FACTOR]
# NOTES:
# - If an unsupported value is specified, a warning will be displayed.
# - If an unsupported value is specified, WinApps will use the closest supported value.
# DEFAULT VALUE: '100'
# VALID VALUES:
# - '100'
# - '140'
# - '180'
RDP_SCALE="100"
# [MOUNTING REMOVABLE PATHS FOR FILES]
# NOTES:
# - By default, `udisks` (which you most likely have installed) uses /run/media for mounting removable devices.
# This improves compatibility with most desktop environments (DEs).
# ATTENTION: The Filesystem Hierarchy Standard (FHS) recommends /media instead. Verify your system's configuration.
# - To manually mount devices, you may optionally use /mnt.
# REFERRENCE: https://wiki.archlinux.org/title/Udisks#Mount_to_/media
REMOVABLE_MEDIA="/run/media"
# [ADDITIONAL FREERDP FLAGS & ARGUMENTS]
# NOTES:
# - 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'
# VALID VALUES: See https://github.com/awakecoding/FreeRDP-Manuals/blob/master/User/FreeRDP-User-Manual.markdown
RDP_FLAGS="/cert:tofu /sound /microphone +home-drive"
# [DEBUG WINAPPS]
# NOTES:
# - Creates and appends to ~/.local/share/winapps/winapps.log when running WinApps.
# DEFAULT VALUE: 'true'
# VALID VALUES:
# - 'true'
# - 'false'
DEBUG="true"
# [AUTOMATICALLY PAUSE WINDOWS]
# NOTES:
# - This is currently INCOMPATIBLE with 'docker' and 'manual'.
# - See https://github.com/dockur/windows/issues/674
# DEFAULT VALUE: 'off'
# VALID VALUES:
# - 'on'
# - 'off'
AUTOPAUSE="off"
# [AUTOMATICALLY PAUSE WINDOWS TIMEOUT]
# NOTES:
# - This setting determines the duration of inactivity to tolerate before Windows is automatically paused.
# - This setting is ignored if 'AUTOPAUSE' is set to 'off'.
# - The value must be specified in seconds (to the nearest 10 seconds e.g., '30', '40', '50', etc.).
# - For RemoteApp RDP sessions, there is a mandatory 20-second delay, so the minimum value that can be specified here is '20'.
# - Source: https://techcommunity.microsoft.com/t5/security-compliance-and-identity/terminal-services-remoteapp-8482-session-termination-logic/ba-p/246566
# DEFAULT VALUE: '300'
# VALID VALUES: >=20
AUTOPAUSE_TIME="300"
# [FREERDP COMMAND]
# NOTES:
# - WinApps will attempt to automatically detect the correct command to use for your system.
# DEFAULT VALUE: '' (BLANK)
# VALID VALUES: The command required to run FreeRDPv3 on your system (e.g., 'xfreerdp', 'xfreerdp3', etc.).
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"

View File

@@ -1,66 +1,25 @@
@echo off @echo off
title WinApps Setup Wizard
REM Check for administrative privileges reg import %~dp0\RDPApps.reg
fltmc >nul 2>&1 || (
echo [INFO] Script not running as administrator. Attempting to relaunch with elevation... if exists %~dp0\Container.reg (
powershell -Command "Start-Process '%~f0' -Verb runAs" reg import %~dp0\Container.reg
exit /b 0
) )
REM Confirm the user wants to proceed with setup REM Create network profile cleanup scheduled task
echo ============================================ copy %~dp0\NetProfileCleanup.ps1 %windir%
echo WinApps Setup Wizard set "taskname=NetworkProfileCleanup"
echo ============================================ set "command=powershell.exe -ExecutionPolicy Bypass -File "%windir%\NetProfileCleanup.ps1^""
echo.
echo Press any key to continue or close this window to cancel...
pause >nul
echo.
echo [INFO] Starting setup...
REM Apply RDP and system configuration tweaks schtasks /query /tn "%taskname%" >nul 2>&1
echo [INFO] Importing "RDPApps.reg"...
reg import "%~dp0RDPApps.reg" >nul 2>&1
if %ERRORLEVEL% equ 0 ( if %ERRORLEVEL% equ 0 (
echo [SUCCESS] Imported "RDPApps.reg". echo Task "%taskname%" already exists, deleting it first...
) else ( schtasks /delete /tn "%taskname%" /f
echo [ERROR] Failed to import "RDPApps.reg".
) )
REM Configure the system clock to use UTC instead of local time schtasks /create /tn "%taskname%" /tr "%command%" /sc onstart /ru "SYSTEM" /rl HIGHEST /f
if exist "%~dp0Container.reg" (
echo [INFO] Importing "Container.reg"...
reg import "%~dp0Container.reg" >nul 2>&1
if %ERRORLEVEL% equ 0 ( if %ERRORLEVEL% equ 0 (
echo [SUCCESS] Imported "Container.reg". echo Scheduled task "%taskname%" created successfully.
) else ( ) else (
echo [ERROR] Failed to import "Container.reg". echo Failed to create scheduled task.
) )
) else (
echo [WARNING] "Container.reg" not found. Skipping...
)
REM Create a startup task to clean up stale network profiles
echo [INFO] Creating network profile cleanup task...
REM Initialise values required to create the startup task
set "scriptpath=%windir%\NetProfileCleanup.ps1"
set "taskname=WinApps_NetworkProfileCleanup"
set "command=powershell.exe -ExecutionPolicy Bypass -File ""%scriptpath%"""
REM Copy the script to the Windows directory
copy /Y "%~dp0NetProfileCleanup.ps1" "%scriptpath%" >nul
if %ERRORLEVEL% neq 0 (
echo [ERROR] Failed to copy "NetProfileCleanup.ps1" to "%windir%".
) else (
schtasks /create /tn "%taskname%" /tr "%command%" /sc onstart /ru "SYSTEM" /rl HIGHEST /f >nul 2>&1
if %ERRORLEVEL% equ 0 (
echo [SUCCESS] Created scheduled task "%taskname%".
) else (
echo [ERROR] Failed to create scheduled task "%taskname%".
)
)
echo.
echo Press any key to exit...
pause >nul

View File

@@ -4,8 +4,8 @@
fetchFromGitHub, fetchFromGitHub,
makeWrapper, makeWrapper,
makeDesktopItem, makeDesktopItem,
callPackage,
yad, yad,
winapps ? throw "Pass in the winapps package",
... ...
}: }:
let let
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
buildInputs = [ buildInputs = [
yad yad
winapps (callPackage ../winapps { })
]; ];
patches = [ ./WinApps-Launcher.patch ]; patches = [ ./WinApps-Launcher.patch ];

View File

@@ -1,36 +1,33 @@
{ {
stdenv, stdenv,
lib, lib,
fetchFromGitHub,
makeWrapper, makeWrapper,
freerdp, freerdp3,
dialog, dialog,
libnotify, libnotify,
netcat, netcat,
iproute2, iproute2,
writeShellScriptBin,
nix-filter ? throw "Pass github:numtide/nix-filter as an argument!",
... ...
}: }:
let
rev = "ce9a84dc5294c45a4b69847f5164628f7d6a4ae1";
hash = "sha256-SsyJy9mCwBjKex8mfCnKrzKUM/+xws0EltI2aSkKTuM=";
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "winapps"; pname = "winapps";
version = "0-unstable-2025-07-02"; version = "0-unstable-2025-07-02";
src = nix-filter { src = fetchFromGitHub {
root = ./../..; owner = "winapps-org";
include = [ repo = "winapps";
"apps"
"install" inherit rev hash;
"bin"
"icons"
"LICENSE.md"
"COPYRIGHT.md"
"setup.sh"
];
}; };
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
buildInputs = [ buildInputs = [
(writeShellScriptBin "xfreerdp3" ''${lib.getExe' freerdp "xfreerdp"} "$@"'') freerdp3
libnotify libnotify
dialog dialog
netcat netcat
@@ -38,6 +35,7 @@ stdenv.mkDerivation rec {
]; ];
patches = [ patches = [
./winapps.patch
./setup.patch ./setup.patch
]; ];

View File

@@ -7,9 +7,9 @@ index 0debe4d..6aeea08 100755
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.
# 'SOURCE' # 'SOURCE'
-readonly SYS_SOURCE_PATH="${SYS_BIN_PATH}/winapps-src" # UNIX path to WinApps source directory for a '--system' WinApps installation. -readonly SYS_SOURCE_PATH="${SYS_BIN_PATH}/winapps-src" # UNIX path to WinApps source directory for a '--system' WinApps installation.
-readonly USER_SOURCE_PATH="${USER_BIN_PATH}/winapps-src" # UNIX path to WinApps source directory for a '--user' WinApps installation. -readonly USER_SOURCE_PATH="${USER_BIN_PATH}/winapps-src" # UNIX path to WinApps source directory for a '--system' WinApps installation.
+readonly SYS_SOURCE_PATH="@out@/src" # UNIX path to WinApps source directory for a '--system' WinApps installation. +readonly SYS_SOURCE_PATH="@out@/src" # UNIX path to WinApps source directory for a '--system' WinApps installation.
+readonly USER_SOURCE_PATH="@out@/src" # UNIX path to WinApps source directory for a '--user' WinApps installation. +readonly USER_SOURCE_PATH="@out@/src" # UNIX path to WinApps source directory for a '--system' 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.

View File

@@ -0,0 +1,11 @@
--- a/bin/winapps
+++ b/bin/winapps
@@ -295,7 +295,7 @@ function waCheckGroupMembership() {
# shellcheck disable=SC2155 # Silence warnings regarding masking return values through simultaneous declaration and assignment.
local USER_GROUPS=$(groups "$(whoami)")
- if ! (echo "$USER_GROUPS" | grep -q -E "\blibvirt\b") || ! (echo "$USER_GROUPS" | grep -q -E "\bkvm\b"); then
+ if ! (echo "$USER_GROUPS" | grep -q -E "\blibvirtd\b") || ! (echo "$USER_GROUPS" | grep -q -E "\bkvm\b"); then
waThrowExit "$EC_NOT_IN_GROUP"
fi
}

View File

@@ -21,7 +21,7 @@ readonly EC_BAD_ARGUMENT="2" # Unsupported argument passed to script.
readonly EC_EXISTING_INSTALL="3" # Existing conflicting WinApps installation. readonly EC_EXISTING_INSTALL="3" # Existing conflicting WinApps installation.
readonly EC_NO_CONFIG="4" # Absence of a valid WinApps configuration file. readonly EC_NO_CONFIG="4" # Absence of a valid WinApps configuration file.
readonly EC_MISSING_DEPS="5" # Missing dependencies. readonly EC_MISSING_DEPS="5" # Missing dependencies.
readonly EC_NO_SUDO="6" # Insufficient privileges to invoke superuser access. readonly EC_NO_SUDO="6" # Insufficient privilages to invoke superuser access.
readonly EC_NOT_IN_GROUP="7" # Current user not in group 'libvirt' and/or 'kvm'. readonly EC_NOT_IN_GROUP="7" # Current user not in group 'libvirt' and/or 'kvm'.
readonly EC_VM_OFF="8" # Windows 'libvirt' VM powered off. readonly EC_VM_OFF="8" # Windows 'libvirt' VM powered off.
readonly EC_VM_PAUSED="9" # Windows 'libvirt' VM paused. readonly EC_VM_PAUSED="9" # Windows 'libvirt' VM paused.
@@ -40,7 +40,7 @@ readonly USER_BIN_PATH="${HOME}/.local/bin" # UNIX path to 'bin' dir
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.
# 'SOURCE' # 'SOURCE'
readonly SYS_SOURCE_PATH="${SYS_BIN_PATH}/winapps-src" # UNIX path to WinApps source directory for a '--system' WinApps installation. readonly SYS_SOURCE_PATH="${SYS_BIN_PATH}/winapps-src" # UNIX path to WinApps source directory for a '--system' WinApps installation.
readonly USER_SOURCE_PATH="${USER_BIN_PATH}/winapps-src" # UNIX path to WinApps source directory for a '--user' WinApps installation. readonly USER_SOURCE_PATH="${USER_BIN_PATH}/winapps-src" # UNIX path to WinApps source directory for a '--system' 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.
@@ -151,7 +151,7 @@ function waGetSourceCode() {
SCRIPT_DIR_PATH=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")") SCRIPT_DIR_PATH=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")
# Check if winapps is currently installed on $SOURCE_PATH # Check if winapps is currently installed on $SOURCE_PATH
if [[ -f "$SCRIPT_DIR_PATH/winapps" && "$SCRIPT_DIR_PATH" != "$SOURCE_PATH" ]]; then if [[ -f "$SCRIPT_DIR_PATH/winapps" && "$SCRIPT_DIR_PATH" -ne "$SOURCE_PATH" ]]; then
# Display a warning. # Display a warning.
echo -e "${WARNING_TEXT}[WARNING]${CLEAR_TEXT} You are running a WinApps installation located outside of default location '${SOURCE_PATH}'. A new installation will be created." echo -e "${WARNING_TEXT}[WARNING]${CLEAR_TEXT} You are running a WinApps installation located outside of default location '${SOURCE_PATH}'. A new installation will be created."
echo -e "${WARNING_TEXT}[WARNING]${CLEAR_TEXT} You might want to remove your old installation on '${SCRIPT_DIR_PATH}'." echo -e "${WARNING_TEXT}[WARNING]${CLEAR_TEXT} You might want to remove your old installation on '${SCRIPT_DIR_PATH}'."
@@ -1156,7 +1156,7 @@ function waFindInstalled() {
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 its 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"
@@ -1279,7 +1279,7 @@ function waConfigureApp() {
# Source 'Info' File Containing: # Source 'Info' File Containing:
# - The Application Name (FULL_NAME) # - The Application Name (FULL_NAME)
# - The Shortcut Name (NAME) # - The Shortcut Nsame (NAME)
# - Application Categories (CATEGORIES) # - Application Categories (CATEGORIES)
# - Executable Path (WIN_EXECUTABLE) # - Executable Path (WIN_EXECUTABLE)
# - Supported MIME Types (MIME_TYPES) # - Supported MIME Types (MIME_TYPES)
@@ -1379,7 +1379,7 @@ function waConfigureApps() {
for OSA in "${OSA_LIST[@]}"; do for OSA in "${OSA_LIST[@]}"; do
# Source 'Info' File Containing: # Source 'Info' File Containing:
# - The Application Name (FULL_NAME) # - The Application Name (FULL_NAME)
# - The Shortcut Name (NAME) # - The Shortcut Nsame (NAME)
# - Application Categories (CATEGORIES) # - Application Categories (CATEGORIES)
# - Executable Path (WIN_EXECUTABLE) # - Executable Path (WIN_EXECUTABLE)
# - Supported MIME Types (MIME_TYPES) # - Supported MIME Types (MIME_TYPES)