Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for UWP apps #129

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/windows-terminal/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions apps/windows-terminal/info
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# GNOME shortcut name
NAME="Windows Terminal"

# Used for descriptions and window class
FULL_NAME="The new Windows Terminal"

# The executable inside windows
WIN_EXECUTABLE="explorer.exe"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't the executable wt.exe?

Copy link

@KernelGhost KernelGhost Jul 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows Terminal is located at %LocalAppData%\Microsoft\WindowsApps\wt.exe.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this PR is very old, but it's trying to launch the UWP using the package family name

UWP_CMD="shell:appsFolder\\${PACKAGE_FAMILY_NAME}!${APP_ID}"
APP_ARGS="${UWP_CMD} \"${FILE}\""

xfreerdp ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} +auto-reconnect +clipboard +home-drive -wallpaper /scale:${RDP_SCALE} /dynamic-resolution /${MULTI_FLAG} /wm-class:"${FULL_NAME}" /app:"${WIN_EXECUTABLE}" /app-icon:"${ICON}" /app-cmd:"${APP_ARGS}"

I think there's a way to list all installed UWP apps and grab their PFN and was hoping avoid having to deal with exes.


UWP_NAME="Microsoft.WindowsTerminal"

PACKAGE_FAMILY_NAME="Microsoft.WindowsTerminal_8wekyb3d8bbwe"

APP_ID="App"

# GNOME categories
CATEGORIES="WinApps;Windows"

# GNOME mimetypes
MIME_TYPES=""
17 changes: 15 additions & 2 deletions bin/winapps
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,26 @@ elif [ "${1}" != "install" ]; then
echo "You need to run 'install.sh' first."
exit 1
fi

UWP_CMD="shell:appsFolder\\${PACKAGE_FAMILY_NAME}!${APP_ID}"
if [ -n "${2}" ]; then
dprint "HOME:${HOME}"
FILE=$(echo "${2}" | sed 's|'"${HOME}"'|\\\\tsclient\\home|;s|/|\\|g;s|\\|\\\\|g')
dprint "FILE:${FILE}"
xfreerdp ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} +auto-reconnect +clipboard +home-drive -wallpaper /scale:${RDP_SCALE} /dynamic-resolution /${MULTI_FLAG} /wm-class:"${FULL_NAME}" /app:"${WIN_EXECUTABLE}" /app-icon:"${ICON}" /app-cmd:"\"${FILE}\"" 1> /dev/null 2>&1 &
if [ -z "${PACKAGE_FAMILY_NAME}" ]; then
APP_ARGS="\"${FILE}\""
else
APP_ARGS="${UWP_CMD} \"${FILE}\""
fi

xfreerdp ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} +auto-reconnect +clipboard +home-drive -wallpaper /scale:${RDP_SCALE} /dynamic-resolution /${MULTI_FLAG} /wm-class:"${FULL_NAME}" /app:"${WIN_EXECUTABLE}" /app-icon:"${ICON}" /app-cmd:"${APP_ARGS}" 1> /dev/null 2>&1 &
else
xfreerdp ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} +auto-reconnect +clipboard +home-drive -wallpaper /scale:${RDP_SCALE} /dynamic-resolution /${MULTI_FLAG} /wm-class:"${FULL_NAME}" /app:"${WIN_EXECUTABLE}" /app-icon:"${ICON}" 1> /dev/null 2>&1 &
if [ -z "${PACKAGE_FAMILY_NAME}" ]; then
APP_ARGS=""
else
APP_ARGS="${UWP_CMD}"
fi
xfreerdp ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} +auto-reconnect +clipboard +home-drive -wallpaper /scale:${RDP_SCALE} /dynamic-resolution /${MULTI_FLAG} /wm-class:"${FULL_NAME}" /app:"${WIN_EXECUTABLE}" /app-icon:"${ICON}" /app-cmd:"${APP_ARGS}" 1> /dev/null 2>&1 &
fi
fi

Expand Down
9 changes: 7 additions & 2 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ function waFindInstalled() {
cp "${DIR}/install/ExtractPrograms.ps1" ${HOME}/.local/share/winapps/ExtractPrograms.ps1
for F in $(ls "${DIR}/apps"); do
. "${DIR}/apps/${F}/info"
echo "IF EXIST \"${WIN_EXECUTABLE}\" ECHO ${F} >> \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp" >> ${HOME}/.local/share/winapps/installed.bat
if [ -z "${UWP_NAME}" ]; then
echo "IF EXIST \"${WIN_EXECUTABLE}\" ECHO ${F} >> \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp" >> ${HOME}/.local/share/winapps/installed.bat
else
echo "powershell.exe if (Get-AppxPackage -Name ${UWP_NAME}) { echo ${F} >> \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp }" >> ${HOME}/.local/share/winapps/installed.bat
UWP_NAME=''
fi
done;
echo "powershell.exe -ExecutionPolicy Bypass -File \\\\tsclient\\home\\.local\\share\\winapps\\ExtractPrograms.ps1 > \\\\tsclient\home\\.local\\share\\winapps\\detected" >> ${HOME}/.local/share/winapps/installed.bat
echo "RENAME \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp installed" >> ${HOME}/.local/share/winapps/installed.bat
Expand Down Expand Up @@ -330,4 +335,4 @@ waConfigureWindows
waConfigureApps
waConfigureDetectedApps

echo "Installation complete."
echo "Installation complete."