diff --git a/.github/workflows/lictool.yaml b/.github/workflows/lictool.yaml deleted file mode 100644 index 6f095457a824114d28857e59490f040221cf29f3..0000000000000000000000000000000000000000 --- a/.github/workflows/lictool.yaml +++ /dev/null @@ -1,21 +0,0 @@ -on: - pull_request: - push: - branches: [main] - -jobs: - lictool: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: 3.x - - - uses: pre-commit/action@v3.0.1 - with: - extra_args: license-tools - - - uses: pre-commit-ci/lite-action@v1.0.2 - if: always() diff --git a/.github/workflows/update-nix.yaml b/.github/workflows/update-nix.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e9a568c352ec855669fd160cb6769ef90c6f907b --- /dev/null +++ b/.github/workflows/update-nix.yaml @@ -0,0 +1,36 @@ +name: "Update Flake Packages" + +permissions: + contents: write + pull-requests: write + +on: + workflow_dispatch: + schedule: + - cron: "0 10 * * 0" # https://crontab.guru/#0_10_*_*_0 + +jobs: + updateFlakePackages: + 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.3.0 + with: + extra-args: --version=branch + + - name: Build packages + run: nix build .#winapps .#winapps-launcher diff --git a/.license-tools-config.json b/.license-tools-config.json deleted file mode 100644 index c361afa72979f2eccb76f5bba75e40c361be4de3..0000000000000000000000000000000000000000 --- a/.license-tools-config.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "author": { - "from_git": true, - "latest_year_only": true - }, - "title": false, - "style_override_for_suffix": { - ".yaml": "POUND_STYLE", - ".ps1": "POUND_STYLE", - ".bat": "BATCH_STYLE", - "": "POUND_STYLE" - }, - "exclude": [ - "^\\.[^/]+", - "/\\.[^/]+", - "^(.+)\\.(md|svg|png|reg|gif)", - "^(fonts|WinApps-Launcher)(/.*)?", - "apps/access/info", - "apps/access-o365-x86/info", - "apps/access-x86/info", - "apps/acrobat-x-pro/info", - "apps/adobe-cc/info", - "apps/aftereffects-cc/info", - "apps/audition-cc/info", - "apps/bridge-cc/info", - "apps/bridge-cs6/info", - "apps/bridge-cs6-x86/info", - "apps/cmd/info", - "apps/excel/info", - "apps/excel-o365-x86/info", - "apps/excel-x86/info", - "apps/explorer/info", - "apps/iexplorer/info", - "apps/illustrator-cc/info", - "apps/indesign-cc/info", - "apps/lightroom-cc/info", - "apps/onenote/info", - "apps/onenote-o365-x86/info", - "apps/onenote-x86/info", - "apps/outlook/info", - "apps/outlook-o365-x86/info", - "apps/outlook-x86/info", - "apps/photoshop-cc/info", - "apps/photoshop-cs6/info", - "apps/photoshop-cs6-x86/info", - "apps/powerpoint/info", - "apps/powerpoint-o365-x86/info", - "apps/powerpoint-x86/info", - "apps/powershell/info", - "apps/publisher/info", - "apps/publisher-o365-x86/info", - "apps/publisher-x86/info", - "apps/word/info", - "apps/word-o365-x86/info", - "apps/word-x86/info", - "apps/access-o365/info", - "apps/excel-o365/info", - "apps/onenote-o365/info", - "apps/outlook-o365/info", - "apps/powerpoint-o365/info", - "apps/publisher-o365/info", - "apps/word-o365/info", - "install/inquirer.sh", - "oem/RDPApps.reg" - ], - "license": false, - "force_author": false, - "force_license": true, - "custom_license": "SPDX-License-Identifier: AGPL-3.0-or-later" -} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6dba83787cfc285f32b5a01b1507a807ac55c967..04d95f85575d79d98e76601f76da0cc6738349e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,7 @@ ci: autoupdate_branch: "rewrite" - skip: [license-tools] + +exclude: ^(.+)\.patch$ repos: - repo: https://github.com/Lucas-C/pre-commit-hooks @@ -49,8 +50,3 @@ repos: rev: v0.10.0.1 hooks: - id: shellcheck - - - repo: https://github.com/emzeat/mz-lictools - rev: v2.7.0 - hooks: - - id: license-tools diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 09c30ec46e455149bb5558bbc26abe5c28a35864..dd2bfb15934485fddad4f89d3c00914495e1c40d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,9 +3,6 @@ Thank you for contributing to winapps! Before you can contribute, we ask some things of you: - Please follow our Code of Conduct, the Contributor Covenant. You can find a copy in this repository or under https://www.contributor-covenant.org/ -- All Contributors have to sign [a CLA](https://gist.github.com/oskardotglobal/35f0a72eb45fcc7087e535561383dbc5) for legal reasons. When opening a PR, @cla-assitant will prompt you and guide you through the process. However, if you contribute on behalf of a legal entity, we ask of you to sign [a different CLA](https://gist.github.com/oskardotglobal/75a8cc056e56a439fa6a1551129ae47f). In that case, please contact us. +- All Contributors have to sign [a CLA](https://gist.github.com/oskardotglobal/35f0a72eb45fcc7087e535561383dbc5) for legal reasons. When opening a PR, @cla-assistant will prompt you and guide you through the process. However, if you contribute on behalf of a legal entity, we ask of you to sign [a different CLA](https://gist.github.com/oskardotglobal/75a8cc056e56a439fa6a1551129ae47f). In that case, please contact us. - Please follow code conventions enforced by `pre-commit`. To keep down CI usage, please run it locally before committing too. See <https://pre-commit.com> for installation, then run `pre-commit install` inside the `winapps` repository you cloned. - -All source code files shall have a valid SPDX-Identifier. For more information, see <https://spdx.dev/learn/handling-license-info/>. -This identifier will be generated by a pre-commit hook most of the time. diff --git a/COPYRIGHT.md b/COPYRIGHT.md new file mode 100644 index 0000000000000000000000000000000000000000..a7f4b5c2577a83ec179abace6604437ce657dd52 --- /dev/null +++ b/COPYRIGHT.md @@ -0,0 +1,8 @@ +Some of the files are + + Copyright (c) 2024 fmstrat + +Many files also contain contributions from third parties. +In this case the original copyright of the contributions can be traced through the history of the source version control system. + +When that is not the case, the files contain a prominent notice stating the original copyright and applicable license, or come with their own dedicated COPYRIGHT and/or LICENSE file. diff --git a/LICENSE.md b/LICENSE.md index 42b6cbced363275c37c859289c5605bc27fb5e73..cab3299214f51847c79e5b7b09b8f3a4c1fbb93a 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,3 +1,5 @@ +For copyright information, please see the [COPYRIGHT.md](./COPYRIGHT.md) file. + This project has files licensed under different licenses. The original project by Fmstrat <https://github.com/Fmstrat/winapps/> is not free software. diff --git a/README.md b/README.md index 6dc589683a8ad2e28eccd42419ea39b7295bbd2a..608b989d83cfc5074bdf6e8ae6d82e24e18f15df 100644 --- a/README.md +++ b/README.md @@ -377,7 +377,7 @@ 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) -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 Windows VM or server you wish to use with WinApps, you will still have to follow the [final steps described in the `libvirt` documentation](docs/libvirt.md#final-configuration-steps). #### Step 2: Install Dependencies Install the required dependencies. @@ -385,6 +385,11 @@ Install the required dependencies. ```bash sudo apt install -y dialog freerdp3-x11 iproute2 libnotify-bin netcat-openbsd ``` + +> [!NOTE] +> On Debian you need to enable the `backports` repository for the `freerdp3-x11` package to become available. +> For instructions, see https://backports.debian.org/Instructions. + - Fedora/RHEL: ```bash sudo dnf install -y dialog freerdp iproute libnotify nmap-ncat @@ -393,9 +398,13 @@ Install the required dependencies. ```bash sudo pacman -Syu --needed -y dialog freerdp iproute2 libnotify gnu-netcat ``` + - OpenSUSE: + ```bash + sudo zypper install -y dialog freerdp iproute2 libnotify netcat-openbsd + ``` - Gentoo Linux: ```bash - sudo emerge --ask=n sys-libs/dialog net-misc/freerdp:3 net-misc/iproute2 x11-libs/libnotify net-analyzer/netcat + sudo emerge --ask=n dev-util/dialog net-misc/freerdp:3 sys-apps/iproute2 x11-libs/libnotify net-analyzer/openbsd-netcat ``` > [!NOTE] @@ -423,6 +432,8 @@ Create a configuration file at `~/.config/winapps/winapps.conf` containing the f RDP_USER="MyWindowsUser" # [WINDOWS PASSWORD] +# NOTES: +# - If using FreeRDP v3.9.0 or greater, you *have* to set a password RDP_PASS="MyWindowsPassword" # [WINDOWS DOMAIN] @@ -436,7 +447,7 @@ RDP_DOMAIN="" # - 'docker': '127.0.0.1' # - 'podman': '127.0.0.1' # - 'libvirt': '' (BLANK) -RDP_IP="" +RDP_IP="127.0.0.1" # [WINAPPS BACKEND] # DEFAULT VALUE: 'docker' @@ -459,6 +470,8 @@ WAFLAVOR="docker" RDP_SCALE="100" # [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' # VALID VALUES: See https://github.com/awakecoding/FreeRDP-Manuals/blob/master/User/FreeRDP-User-Manual.markdown RDP_FLAGS="/cert:tofu /sound /microphone" @@ -516,7 +529,13 @@ FREERDP_COMMAND="" > [!NOTE] > If you wish to use an alternative WinApps backend (other than `Docker`), uncomment and change `WAFLAVOR="docker"` to `WAFLAVOR="podman"` or `WAFLAVOR="libvirt"`. -##### Configuration Options Explained +> [!NOTE] +> If you encounter issues with tls certificate getting rejected, delete the existing `.pem` file with +> `rm ~/.config/freerdp/server/127.0.0.1_3389.pem` and run +> `xfreerdp3 /u:MyWindowsUser /p:MyWindowsPassword /v:127.0.0.1 /cert:tofu` +> to set up Trust On First Authentication. Then retry the `setup.sh` script. + +#### 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`. @@ -557,6 +576,121 @@ The installer can be run multiple times. To update your installation of WinApps: 2. Pull the latest changes from the WinApps GitHub repository. 3. Re-install WinApps using the WinApps installer by running `winapps-setup`. +## Installation using Nix + +First, follow Step 1 of the normal installation guide to create your VM. +Then, install WinApps according to the following instructions. + +After installation, it will be available under `winapps`, with the installer being available under `winapps-setup` +and the optional launcher being available under `winapps-launcher.` + +### Using standalone Nix + +First, make sure Flakes and the `nix` command are enabled. +In your `~/.config/nix/nix.conf`: +``` +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 +nix profile install github:winapps-org/winapps#winapps +nix profile install github:winapps-org/winapps#winapps-launcher # optional +``` + +### On NixOS using Flakes + +```nix +# flake.nix +{ + description = "My configuration"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + winapps = { + url = "github:winapps-org/winapps"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + inputs@{ + nixpkgs, + winapps, + ... + }: + { + nixosConfigurations.hostname = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + + specialArgs = { + inherit inputs system; + }; + + modules = [ + ./configuration.nix + ( + { + pkgs, + system ? pkgs.system, + ... + }: + { + # set up binary cache (optional) + nix.settings = { + substituters = [ "https://winapps.cachix.org/" ]; + trusted-public-keys = [ "winapps.cachix.org-1:HI82jWrXZsQRar/PChgIx1unmuEsiQMQq+zt05CD36g=" ]; + }; + + environment.systemPackages = [ + winapps.packages."${system}".winapps + winapps.packages."${system}".winapps-launcher # optional + ]; + } + ) + ]; + }; + }; +} +``` + +### On NixOS without Flakes + +[Flakes aren't real and they can't hurt you.](https://jade.fyi/blog/flakes-arent-real/). +However, if you still don't want to use flakes, you can use WinApps with flake-compat like: + +```nix +# configuration.nix +{ + pkgs, + system ? pkgs.system, + ... +}: +{ + # set up binary cache (optional) + nix.settings = { + substituters = [ "https://winapps.cachix.org/" ]; + trusted-public-keys = [ "winapps.cachix.org-1:HI82jWrXZsQRar/PChgIx1unmuEsiQMQq+zt05CD36g=" ]; + trusted-users = [ "<your username>" ]; # replace with your username + }; + + environment.systemPackages = + let + winapps = + (import (builtins.fetchTarball "https://github.com/winapps-org/winapps/archive/main.tar.gz")) + .packages."${system}"; + in + [ + winapps.winapps + winapps.winapps-launcher # optional + ]; +} +``` + ## Star History <a href="https://star-history.com/#winapps-org/winapps&Date"> <picture> diff --git a/apps/access-o365-x86/info b/apps/access-o365-x86/info index 13de9d5ed83504b372c11ad55a8a4389d7384e04..3c6739f24ffed0f413581b63381c48dfd226b392 100644 --- a/apps/access-o365-x86/info +++ b/apps/access-o365-x86/info @@ -1,8 +1,3 @@ -# Copyright (c) 2024 winapps-org -# All rights reserved. -# -# SPDX-License-Identifier: Unlicense - # GNOME shortcut name NAME="Access" diff --git a/apps/access-x86/info b/apps/access-x86/info index 9bf0bf78d8ff57370d9d7ee29a82c09e977642fb..d37673cd8538ab89629d79846fe1b2eb779b2bce 100644 --- a/apps/access-x86/info +++ b/apps/access-x86/info @@ -1,8 +1,3 @@ -# Copyright (c) 2024 winapps-org -# All rights reserved. -# -# SPDX-License-Identifier: Unlicense - # GNOME shortcut name NAME="Access" diff --git a/apps/acrobat9/info b/apps/acrobat9/info index 05d285aa320798c935664fab6683dad64f036093..76e8261042ec4b7d2a2898dc4383efb65f2ba427 100644 --- a/apps/acrobat9/info +++ b/apps/acrobat9/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Adam -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # GNOME shortcut name NAME="Acrobat 9" diff --git a/apps/excel-x86-2010/info b/apps/excel-x86-2010/info index 29df3dce5822bf81e156cd6fc9b6ce34f03dbce2..e02703249d47782ffc939218034bcb641a2e5f07 100644 --- a/apps/excel-x86-2010/info +++ b/apps/excel-x86-2010/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Adam -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # GNOME shortcut name NAME="Excel" diff --git a/apps/linqpad8/icon.svg b/apps/linqpad8/icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..79b88c0084e4192c78480e9322947473b141c40f --- /dev/null +++ b/apps/linqpad8/icon.svg @@ -0,0 +1 @@ +<svg height="512" width="485" xmlns="http://www.w3.org/2000/svg"><path d="m70.9856796.099867 147.1711121 21.1684494c4.9958038.7186089 9.4206696 3.6028881 12.0942841 7.8835335l186.6232452 298.7956543 57.4749451 24.1019287c7.645813 3.2071838 11.9003601 11.4268799 10.1008911 19.5205688l-28.2246018 127.0107173c-1.741394 7.8406982-8.6961365 13.419281-16.7278442 13.419281h-99.7940979c-7.125061 0-13.5059204-4.4081116-16.026947-11.0715027l-64.8904114-171.496521-33.5339355 10.1796265-70.4281006 162.0817871c-2.7193909 6.257782-8.8930359 10.3066101-15.7168732 10.3066101h-96.77005c-7.6413727 0-14.3593845-5.0597839-16.4699287-12.4033813l-25.2005348-87.697876c-1.6572304-5.7675781-.1771913-11.9810791 3.9016533-16.3813171l182.9347229-197.3772888-20.0501709-34.7536011-57.9149628-11.582901c-5.8025284-1.1605988-10.5960388-5.2325439-12.6790237-10.7717438l-44.3529436-117.9385052c-3.7618599-11.4255447 3.7893296-24.361076 18.4795723-22.9935187zm280.5562821 477.6273974h74.2096558l22.1351318-99.6100159-49.2886963-20.6693725c-3.268219-1.3702698-6.030426-3.7200317-7.9076538-6.7254028l-185.2913666-296.663929-110.6150894-15.9103012 30.805191 81.9140472 56.1917801 11.2383575c4.8348541.9671631 9.0185394 3.969574 11.4824829 8.2403717l30.2406464 52.4171143c3.7544861 6.5073547 2.8321075 14.7019501-2.2749481 20.2121124l-184.9527245 199.5542717 18.9663582 66.0027466h72.6262665l69.107048-159.0409546c2.0032501-4.6099243 5.9295197-8.1074829 10.7392731-9.5673523l56.4487152-17.1363525c8.6380615-2.6244202 17.8136292 1.8988953 21.0050354 10.3322144z"/></svg> diff --git a/apps/linqpad8/info b/apps/linqpad8/info new file mode 100644 index 0000000000000000000000000000000000000000..c24dfd7a2c6da5ac41d550de95311e626e3fd165 --- /dev/null +++ b/apps/linqpad8/info @@ -0,0 +1,14 @@ +# GNOME shortcut name +NAME="LINQPad8" + +# Used for descriptions and window class +FULL_NAME="LINQPad 8" + +# The executable inside windows +WIN_EXECUTABLE="C:\Program Files\LINQPad8\LINQPad8.exe" + +# GNOME categories +CATEGORIES="WinApps;Development" + +# GNOME mimetypes +MIME_TYPES="text/cs" diff --git a/apps/mspaint/info b/apps/mspaint/info index 54e44e5a4323ec9fe888e07317c642b2d779b3f6..f9c91ade875b1a03ebaffe012b393d1cecabc138 100644 --- a/apps/mspaint/info +++ b/apps/mspaint/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Adam -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # GNOME shortcut name NAME="Paint" diff --git a/apps/powershell-ide/info b/apps/powershell-ide/info index 6ef8e4e623b0e1562b61fd472b89c7ca75c7f873..4eca7c5815047b8611b0bf25ea50beb53203bce5 100644 --- a/apps/powershell-ide/info +++ b/apps/powershell-ide/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Adam -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # GNOME shortcut name NAME="Powershell" diff --git a/apps/project-x86/info b/apps/project-x86/info index c20250dfa0dbf5c1562309786f33917f92a17e3c..5ebb988adf4d30b5a8a3bc5ec34b55c3b87da198 100644 --- a/apps/project-x86/info +++ b/apps/project-x86/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - -# GNOME shortcut name NAME="Project" # Used for descriptions and window class diff --git a/apps/project/info b/apps/project/info index 0ac47a27796ef3009577a931a640efe983954aa6..d5d904b894a463df85cfd594f15931cd7e891d29 100644 --- a/apps/project/info +++ b/apps/project/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Gordon Cheong -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # GNOME shortcut name NAME="Project" diff --git a/apps/remarkable-desktop/icon.svg b/apps/remarkable-desktop/icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..0586794207cb818f5842a78a9c95ceb8cb0600e3 --- /dev/null +++ b/apps/remarkable-desktop/icon.svg @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> + +<svg + version="1.1" + id="Livello_1" + x="0px" + y="0px" + viewBox="0 0 1881.25 1750" + enable-background="new 0 0 1881.25 1750" + xml:space="preserve" + sodipodi:docname="icon.svg" + inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:ns="&ns_sfw;"><defs + id="defs34" /><sodipodi:namedview + id="namedview32" + pagecolor="#ffffff" + bordercolor="#000000" + borderopacity="0.25" + inkscape:showpageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" + showgrid="false" + inkscape:zoom="0.58685714" + inkscape:cx="940.6037" + inkscape:cy="800.02434" + inkscape:window-width="2494" + inkscape:window-height="1371" + inkscape:window-x="66" + inkscape:window-y="32" + inkscape:window-maximized="1" + inkscape:current-layer="Livello_1" /> +<metadata + id="metadata2"> + <ns:sfw> + <ns:slices /> + <ns:sliceSourceBounds + bottomLeftOrigin="true" + height="1750" + width="1881.25" + x="-938.5" + y="-851" /> + </ns:sfw> +</metadata> + + + + + + + + +<linearGradient + id="SVGID_1_" + gradientUnits="userSpaceOnUse" + x1="167.2057" + y1="1420.9117" + x2="795.2943" + y2="333.0883" + gradientTransform="matrix(1 0 0 -1 0 1752)"> + <stop + offset="0" + style="stop-color:#2368C4" + id="stop20" /> + <stop + offset="0.5" + style="stop-color:#1A5DBE" + id="stop22" /> + <stop + offset="1" + style="stop-color:#1146AC" + id="stop24" /> +</linearGradient> + + +<rect + style="fill:#fff6d5" + id="rect399" + width="1881.25" + height="1750" + x="0" + y="0" + ry="134.62839" /><text + xml:space="preserve" + style="font-size:1066.67px;fill:#000000;-inkscape-font-specification:serif;font-family:serif;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal" + x="204.01395" + y="1266.3248" + id="text295"><tspan + sodipodi:role="line" + id="tspan293" + x="204.01395" + y="1266.3248">rM</tspan></text></svg> diff --git a/apps/remarkable-desktop/info b/apps/remarkable-desktop/info new file mode 100644 index 0000000000000000000000000000000000000000..34f47f549e7c4f362125214695c4def4045da69a --- /dev/null +++ b/apps/remarkable-desktop/info @@ -0,0 +1,17 @@ +# GNOME shortcut name +NAME="reMarkable" + +# Used for descriptions and window class +FULL_NAME="reMarkable Desktop App" + +# The executable inside windows +WIN_EXECUTABLE="C:\Program Files\reMarkable\reMarkable.exe" + +# GNOME categories +CATEGORIES="WinApps;Office" + +# GNOME mimetypes +MIME_TYPES="" + +# System Icon +ICON="reMarkable" diff --git a/apps/ssms20/icon.svg b/apps/ssms20/icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..656911f76190bab266fb1c934a850b6562b4a7c5 --- /dev/null +++ b/apps/ssms20/icon.svg @@ -0,0 +1,61 @@ +<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="200px" height="200px" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" viewBox="0 0 8.53 8.53" xmlns:xlink="http://www.w3.org/1999/xlink"> + <defs> + <style type="text/css"> + <![CDATA[ + .fil0 {fill:none} + .fil7 {fill:#007400} + .fil6 {fill:#017901} + .fil5 {fill:#107B10} + .fil3 {fill:#3C3C41} + .fil12 {fill:#439043} + .fil10 {fill:#5EA05E} + .fil8 {fill:#6EA76E} + .fil9 {fill:#78AC78} + .fil11 {fill:#94BC94} + .fil13 {fill:#B9B9BB} + .fil2 {fill:#D2D2D2} + .fil1 {fill:#FEB900} + .fil4 {fill:#FFDC80} + ]]> + </style> + </defs> + <g id="Layer_x0020_1"> + <metadata id="CorelCorpID_0Corel-Layer"/> + <g id="_2075241592848"> + <rect class="fil0" width="8.53" height="8.53"/> + <g> + <path class="fil1" d="M1.74 1.57c0.26,-0.2 0.37,-0.27 0.77,-0.35 1.81,-0.4 3.75,0.46 1.87,0.85 -0.64,0.13 -1.36,0.13 -1.99,-0.03 -0.24,-0.07 -0.65,-0.17 -0.65,-0.47zm1.92 2.92l0.13 0.11c0.07,-0.07 0.03,0.02 0.05,-0.12 0,-0.01 0,-0.11 0,-0.12l0 -1.95c0.18,-0.04 0.39,-0.04 0.58,-0.08 0.16,-0.04 0.38,-0.13 0.51,-0.14l-0.01 1.9c0.32,0.1 0.4,0.44 0.49,0.55 0.03,-0.74 0.01,-2.1 0,-2.94 0,-0.32 -0.18,-0.45 -0.42,-0.57 -0.81,-0.38 -2.52,-0.39 -3.24,0.09 -0.24,0.17 -0.28,0.3 -0.28,0.67l0 2.96c0,0.38 0.08,0.5 0.32,0.65 0.19,0.11 0.48,0.2 0.74,0.26 0.59,0.12 1.2,0.11 1.82,0 -0.58,-0.26 -0.85,-0.46 -0.69,-1.27z"/> + <path class="fil2" d="M1.74 1.57c0,0.3 0.41,0.4 0.65,0.47 0.63,0.16 1.35,0.16 1.99,0.03 1.88,-0.39 -0.06,-1.25 -1.87,-0.85 -0.4,0.08 -0.51,0.15 -0.77,0.35z"/> + <path class="fil3" d="M5.81 6.23c0.25,-0.15 0.23,-0.41 0.33,-0.52 0.08,-0.1 0.14,-0.09 0.3,-0.14 0.15,-0.05 1.03,-0.96 1.06,-1.04l-0.61 -0.53c-0.19,0.29 -0.58,0.59 -0.83,0.83 -0.2,0.18 -0.15,0.11 -0.18,0.26 -0.08,0.39 -0.3,0.29 -0.45,0.37 -0.08,0.05 -0.13,0.14 -0.21,0.19 0.07,0.09 0.12,0.11 0.2,0.21 -0.07,0.07 -0.12,0.15 -0.2,0.22 -0.2,0.19 -0.48,0.41 -0.63,0.6 -0.3,0.38 -0.15,-0.12 -0.63,0.6 -0.13,0.2 -0.13,0.19 -0.09,0.24 0.09,0.09 0.16,0 0.28,-0.08 0.27,-0.18 0.3,-0.12 0.43,-0.38 0.04,-0.08 0.09,-0.12 0.17,-0.19l0.4 -0.43c0.13,-0.13 0.28,-0.32 0.44,-0.41l0.22 0.2z"/> + <path class="fil4" d="M3.79 4.6c0.37,0.3 0.25,0.5 0.75,0.31l0.1 -0.31c-0.15,-0.25 -0.39,-0.36 -0.53,-0.56 0.24,-0.04 0.6,-0.13 0.81,0.05l0.01 -1.9c-0.13,0.01 -0.35,0.1 -0.51,0.14 -0.19,0.04 -0.4,0.04 -0.58,0.08l0 1.95c0,0.01 0,0.11 0,0.12 -0.02,0.14 0.02,0.05 -0.05,0.12z"/> + <path class="fil3" d="M4.31 4.15l0.44 0.39 -0.13 0.45 -0.45 0.1 -0.46 -0.42c-0.08,0.47 0.15,0.78 0.46,0.92 0.27,0.11 0.52,0.02 0.6,0.05 0.11,0.05 0.23,0.25 0.36,0.31l0.09 -0.07c-0.05,-0.12 -0.11,-0.14 -0.19,-0.23 0.04,-0.07 0.03,-0.06 0.09,-0.13l0.24 -0.2c0.14,-0.07 0.08,0.03 0.11,-0.04 0,0 0.01,0 0.02,0 -0.16,-0.23 -0.2,-0.09 -0.18,-0.37 0.04,-0.57 -0.39,-0.83 -0.95,-0.84 -0.06,0.03 -0.01,0 -0.05,0.08z"/> + <path class="fil3" d="M5.84 6.42c-0.17,-0.08 -0.23,-0.27 -0.3,-0.14 -0.03,0.04 -0.02,0 -0.01,0.07 0,0.04 0.05,0.08 0.08,0.11 0.3,0.27 0.76,0.69 1.02,0.98 0.22,0.25 0.7,0.13 0.69,-0.25 -0.01,-0.31 -0.67,-0.73 -1.1,-1.24 -0.01,0.01 -0.01,0.02 -0.02,0.02 -0.11,0.23 -0.1,0.17 -0.36,0.45z"/> + <polygon class="fil5" points="0.85,7.67 1.09,7.67 1.1,7.42 0.84,7.42 "/> + <polygon class="fil5" points="7.43,1.1 7.68,1.1 7.68,0.85 7.44,0.85 "/> + <polygon class="fil5" points="0.84,6.82 1.07,6.83 1.07,6.57 0.84,6.57 "/> + <polygon class="fil5" points="7.45,2.39 7.59,2.38 7.68,2.38 7.68,2.26 7.68,2.13 7.45,2.13 "/> + <polygon class="fil5" points="0.84,7.25 1.07,7.25 1.07,7 0.84,7 "/> + <polygon class="fil5" points="7.45,1.53 7.5,1.53 7.68,1.53 7.68,1.4 7.68,1.27 7.45,1.27 "/> + <polygon class="fil5" points="0.84,6.4 1.07,6.4 1.07,6.14 0.85,6.14 "/> + <polygon class="fil5" points="7.45,1.96 7.68,1.96 7.68,1.83 7.68,1.7 7.45,1.7 "/> + <polygon class="fil5" points="1.28,7.67 1.52,7.67 1.51,7.45 1.27,7.45 "/> + <path class="fil6" d="M7.22 0.91l0 0.12 -0.19 0 0 -0.12 0.19 0zm-0.22 0.17l0.26 0 -0.01 -0.23 -0.24 0 -0.01 0.23z"/> + <path class="fil6" d="M1.89 7.49l0 0.13 -0.15 0 0 -0.13 0.15 0zm-0.2 0.17l0.24 0 0.01 -0.19 -0.24 0 -0.01 0.19z"/> + <path class="fil6" d="M2.17 7.49l0.15 0 0 0.13 -0.15 0 0 -0.13zm-0.03 0.17l0.21 0 0 -0.2 -0.21 0.01 0 0.19z"/> + <path class="fil6" d="M6.79 0.91l0 0.12 -0.16 0 0 -0.12 0.16 0zm-0.19 0.15l0.22 0 -0.01 -0.19 -0.21 0.01 0 0.18z"/> + <polygon class="fil5" points="7.03,1.03 7.22,1.03 7.22,0.91 7.03,0.91 "/> + <path class="fil7" d="M6.36 0.9l0 0.13 -0.16 0 0 -0.13 0.16 0zm-0.19 0.16l0.22 0 -0.01 -0.2 -0.21 0 0 0.2z"/> + <path class="fil8" d="M2.14 7.47l0.21 -0.01 0 0.2 -0.21 0 0 -0.19zm-0.03 0.22l0.27 -0.02 -0.01 -0.23 -0.26 0 0 0.25z"/> + <path class="fil9" d="M6.17 0.86l0.21 0 0.01 0.2 -0.22 0 0 -0.2zm-0.02 0.22l0.26 0.01 0.01 -0.24 -0.27 -0.01 0 0.24z"/> + <polygon class="fil5" points="6.2,1.03 6.36,1.03 6.36,0.9 6.2,0.9 "/> + <polygon class="fil5" points="2.32,7.62 2.32,7.49 2.17,7.49 2.17,7.62 "/> + <polygon class="fil5" points="1.74,7.62 1.89,7.62 1.89,7.49 1.74,7.49 "/> + <polygon class="fil5" points="6.63,1.03 6.79,1.03 6.79,0.91 6.63,0.91 "/> + <path class="fil10" d="M1.69 7.66c0.1,0.04 0.16,0.03 0.27,0.02l-0.01 -0.24c-0.16,0 -0.16,-0.02 -0.25,0.03l0.24 0 -0.01 0.19 -0.24 0z"/> + <path class="fil11" d="M6.6 1.06l-0.03 0c0.05,0.06 0.18,0.04 0.26,0.01 0.01,-0.04 0.02,-0.06 0.02,-0.1 -0.01,-0.14 0,-0.08 -0.04,-0.12l0 0.02 0.01 0.19 -0.22 0z"/> + <polygon class="fil12" points="6.57,1.06 6.6,1.06 6.6,0.88 6.81,0.87 6.81,0.85 6.58,0.85 "/> + <path class="fil13" d="M4.31 4.15c0.04,-0.08 -0.01,-0.05 0.05,-0.08l-0.06 0.01 0.01 0.07z"/> + </g> + </g> + </g> +</svg> diff --git a/apps/ssms20/info b/apps/ssms20/info new file mode 100644 index 0000000000000000000000000000000000000000..f24d12bad91ad6c7acf78edff6bb5fb68701a5c7 --- /dev/null +++ b/apps/ssms20/info @@ -0,0 +1,14 @@ +# GNOME shortcut name +NAME="SQL Server Management Studio" + +# Used for descriptions and window class +FULL_NAME="SQL Server Management Studio" + +# The executable inside windows +WIN_EXECUTABLE="C:\Program Files (x86)\Microsoft SQL Server Management Studio 20\Common7\IDE\Ssms.exe" + +# GNOME categories +CATEGORIES="Development" + +# GNOME mimetypes +MIME_TYPES="text/sql" diff --git a/apps/visio-x86/info b/apps/visio-x86/info index 8adeb7d715db6f68a76eaf1821230db2445a0608..dc8a1933c6e954a54906d27a0a7851afcbd8dc77 100644 --- a/apps/visio-x86/info +++ b/apps/visio-x86/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Gordon Cheong -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # GNOME shortcut name NAME="Visio" diff --git a/apps/visio/info b/apps/visio/info index a0677fcfc50a6cfbf0aa202880379c0c0ae3dd34..a7ad0be3a5b4dd7fab797e721438b6e1c4b02b9f 100644 --- a/apps/visio/info +++ b/apps/visio/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Gordon Cheong -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # GNOME shortcut name NAME="Visio" diff --git a/apps/visual-studio-comm/info b/apps/visual-studio-comm/info index 93f2f91efd6421f7152c7d7f8a806a34602cc96a..c99a038e8113b7dff4618483707a2d19f540c6fb 100644 --- a/apps/visual-studio-comm/info +++ b/apps/visual-studio-comm/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Gordon Cheong -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # GNOME shortcut name NAME="Visual Studio Community" diff --git a/apps/visual-studio-ent/info b/apps/visual-studio-ent/info index 4c598c6c872aec83ce36184bb4846de73fc7d6fa..81cc124be1a98847ccd3a0768550951e5061b8ee 100644 --- a/apps/visual-studio-ent/info +++ b/apps/visual-studio-ent/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Gordon Cheong -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # GNOME shortcut name NAME="Visual Studio Enterprise" diff --git a/apps/visual-studio-pro/info b/apps/visual-studio-pro/info index 30cf6e7c4d960e1c08a23fe88a71871df1e10a44..0c0886171f4ddc5236fc63102433d1224f2c6e11 100644 --- a/apps/visual-studio-pro/info +++ b/apps/visual-studio-pro/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Gordon Cheong -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # GNOME shortcut name NAME="Visual Studio Professional" diff --git a/apps/word-x86-2010/info b/apps/word-x86-2010/info index 5aa5e9e1df0d74f00f0f7a229bfb761203c086ed..70f388185ff21fcd8c83ace0ca2f14b09cd04dc3 100644 --- a/apps/word-x86-2010/info +++ b/apps/word-x86-2010/info @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Adam -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # GNOME shortcut name NAME="Word" diff --git a/bin/winapps b/bin/winapps index 3030aff7bdee031d40c92370be7d0ab17c1e5f6f..92280e03150b70c590c5d18e586282da84d36b75 100755 --- a/bin/winapps +++ b/bin/winapps @@ -1,12 +1,4 @@ #!/usr/bin/env bash -# Copyright (c) 2024 Felix Bartels -# Copyright (c) 2024 Rhea Barar -# Copyright (c) 2024 Rohan Barar -# Copyright (c) 2024 Oskar Manhart -# Copyright (c) 2024 escapefreeg -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later ### GLOBAL CONSTANTS ### # ERROR CODES @@ -42,7 +34,7 @@ readonly CONTAINER_NAME="WinApps" # FOR 'docker' AND 'podman' ONLY readonly RDP_PORT=3389 readonly DOCKER_IP="127.0.0.1" # shellcheck disable=SC2155 # Silence warnings regarding masking return values through simultaneous declaration and assignment. -readonly RUN="$(date)-${RANDOM}" +readonly RUNID="${RANDOM}" ### GLOBAL VARIABLES ### # WINAPPS CONFIGURATION FILE @@ -162,7 +154,7 @@ Please run: # Name: 'dprint' # Role: Conditionally print debug messages to a log file, creating it if it does not exist. function dprint() { - [ "$DEBUG" = "true" ] && echo "[$RUN] $1" >>"$LOG_PATH" + [ "$DEBUG" = "true" ] && echo "[$(date)-$RUNID] $1" >>"$LOG_PATH" } # Name: 'waFixScale' diff --git a/compose.yaml b/compose.yaml index 3bd9357db8319ec3c9a7e6291059d1c81b402093..a03c65ffc271acdd0ac00c4d6e38a34d02f2e5f6 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Oskar Manhart -# Copyright (c) 2024 Rohan Barar -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - # For documentation, FAQ, additional configuration options and technical help, visit: https://github.com/dockur/windows # Modified for IMGW @@ -16,8 +10,8 @@ volumes: data: services: windows: - image: docker.io/dockurr/windows # https://hub.docker.com/r/dockurr/windows # image: dockurr/windows # https://harbor.wolke.img.univie.ac.at/podman/windows + image: ghcr.io/dockur/windows:latest container_name: WinApps # Created Docker VM Name. environment: # Version of Windows to configure. For valid options, visit: @@ -28,8 +22,8 @@ services: CPU_CORES: "4" # CPU cores allocated to the Windows VM. DISK_SIZE: "20G" # 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. - USERNAME: "Docker" # Uncomment to set a custom Windows username. The default is 'Docker'. - PASSWORD: "docker" # Uncomment to set a password for the Windows user. There is no default password. + USERNAME: "MyWindowsUser" # Edit here to set a custom Windows username. The default is 'MyWindowsUser'. + PASSWORD: "MyWindowsPassword" # Edit here to set a password for the Windows user. The default is 'MyWindowsPassword'. HOME: "${HOME}" # Set path to Linux user home folder. privileged: true # Grant the Windows VM extended privileges. ports: @@ -46,10 +40,9 @@ services: #- /path/to/windows/install/media.iso:/custom.iso # Uncomment to use a custom Windows ISO. If specified, 'VERSION' (e.g. 'tiny11') will be ignored. devices: - /dev/kvm # Enable KVM. - #- /dev/sdX:/disk1 # Uncomment to mount a disk directly within the Windows VM (Note: 'disk1' will be mounted as the main drive). - #- /dev/sdY:/disk2 # Uncomment to mount a disk directly within the Windows VM (Note: 'disk2' and higher will be mounted as secondary drives). - #annotations: + #- /dev/sdX:/disk1 # Uncomment to mount a disk directly within the Windows VM (Note: 'disk1' will be mounted as the main drive. THIS DISK WILL BE FORMATTED BY DOCKER). + #- /dev/sdY:/disk2 # Uncomment to mount a disk directly within the Windows VM (Note: 'disk2' and higher will be mounted as secondary drives. THIS DISK WILL NOT BE FORMATTED). + #annotations: # Maybe this allows the container to be correctly shutdown. #org.systemd.property.KillMode: "none" #org.systemd.property.TimeoutStopSec: 420 - diff --git a/default.nix b/default.nix new file mode 100644 index 0000000000000000000000000000000000000000..1d976a357629ddff8747d676131cd2fc52b7e434 --- /dev/null +++ b/default.nix @@ -0,0 +1,11 @@ +(import ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in + fetchTarball { + url = + lock.nodes.flake-compat.locked.url + or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } +) { src = ./.; }).defaultNix diff --git a/docs/docker.md b/docs/docker.md index afeccaa1ba2b4ccabe00d374ebe38a4ff53ccd06..0d3e00e60c8ec6e06f54fcfcea78f0d27625b3bd 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -6,13 +6,19 @@ Although WinApps supports using `QEMU+KVM+libvirt` as a backend for running Wind > [!IMPORTANT] > WinApps does __NOT__ officially support versions of Windows prior to Windows 10. Despite this, it may be possible to achieve a successful installation with some additional experimentation. If you find a way to achieve this, please share your solution through a pull request for the benefit of other users. +> Possible setup instructions for Windows 10: +> - 'Professional', 'Enterprise' or 'Server' editions of Windows are required to run RDP applications. Windows 'Home' will __NOT__ suffice. It is recommended to download the ISO from a reputed source, as the built in downloader from dockur (default set to `tiny11`) will take longer than it would to download from a browser/torrent. +> - It is recommended to edit the initial `compose.yaml` file to keep your required username and password from the beginning. +> - It is recommended to not use `sudo` to force commands to run. Add your user to the relevant permissions group wherever possible. + + ## `Docker` ### Installation You can find a guide for installing `Docker Engine` [here](https://docs.docker.com/engine/install/). ### Setup `Docker` Container -WinApps utilises `docker compose` to configure Windows VMs. A template [`compose.yaml`](https://github.com/winapps-org/winapps/blob/main/compose.yaml) is provided. +WinApps utilises `docker compose` to configure Windows VMs. A template [`compose.yaml`](../compose.yaml) is provided. Prior to installing Windows, you can modify the RAM and number of CPU cores available to the Windows VM by changing `RAM_SIZE` and `CPU_CORES` within `compose.yaml`. @@ -23,6 +29,12 @@ It is also possible to specify the version of Windows you wish to install within Please refer to the [original GitHub repository](https://github.com/dockur/windows) for more information on additional configuration options. +> [!NOTE] +> If you want to undo all your changes and start from scratch, run the following. For `podman`, replace `docker compose` with `podman-compose`. +> ```bash +> docker compose down --rmi=all --volumes +> ``` + ### Installing Windows You can initiate the Windows installation using `docker compose`. ```bash @@ -112,9 +124,6 @@ podman-compose --file ./compose.yaml down podman-compose --file ~/.config/winapps/compose.yaml up ``` -### Installing WinApps -Please follow the [`docker` instructions](#installing-winapps). - ### Changing `compose.yaml` Changes to `compose.yaml` require the Windows virtual machine to be removed and re-created. This should __NOT__ affect your data. diff --git a/docs/libvirt.md b/docs/libvirt.md index 65869131689a42b34f85108a500f6bae992f26f6..568ad7981fe26765576e63f412724e3e3ee5f8c3 100644 --- a/docs/libvirt.md +++ b/docs/libvirt.md @@ -28,9 +28,17 @@ Together, these components form a powerful and flexible virtualization stack, wi 3. Configure `libvirt` to use the 'system' URI by adding the line `LIBVIRT_DEFAULT_URI="qemu:///system"` to your preferred shell profile file (e.g., `.bashrc`, `.zshrc`, etc.). ```bash - echo "export LIBVIRT_DEFAULT_URI=\"qemu:///system\"" >> ~/.bashrc + echo 'export LIBVIRT_DEFAULT_URI="qemu:///system"' >> ~/.bashrc ``` +> [!NOTE] +> WinApps may not read your shell's configuration. If you're having issues getting the installer to detect your VM, try adding +> `LIBVIRT_DEFAULT_URI="qemu:///system"` to your `/etc/environment` like: +> ```bash +> echo 'LIBVIRT_DEFAULT_URI="qemu:///system"' | sudo tee -a /etc/environment +> ``` +> Thanks to imoize for pointing this out: https://github.com/winapps-org/winapps/issues/310#issuecomment-2505348088 + 4. Install `QEMU Guest Agent`. ```bash sudo apt install qemu-guest-agent # Debian/Ubuntu @@ -642,13 +650,13 @@ You can then test whether the host GNU/Linux system can communicate with Windows {"return":{"version":"107.0.1","supported_commands":[{"enabled":true,"name":"guest-get-cpustats","success-response":true},{"enabled":true,"name":"guest-get-diskstats","success-response":true},{"enabled":true,"name":"guest-get-devices","success-response":true},{"enabled":true,"name":"guest-get-osinfo","success-response":true},{"enabled":true,"name":"guest-get-timezone","success-response":true},{"enabled":true,"name":"guest-get-users","success-response":true},{"enabled":true,"name":"guest-get-host-name","success-response":true},{"enabled":true,"name":"guest-exec","success-response":true},{"enabled":true,"name":"guest-exec-status","success-response":true},{"enabled":false,"name":"guest-get-memory-block-info","success-response":true},{"enabled":false,"name":"guest-set-memory-blocks","success-response":true},{"enabled":false,"name":"guest-get-memory-blocks","success-response":true},{"enabled":true,"name":"guest-set-user-password","success-response":true},{"enabled":true,"name":"guest-get-fsinfo","success-response":true},{"enabled":true,"name":"guest-get-disks","success-response":true},{"enabled":false,"name":"guest-set-vcpus","success-response":true},{"enabled":true,"name":"guest-get-vcpus","success-response":true},{"enabled":true,"name":"guest-network-get-interfaces","success-response":true},{"enabled":false,"name":"guest-suspend-hybrid","success-response":false},{"enabled":true,"name":"guest-suspend-ram","success-response":false},{"enabled":true,"name":"guest-suspend-disk","success-response":false},{"enabled":true,"name":"guest-fstrim","success-response":true},{"enabled":true,"name":"guest-fsfreeze-thaw","success-response":true},{"enabled":true,"name":"guest-fsfreeze-freeze-list","success-response":true},{"enabled":true,"name":"guest-fsfreeze-freeze","success-response":true},{"enabled":true,"name":"guest-fsfreeze-status","success-response":true},{"enabled":true,"name":"guest-file-flush","success-response":true},{"enabled":true,"name":"guest-file-seek","success-response":true},{"enabled":true,"name":"guest-file-write","success-response":true},{"enabled":true,"name":"guest-file-read","success-response":true},{"enabled":true,"name":"guest-file-close","success-response":true},{"enabled":true,"name":"guest-file-open","success-response":true},{"enabled":true,"name":"guest-shutdown","success-response":false},{"enabled":true,"name":"guest-info","success-response":true},{"enabled":true,"name":"guest-set-time","success-response":true},{"enabled":true,"name":"guest-get-time","success-response":true},{"enabled":true,"name":"guest-ping","success-response":true},{"enabled":true,"name":"guest-sync","success-response":true},{"enabled":true,"name":"guest-sync-delimited","success-response":true}]}} ``` -Next, you will need to make some registry changes to enable RDP Applications to run on the system. Start by downloading the [RDPApps.reg](https://github.com/winapps-org/winapps/blob/main/oem/RDPApps.reg) file, right-clicking on the `Raw` button, and clicking on `Save target as`. +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.** <p align="center"> <img src="./libvirt_images/26.png" width="700px"/> </p> -Once you have downloaded the registry file, right-click on it, and choose `Merge`. +Once you have downloaded all three files, right-click the install.bat and select "Run as administrator". <p align="center"> <img src="./libvirt_images/27.png" width="700px"/> diff --git a/docs/libvirt_images/27.png b/docs/libvirt_images/27.png index 5e9a2fbf0e598c5e51d16a900e9171eae2bcd04d..1da95dbab68dc71572802af14e6b55ffacbb757a 100644 Binary files a/docs/libvirt_images/27.png and b/docs/libvirt_images/27.png differ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000000000000000000000000000000000..dc621f09641966cc7d0d653897e1175ec817aff3 --- /dev/null +++ b/flake.lock @@ -0,0 +1,76 @@ +{ + "nodes": { + "flake-compat": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1724819573, + "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000000000000000000000000000000000..bc6394452f6ece48f4e3987ad212ac6d992999ca --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "WinApps Nix packages & NixOS module"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + formatter = pkgs.nixfmt-rfc-style; + + packages.winapps = pkgs.callPackage ./packages/winapps { }; + packages.winapps-launcher = pkgs.callPackage ./packages/winapps-launcher { }; + } + ); +} diff --git a/install/ExtractPrograms.ps1 b/install/ExtractPrograms.ps1 index 54aa5874b522f1236c38269e80c7934ff48049ac..fcfbf3d40a43e08097061fd35849de4643a75d16 100644 --- a/install/ExtractPrograms.ps1 +++ b/install/ExtractPrograms.ps1 @@ -1,9 +1,3 @@ -# Copyright (c) 2024 Rohan Barar -# Copyright (c) 2024 Oskar Manhart -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later - ### FUNCTIONS ### # Name: 'GetApplicationIcon' # Role: Extract the icon from a given executable file as a base-64 string. diff --git a/oem/Container.reg b/oem/Container.reg new file mode 100644 index 0000000000000000000000000000000000000000..10c018a5c187479dd8e38be7f506d2b3efa68353 --- /dev/null +++ b/oem/Container.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + + [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] + "RealTimeIsUniversal"=dword:00000001 diff --git a/oem/NetProfileCleanup.ps1 b/oem/NetProfileCleanup.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..e50a07cb40795d15533a16bc580054f491549bcf --- /dev/null +++ b/oem/NetProfileCleanup.ps1 @@ -0,0 +1,30 @@ +# Get the current network profile name +$currentProfile = (Get-NetConnectionProfile).Name + +# Get all profiles from the registry +$profilesKey = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles" +$profiles = Get-ChildItem -Path $profilesKey + +foreach ($profile in $profiles) { + $profilePath = "$profilesKey\$($profile.PSChildName)" + $profileName = (Get-ItemProperty -Path $profilePath).ProfileName + + # Remove profiles that don't match the current one + if ($profileName -ne $currentProfile) { + Remove-Item -Path $profilePath -Recurse + Write-Host "Deleted profile: $profileName" + } +} + +# Change the current profile name to "WinApps" +$profiles = Get-ChildItem -Path $profilesKey +foreach ($profile in $profiles) { + $profilePath = "$profilesKey\$($profile.PSChildName)" + $profileName = (Get-ItemProperty -Path $profilePath).ProfileName + + if ($profileName -eq $currentProfile) { + # Update the profile name + Set-ItemProperty -Path $profilePath -Name "ProfileName" -Value "WinApps" + Write-Host "Renamed profile to: WinApps" + } +} diff --git a/oem/RDPApps.reg b/oem/RDPApps.reg index acb5aacfda624b36b3d38c7fc22b581af4ee6492..f9e4b79a7514c278bce2eb9e7be3d70e227755ff 100644 --- a/oem/RDPApps.reg +++ b/oem/RDPApps.reg @@ -1,10 +1,20 @@ Windows Registry Editor Version 5.00 + ; 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 + ; Allow unlisted programs to be run in Remote Desktop sessions [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services] "fAllowUnlistedRemotePrograms"=dword:00000001 + ; Disable automatic administrator logon at startup [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] "AutoAdminLogon"="0" + + ; Always use the server's keyboard layout + [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] + "IgnoreRemoteKeyboardLayout"=dword:00000001 + + ; Disable "Do you want your PC to be discoverable" prompt after each host system reboot + [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff] diff --git a/oem/install.bat b/oem/install.bat index be237175730b259941518ca065d8495de5416ded..018c5109a6e4d84879ca6ebb7e2f214e46bff521 100644 --- a/oem/install.bat +++ b/oem/install.bat @@ -1,7 +1,25 @@ @echo off -REM Copyright (c) 2024 Oskar Manhart -REM All rights reserved. -REM -REM SPDX-License-Identifier: AGPL-3.0-or-later -REG IMPORT C:\OEM\RDPApps.reg +reg import %~dp0\RDPApps.reg + +if exists %~dp0\Container.reg ( + reg import %~dp0\Container.reg +) + +REM Create network profile cleanup scheduled task +copy %~dp0\NetProfileCleanup.ps1 %windir% +set "taskname=NetworkProfileCleanup" +set "command=powershell.exe -ExecutionPolicy Bypass -File "%windir%\NetProfileCleanup.ps1^"" + +schtasks /query /tn "%taskname%" >nul 2>&1 +if %ERRORLEVEL% equ 0 ( + echo Task "%taskname%" already exists, deleting it first... + schtasks /delete /tn "%taskname%" /f +) + +schtasks /create /tn "%taskname%" /tr "%command%" /sc onstart /ru "SYSTEM" /rl HIGHEST /f +if %ERRORLEVEL% equ 0 ( + echo Scheduled task "%taskname%" created successfully. +) else ( + echo Failed to create scheduled task. +) diff --git a/packages/winapps-launcher/WinAppsLauncher.patch b/packages/winapps-launcher/WinAppsLauncher.patch new file mode 100644 index 0000000000000000000000000000000000000000..962b1bf082586b021a5c3a4697ce6b3f09061f5b --- /dev/null +++ b/packages/winapps-launcher/WinAppsLauncher.patch @@ -0,0 +1,11 @@ +--- a/WinAppsLauncher.sh ++++ b/WinAppsLauncher.sh +@@ -19,7 +19,7 @@ declare -rx EC_WIN_NOT_SPEC=6 + declare -rx EC_NO_WIN_FOUND=7 + + # Paths +-declare -rx ICONS_PATH="./Icons" ++declare -rx ICONS_PATH="@out@/Icons" + declare -rx APPDATA_PATH="${HOME}/.local/share/winapps" + declare -rx CONFIG_PATH="${HOME}/.config/winapps" + declare -rx CONFIG_FILE="${CONFIG_PATH}/winapps.conf" diff --git a/packages/winapps-launcher/default.nix b/packages/winapps-launcher/default.nix new file mode 100644 index 0000000000000000000000000000000000000000..8a40ad319fb1929d9587852d559a07904b8d3867 --- /dev/null +++ b/packages/winapps-launcher/default.nix @@ -0,0 +1,72 @@ +{ + stdenv, + lib, + fetchFromGitHub, + makeWrapper, + makeDesktopItem, + callPackage, + yad, + ... +}: +let + rev = "3eb63ad1442068119c2e0f2586e6d63e7a45042e"; + hash = "sha256-y31AdBZSiarcQzH2wyDnhzgrrELbLW4XY94JvLejoTU="; +in +stdenv.mkDerivation rec { + pname = "winapps-launcher"; + version = "0-unstable-2025-01-12"; + + src = fetchFromGitHub { + owner = "winapps-org"; + repo = "WinApps-Launcher"; + + inherit rev hash; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ + yad + (callPackage ../winapps { }) + ]; + + patches = [ ./WinAppsLauncher.patch ]; + + postPatch = '' + substituteAllInPlace WinAppsLauncher.sh + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp -r ./Icons $out/Icons + + install -m755 -D WinAppsLauncher.sh $out/bin/winapps-launcher + install -Dm444 -T Icons/AppIcon.svg $out/share/pixmaps/winapps.svg + + wrapProgram $out/bin/winapps-launcher \ + --set LIBVIRT_DEFAULT_URI "qemu:///system" \ + --prefix PATH : "${lib.makeBinPath buildInputs}" + + runHook postInstall + ''; + + desktopItems = [ + (makeDesktopItem { + name = "winapps"; + exec = "winapps-launcher"; + icon = "winapps"; + comment = meta.description; + desktopName = "WinApps"; + categories = [ "Utility" ]; + }) + ]; + + meta = with lib; { + homepage = "https://github.com/winapps-org/WinApps-Launcher"; + description = "Graphical launcher for WinApps. Run Windows applications (including Microsoft 365 and Adobe Creative Cloud) on GNU/Linux with KDE, GNOME or XFCE, integrated seamlessly as if they were native to the OS. Wayland is currently unsupported."; + mainProgram = "winapps-launcher"; + platforms = platforms.linux; + license = licenses.gpl3; + }; +} diff --git a/packages/winapps/default.nix b/packages/winapps/default.nix new file mode 100644 index 0000000000000000000000000000000000000000..b7c52d6a91ff1eca3b91d92210394ba62043f0af --- /dev/null +++ b/packages/winapps/default.nix @@ -0,0 +1,75 @@ +{ + stdenv, + lib, + fetchFromGitHub, + makeWrapper, + freerdp3, + dialog, + libnotify, + netcat, + iproute2, + ... +}: +let + rev = "d12b40073074ba8f639d723601146ea9527ac16c"; + hash = "sha256-SG1EVN0pKXzZxQGz01HgmsmCEvRNBFI9JrA5VxmRzDg="; +in +stdenv.mkDerivation rec { + pname = "winapps"; + version = "0-unstable-2025-01-16"; + + src = fetchFromGitHub { + owner = "winapps-org"; + repo = "winapps"; + + inherit rev hash; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ + freerdp3 + libnotify + dialog + netcat + iproute2 + ]; + + patches = [ + ./winapps.patch + ./setup.patch + ]; + + postPatch = '' + substituteAllInPlace bin/winapps + substituteAllInPlace setup.sh + patchShebangs install/inquirer.sh + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + mkdir -p $out/src + + cp -r ./ $out/src/ + + install -m755 -D bin/winapps $out/bin/winapps + install -m755 -D setup.sh $out/bin/winapps-setup + + for f in winapps-setup winapps; do + wrapProgram $out/bin/$f \ + --set LIBVIRT_DEFAULT_URI "qemu:///system" \ + --prefix PATH : "${lib.makeBinPath buildInputs}" + done + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/winapps-org/winapps"; + description = "Run Windows applications (including Microsoft 365 and Adobe Creative Cloud) on GNU/Linux with KDE, GNOME or XFCE, integrated seamlessly as if they were native to the OS. Wayland is currently unsupported."; + mainProgram = "winapps"; + platforms = platforms.linux; + license = licenses.agpl3Plus; + }; +} diff --git a/packages/winapps/setup.patch b/packages/winapps/setup.patch new file mode 100644 index 0000000000000000000000000000000000000000..01308285453e051c12ccf39905614ca60314135c --- /dev/null +++ b/packages/winapps/setup.patch @@ -0,0 +1,202 @@ +diff --git a/setup.sh b/setup.sh +index b7d930d6..18000c65 100755 +--- a/setup.sh ++++ b/setup.sh +@@ -39,8 +39,8 @@ readonly SYS_BIN_PATH="/usr/local/bin" # UNIX path to 'bin' dir + readonly USER_BIN_PATH="${HOME}/.local/bin" # UNIX 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' +-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 '--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 '--system' WinApps installation. + # 'APP' + 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. +@@ -70,7 +70,7 @@ readonly TEST_PATH_WIN="${USER_APPDATA_PATH_WIN}\\FreeRDP_Connection_Test" # WIN + # 'WinApps Configuration File' + readonly CONFIG_PATH="${HOME}/.config/winapps/winapps.conf" # UNIX path to the WinApps configuration file. + # 'Inquirer Bash Script' +-readonly INQUIRER_PATH="./install/inquirer.sh" # UNIX path to the 'inquirer' script, which is used to produce selection menus. ++readonly INQUIRER_PATH="@out@/src/install/inquirer.sh" # UNIX path to the 'inquirer' script, which is used to produce selection menus. + + # REMOTE DESKTOP CONFIGURATION + readonly VM_NAME="RDPWindows" # Name of the Windows VM (FOR 'libvirt' ONLY). +@@ -130,13 +130,13 @@ function waTerminateScript() { + # Role: Displays usage information for the script. + function waUsage() { + echo -e "Usage: +- ${COMMAND_TEXT}./setup.sh --user${CLEAR_TEXT} # Install WinApps and selected applications in ${HOME} +- ${COMMAND_TEXT}./setup.sh --system${CLEAR_TEXT} # Install WinApps and selected applications in /usr +- ${COMMAND_TEXT}./setup.sh --user --setupAllOfficiallySupportedApps${CLEAR_TEXT} # Install WinApps and all officially supported applications in ${HOME} +- ${COMMAND_TEXT}./setup.sh --system --setupAllOfficiallySupportedApps${CLEAR_TEXT} # Install WinApps and all officially supported applications in /usr +- ${COMMAND_TEXT}./setup.sh --user --uninstall${CLEAR_TEXT} # Uninstall everything in ${HOME} +- ${COMMAND_TEXT}./setup.sh --system --uninstall${CLEAR_TEXT} # Uninstall everything in /usr +- ${COMMAND_TEXT}./setup.sh --help${CLEAR_TEXT} # Display this usage message." ++ ${COMMAND_TEXT}winapps-setup --user${CLEAR_TEXT} # Install WinApps and selected applications in ${HOME} ++ ${COMMAND_TEXT}winapps-setup --system${CLEAR_TEXT} # Install WinApps and selected applications in /usr ++ ${COMMAND_TEXT}winapps-setup --user --setupAllOfficiallySupportedApps${CLEAR_TEXT} # Install WinApps and all officially supported applications in ${HOME} ++ ${COMMAND_TEXT}winapps-setup --system --setupAllOfficiallySupportedApps${CLEAR_TEXT} # Install WinApps and all officially supported applications in /usr ++ ${COMMAND_TEXT}winapps-setup --user --uninstall${CLEAR_TEXT} # Uninstall everything in ${HOME} ++ ${COMMAND_TEXT}winapps-setup --system --uninstall${CLEAR_TEXT} # Uninstall everything in /usr ++ ${COMMAND_TEXT}winapps-setup --help${CLEAR_TEXT} # Display this usage message." + } + + # Name: 'waGetSourceCode' +@@ -155,13 +155,6 @@ function waGetSourceCode() { + echo -e "${WARNING_TEXT}[WARNING]${CLEAR_TEXT} You might want to remove your old installation on '${SCRIPT_DIR_PATH}'." + fi + +- if [[ ! -d "$SOURCE_PATH" ]]; then +- $SUDO git clone --recurse-submodules --remote-submodules https://github.com/winapps-org/winapps.git "$SOURCE_PATH" +- else +- echo -e "${INFO_TEXT}WinApps installation already present at ${CLEAR_TEXT}${COMMAND_TEXT}${SOURCE_PATH}${CLEAR_TEXT}${INFO_TEXT}. Updating...${CLEAR_TEXT}" +- $SUDO git -C "$SOURCE_PATH" pull --no-rebase +- fi +- + # Silently change the working directory. + if ! cd "$SOURCE_PATH" &>/dev/null; then + # Display the error type. +@@ -186,21 +179,8 @@ function waGetSourceCode() { + # Name: 'waGetInquirer' + # Role: Loads the inquirer script, even if the source isn't cloned yet + function waGetInquirer() { +- local INQUIRER=$INQUIRER_PATH +- +- if [ -d "$SYS_SOURCE_PATH" ]; then +- INQUIRER=$SYS_SOURCE_PATH/$INQUIRER_PATH +- elif [ -d "$USER_SOURCE_PATH" ] ; then +- INQUIRER=$USER_SOURCE_PATH/$INQUIRER_PATH +- else +- INQUIRER="/tmp/waInquirer.sh" +- rm -f "$INQUIRER" +- +- curl -o "$INQUIRER" "https://raw.githubusercontent.com/winapps-org/winapps/main/install/inquirer.sh" +- fi +- + # shellcheck source=/dev/null # Exclude this file from being checked by ShellCheck. +- source "$INQUIRER" ++ source "$INQUIRER_PATH" + } + + # Name: 'waCheckInput' +@@ -390,7 +370,7 @@ function waCheckExistingInstall() { + + # Display the suggested action(s). + echo "--------------------------------------------------------------------------------" +- echo -e "Please remove the existing WinApps installation using ${COMMAND_TEXT}./setup.sh --user --uninstall${CLEAR_TEXT}." ++ echo -e "Please remove the existing WinApps installation using ${COMMAND_TEXT}winapps-setup --user --uninstall${CLEAR_TEXT}." + echo "--------------------------------------------------------------------------------" + + # Terminate the script. +@@ -410,7 +390,7 @@ function waCheckExistingInstall() { + + # Display the suggested action(s). + echo "--------------------------------------------------------------------------------" +- echo -e "Please remove the existing WinApps installation using ${COMMAND_TEXT}./setup.sh --system --uninstall${CLEAR_TEXT}." ++ echo -e "Please remove the existing WinApps installation using ${COMMAND_TEXT}winapps-setup --system --uninstall${CLEAR_TEXT}." + echo "--------------------------------------------------------------------------------" + + # Terminate the script. +@@ -805,7 +785,7 @@ function waCheckGroupMembership() { + # Identify groups the current user belongs to. + 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 + # Complete the previous line. + echo -e "${FAIL_TEXT}Failed!${CLEAR_TEXT}\n" + +@@ -1239,11 +1219,11 @@ function waConfigureWindows() { + # Populate variables. + WIN_BASH="\ + #!/usr/bin/env bash +-${BIN_PATH}/winapps windows" ++@out@/bin/winapps windows" + WIN_DESKTOP="\ + [Desktop Entry] + Name=Windows +-Exec=${BIN_PATH}/winapps windows %F ++Exec=@out@/bin/winapps windows %F + Terminal=false + Type=Application + Icon=${APPDATA_PATH}/icons/windows.svg +@@ -1290,13 +1270,13 @@ function waConfigureApp() { + # Determine the content of the bash script for the application. + APP_BASH="\ + #!/usr/bin/env bash +-${BIN_PATH}/winapps ${1}" ++@out@/bin/winapps ${1}" + + # Determine the content of the '.desktop' file for the application. + APP_DESKTOP_FILE="\ + [Desktop Entry] + Name=${NAME} +-Exec=${BIN_PATH}/winapps ${1} %F ++Exec=@out@/bin/winapps ${1} %F + Terminal=false + Type=Application + Icon=${APP_ICON} +@@ -1550,7 +1530,7 @@ function waInstall() { + echo -e "${BOLD_TEXT}Installing WinApps.${CLEAR_TEXT}" + + # Check for existing conflicting WinApps installations. +- waCheckExistingInstall ++ # waCheckExistingInstall + + # Load the WinApps configuration file. + waLoadConfig +@@ -1626,8 +1606,8 @@ function waInstall() { + waFindInstalled + + # Install the WinApps bash scripts. +- $SUDO ln -sf "${SOURCE_PATH}/bin/winapps" "${BIN_PATH}/winapps" +- $SUDO ln -sf "${SOURCE_PATH}/setup.sh" "${BIN_PATH}/winapps-setup" ++ ++ + + # Configure the Windows RDP session application launcher. + waConfigureWindows +@@ -1677,18 +1657,15 @@ function waUninstall() { + local DESKTOP_FILE_NAME="" # Stores the name of the '.desktop' file for the application. + local BASH_SCRIPT_NAME="" # Stores the name of the application. + +- # Remove the 'WinApps' bash scripts. +- $SUDO rm -f "${BIN_PATH}/winapps" +- $SUDO rm -f "${BIN_PATH}/winapps-setup" +- + # Remove WinApps configuration data, temporary files and logs. ++ chmod -R +rw "$USER_APPDATA_PATH" + rm -rf "$USER_APPDATA_PATH" + + # Remove application icons and shortcuts. + $SUDO rm -rf "$APPDATA_PATH" + + # Store '.desktop' files containing "${BIN_PATH}/winapps" in an array, returning an empty array if no such files exist. +- readarray -t WINAPPS_DESKTOP_FILES < <(grep -l -d skip "${BIN_PATH}/winapps" "${APP_PATH}/"* 2>/dev/null || true) ++ readarray -t WINAPPS_DESKTOP_FILES < <(grep -l -d skip "@out@/bin/winapps" "${APP_PATH}/"* 2>/dev/null || true) + + # Remove each '.desktop' file. + for DESKTOP_FILE_PATH in "${WINAPPS_DESKTOP_FILES[@]}"; do +@@ -1709,7 +1686,7 @@ function waUninstall() { + done + + # Store the paths of bash scripts calling 'WinApps' to launch specific applications in an array, returning an empty array if no such files exist. +- readarray -t WINAPPS_APP_BASH_SCRIPTS < <(grep -l -d skip "${BIN_PATH}/winapps" "${BIN_PATH}/"* 2>/dev/null || true) ++ readarray -t WINAPPS_APP_BASH_SCRIPTS < <(grep -l -d skip "@out@/bin/winapps" "${BIN_PATH}/"* 2>/dev/null || true) + + # Remove each bash script. + for BASH_SCRIPT_PATH in "${WINAPPS_APP_BASH_SCRIPTS[@]}"; do +@@ -1730,10 +1707,9 @@ function waUninstall() { + done + + # Print caveats. +- echo -e "\n${INFO_TEXT}Please note that your WinApps configuration and the WinApps source code were not removed.${CLEAR_TEXT}" +- echo -e "${INFO_TEXT}You can remove these manually by running:${CLEAR_TEXT}" ++ echo -e "\n${INFO_TEXT}Please note that your WinApps configuration and the WinApps package were not removed.${CLEAR_TEXT}" ++ echo -e "${INFO_TEXT}You can remove your config manually by running:${CLEAR_TEXT}" + echo -e "${COMMAND_TEXT}rm -r $(dirname "$CONFIG_PATH")${CLEAR_TEXT}" +- echo -e "${COMMAND_TEXT}rm -r ${SOURCE_PATH}${CLEAR_TEXT}\n" + + # Print feedback. + echo -e "${SUCCESS_TEXT}UNINSTALLATION COMPLETE.${CLEAR_TEXT}" diff --git a/packages/winapps/winapps.patch b/packages/winapps/winapps.patch new file mode 100644 index 0000000000000000000000000000000000000000..478d0ac38c783b7a6e4aeada4bd166f8f6b299ec --- /dev/null +++ b/packages/winapps/winapps.patch @@ -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 + } diff --git a/setup.sh b/setup.sh index f4b3895da62d008fa1360b8844a3297e4a5dcb04..accfb8d2a8fdd59736ceca0f829411fe21cb46ed 100755 --- a/setup.sh +++ b/setup.sh @@ -1,13 +1,4 @@ #!/usr/bin/env bash -# Copyright (c) 2024 Felix Bartels -# Copyright (c) 2024 Coruscant11 -# Copyright (c) 2024 escapefreeg -# Copyright (c) 2024 Rohan Barar -# Copyright (c) 2024 Oskar Manhart -# Copyright (c) 2024 Sebastien Bürky -# All rights reserved. -# -# SPDX-License-Identifier: AGPL-3.0-or-later # shellcheck disable=SC2034 # Silence warnings regarding unused variables globally. @@ -163,7 +154,7 @@ function waGetSourceCode() { # Check if winapps is currently installed on $SOURCE_PATH # MB: useless - #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. # 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}'." @@ -203,14 +194,18 @@ function waGetSourceCode() { function waGetInquirer() { local INQUIRER=$INQUIRER_PATH - if [ ! -d "$SYS_SOURCE_PATH" ] && [ ! -d "$USER_SOURCE_PATH" ]; then + if [ -d "$SYS_SOURCE_PATH" ]; then + INQUIRER=$SYS_SOURCE_PATH/$INQUIRER_PATH + elif [ -d "$USER_SOURCE_PATH" ] ; then + INQUIRER=$USER_SOURCE_PATH/$INQUIRER_PATH + else INQUIRER="/tmp/waInquirer.sh" rm -f "$INQUIRER" # curl -o "$INQUIRER" "https://raw.githubusercontent.com/winapps-org/winapps/main/install/inquirer.sh" curl -o "$INQUIRER" "https://gitlab.phaidra.org/imgw/winapps/-/raw/eeb08b09ed9fda0ec85c51f616476ed10bc7a6c1/install/inquirer.sh" - # shellcheck source=/dev/null # Exclude this file from being checked by ShellCheck. - source "$INQUIRER" - elif [ -d "$SYS_SOURCE_PATH" ]; then + # shellcheck source=/dev/null # Exclude this file from being checked by ShellCheck. + source "$INQUIRER" + if [ -d "$SYS_SOURCE_PATH" ]; then source "$SYS_SOURCE_PATH/$INQUIRER" elif [ -d "$USER_SOURCE_PATH" ]; then source "$USER_SOURCE_PATH/$INQUIRER" @@ -1738,7 +1733,7 @@ function waInstall() { # Name: 'waEnsureOnPath' # Role: Ensures that $BIN_PATH is on $PATH. function waEnsureOnPath() { - if [[ ":$PATH:" == *":$BIN_PATH:"* ]]; then + if [[ ":$PATH:" != *":$BIN_PATH:"* ]]; then echo -e "${WARNING_TEXT}[WARNING]${CLEAR_TEXT} It seems like '${BIN_PATH}' is not on PATH." echo -e "${WARNING_TEXT}[WARNING]${CLEAR_TEXT} You can add it by running:" # shellcheck disable=SC2086