diff --git a/README.md b/README.md
index cc7361e..71355a2 100644
--- a/README.md
+++ b/README.md
@@ -20,19 +20,19 @@ WinApps works by:
- 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.)
## Supported Applications
-**WinApps supports *ALL* Windows applications.**
+**WinApps supports *ALL* Windows applications.** Support does not, however, extend to kernel-level anti-cheat systems (e.g. Riot Vanguard).
Universal application support is achieved by:
-1. Scanning Windows for any officially supported applications (list below).
+1. Scanning Windows for any community tested applications (list below).
2. Scanning Windows for any other `.exe` files listed within the Windows Registry.
-Officially supported applications benefit from high-resolution icons and pre-populated MIME types. This enables file managers to determine which Windows applications should open files based on file extensions. Icons for other detected applications are pulled from `.exe` files.
+Community tested applications benefit from high-resolution icons and pre-populated MIME types. This enables file managers to determine which Windows applications should open files based on file extensions. Icons for other detected applications are pulled from `.exe` files.
Contributing to the list of supported applications is encouraged through submission of pull requests! Please help us grow the WinApps community.
-*Please note that the provided list of officially supported applications is community-driven. As such, some applications may not be tested and verified by the WinApps team.*
+*Please note that the provided list of community tested applications is community-driven. As such, some applications may not be tested and verified by the WinApps team.*
-### Officially Supported Applications
+### Community Tested Applications
@@ -565,7 +565,7 @@ Adding your own applications with custom icons and MIME types to the installer i
1. Modify the name and variables to reflect the appropriate/desired values for your application.
2. Replace `icon.svg` with an SVG for your application (ensuring the icon is appropriately licensed).
3. Remove and reinstall WinApps.
-4. Submit a pull request to add your application to WinApps as an officially supported application once you have tested and verified your configuration (optional, but encouraged).
+4. Submit a pull request to add your application to WinApps as a community tested application once you have tested and verified your configuration (optional, but encouraged).
## Running Applications Manually
WinApps offers a manual mode for running applications that were not configured by the WinApps installer. This is completed with the `manual` flag. Executables that are in the Windows PATH do not require full path definition.
diff --git a/docs/libvirt.md b/docs/libvirt.md
index 1b41038..5daeaf0 100644
--- a/docs/libvirt.md
+++ b/docs/libvirt.md
@@ -1,6 +1,8 @@
# Creating a `libvirt` Windows VM
-## Understanding The Virtualisation Stack
-This method of configuring a Windows virtual machine for use with WinApps is significantly more involved than utilising `Docker` or `Podman`. Nevertheless, expert users may prefer this method due to its greater flexibility and wider range of customisation options.
+This method of configuring a Windows virtual machine for use with WinApps is significantly more involved than utilising `Docker` or `Podman`. Nevertheless, expert users may prefer this method due to its greater flexibility and wider range of customisation options (e.g. GPU passthrough).
+
+
+Understanding The Virtualisation Stack
Before beginning, it is important to have a basic understanding of the various components involved in this particular method.
@@ -15,6 +17,8 @@ Together, these components form a powerful and flexible virtualization stack, wi
+
+
## Prerequisites
1. Ensure your CPU supports hardware virtualisation extensions by [reading this article](https://wiki.archlinux.org/title/KVM).
@@ -146,113 +150,7 @@ Together, these components form a powerful and flexible virtualization stack, wi
-10. (Optional) Assign specific physical CPU cores to the virtual machine. This can improve performance by reducing context switching and ensuring that the virtual machine's workload consistently uses the same cores, leading to better CPU cache utilisation.
- 1. Run `lscpu -e` to determine which L1, L2 and L3 caches are associated with which CPU cores.
-
- Example 1 (Intel 11th Gen Core i7-1185G7):
- ```
- CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ MINMHZ
- 0 0 0 0 0:0:0:0 yes 4800.0000 400.0000
- 1 0 0 1 1:1:1:0 yes 4800.0000 400.0000
- 2 0 0 2 2:2:2:0 yes 4800.0000 400.0000
- 3 0 0 3 3:3:3:0 yes 4800.0000 400.0000
- 4 0 0 0 0:0:0:0 yes 4800.0000 400.0000
- 5 0 0 1 1:1:1:0 yes 4800.0000 400.0000
- 6 0 0 2 2:2:2:0 yes 4800.0000 400.0000
- 7 0 0 3 3:3:3:0 yes 4800.0000 400.0000
- ```
-
- - C0 = T0+T4 → L10+L20+L30
- - C1 = T1+T5 → L11+L21+L30
- - C2 = T2+T6 → L12+L22+L30
- - C3 = T3+T7 → L13+L23+L30
-
- Example 2 (AMD Ryzen 5 1600):
- ```
- CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ MINMHZ
- 0 0 0 0 0:0:0:0 yes 3800.0000 1550.0000
- 1 0 0 0 0:0:0:0 yes 3800.0000 1550.0000
- 2 0 0 1 1:1:1:0 yes 3800.0000 1550.0000
- 3 0 0 1 1:1:1:0 yes 3800.0000 1550.0000
- 4 0 0 2 2:2:2:0 yes 3800.0000 1550.0000
- 5 0 0 2 2:2:2:0 yes 3800.0000 1550.0000
- 6 0 0 3 3:3:3:1 yes 3800.0000 1550.0000
- 7 0 0 3 3:3:3:1 yes 3800.0000 1550.0000
- 8 0 0 4 4:4:4:1 yes 3800.0000 1550.0000
- 9 0 0 4 4:4:4:1 yes 3800.0000 1550.0000
- 10 0 0 5 5:5:5:1 yes 3800.0000 1550.0000
- 11 0 0 5 5:5:5:1 yes 3800.0000 1550.0000
- ```
-
- - C0 = T0+T1 → L10+L20+L30
- - C1 = T2+T3 → L11+L21+L30
- - C2 = T4+T5 → L12+L22+L30
- - C3 = T6+T7 → L13+L23+L31
- - C4 = T8+T9 → L14+L24+L31
- - C5 = T10+T11 → L15+L25+L31
-
- 2. Select which CPU cores to 'pin'. You should aim to select a combination of CPU cores that minimises sharing of caches between Windows and GNU/Linux.
-
- Example 1:
- - 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.
- - Thus, if limiting the virtual machine to a maximum of 4 threads, there are 10 possible optimal configurations:
- - T0+T4
- - T1+T5
- - T2+T6
- - T3+T7
- - T0+T4+T1+T5
- - T0+T4+T2+T6
- - T0+T4+T3+T7
- - T1+T5+T2+T6
- - T1+T5+T3+T7
- - T2+T6+T3+T7
-
- Example 2:
- - Threads 0-5 utilise one L3 cache whereas threads 6-11 utilise a different L3 cache. Thus, one of these two sets of threads should be pinned to the virtual machine.
- - Pinning and isolating fewer than these (e.g. threads 8-11) would result in the host system making use of the L3 cache in threads 6 and 7, resulting in cache evictions and therefore bad performance.
- - Thus, there are only two possible optimal configurations:
- - T0+T1+T2+T3+T4+T5
- - T6+T7+T8+T9+T10+T11
-
- 3. Prepare and add/modify the following to the ``, `` and `` sections, adjusting the values to match your selected threads.
-
- Example 1: The following selects 'T2+T6+T3+T7'.
-
- ```xml
- 4
-
-
-
-
-
-
-
-
-
- ```
-
- Example 2: The following selects 'T6+T7+T8+T9+T10+T11'.
-
- ```xml
- 6
-
-
-
-
-
-
-
-
-
-
-
- ```
-
-> [!NOTE]
-> More information on configuring CPU pinning can be found in [this excellent guide](https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#CPU_pinning).
-
-11. Navigate to the `XML` tab, and edit the `` section to disable all timers except for the hypervclock, thereby drastically reducing idle CPU usage. Once changed, click `Apply`.
+10. Navigate to the `XML` tab, and edit the `` section to disable all timers except for the hypervclock, thereby drastically reducing idle CPU usage. Once changed, click `Apply`.
```xml
@@ -267,7 +165,7 @@ Together, these components form a powerful and flexible virtualization stack, wi
-12. Enable Hyper-V enlightenments by adding the following to the `` section. Once changed, click `Apply`.
+11. Enable Hyper-V enlightenments by adding the following to the `` section. Once changed, click `Apply`.
```xml
@@ -290,7 +188,7 @@ Together, these components form a powerful and flexible virtualization stack, wi
> [!NOTE]
> Hyper-V enlightenments make Windows (and other Hyper-V guests) think they are running on top of a Hyper-V compatible hypervisor. This enables use of Hyper-V specific features, allowing `KVM` to implement paravirtualised interfaces for improved virtual machine performance.
-13. Add the following XML snippet within the `` section to enable the GNU/Linux host to communicate with Windows using `QEMU Guest Agent`.
+12. Add the following XML snippet within the `` section to enable the GNU/Linux host to communicate with Windows using `QEMU Guest Agent`.
```xml
@@ -300,31 +198,31 @@ Together, these components form a powerful and flexible virtualization stack, wi
```
-14. In the 'Memory' section, set the `Current allocation` to the minimum amount of memory you want the virtual machine to use, with a recommended value of `1024MB`.
+13. In the 'Memory' section, set the `Current allocation` to the minimum amount of memory you want the virtual machine to use, with a recommended value of `1024MB`.
-15. (Optional) Under `Boot Options`, enable `Start virtual machine on host boot up`.
+14. (Optional) Under `Boot Options`, enable `Start virtual machine on host boot up`.
-16. Navigate to 'SATA Disk 1' and set the `Disk bus` type to `VirtIO`. This allows disk access to be paravirtualised, improving virtual machine performance.
+15. Navigate to 'SATA Disk 1' and set the `Disk bus` type to `VirtIO`. This allows disk access to be paravirtualised, improving virtual machine performance.
-17. Navigate to 'NIC' and set the `Device model` type to `virtio` to enable paravirtualised networking.
+16. Navigate to 'NIC' and set the `Device model` type to `virtio` to enable paravirtualised networking.
-18. Click the `Add Hardware` button in the lower left, and choose `Storage`. For `Device type`, select `CDROM device` and choose the VirtIO driver `.ISO` you downloaded earlier. Click `Finish` to add the new CD-ROM device.
+17. Click the `Add Hardware` button in the lower left, and choose `Storage`. For `Device type`, select `CDROM device` and choose the VirtIO driver `.ISO` you downloaded earlier. Click `Finish` to add the new CD-ROM device.
> [!IMPORTANT]
> If you skip this step, the Windows installer will fail to recognise and list the virtual hard drive you created earlier.
@@ -333,14 +231,121 @@ Together, these components form a powerful and flexible virtualization stack, wi
-19. Click `Begin Installation` in the top left.
+
+(Optional) Assign Specific Physical CPU Cores
-
-
-
+Assigning specific physical CPU cores to the virtual machine can improve performance by reducing context switching and ensuring that the virtual machine's workload consistently uses the same cores, leading to better CPU cache utilisation. This is an optional step.
+
+1. Run `lscpu -e` to determine which L1, L2 and L3 caches are associated with which CPU cores.
+
+ Example 1 (Intel 11th Gen Core i7-1185G7):
+ ```
+ CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ MINMHZ
+ 0 0 0 0 0:0:0:0 yes 4800.0000 400.0000
+ 1 0 0 1 1:1:1:0 yes 4800.0000 400.0000
+ 2 0 0 2 2:2:2:0 yes 4800.0000 400.0000
+ 3 0 0 3 3:3:3:0 yes 4800.0000 400.0000
+ 4 0 0 0 0:0:0:0 yes 4800.0000 400.0000
+ 5 0 0 1 1:1:1:0 yes 4800.0000 400.0000
+ 6 0 0 2 2:2:2:0 yes 4800.0000 400.0000
+ 7 0 0 3 3:3:3:0 yes 4800.0000 400.0000
+ ```
+
+ - C0 = T0+T4 → L10+L20+L30
+ - C1 = T1+T5 → L11+L21+L30
+ - C2 = T2+T6 → L12+L22+L30
+ - C3 = T3+T7 → L13+L23+L30
+
+ Example 2 (AMD Ryzen 5 1600):
+ ```
+ CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ MINMHZ
+ 0 0 0 0 0:0:0:0 yes 3800.0000 1550.0000
+ 1 0 0 0 0:0:0:0 yes 3800.0000 1550.0000
+ 2 0 0 1 1:1:1:0 yes 3800.0000 1550.0000
+ 3 0 0 1 1:1:1:0 yes 3800.0000 1550.0000
+ 4 0 0 2 2:2:2:0 yes 3800.0000 1550.0000
+ 5 0 0 2 2:2:2:0 yes 3800.0000 1550.0000
+ 6 0 0 3 3:3:3:1 yes 3800.0000 1550.0000
+ 7 0 0 3 3:3:3:1 yes 3800.0000 1550.0000
+ 8 0 0 4 4:4:4:1 yes 3800.0000 1550.0000
+ 9 0 0 4 4:4:4:1 yes 3800.0000 1550.0000
+ 10 0 0 5 5:5:5:1 yes 3800.0000 1550.0000
+ 11 0 0 5 5:5:5:1 yes 3800.0000 1550.0000
+ ```
+
+ - C0 = T0+T1 → L10+L20+L30
+ - C1 = T2+T3 → L11+L21+L30
+ - C2 = T4+T5 → L12+L22+L30
+ - C3 = T6+T7 → L13+L23+L31
+ - C4 = T8+T9 → L14+L24+L31
+ - C5 = T10+T11 → L15+L25+L31
+
+2. Select which CPU cores to 'pin'. You should aim to select a combination of CPU cores that minimises sharing of caches between Windows and GNU/Linux.
+
+ Example 1:
+ - 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.
+ - Thus, if limiting the virtual machine to a maximum of 4 threads, there are 10 possible optimal configurations:
+ - T0+T4
+ - T1+T5
+ - T2+T6
+ - T3+T7
+ - T0+T4+T1+T5
+ - T0+T4+T2+T6
+ - T0+T4+T3+T7
+ - T1+T5+T2+T6
+ - T1+T5+T3+T7
+ - T2+T6+T3+T7
+
+ Example 2:
+ - Threads 0-5 utilise one L3 cache whereas threads 6-11 utilise a different L3 cache. Thus, one of these two sets of threads should be pinned to the virtual machine.
+ - Pinning and isolating fewer than these (e.g. threads 8-11) would result in the host system making use of the L3 cache in threads 6 and 7, resulting in cache evictions and therefore bad performance.
+ - Thus, there are only two possible optimal configurations:
+ - T0+T1+T2+T3+T4+T5
+ - T6+T7+T8+T9+T10+T11
+
+3. Prepare and add/modify the following to the ``, `` and `` sections, adjusting the values to match your selected threads.
+
+ Example 1: The following selects 'T2+T6+T3+T7'.
+
+ ```xml
+ 4
+
+
+
+
+
+
+
+
+
+ ```
+
+ Example 2: The following selects 'T6+T7+T8+T9+T10+T11'.
+
+ ```xml
+ 6
+
+
+
+
+
+
+
+
+
+
+
+ ```
+
+> [!NOTE]
+> More information on configuring CPU pinning can be found in [this excellent guide](https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#CPU_pinning).
+
+
-### Example `.XML` File
Below is an example `.XML` file that describes a Windows 11 virtual machine.
+
+Example .XML File
```xml
@@ -563,14 +568,21 @@ Below is an example `.XML` file that describes a Windows 11 virtual machine.
```
+
+
## Install Windows
-Install Windows as you would on any other machine.
+Click `Begin Installation` in the top left.
+
+
+
+
Once you get to the point of selecting the location for installation, you will see there are no disks available. This is because the `VirtIO driver` needs to be specified manually.
+
1. Select `Load driver`.
@@ -615,19 +627,17 @@ Following the above, choose to "Continue with limited setup".
## Final Configuration Steps
-Open `File Explorer` and navigate to the drive where the `VirtIO` driver `.ISO` is mounted. Run `virtio-win-gt-x64.exe` to launch the `VirtIO` driver installer.
+Open `File Explorer` and navigate to the drive where the "virtio-win" `.iso` is mounted. Run `virtio-win-guest-tools.exe` to install all necessary drivers as well as `QEMU Guest Agent`. Leave everything as default and click `Next` through the installer.
-Leave everything as default and click `Next` through the installer. This will install all required device drivers as well as the 'Memory Ballooning' service.
-
-Next, install the `QEMU Guest Agent` within Windows. This agent allows the GNU/Linux host to request a graceful shutdown of the Windows system. To do this, either run `virtio-win-guest-tools.exe` or `guest-agent\qemu-ga-x86_64.msi`. You can confirm the guest agent was successfully installed by running `Get-Service QEMU-GA` within a PowerShell window. The output should resemble:
+Confirm `QEMU Guest Agent` was successfully installed by running `Get-Service QEMU-GA` within a PowerShell window. The output should resemble:
```
Status Name DisplayName
@@ -654,7 +664,7 @@ You can then test whether the host GNU/Linux system can communicate with Windows
}
```
-Next, you will need to make some registry changes to enable RDP Applications to run on the system. Start by downloading the [RDPApps.reg](../oem/RDPApps.reg) file, right-clicking on the `Raw` button, and clicking on `Save target as`. Repeat the same thing for the [install.bat](../oem/install.bat) and the [NetProfileCleanup.ps1](../oem/NetProfileCleanup.ps1). **Do not download the Container.reg.**
+Next, you will need to make some registry changes to enable RDP Applications to run on the system. Start by downloading the [RDPApps.reg](../oem/RDPApps.reg) file, right-clicking on the `Raw` button, and clicking on `Save target as`. Repeat the same thing for the [install.bat](../oem/install.bat) and the [NetProfileCleanup.ps1](../oem/NetProfileCleanup.ps1). **Do not download 'Container.reg'** - this file is only required for users using docker or podman.
@@ -666,33 +676,11 @@ Once you have downloaded all three files, right-click the install.bat and select
-Rename the Windows virtual machine so that WinApps can locate it by navigating to the start menu and typing `About` to bring up the `About your PC` settings.
+Once this is complete, restart the Windows virtual machine.
-
-
-
+
+(Optional) Configuring a Fallback Shared Folder
-Scroll down and click on `Rename this PC`.
-
-
-
-
-
-Rename the PC to `RDPWindows`, but **DO NOT** restart the virtual machine.
-
-
-
-
-
-Scroll down to `Remote Desktop`, and enable `Enable Remote Desktop`.
-
-
-
-
-
-At this point, you will need to restart the Windows virtual machine.
-
-## (Optional) Configuring a Fallback Shared Folder
When connecting to Windows through FreeRDP, your home folder will be shared automatically. However, this sharing setup does not apply when using Windows via virt-manager. To configure a fallback shared folder, follow these steps:
1. Navigate to "Virtual Hardware Details", then "Memory" and then check the box for "Enable shared memory".
@@ -709,7 +697,11 @@ When connecting to Windows through FreeRDP, your home folder will be shared auto
5. Reboot Windows.
-## (Optional) Configuring a Static IP Address
+
+
+
+(Optional) Configuring a Static IP Address
+
1. Identify the Windows MAC address.
```bash
virsh dumpxml "RDPWindows" | grep "mac address"
@@ -744,12 +736,18 @@ When connecting to Windows through FreeRDP, your home folder will be shared auto
5. Reboot Windows.
+
+
+
+(Optional) Installing Spice Guest Tools
+
+You may also wish to install [Spice Guest Tools](https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe) inside the virtual machine, which enables features like auto-desktop resize and cut-and-paste when accessing the virtual machine through `virt-manager`. Since WinApps uses RDP, however, this is unnecessary if you don't plan to access the virtual machine via `virt-manager`.
+
+
+
## Installing Windows Software and Configuring WinApps
You may now proceed to install other applications like 'Microsoft 365', 'Adobe Creative Cloud' or any other applications you would like to use through WinApps.
-> [!NOTE]
-> You may also wish to install [Spice Guest Tools](https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe) inside the virtual machine, which enables features like auto-desktop resize and cut-and-paste when accessing the virtual machine through `virt-manager`. Since WinApps uses RDP, however, this is unnecessary if you don't plan to access the virtual machine via `virt-manager`.
-
> [!IMPORTANT]
> Ensure `WAFLAVOR` is set to `"libvirt"` in your `~/.config/winapps/winapps.conf` to prevent WinApps looking for a `Docker` installation instead.
diff --git a/docs/libvirt_images/24.png b/docs/libvirt_images/24.png
index 42da615..74aff92 100644
Binary files a/docs/libvirt_images/24.png and b/docs/libvirt_images/24.png differ
diff --git a/docs/libvirt_images/25.png b/docs/libvirt_images/25.png
index 9c8f68c..f75edcf 100644
Binary files a/docs/libvirt_images/25.png and b/docs/libvirt_images/25.png differ
diff --git a/docs/libvirt_images/28.png b/docs/libvirt_images/28.png
deleted file mode 100644
index 258ad55..0000000
Binary files a/docs/libvirt_images/28.png and /dev/null differ
diff --git a/docs/libvirt_images/29.png b/docs/libvirt_images/29.png
deleted file mode 100644
index 7e72ff3..0000000
Binary files a/docs/libvirt_images/29.png and /dev/null differ
diff --git a/docs/libvirt_images/30.png b/docs/libvirt_images/30.png
deleted file mode 100644
index 5668f62..0000000
Binary files a/docs/libvirt_images/30.png and /dev/null differ
diff --git a/docs/libvirt_images/31.png b/docs/libvirt_images/31.png
deleted file mode 100644
index 9cb9204..0000000
Binary files a/docs/libvirt_images/31.png and /dev/null differ
diff --git a/oem/RDPApps.reg b/oem/RDPApps.reg
index f9e4b79..2de1b21 100644
--- a/oem/RDPApps.reg
+++ b/oem/RDPApps.reg
@@ -1,5 +1,17 @@
Windows Registry Editor Version 5.00
+ ; Enable Remote Desktop
+ ; NOTE: The relevant firewall rule must be added separately with either:
+ ; Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
+ ; or
+ ; netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
+ [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]
+ "fDenyTSConnections"=dword:00000000
+
+ ; Require Network Level Authentication (NLA) for Remote Desktop
+ [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
+ "UserAuthentication"=dword:00000001
+
; Disable RemoteApp allowlist so all applications can be used in Remote Desktop sessions
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList]
"fDisabledAllowList"=dword:00000001
diff --git a/oem/install.bat b/oem/install.bat
index 92bcc38..d786c70 100644
--- a/oem/install.bat
+++ b/oem/install.bat
@@ -1,33 +1,50 @@
@echo off
title WinApps Setup Wizard
-REM Check for administrative privileges
+:: Check for administrative privileges
fltmc >nul 2>&1 || (
echo [INFO] Script not running as administrator. Attempting to relaunch with elevation...
powershell -Command "Start-Process '%~f0' -Verb runAs"
- exit /b 0
+ exit /b
)
-REM Confirm the user wants to proceed with setup
echo ============================================
echo WinApps Setup Wizard
echo ============================================
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
+:: Apply RDP and system configuration tweaks
echo [INFO] Importing "RDPApps.reg"...
-reg import "%~dp0RDPApps.reg" >nul 2>&1
-if %ERRORLEVEL% equ 0 (
- echo [SUCCESS] Imported "RDPApps.reg".
+if exist "%~dp0RDPApps.reg" (
+ reg import "%~dp0RDPApps.reg" >nul 2>&1
+ if %ERRORLEVEL% equ 0 (
+ echo [SUCCESS] Imported "RDPApps.reg".
+ ) else (
+ echo [ERROR] Failed to import "RDPApps.reg".
+ )
) else (
- echo [ERROR] Failed to import "RDPApps.reg".
+ echo [ERROR] "RDPApps.reg" not found. Skipping...
)
-REM Configure the system clock to use UTC instead of local time
+:: Allow Remote Desktop connections through the firewall
+echo [INFO] Allowing Remote Desktop connections through the firewall...
+powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass ^
+ -Command "if (Get-Command Enable-NetFirewallRule -ErrorAction SilentlyContinue) { try { Enable-NetFirewallRule -DisplayGroup 'Remote Desktop' -ErrorAction Stop; exit 0 } catch { exit 1 } } else { exit 2 }" >nul 2>&1
+if %ERRORLEVEL% equ 0 (
+ echo [SUCCESS] Firewall changes applied successfully.
+) else (
+ :: Fallback to using 'netsh' to make the firewall modification
+ netsh advfirewall firewall set rule group="remote desktop" new enable=Yes >nul 2>&1
+ if %ERRORLEVEL% equ 0 (
+ echo [SUCCESS] Firewall changes applied successfully.
+ ) else (
+ echo [ERROR] Failed to apply firewall changes.
+ echo Please manually enable Remote Desktop via 'Settings ► System ► Remote Desktop'.
+ )
+)
+
+:: Configure the system clock to use UTC instead of local time
if exist "%~dp0Container.reg" (
echo [INFO] Importing "Container.reg"...
reg import "%~dp0Container.reg" >nul 2>&1
@@ -40,15 +57,15 @@ if exist "%~dp0Container.reg" (
echo [WARNING] "Container.reg" not found. Skipping...
)
-REM Create a startup task to clean up stale network profiles
+:: 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
+:: 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 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%".
@@ -60,7 +77,3 @@ if %ERRORLEVEL% neq 0 (
echo [ERROR] Failed to create scheduled task "%taskname%".
)
)
-
-echo.
-echo Press any key to exit...
-pause >nul