Skip to content

Commit b5cb322

Browse files
authored
Merge pull request #619 from KernelGhost/main
Miscellaneous Fixes
2 parents 1c4b38b + 44f9df7 commit b5cb322

13 files changed

Lines changed: 86 additions & 52 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/.idea
22
/.vscode
33
/result
4+
.DS_Store
5+
**/.DS_Store

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Due to lack of a license, it is All Rights Reserved by the original author.
88
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.
99
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.
1010

11-
Refer to a specific file for it's respective license.
11+
Refer to a specific file for its respective license.
1212

1313
# GNU AFFERO GENERAL PUBLIC LICENSE
1414

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ WinApps works by:
1717
- The GNU/Linux `/home` directory is accessible within Windows via the `\\tsclient\home` mount.
1818
- Integration with `Nautilus`, allowing you to right-click files to open them with specific Windows applications based on the file MIME type.
1919
- 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.
20-
- 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.)
20+
- 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.)
2121

2222
## Supported Applications
2323
**WinApps supports <u>*ALL*</u> Windows applications.**
@@ -398,7 +398,7 @@ RDP_SCALE="100"
398398
# This improves compatibility with most desktop environments (DEs).
399399
# ATTENTION: The Filesystem Hierarchy Standard (FHS) recommends /media instead. Verify your system's configuration.
400400
# - To manually mount devices, you may optionally use /mnt.
401-
# REFERRENCE: https://wiki.archlinux.org/title/Udisks#Mount_to_/media
401+
# REFERENCE: https://wiki.archlinux.org/title/Udisks#Mount_to_/media
402402
REMOVABLE_MEDIA="/run/media"
403403
404404
# [ADDITIONAL FREERDP FLAGS & ARGUMENTS]

bin/winapps

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ Please run:
107107
notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Windows failed to resume."
108108
;;
109109
"$EC_FAIL_DESTROY")
110-
dprint "ERROR: WINDOWS FAILED TO IMMEDIATELY UNGRACEFULLY SHUT DOWN WINDOWS. EXITING."
111-
notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Failed to ungracefully shut down Windows."
110+
dprint "ERROR: FAILED TO FORCE STOP WINDOWS. EXITING."
111+
notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Failed to forcibly stop Windows."
112112
;;
113113
"$EC_SD_TIMEOUT")
114114
dprint "ERROR: WINDOWS TOOK TOO LONG TO SHUT DOWN. EXITING."
115115
notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Windows took too long to shut down."
116116
;;
117117
"$EC_DIE_TIMEOUT")
118-
dprint "ERROR: WINDOWS TOOK TOO LONG TO SHUT DOWN. EXITING."
118+
dprint "ERROR: WINDOWS TOOK TOO LONG TO DIE. EXITING."
119119
notify-send --expire-time=8000 --icon="dialog-error" --app-name="WinApps" --urgency="low" "WinApps" "Windows took too long to die."
120120
;;
121121
"$EC_RESTART_TIMEOUT")
@@ -158,7 +158,7 @@ function dprint() {
158158
[ "$DEBUG" = "true" ] && echo "[$(date)-$RUNID] $1" >>"$LOG_PATH"
159159
}
160160
# Name: 'waFixRemovableMedia'
161-
# Role: If user left REMOVABLE_MEDIA config null,fallback to /run/media for udisks defaults ,warning.
161+
# Role: If REMOVABLE_MEDIA is empty, default to /run/media (udisks default) and show a warning.
162162
function waFixRemovableMedia() {
163163
if [ -z "$REMOVABLE_MEDIA" ]; then
164164
REMOVABLE_MEDIA="/run/media" # Default for udisks
@@ -301,9 +301,10 @@ function waGetFreeRDPCommand() {
301301
function waCheckGroupMembership() {
302302
# Identify groups the current user belongs to.
303303
# shellcheck disable=SC2155 # Silence warnings regarding masking return values through simultaneous declaration and assignment.
304-
local USER_GROUPS=$(groups "$(whoami)")
304+
local USER_GROUPS=$(id -nG "$(whoami)")
305305

306-
if ! (echo "$USER_GROUPS" | grep -q -E "\blibvirt\b") || ! (echo "$USER_GROUPS" | grep -q -E "\bkvm\b"); then
306+
if ! echo "$USER_GROUPS" | grep -qE '\b(libvirt|libvirtd)\b' || \
307+
! echo "$USER_GROUPS" | grep -qE '\bkvm\b'; then
307308
waThrowExit "$EC_NOT_IN_GROUP"
308309
fi
309310
}
@@ -677,7 +678,7 @@ function waRunCommand() {
677678
+auto-reconnect \
678679
/drive:media,"$REMOVABLE_MEDIA" \
679680
/wm-class:"$FULL_NAME" \
680-
/app:program:"$WIN_EXECUTABLE",icon:"$ICON",name:$"FULL_NAME",cmd:\""$FILE_PATH"\" \
681+
/app:program:"$WIN_EXECUTABLE",icon:"$ICON",name:"$FULL_NAME",cmd:\""$FILE_PATH"\" \
681682
/v:"$RDP_IP" &>/dev/null &
682683

683684
# Capture the process ID.

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ services:
4444
# NOTE: 'disk1' will be mounted as the main drive. THIS DISK WILL BE FORMATTED BY DOCKER.
4545
# All following disks (disk2, ...) WILL NOT BE FORMATTED.
4646
# - /dev/disk/by-id/<id>:/disk1
47-
# - dev/disk/by-id/<id>:/disk2
47+
# - /dev/disk/by-id/<id>:/disk2
4848
# group_add: # uncomment this line and the next one for using rootless podman containers
4949
# - 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.

docs/docker.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Although WinApps supports using `QEMU+KVM+libvirt` as a backend for running Wind
1313
1414
> [!IMPORTANT]
1515
> The iptables kernel module must be loaded for folder sharing with the host to work.
16-
> Check that the output of `lsmod | grep ip_tables` and `lsmod | grep iptable_nat` is non empty.
17-
> 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.
16+
> Check that the output of `lsmod | grep ip_tables` and `lsmod | grep iptable_nat` is non-empty.
17+
> 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.
1818
1919
## `Docker`
2020
### Installation

docs/libvirt.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Together, these components form a powerful and flexible virtualization stack, wi
4646
sudo reboot # Reboot the system to ensure the user is added to the relevant groups.
4747
```
4848

49+
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).
50+
4951
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`.
5052
5153
To resolve this:
@@ -193,7 +195,7 @@ Together, these components form a powerful and flexible virtualization stack, wi
193195

194196
Example 1:
195197
- CPU cores share the same singular L3 cache, so this cannot be optimised.
196-
- CPU cores utilise different L1 and L2 caches, so isolatng corresponding thread pairs will help improve performance.
198+
- CPU cores utilise different L1 and L2 caches, so isolating corresponding thread pairs will help improve performance.
197199
- Thus, if limiting the virtual machine to a maximum of 4 threads, there are 10 possible optimal configurations:
198200
- T<sub>0</sub>+T<sub>4</sub>
199201
- T<sub>1</sub>+T<sub>5</sub>

install/ExtractPrograms.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Function GetApplicationIcon {
4949
# Args:
5050
# - 'Names': An array of application names.
5151
# - 'Paths': An array of executable paths.
52-
# - 'Source': The source of the applications (e.g. Windows Registry, Package manangers, Universal Windows Platform (UWP), etc.)
52+
# - 'Source': The source of the applications (e.g. Windows Registry, Package managers, Universal Windows Platform (UWP), etc.)
5353
function PrintArrayData {
5454
param (
5555
[string[]]$Names,
@@ -240,7 +240,7 @@ function AppSearchUWP {
240240
PrintArrayData -Names $exeNames -Paths $exePaths -Source "uwp"
241241
}
242242

243-
# Name: 'AppSearchWinReg'
243+
# Name: 'AppSearchChocolatey'
244244
# Role: Search for chocolatey shims.
245245
function AppSearchChocolatey {
246246
# Initialise empty arrays.
@@ -272,7 +272,7 @@ function AppSearchChocolatey {
272272
}
273273
}
274274

275-
# Name: 'AppSearchWinReg'
275+
# Name: 'AppSearchScoop'
276276
# Role: Search for scoop shims.
277277
function AppSearchScoop {
278278
# Initialise empty arrays.

oem/install.bat

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,66 @@
11
@echo off
2+
title WinApps Setup Wizard
23

3-
reg import %~dp0\RDPApps.reg
4-
5-
if exists %~dp0\Container.reg (
6-
reg import %~dp0\Container.reg
4+
REM Check for administrative privileges
5+
fltmc >nul 2>&1 || (
6+
echo [INFO] Script not running as administrator. Attempting to relaunch with elevation...
7+
powershell -Command "Start-Process '%~f0' -Verb runAs"
8+
exit /b 0
79
)
810

9-
REM Create network profile cleanup scheduled task
10-
copy %~dp0\NetProfileCleanup.ps1 %windir%
11-
set "taskname=NetworkProfileCleanup"
12-
set "command=powershell.exe -ExecutionPolicy Bypass -File "%windir%\NetProfileCleanup.ps1^""
11+
REM Confirm the user wants to proceed with setup
12+
echo ============================================
13+
echo WinApps Setup Wizard
14+
echo ============================================
15+
echo.
16+
echo Press any key to continue or close this window to cancel...
17+
pause >nul
18+
echo.
19+
echo [INFO] Starting setup...
1320

14-
schtasks /query /tn "%taskname%" >nul 2>&1
21+
REM Apply RDP and system configuration tweaks
22+
echo [INFO] Importing "RDPApps.reg"...
23+
reg import "%~dp0RDPApps.reg" >nul 2>&1
1524
if %ERRORLEVEL% equ 0 (
16-
echo Task "%taskname%" already exists, deleting it first...
17-
schtasks /delete /tn "%taskname%" /f
25+
echo [SUCCESS] Imported "RDPApps.reg".
26+
) else (
27+
echo [ERROR] Failed to import "RDPApps.reg".
1828
)
1929

20-
schtasks /create /tn "%taskname%" /tr "%command%" /sc onstart /ru "SYSTEM" /rl HIGHEST /f
21-
if %ERRORLEVEL% equ 0 (
22-
echo Scheduled task "%taskname%" created successfully.
30+
REM Configure the system clock to use UTC instead of local time
31+
if exist "%~dp0Container.reg" (
32+
echo [INFO] Importing "Container.reg"...
33+
reg import "%~dp0Container.reg" >nul 2>&1
34+
if %ERRORLEVEL% equ 0 (
35+
echo [SUCCESS] Imported "Container.reg".
36+
) else (
37+
echo [ERROR] Failed to import "Container.reg".
38+
)
2339
) else (
24-
echo Failed to create scheduled task.
40+
echo [WARNING] "Container.reg" not found. Skipping...
2541
)
42+
43+
REM Create a startup task to clean up stale network profiles
44+
echo [INFO] Creating network profile cleanup task...
45+
46+
REM Initialise values required to create the startup task
47+
set "scriptpath=%windir%\NetProfileCleanup.ps1"
48+
set "taskname=WinApps_NetworkProfileCleanup"
49+
set "command=powershell.exe -ExecutionPolicy Bypass -File ""%scriptpath%"""
50+
51+
REM Copy the script to the Windows directory
52+
copy /Y "%~dp0NetProfileCleanup.ps1" "%scriptpath%" >nul
53+
if %ERRORLEVEL% neq 0 (
54+
echo [ERROR] Failed to copy "NetProfileCleanup.ps1" to "%windir%".
55+
) else (
56+
schtasks /create /tn "%taskname%" /tr "%command%" /sc onstart /ru "SYSTEM" /rl HIGHEST /f >nul 2>&1
57+
if %ERRORLEVEL% equ 0 (
58+
echo [SUCCESS] Created scheduled task "%taskname%".
59+
) else (
60+
echo [ERROR] Failed to create scheduled task "%taskname%".
61+
)
62+
)
63+
64+
echo.
65+
echo Press any key to exit...
66+
pause >nul

packages/winapps/default.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ stdenv.mkDerivation rec {
3838
];
3939

4040
patches = [
41-
./winapps.patch
4241
./setup.patch
4342
];
4443

0 commit comments

Comments
 (0)