diff --git a/.github/workflows/update.yaml b/.github/workflows/update.yaml
new file mode 100644
index 0000000..f939450
--- /dev/null
+++ b/.github/workflows/update.yaml
@@ -0,0 +1,25 @@
+name: Update submodules
+on:
+ repository_dispatch:
+ types: update
+
+jobs:
+ update:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+
+ - name: Update module
+ run: |
+ git submodule update --init --recursive --checkout -f
+
+ - name: Commit and push
+ uses: EndBug/add-and-commit@v9
+ with:
+ add: "WinApps-Launcher"
+ default_author: github_actions
+ message: "Update submodules"
+ push: true
+ fetch: true
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..2c3ac9c
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "WinApps-Launcher"]
+ path = WinApps-Launcher
+ url = https://github.com/winapps-org/WinApps-Launcher.git
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..b5f2edb
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,50 @@
+ci:
+ autoupdate_branch: "rewrite"
+
+repos:
+ - repo: https://github.com/Lucas-C/pre-commit-hooks
+ rev: v1.5.5
+ hooks:
+ - id: chmod
+ args: [ "775" ]
+ files: (\.sh|winapps)$
+ - id: forbid-crlf
+ - id: remove-crlf
+ - id: forbid-tabs
+ - id: remove-tabs
+ args: [ --whitespaces-count, "4" ]
+
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.6.0
+ hooks:
+ - id: check-added-large-files
+ - id: check-case-conflict
+ - id: check-executables-have-shebangs
+ - id: check-json
+ - id: check-merge-conflict
+ - id: check-shebang-scripts-are-executable
+ - id: check-symlinks
+ - id: check-toml
+ - id: check-vcs-permalinks
+ - id: check-xml
+ - id: check-yaml
+ - id: destroyed-symlinks
+ - id: detect-private-key
+ - id: end-of-file-fixer
+ - id: fix-byte-order-marker
+ - id: mixed-line-ending
+ - id: pretty-format-json
+ args: [ "--autofix", "--no-sort-keys" ]
+ - id: sort-simple-yaml
+ - id: trailing-whitespace
+
+ - repo: https://github.com/scop/pre-commit-shfmt
+ rev: v3.8.0-1
+ hooks:
+ - id: shfmt
+ args: ["-i", "4", "-ci", "-s"]
+
+ - repo: https://github.com/shellcheck-py/shellcheck-py
+ rev: v0.10.0.1
+ hooks:
+ - id: shellcheck
diff --git a/README.md b/README.md
index 5b727f5..454666d 100644
--- a/README.md
+++ b/README.md
@@ -1,174 +1,481 @@
-# winapps
-The winapps main project
-Originally created by fmstrat https://github.com/Fmstrat/winapps/
+
-
-  | Adobe Acrobat Pro (X) |
-  | Adobe Acrobat Reader (DC) |
-
-
-  | Adobe After Effects (CC) |
-  | Adobe Audition (CC) |
-
-
-  | Adobe Bridge (CS6, CC) |
-  | Adobe Creative Cloud (CC) |
-
-
-  | Adobe Illustrator (CC) |
-  | Adobe InDesign (CC) |
-
-
-  | Adobe Lightroom (CC) |
-  | Command Prompt (cmd.exe) |
-
-
-  | Explorer (File Manager) |
-  | Internet Explorer (11) |
-
-
-  | Microsoft Access (2016, 2019, o365) |
-  | Microsoft Excel (2016, 2019, o365) |
-
-
-  | Microsoft Word (2016, 2019, o365) |
-  | Microsoft OneNote (2016, 2019, o365) |
-
-
-  | Microsoft Outlook (2016, 2019, o365) |
-  | Microsoft PowerPoint (2016, 2019, o365) |
-
-
-  | Microsoft Publisher (2016, 2019, o365) |
-  | Powershell |
-
-
-  | Windows (Full RDP session) |
- | |
-
+
+
+
+
+ |
+
+ Adobe Acrobat Pro
+ (X)
+ Icon in the Public Domain.
+ |
+
+
+
+ |
+
+ Adobe After Effects
+ (CC)
+ Icon in the Public Domain.
+ |
+
+
+
+
+
+ |
+
+ Adobe Audition
+ (CC)
+ Icon in the Public Domain.
+ |
+
+
+
+ |
+
+ Adobe Bridge
+ (CS6, CC)
+ Icon in the Public Domain.
+ |
+
+
+
+
+
+ |
+
+ Adobe Creative Cloud
+ (CC)
+ Icon under MIT license.
+ |
+
+
+
+ |
+
+ Adobe Illustrator
+ (CC)
+ Icon in the Public Domain.
+ |
+
+
+
+
+
+ |
+
+ Adobe InDesign
+ (CC)
+ Icon in the Public Domain.
+ |
+
+
+
+ |
+
+ Adobe Lightroom
+ (CC)
+ Icon in the Public Domain.
+ |
+
+
+
+
+
+ |
+
+ Adobe Photoshop
+ (CS6, CC)
+ Icon in the Public Domain.
+ |
+
+
+
+ |
+
+ Command Prompt
+ (cmd.exe)
+ Icon under MIT license.
+ |
+
+
+
+
+
+ |
+
+ File Explorer
+ (Windows Explorer)
+ Icon in the Public Domain.
+ |
+
+
+
+ |
+
+ Internet Explorer
+ (11)
+ Icon in the Public Domain.
+ |
+
+
+
+
+
+ |
+
+ Microsoft Access
+ (2016, 2019, o365)
+ Icon in the Public Domain.
+ |
+
+
+
+ |
+
+ Microsoft Excel
+ (2016, 2019, o365)
+ Icon in the Public Domain.
+ |
+
+
+
+
+
+ |
+
+ Microsoft Word
+ (2016, 2019, o365)
+ Icon in the Public Domain.
+ |
+
+
+
+ |
+
+ Microsoft OneNote
+ (2016, 2019, o365)
+ Icon in the Public Domain.
+ |
+
+
+
+
+
+ |
+
+ Microsoft Outlook
+ (2016, 2019, o365)
+ Icon in the Public Domain.
+ |
+
+
+
+ |
+
+ Microsoft PowerPoint
+ (2016, 2019, o365)
+ Icon in the Public Domain.
+ |
+
+
+
+
+
+ |
+
+ Microsoft Publisher
+ (2016, 2019, o365)
+ Icon in the Public Domain.
+ |
+
+
+
+ |
+
+ Microsoft Visio
+ (Standard/Pro. 2021, Plan 2)
+ Icon in the Public Domain.
+ |
+
+
+
+
+
+ |
+
+ Microsoft Project
+ (Standard/Pro. 2021, Plan 3/5)
+ Icon in the Public Domain.
+ |
+
+
+
+ |
+
+ Microsoft Visual Studio
+ (Comm./Pro./Ent. 2022)
+ Icon in the Public Domain.
+ |
+
+
+
+
+
+ |
+
+ PowerShell
+ Icon under MIT license.
+ |
+
+
+
+ |
+
+ Windows
+ (Full RDP Session)
+ Icon in the Public Domain.
+ |
+
## Installation
+### Step 1: Configure a Windows VM
+Both `Docker` and `Podman` are recommended backends for running the Windows virtual machine, as they facilitate an automated Windows installation process. WinApps is also compatible with `libvirt`. While this method requires considerably more manual configuration, it also provides greater virtual machine customisation options. All three methods leverage the `KVM` hypervisor, ensuring excellent virtual machine performance. Ultimately, the choice of backend depends on your specific use case.
-### Step 1: Set up a Windows Virtual Machine
-The best solution for running a VM as a subsystem for WinApps would be KVM. KVM is a CPU and memory-efficient virtualization engine bundled with most major Linux distributions. To set up the VM for WinApps, follow this guide:
+The following guides are available:
+- [Creating a Windows VM with `Docker` or `Podman`](docs/docker.md)
+- [Creating a Windows VM with `libvirt`](docs/libvirt.md)
-- [Creating a Virtual Machine in KVM](docs/KVM.md)
+If you already have a Windows VM or server you wish to use with WinApps, you will need to merge `install/RDPApps.reg` into the Windows Registry manually.
-If you already have a Virtual Machine or server you wish to use with WinApps, you will need to merge `install/RDPApps.reg` into the VM's Windows Registry. If this VM is in KVM and you want to use auto-IP detection, you will need to name the machine `RDPWindows`. Directions for both of these can be found in the guide linked above.
+### Step 2: Clone WinApps Repository and Dependencies
+1. Clone the WinApps GitHub repository.
+ ```bash
+ git clone --recurse-submodules --remote-submodules https://github.com/winapps-org/winapps.git && cd winapps
+ ```
-### Step 2: Download the repo and prerequisites
-To get things going, use:
-``` bash
-sudo apt install -y freerdp2-x11
-git clone https://github.com/winapps-org/winapps.git
-cd winapps
+2. Install the required dependencies.
+ - Debian/Ubuntu:
+ ```bash
+ sudo apt install -y dialog freerdp3-x11 iproute2 libnotify-bin netcat
+ ```
+ - Fedora/RHEL:
+ ```bash
+ sudo dnf install -y dialog freerdp iproute libnotify nmap-ncat
+ ```
+ - Arch Linux:
+ ```bash
+ sudo pacman -Syu --needed -y dialog freerdp iproute2 libnotify gnu-netcat
+ ```
+ - Gentoo Linux:
+ ```bash
+ sudo emerge --ask=n sys-libs/dialog net-misc/freerdp:3 net-misc/iproute2 x11-libs/libnotify net-analyzer/netcat
+ ```
+
+- `Docker Engine`: https://docs.docker.com/engine/install/
+- `Podman`: https://podman.io/docs/installation
+- `podman-compose`: https://github.com/containers/podman-compose
+
+> [!NOTE]
+> WinApps requires `FreeRDP` version 3 or later. If not available for your distribution through your package manager, you can install the [Flatpak](https://flathub.org/apps/com.freerdp.FreeRDP).
+
+```bash
+flatpak install flathub com.freerdp.FreeRDP
+sudo flatpak override --filesystem=home com.freerdp.FreeRDP # To use `+home-drive`
```
-### Step 3: Creating your WinApps configuration file
-You will need to create a `~/.config/winapps/winapps.conf` configuration file with the following information in it:
-``` bash
+
+### Step 3: Create a WinApps Configuration File
+Create a configuration file at `~/.config/winapps/winapps.conf` containing the following:
+```bash
+##################################
+# 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="MyWindowsUser"
+
+# [WINDOWS PASSWORD]
RDP_PASS="MyWindowsPassword"
-#RDP_DOMAIN="MYDOMAIN"
-#RDP_IP="192.168.123.111"
-#RDP_SCALE=100
-#RDP_FLAGS=""
-#MULTIMON="true"
-#DEBUG="true"
+
+# [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=""
+
+# [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"
+
+# [ADDITIONAL FREERDP FLAGS & ARGUMENTS]
+# DEFAULT VALUE: '' (BLANK)
+# VALID VALUES: See https://github.com/awakecoding/FreeRDP-Manuals/blob/master/User/FreeRDP-User-Manual.markdown
+RDP_FLAGS=""
+
+# [MULTIPLE MONITORS]
+# NOTES:
+# - If enabled, a FreeRDP bug *might* produce a black screen.
+# DEFAULT VALUE: 'false'
+# VALID VALUES:
+# - 'true'
+# - 'false'
+MULTIMON="false"
+
+# [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=""
```
-The username and password should be a full user account and password, such as the one created when setting up Windows or a domain user. It cannot be a user/PIN combination as those are not valid for RDP access.
-Options:
-- When using a pre-existing non-KVM RDP server, you can use the `RDP_IP` to specify it's location
-- If you are running a VM in KVM with NAT enabled, leave `RDP_IP` commented out and WinApps will auto-detect the right local IP
-- 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 [100|140|160|180]
-- To add flags to the FreeRDP call, such as `/audio-mode:1` to pass in a mic, use the `RDP_FLAGS` configuration option
-- For multi-monitor setups, you can try enabling `MULTIMON`, however if you get a black screen (FreeRDP bug) you will need to revert back
-- If you enable `DEBUG`, a log will be created on each application start in `~/.local/share/winapps/winapps.log`
+> [!NOTE]
+> `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.
-### Step 4: Run the WinApps installer
-Lastly, check that FreeRDP can connect with:
-```
-bin/winapps check
-```
-You will see output from FreeRDP, as well as potentially have to accept the initial certificate. After that, a Windows Explorer window should pop up. You can close this window and press `Ctrl-C` to cancel out of FreeRDP.
+> [!NOTE]
+> If you wish to use an alternative WinApps backend (other than `Docker`), uncomment and change `WAFLAVOR="docker"` to `WAFLAVOR="podman"` or `WAFLAVOR="libvirt"`.
-If this step fails, try restarting the VM, or your problem could be related to:
-- You need to accept the security cert the first time you connect (with 'check')
-- Not enabling RDP in the Windows VM
-- Not being able to connect to the IP of the VM
-- Incorrect user credentials in `~/.config/winapps/winapps.conf`
-- Not merging `install/RDPApps.reg` into the VM
+#### Configuration Options Explained
+- If using a pre-existing Windows RDP server on your LAN, you must use `RDP_IP` to specify the location of the Windows server. You may also wish to configure a static IP address for this server.
+- If running a Windows VM using `libvirt` with NAT enabled, leave `RDP_IP` commented out and WinApps will auto-detect the local IP address for the VM.
+- 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).
+- 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 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 using a system on which the FreeRDP command is not `xfreerdp` or `xfreerdp3`, the correct command can be specified using `FREERDP_COMMAND`.
-Then the final step is to run the installer which will prompt you for a system or user install:
-``` bash
+### Step 4: Run the WinApps Installer
+Run the WinApps installer.
+```bash
./installer.sh
```
-This will take you through the following process:
-