That is, after user installing the msix, there should be the shortcut. Or at least, the app create the shortcut after first launch. Not some post-installation script.
I tried desktop7:Shortcut, but the shortcut does not appear.
That is, after user installing the msix, there should be the shortcut. Or at least, the app create the shortcut after first launch. Not some post-installation script.
I tried desktop7:Shortcut, but the shortcut does not appear.
On
If this is a full-trust MSIX, you should be able to create a shortcut for it on first-run by using the Shell Folder APIs. To get started, take a look at this repo to see if it can work for you.
If it's a low-trust UWP then there is currently no solution.
Note that once you create the shortcut, there is no way to automatically remove it when the MSIX app is uninstalled; the shortcut will still be there but will just point to nothing.
First of all, the packaged WinUI3 app cannot be started from the exe, so creating a shortcut is invalid, this is by design.
If you need to create a shortcut on the desktop, first you need to make your app non-packaged (unpackaged) and self-contained), you need to modify your csproj file.
Then you can try to create a desktop shortcut with the Windows Script Host.
Project > Add Reference > COM > Windows Script Host Object Model.