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

Time:12-25

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://docs.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://docs.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?

CodePudding user response:

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.

  • Related