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

Option to set shortcutPolicy when creating PhotinoWindow #85

Open
Scraphead opened this issue Jan 20, 2022 · 5 comments
Open

Option to set shortcutPolicy when creating PhotinoWindow #85

Scraphead opened this issue Jan 20, 2022 · 5 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed Windows

Comments

@Scraphead
Copy link

Every time a Photino application starts up, Photino.Native attempts to creates a shortcut in windows start menu.

I would like to avoid that for a portable application.

There is a setShortcutPolicy method in Photino.Native. Can I request a feature to forward a shortcutPolicy from Photino.Net when calling "new PhotinoWindow"?

Great work on this framework, its been a pleasure to use!

@MikeYeager MikeYeager added bug Something isn't working help wanted Extra attention is needed Windows labels Jan 20, 2022
@MikeYeager
Copy link
Collaborator

From: https://docs.microsoft.com/en-us/windows/win32/shell/enable-desktop-toast-with-appusermodelid
"Without a valid shortcut installed in the Start screen or in All Programs, you cannot raise a toast notification from a desktop app."

This was enabled to allow toast notifications in a pull request by @mynameisvasco. We need to either allow opting out of native notifications on Windows or add a feature to remove the shortcut on shutdown.

@prymo69
Copy link

prymo69 commented Feb 21, 2022

I hit this same problem. The workaround I used was to force a failure in the Photino native code that creates the shortcut. Since the shortcut is created from the window title when the window is first created, this can achieved by setting the Windows title to an empty string before calling WaitForClose(). To give the window a title set in the window created event handler instead:

private static void RunApp(string url)
{
    var window = new PhotinoWindow()
        .SetTitle(string.Empty)
        .RegisterWindowCreatedHandler(WindowCreatedHandler)
        .Load(url);

    window.WaitForClose();
}

private static void WindowCreatedHandler(object? sender, EventArgs e)
{
    window.SetTitle(DisplayBranding.ImagerProductName);
}

@philippjbauer
Copy link
Member

We probably have to think about making the notification system startup configurable through a setter for the PhotinoWindow to prevent this issue.

@orels1
Copy link

orels1 commented Aug 22, 2024

This is still something we'd like to have an option for.
We don't use desktop notifications, and create a shortcut via our own installer.
So it would be nice to be able to skip creating extra shortcuts on launch.

@IceReaper
Copy link

IceReaper commented Oct 11, 2024

Our problem is currently that the customer has demanded the version number of the software in the titlebar. So whenever he installs a new version, it spams another icon in the start menu.

Our installer (wix toolkit) however wont uninstall those icons, as he is not aware of the creation. I thought i tricked it by launching the window without the version number and add it afterwards, so the name of the shortcut would be identical to the one the installer creates. Still he creates another. Ours is in the system wide start menu, while photino creates another one in the user start menu.

The customer currently is super unhappy having 10+ icons meanwhile (one release all 2 weeks), and we just cant disable this behavior. He demanded we fix that before the application goes into public availability. Ill try the empty-string title workaround, but in a long term i would love to see an option to disable this feature. Or at least fix that it recreates the shortcut with the exact same name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed Windows
Projects
None yet
Development

No branches or pull requests

6 participants