From bac0d08cf20f8f1dae2694867d1120cd1df59d37 Mon Sep 17 00:00:00 2001 From: "eddie g." Date: Thu, 15 May 2025 14:01:17 +0200 Subject: [PATCH 1/6] testing ms-office-protocol install --- apps/ms-office-protocol-handler.desktop | 9 +++++++++ setup.sh | 26 ++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 apps/ms-office-protocol-handler.desktop diff --git a/apps/ms-office-protocol-handler.desktop b/apps/ms-office-protocol-handler.desktop new file mode 100644 index 0000000..2a3459e --- /dev/null +++ b/apps/ms-office-protocol-handler.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Microsoft Office Protocol Handler +Comment=Handle Microsoft Office URI schemes via WinApps +Exec=/usr/local/bin/winapps manual %u +Terminal=false +Type=Application +MimeType=x-scheme-handler/ms-word;x-scheme-handler/ms-excel;x-scheme-handler/ms-powerpoint;x-scheme-handler/ms-outlook;x-scheme-handler/ms-access;x-scheme-handler/ms-visio;x-scheme-handler/ms-project;x-scheme-handler/ms-teams;x-scheme-handler/ms-whiteboard;x-scheme-handler/ms-officeapp; +NoDisplay=true +Categories=Office;Utility; diff --git a/setup.sh b/setup.sh index f1c6813..2b02981 100755 --- a/setup.sh +++ b/setup.sh @@ -1320,9 +1320,9 @@ MimeType=${MIME_TYPES}" function waConfigureOfficiallySupported() { # Declare variables. local OSA_LIST=() # Stores a list of all officially supported applications installed on Windows. + local OFFICE_APPS=("access" "access-o365" "access-o365-x86" "access-x86" "adobe-cc" "acrobat9" "acrobat-x-pro" "aftereffects-cc" "audition-cc" "bridge-cc" "bridge-cc-x86" "bridge-cs6" "bridge-cs6-x86" "cmd" "dymo-connect" "excel" "excel-o365" "excel-o365-x86" "excel-x86" "excel-x86-2010" "explorer" "iexplorer" "illustrator-cc" "lightroom-cc" "linqpad8" "mirc" "mspaint" "onenote" "onenote-o365" "onenote-o365-x86" "onenote-x86" "outlook" "outlook-o365" "outlook-o365-x86" "powerpoint" "powerpoint-o365" "powerpoint-o365-x86" "powerpoint-x86" "publisher" "publisher-o365" "publisher-o365-x86" "publisher-x86" "project" "project-x86" "remarkable-desktop" "ssms20" "visual-studio-comm" "visual-studio-ent" "visual-studio-pro" "visio" "visio-x86" "word" "word-o365" "word-o365-x86" "word-x86" "word-x86-2010") # Read the list of officially supported applications that are installed on Windows into an array, returning an empty array if no such files exist. - # This will remove leading and trailing whitespace characters as well as ignore empty lines. readarray -t OSA_LIST < <(grep -v '^[[:space:]]*$' "$INST_FILE_PATH" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' 2>/dev/null || true) # Create application entries for each officially supported application. @@ -1336,6 +1336,19 @@ function waConfigureOfficiallySupported() { # Configure the application. waConfigureApp "$OSA" svg + # Check if the application is an Office app and copy the protocol handler. + if [[ " ${OFFICE_APPS[*]} " == *" $OSA "* ]]; then + # Determine the target directory based on whether the installation is for the system or user. + if [[ "$OPT_SYSTEM" -eq 1 ]]; then + TARGET_DIR="$SYS_APP_PATH" + else + TARGET_DIR="$USER_APP_PATH" + fi + + # Copy the protocol handler to the appropriate directory. + $SUDO cp "./apps/ms-office-protocol-handler.desktop" "$TARGET_DIR/ms-office-protocol-handler.desktop" + fi + # Print feedback. echo -e "${DONE_TEXT}Done!${CLEAR_TEXT}" done @@ -1667,10 +1680,21 @@ function waEnsureOnPath() { # Name: 'waUninstall' # Role: Uninstalls WinApps. function waUninstall() { + # Print feedback. [ "$OPT_SYSTEM" -eq 1 ] && echo -e "${BOLD_TEXT}REMOVING SYSTEM INSTALLATION.${CLEAR_TEXT}" [ "$OPT_USER" -eq 1 ] && echo -e "${BOLD_TEXT}REMOVING USER INSTALLATION.${CLEAR_TEXT}" + # Determine the target directory for the protocol handler based on the installation type. + if [[ "$OPT_SYSTEM" -eq 1 ]]; then + TARGET_DIR="$SYS_APP_PATH" + else + TARGET_DIR="$USER_APP_PATH" + fi + + # Remove the 'ms-office-protocol-handler.desktop' file if it exists. + $SUDO rm -f "$TARGET_DIR/ms-office-protocol-handler.desktop" + # Declare variables. local WINAPPS_DESKTOP_FILES=() # Stores a list of '.desktop' file paths. local WINAPPS_APP_BASH_SCRIPTS=() # Stores a list of bash script paths. From c06ae550bc46a1ef3b93c6f8855d9c50f34e33f8 Mon Sep 17 00:00:00 2001 From: "eddie g." Date: Thu, 15 May 2025 14:09:17 +0200 Subject: [PATCH 2/6] fix for application loop --- setup.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 2b02981..46cf023 100755 --- a/setup.sh +++ b/setup.sh @@ -156,7 +156,7 @@ function waGetSourceCode() { fi if [[ ! -d "$SOURCE_PATH" ]]; then - $SUDO git clone --recurse-submodules --remote-submodules https://github.com/winapps-org/winapps.git "$SOURCE_PATH" + $SUDO git clone --recurse-submodules --remote-submodules https://github.com/fluffy-git/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 @@ -196,7 +196,7 @@ function waGetInquirer() { 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://raw.githubusercontent.com/fluffy-git/winapps/main/install/inquirer.sh" fi # shellcheck source=/dev/null # Exclude this file from being checked by ShellCheck. @@ -1137,6 +1137,10 @@ function waFindInstalled() { # Extract the name of the application from the absolute path of the folder. APPLICATION="$(basename "$APPLICATION")" + if [[ "$APPLICATION" == "ms-office-protocol-handler.desktop" ]]; then + continue + fi + # Source 'Info' File Containing: # - The Application Name (FULL_NAME) # - The Shortcut Name (NAME) From 97a3889eccfa61d6dd2b11a982cd85d537255a02 Mon Sep 17 00:00:00 2001 From: "eddie g." Date: Thu, 15 May 2025 16:13:39 +0200 Subject: [PATCH 3/6] return to original link to be able to merge + readme update --- README.md | 1 + setup.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 24545d5..948afd8 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ WinApps works by: - The GNU/Linux `/home` directory is accessible within Windows via the `\\tsclient\home` mount. - Integration with `Nautilus`, allowing you to right-click files to open them with specific Windows applications based on the file MIME type. - The [official taskbar widget](https://github.com/winapps-org/WinApps-Launcher) enables seamless administration of the Windows subsystem and offers an easy way to launch Windows applications. +- Microsoft Office links (e.g. ms-word://) from the host system are automatically opened in the Windows subsystem. (Note: You may need to use a [User-Agent-switcher] (https://github.com/ray-lothian/UserAgent-Switcher/) and set the User-Agent to Windows, as Office's web interface typically hides the "Open in Desktop App" option for Linux users.) ## Supported Applications **WinApps supports *ALL* Windows applications.** diff --git a/setup.sh b/setup.sh index 46cf023..5c6ec1e 100755 --- a/setup.sh +++ b/setup.sh @@ -156,7 +156,7 @@ function waGetSourceCode() { fi if [[ ! -d "$SOURCE_PATH" ]]; then - $SUDO git clone --recurse-submodules --remote-submodules https://github.com/fluffy-git/winapps.git "$SOURCE_PATH" + $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 @@ -196,7 +196,7 @@ function waGetInquirer() { INQUIRER="/tmp/waInquirer.sh" rm -f "$INQUIRER" - curl -o "$INQUIRER" "https://raw.githubusercontent.com/fluffy-git/winapps/main/install/inquirer.sh" + 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. From afb333ab4f5c637f5a77d5110be65e659a671a15 Mon Sep 17 00:00:00 2001 From: "eddie g." Date: Thu, 15 May 2025 16:19:14 +0200 Subject: [PATCH 4/6] small README.md fixes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 948afd8..02abd66 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ WinApps works by: - The GNU/Linux `/home` directory is accessible within Windows via the `\\tsclient\home` mount. - Integration with `Nautilus`, allowing you to right-click files to open them with specific Windows applications based on the file MIME type. - The [official taskbar widget](https://github.com/winapps-org/WinApps-Launcher) enables seamless administration of the Windows subsystem and offers an easy way to launch Windows applications. -- Microsoft Office links (e.g. ms-word://) from the host system are automatically opened in the Windows subsystem. (Note: You may need to use a [User-Agent-switcher] (https://github.com/ray-lothian/UserAgent-Switcher/) and set the User-Agent to Windows, as Office's web interface typically hides the "Open in Desktop App" option for Linux users.) +- Microsoft Office links (e.g. ms-word://) from the host system are automatically opened in the Windows subsystem. (Note: You may need to use an [User Agent switcher](https://github.com/ray-lothian/UserAgent-Switcher/) Browser Extension and set the User-Agent to Windows, as as the Office webapps typically hide the "Open in Desktop App" option for Linux users.) ## Supported Applications **WinApps supports *ALL* Windows applications.** From 5946444c63a60b0e7eac12d73b74db16e6cb6a6b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 14:26:57 +0000 Subject: [PATCH 5/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 5c6ec1e..1bd577a 100755 --- a/setup.sh +++ b/setup.sh @@ -1684,7 +1684,7 @@ function waEnsureOnPath() { # Name: 'waUninstall' # Role: Uninstalls WinApps. function waUninstall() { - + # Print feedback. [ "$OPT_SYSTEM" -eq 1 ] && echo -e "${BOLD_TEXT}REMOVING SYSTEM INSTALLATION.${CLEAR_TEXT}" [ "$OPT_USER" -eq 1 ] && echo -e "${BOLD_TEXT}REMOVING USER INSTALLATION.${CLEAR_TEXT}" From 5594a23298c4fd964a8e9207661e6361e9e4cd57 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Tue, 10 Jun 2025 16:12:53 +0200 Subject: [PATCH 6/6] feat: don't hardcode winapps path --- apps/ms-office-protocol-handler.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ms-office-protocol-handler.desktop b/apps/ms-office-protocol-handler.desktop index 2a3459e..62b23f3 100644 --- a/apps/ms-office-protocol-handler.desktop +++ b/apps/ms-office-protocol-handler.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=Microsoft Office Protocol Handler Comment=Handle Microsoft Office URI schemes via WinApps -Exec=/usr/local/bin/winapps manual %u +Exec=winapps manual %u Terminal=false Type=Application MimeType=x-scheme-handler/ms-word;x-scheme-handler/ms-excel;x-scheme-handler/ms-powerpoint;x-scheme-handler/ms-outlook;x-scheme-handler/ms-access;x-scheme-handler/ms-visio;x-scheme-handler/ms-project;x-scheme-handler/ms-teams;x-scheme-handler/ms-whiteboard;x-scheme-handler/ms-officeapp;