Luis Delgado
Luis Delgado

Reputation: 23

Add Package support framework to a .Netcore 3.1 app (WPF) through Visual Studio MSIX packaging

I have a .netcore 3.1 WPF app and I'm using a MSIX packaging project through visual studio for distribution. Is it possible to add PSF to a .netcore 3.1 app?. Basically what I'm trying to do is, I want the MSIX installer to add a desktop shortcut automatically after the installation is done. This is the approach I'm following: https://learn.microsoft.com/en-us/windows/msix/psf/create-shortcut-with-script-package-support-framework

I also found this guide on how to add PSF to visual studio: https://learn.microsoft.com/en-us/windows/msix/psf/package-support-framework-vs. It uses a c++ project to run a .dll, but I think that's only compatible with .net framework and it's not compatible with .netcore. Can anyone please help me?

Upvotes: 0

Views: 159

Answers (1)

Bogdan Mitrache
Bogdan Mitrache

Reputation: 11013

You don't need to use the package support framework.

The PSF is recommended for cases when IT pros don't have access to the source code of the application and basically, they need an additional launcher (the psflauncher.exe) to execute additional code or redirect API calls before they get to the application.

In your case, all you need is to add a few lines of code inside your startup/main method of your application to create the shortcut.

Remember, the trick is to run this code only the first time the application is launched and if the shortcut isn't already on the desktop.

Upvotes: 0

Related Questions