-
-
Notifications
You must be signed in to change notification settings - Fork 464
feat: add desktop shortcuts for Windows applications #417
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
base: main
Are you sure you want to change the base?
Conversation
Implement Linux .desktop file integration allowing users to launch Windows apps directly from their desktop environment. - Add context menu option to create/remove shortcuts - Auto-detect WinBoat executable location with user fallback - Display loading overlay during app launch from shortcuts - Fix single-instance lock to prevent duplicate instance dialogs - Add reactive shortcut badges in Apps view Closes TibixDev#121
output.webmIf I were to talk about the video in a moment, as I mentioned earlier, the loading bars are currently static for one second and then close immediately. Normally, when you click to create a shortcut, it searches for where WinBoat is installed, and if it can't find it, it asks you. However, since I run WinBoat with info Using custom WinBoat executable from config: /home/enxov/.local/bin/winboat-dev-wrapper.sh You can find all the detailed logs in the console. If you have any other questions, feel free to ask. I'll try to answer them all because this is really a huge update 😭 |
|
Skärmsändning_20251124_220430.webm |
src/main/main.ts
Outdated
| // Another instance is already running, exit silently | ||
| // The second-instance handler in the first instance will receive our command line args | ||
| app.quit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should still display the dialog in case WinBoat wasn't invoked with the --launch-app argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the single-instance lock logic to only exit silently when launched with --launch-app-name or --launch-app-path flags. Otherwise, shows an error dialog informing the user that WinBoat is already running.
src/main/main.ts
Outdated
|
|
||
| // Check if we're launching an app from a desktop shortcut | ||
| // Look for --launch-app=AppName format to avoid conflicts with Electron's internal flags | ||
| const launchAppArg = commandLine.find(arg => arg.startsWith("--launch-app=")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should come up with a way that lets us launch a program by both it's name and path, as migrating later on will be hard.
Something like --launch-app-name or --launch-app-path could work, but can be confusing
Or we could also go with a launch subcommand, accepting either a --path or --name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented support for launching apps by both name and path:
--launch-app-name="AppName"- Launch by application name (used by shortcuts)--launch-app-path="C:\path\to\app.exe"- Launch by executable path (future feature)
This provides flexibility for future enhancements while keeping the current implementation simple. Desktop shortcuts currently use--launch-app-name.
| let mainWindow: BrowserWindow | null = null; | ||
|
|
||
| function createWindow() { | ||
| if (!app.requestSingleInstanceLock()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not present, we need to store the realpath of the current argv[0] (or the ARGV0 envvar if it exists) somewhere, so later on we can invoke WinBoat through that path.
WinBoat isn't guaranteed to be present in PATH, so this will solve us a lot of headache later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WinBoat now stores the realpath of its executable (argv[0] or ARGV0 env var) on startup in the electron-store config. This ensures desktop shortcuts can invoke WinBoat even when it's not in PATH.
The path is resolved using fs.promises.realpath() to handle symlinks correctly.
- Fix single-instance lock to show dialog when not launched with app flags - Add support for dual launch methods: --launch-app-name and --launch-app-path - Store WinBoat executable realpath on startup for reliable invocation Addresses review comments from @Levev: 1. Single instance now only exits silently when invoked with launch flags 2. Implemented --launch-app-name and --launch-app-path for future flexibility 3. Store argv[0] realpath to ensure shortcuts work without PATH dependency
67490cb to
6392dde
Compare
|
im still dont test these btw somehow my winboat is broken and have to reinstall i think |
|
conflict resolved, merged with main, and that fix needs to be otherwise its giving just gray screen |
…esolution for desktop shortcuts
|
and these fixes needs to be first one is resolve the 'npm run dev' issue, if you run the winboat with 'npm run dev' its somehow open the original winboat not dev-wrapper. Second one is resolve the loading issues, again somehow if you open a program from shortcuts its stuck on messagebox loading bar. Its very hard to resolve bug/fixes 1 month old pr 😭 |
|
all works good on cachy os plasma desktop(kde) but bear in mind before merge with main. Loading overlay uses 3-second static delay (could be made dynamic by detecting RDP window appearance). And maybe add that desktopshortcuts info in cached apps because the if a app have shortcut the icon loading lately |
|
I build the pr locally, right click to shortcut works, but when I run a shortcut I got hit with the "Please start Winboat in development mode first (npm run dev) " as a toast popup in fedora42 kde plasma. I tried npm run dev and also the appImage in the ditr directory. No output in the log. Any tipps? |
thanks for trying! the latest should be fix but i dont sure, can you try that one? have to recreate shortcut btw |
|
Works with the fix: 637d68f Winboat needs to run from npm run dev though. The shortcut did not work when no winboat or appimage winboat was running |
Previously, shortcuts would incorrectly use the dev wrapper script when either app.isPackaged was false OR NODE_ENV was 'development'. This caused shortcuts to fail in unpacked production builds. Now both conditions must be true for dev mode, and saved dev wrapper paths are ignored when running in production mode.
|
Sorry about that! My previous explanation was theoretically correct, but there was actually a bug in the code XD The issue was in the dev mode detection logic - it was using || (OR) instead of && (AND): This meant shortcuts would incorrectly use the dev wrapper whenever either condition was true, instead of only when both are true. I've pushed a fix now. Could you please: Pull the latest changes and rebuild |
|
thanks for testing but interesting, i check all types of winboat(npm run dev, appimage, unpacked) all of them working, what you change from desktop file? why shortcuts try to find program on /tmp/ you install winboat there? |
|
Could very well be user error on my side. Here again what I did:
|
|
thansk! somehow on your side try to find program on /tmp/.mount hmmm thanks! lemme quick look now |
|
okay thanks for your amazing testing, i understand the problem the problem was: i run the appimage with:
because appimages requires a kind of tool named 'fuse' and i dont want to intsall it and run it from ^ commands, but you probably run the appimage normally |
When running from an AppImage, the app was using the temporary mount path (e.g., /tmp/.mount_winboa*/winboat) for desktop shortcuts. This path becomes invalid after the AppImage is closed, causing shortcuts to fail. Now the code checks for the APPIMAGE environment variable first, which contains the actual AppImage file path. This ensures shortcuts work even after Winboat is closed and reopened. Fixes issue where shortcuts would show 'Could not find the program' error on systems running AppImage directly (e.g., Fedora with KDE).
|
that should be 100% working, can you test now??? |
|
Works great, this was much needed after switching from WinApps. |
|
Thank you very much for testing it—I’m glad to hear it works well for you. As for your question, that would indeed be a very nice feature to have; however, in my opinion, it isn’t directly related to this PR. So if you post this idea as a suggestion in the Issues section, I’m sure there will be people who will work on it in the future. right click a .docx file => open with => winboat(word or whatever) => should be word opened with file in winboat |
You only wrote that as a suggestion, right? Currently that does not work. |
Yes i write that as a suggestions, like a summary of what you want. But again its really good future |
|
Found an issue. If the container is paused, shortcuts can't unpause it. However, everything works fine if the container is stopped instead of paused. I think this log makes it pretty clear why. |
|
Thank you very much (if you hadn’t mentioned it, I wouldn’t have known there was such a thing as “pause” XD) |
|
This works great and is a really handy feature to start apps from terminal |
This enables launching apps by path from terminal, including internal apps like WINDOWS_DESKTOP. Previously, --launch-app-path flag was ignored because there was no IPC handler for it in the renderer. Fixes launching WINDOWS_DESKTOP from terminal via: --launch-app-path="WINDOWS_DESKTOP"
|
@TDS700 should be fix, can you try again, thanks |




Overview
Implements Linux desktop shortcuts (.desktop files) for Windows applications, allowing users to launch apps directly from their desktop environment (GNOME, KDE, etc.).
Closes #121
What's New
Technical Details
~/.local/share/applications/~/.local/share/winboat/icons/--launch-app="AppName"format for IPC communicationKnown Limitations
Testing
Tested with:
npm run dev) and production buildsNote: I want everyone who sees this pull request to test these changes. Yes, I tested them and everything works fine for me, but that doesn't mean it will work fine for everyone.